Hotsanic

Nevím si rady s modulem ping. Všechny ostatní moduly běží bez problému, ale ping nevytváří obrázky. Proces pingu běží, ale skript pro vytváření nic neudělá.

Mám naistalováno:
Linux version 2.6.18-1.2257.fc5 (brewbuilder@hs20-bc1-5.build.redhat.com) (gcc version 4.1.1 20060525 (Red Hat 4.1.1-1)) #1 Fri Dec 15 16:04:33 EST 2006

Hotsanic 0.5.0-pre5

RRDtool 1.2.15

“Chyba” při spuštění skriptu diagrams.pl:
----- modules/ping -----
creating images for 10.33.10.67 ( AP Bratrk) …
Use of uninitialized value in printf at ./diagrams.pl line 167 (#1)
(W uninitialized) An undefined value was used as if it were already
defined. It was interpreted as a “” or a 0, but maybe it was a mistake.
To suppress this warning assign a defined value to your variables.

To help you figure out what was undefined, perl tells you what operation
you used the undefined value in. Note, however, that perl optimizes your
program and the operation displayed in the warning may not necessarily
appear literally in your program. For example, "that $foo" is
usually optimized into "that " . $foo, and the warning will refer to
the concatenation (.) operator, even though there is no . in your
program.

hour 0x0 /var/www/html/hotsanic/ping/10.33.10.67-hour.png
6 hours 0x0 /var/www/html/hotsanic/ping/10.33.10.67-6h.png
day 0x0 /var/www/html/hotsanic/ping/10.33.10.67-day.png
week 0x0 /var/www/html/hotsanic/ping/10.33.10.67-week.png
month 0x0 /var/www/html/hotsanic/ping/10.33.10.67-month.png
year 0x0 /var/www/html/hotsanic/ping/10.33.10.67-year.png

creating images for 10.33.0.38 ( Topenar) …
hour 0x0 /var/www/html/hotsanic/ping/10.33.0.38-hour.png
6 hours 0x0 /var/www/html/hotsanic/ping/10.33.0.38-6h.png
day 0x0 /var/www/html/hotsanic/ping/10.33.0.38-day.png
week 0x0 /var/www/html/hotsanic/ping/10.33.0.38-week.png
month 0x0 /var/www/html/hotsanic/ping/10.33.0.38-month.png
year 0x0 /var/www/html/hotsanic/ping/10.33.0.38-year.png

Při incializaci HotSaNICu je vše ok:
[root@topenar hotsanic]# ./rrdgraph start
Starting rrdtimer…
reading & checking config (/var/www/hotsanic/settings) …
evaluating cmdline arguments…
entering daemon mode…

[root@topenar log]# cat HotSaNIC.log

1171484547: archiver successfully forked into background and running on PID 19665
1171484547 Initializing modules…
1171484547 END Initializing modules…

netstat running on PID 19503
part running on PID 19509
ping running on PID 19513
system running on PID 19517
traffic running on PID 19524

Ještě uvádím výpis konfiguračního skriptu modulu ping:
[root@topenar settings]# cat mod_ping

query-interval in seconds.

INTERVAL=“30”

set type of diagrams (whatever you like best … Thanx M. Renner! )

classic (default) -> shade ranges for min, avg, max in different colors

simple -> only shade area between min and max in light blue

TYPE=“simple”

set diagram scaling

log -> set logarithmic scaling (default)

lin -> set linear scaling

SCALE=“lin”

set diagram initial upper border in milliseconds (for better graph comparison)

UPPER=“10” sets all diagrams upper border to 10ms

UPPER=“0.01” sets all diagrams upper border to 100us

UPPER=“1”

how many ping processes shall be done in parallel. Reducing the number

causes the process to run longer, but keeps your system load a bit lower.

PARALLEL=“4”

use system’s “ping” command instead of perl library. This is useful when not

running as root. Fallback is implemented in case Net::Ping is not installed

on your system

SYSPING=“0” use Net::Ping library (default)

SYSPING=“1” use system command

SYSPING=“0”

If SYSPING is set to “0”, then you may specify the protocol used to ping all

hosts. Valid are “icmp” (the default) and “tcp”. If you run HotSaNIC without

root privileges, you should use “tcp” - but note, that some hosts don’t reply

to tcp ping packages!

PROTOCOL=“icmp”

PROTOCOL=“icmp”

configure multiple destinations of the form:

HOST=,

HOST=10.33.10.67, AP Bratrk
HOST=10.33.0.38, Topenar

Perl ma uzasnou vec to je velice snadno ovladatelny debugger

perl -d ./diagrams.pl
c 167

tim se dostanete na radek 167 a pak se podivejte kolem kde je problem.

Zdravim na Prosek.

Posílám výstup, ale vůbec z něj nejsem moudrý:

[root@topenar ping]# perl -d ./diagrams.pl

Loading DB routines from perl5db.pl version 1.28
Editor support available.

Enter h or h h' for help, orman perldebug’ for more help.

main::(./diagrams.pl:13): my $MODNAME=HotSaNICparser::get_module_name();
DB<1> c 167
creating images for 10.33.10.133 ( AP Bratrk) …
main::(./diagrams.pl:167): printf " %-7s %d".“x%d %s\n”,$descr,$xs,$ys,$FILENAME;
DB<2>

To si asi budete muset precit ono “h” neboli help a pokracovat jaksi dal. To co jsem poradil byl jen postup jak spustit debugger a dostat se na radek 167. Dal budete muset pouzit hlavu, coz chapu je bolestne :).

Jesli dobre vidim radek 167 tak tam zadna promenna W na kterou si perl stezuje neni. Takze bych to typnul na nejaky problem s obsahem nektereho z retezcu $descr, $xs, $ys nebo $FILENAME. Tyto promenne se vypisete prikazem
p$descr
pripadne dany radek odkrokujete pres prikaz
s

Bohužel se v perlu či jiném programovacím jazyku vůbec nevyznám, takže řešení tohto problému by pro mne znamenalo mít čas na studium. Boužel tento čas nemám. Spokojím se tedy s nefunkčním pingem. Děkuji za Váš čas.

BTW řádek vrací hour.

[root@topenar ping]# perl -d ./diagrams.pl

Loading DB routines from perl5db.pl version 1.28
Editor support available.

Enter h or h h' for help, orman perldebug’ for more help.

main::(./diagrams.pl:13): my $MODNAME=HotSaNICparser::get_module_name();
DB<1> c 167
creating images for 10.33.10.133 ( AP Bratrk) …
main::(./diagrams.pl:167): printf " %-7s %d".“x%d %s\n”,$descr,$xs,$ys,$FILENAME;
DB<2> p$descr
hour

To je skoda, protoze je to velmi jednoduche (mam takovy pocit ze nejaky init skrip ste si opravil taky sam). Smutne na tom je, ze nekde chybi cas na studium jednoduchych prikazu debugeru (p je print, s je step, c je continuje) ale jinde by mel byt cas vyresit vas problem. Ja s hotsanicem tento problem nemam, proto jsem odhadoval, ze to musi byt zpusobene nejakym nastavenim.

p$descr jste vypsal jen promennou $descr, jeste jsou tam tri dalsi… zkuste ten radek odkrokovat prikazem s, jesli vam to vyhodi stejnou chybu…

Takže je problém v xs a ys. Z výpisu nejsem moc moudrý. Budu hledat na internetu a uvidíme.

Dostal jsem návrh na rebuild modulů perlu. Uvidíme jestli to pomůže.


[root@topenar ping]# perl -d ./diagrams.pl

Loading DB routines from perl5db.pl version 1.28
Editor support available.

Enter h or h h' for help, orman perldebug’ for more help.

main::(./diagrams.pl:13): my $MODNAME=HotSaNICparser::get_module_name();
DB<1> c 167
creating images for 10.33.10.133 ( AP Bratrk) …
main::(./diagrams.pl:167): printf " %-7s %d".“x%d %s\n”,$descr,$xs,$ys,$FILENAME;
DB<2> p$descr
hour
DB<3> p$xs
Use of uninitialized value in print at (eval
11)[/usr/lib/perl5/5.8.8/perl5db.pl:628] line 2 (#1)
(W uninitialized) An undefined value was used as if it were already
defined. It was interpreted as a “” or a 0, but maybe it was a mistake.
To suppress this warning assign a defined value to your variables.

To help you figure out what was undefined, perl tells you what operation
you used the undefined value in.  Note, however, that perl optimizes your
program and the operation displayed in the warning may not necessarily
appear literally in your program.  For example, "that $foo" is
usually optimized into "that " . $foo, and the warning will refer to
the concatenation (.) operator, even though there is no . in your
program.

Use of uninitialized value in print at (eval 11)[/usr/lib/perl5/5.8.8/perl5db.pl:628] line 2.
at (eval 11)[/usr/lib/perl5/5.8.8/perl5db.pl:628] line 2
eval '($@, $!, $^E, $, $/, $\, $^W) = @saved;package main; $^D = $^D | $DB::db_stop;
print {$DB::OUT} $xs;

;’ called at /usr/lib/perl5/5.8.8/perl5db.pl line 628
DB::eval called at /usr/lib/perl5/5.8.8/perl5db.pl line 3410
DB::DB called at ./diagrams.pl line 167

DB<4> p$ys
Use of uninitialized value in print at (eval
12)[/usr/lib/perl5/5.8.8/perl5db.pl:628] line 2 (#1)
Use of uninitialized value in print at (eval 12)[/usr/lib/perl5/5.8.8/perl5db.pl:628] line 2.
at (eval 12)[/usr/lib/perl5/5.8.8/perl5db.pl:628] line 2
eval '($@, $!, $^E, $, $/, $\, $^W) = @saved;package main; $^D = $^D | $DB::db_stop;
print {$DB::OUT} $ys;

;’ called at /usr/lib/perl5/5.8.8/perl5db.pl line 628
DB::eval called at /usr/lib/perl5/5.8.8/perl5db.pl line 3410
DB::DB called at ./diagrams.pl line 167

DB<5> p$FILENAME
/var/www/html/hotsanic/ping/10.33.10.133-hour.png

Ahojte,

Tento problem sa mi dokazalo reprodukovat, skusim najst kde je chyba. Avsak hotsanic neni v fedora extras, takze uz neni supportovany a ani developovany.

/M.

Řešení z abclinux.cz jsem aplikoval a vše je funkční. Provedl jsem downgrade na 1.0.49 + make site-perl-install zabral.