[mrtg] graphing small counter values?

Hubert depesz Lubaczewski depesz at depesz.pl
Sat Dec 14 19:34:25 MET 2002


hi
sorry for possibly siumple question, but i have spent more than 2 days
trying to figure this out.

i want to graph a number of rejected (by iptables) packets (input and
output).
to do so, i created two scripts:

--------------------------- iptables-INPUT.pl: ---------------------------
#!/usr/bin/perl
my ($sNewInput) = grep {
	s/^Chain\s+INPUT\s+\(\s*policy\s+DROP\s+(\d+)\s+packets.*$/$1/s
} `/usr/sbin/iptables -v -L`;
printf("%u\n", $sNewInput);
--------------------------- :iptables-INPUT.pl ---------------------------
--------------------------- iptables-OUTPUT.pl: ---------------------------
#!/usr/bin/perl
my ($sNewOutput) = grep {
	s/^Chain\s+OUTPUT\s+\(\s*policy\s+DROP\s+(\d+)\s+packets.*$/$1/s
} `/usr/sbin/iptables -v -L`;

printf("%u\n", $sNewOutput);
--------------------------- :iptables-OUTPUT.pl ---------------------------

this scripts are linked into my snmpd, and (wow) they work.
now i created in mrtg.cfg section to graph it:
Target[depeszws_fire]: .1.3.6.1.4.1.2021.8.1.101.1&.1.3.6.1.4.1.2021.8.1.101.2:public at 127.0.0.1
Title[depeszws_fire]: firewalled packets
MaxBytes[depeszws_fire]: 20
Factor[depeszws_fire]: 300
YScale[depeszws_fire]: 2
XScale[depeszws_fire]: 2
YTics[depeszws_fire]: 12
Options[depeszws_fire]: growright,perminute
PageTop[depeszws_fire]: <H1>firewalled packets</H1>

and - it doesn't work.
by doesn't i mean that usally it just draws line at "0".
i tried to work with plain Options: growright. then i tried absolute,
perhour, perminute, and even Factor - just like it is right now.
none of this setups do work for me.
what am i doing wrong?
i have about 1-2 rejected packets per 5 minutes.
i'd like to get this values (1-2) "asis" on graph. not divided, not
nothing - just graphed as 1, or 2 or whatever it will be.
but mrtg seems to be smarter then i am.

of course i checked if snmp is providing information:
$ snmpwalk 127.0.0.1 public .1.3.6.1.4.1.2021.8.1.101.1
enterprises.ucdavis.extTable.extEntry.extOutput.1 = 135

$ snmpwalk 127.0.0.1 public .1.3.6.1.4.1.2021.8.1.101.2
enterprises.ucdavis.extTable.extEntry.extOutput.2 = 197

i read what i could out of refernce.txt. i search the net with google.
still it yielded no results.
can anyone of you be kind enough to help me with it?

thanks in advance

depesz

-- 
hubert depesz lubaczewski                          http://www.depesz.pl/
------------------------------------------------------------------------
Mój Boże, spraw abym milczał, dopóki się nie upewnię,  że  naprawdę  mam
coś do powiedzenia.                                      (c) 1998 depesz

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list