mam problemek. nainstalil sem Hotsanic, meri a kresli grafy, ale nefunguje mereni dat prenesenych po siti. do logu to pise ze hodnota namere is not a simple integer
Kód:
1076182112: : unable to update `192.168.3.254_eth0.rrd': not a simple integer: '50077915
'
1076182122: : unable to update `192.168.3.254_eth0.rrd': not a simple integer: '50087148
'
1076182132: : unable to update `192.168.3.254_eth0.rrd': not a simple integer: '50100183
'
je tam divne odratkovani jako by to cpalo \n za cislo, tak jsem kouknul tam kde se to kresli a zjistil ze to parsuje /proc/net/dev
touto funkci. pruser dela to cislo output. kdyz to nahradim cislem je to ok takze uz nekde pred tim se to kazi.
Kód:
open(IN,"/proc/net/dev");
while(<IN>) {
chomp;
if ( /:/ ) {
my ($combined, $a, undef, undef, undef, undef, undef, undef, $output, $e)=split;
($name, $input)=split(":",$combined);
if(!$input) { ($input, $output) = ($a, $e); }
$devin{$name}=$input;
$devout{$name}=1000; #$output;
$sampletime{$name}=time;
}
}
close(IN);
v proc net dev je neco takovehoto
Kód:
Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
lo:148334339 591589 0 0 0 0 0 0 148334339 591589 0 0 0 0 0 0
dummy: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
eth0:3168642959 135904059 0 0 0 0 0 0 52665557 132310971 0 0 0 0 0 0
eth1:3381235504 208210865 0 0 0 0 0 0 4043680851 189054283 0 0 0 0 0 0
tohle by to melo onen radek rozparsovat dobre ale zrejme ne a pridava to tam odradkovani
$combined, $a, undef, undef, undef, undef, undef, undef, $output, $e)=split;
nevite nekdo co stim? ja perlu moc nehovim