[SC.LUG] Anyone use MRTG?

Greg Bolshaw greg at linuxtechnologies.co.uk
Sun Mar 7 19:22:40 GMT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

damian at damosoft.co.uk wrote:
> I did find this for mrtg config file:
>
> WorkDir: /var/www/html/mrtg
> Target[eth0]: `perl -e '@a=split(/[:\s]+/,qx(grep eth0
> /proc/net/dev));$f="%.0f";$fmt="$f\n$f\n1\neth0 traffic\n";$s=sprintf
> $fmt,$a[2],$a[10];print $s;print STDERR $s;'`;
<snip>

That's a nasty way of doing it, but it'll work assuming your kernel 
has /proc filesystem support.

> But really I want bandwidth and total of data transferred, that has
> to be done with SNMP?

You'll get the same results either way. If you use SNMP, MRTG can probe 
information relating to network bandwidth itself (using cfgmaker). If 
however you chose the nasty perl hack above, you'll have to basically 
write the config file from scratch.

- -- 
+---------------------------------------------------------------+
| Greg Bolshaw LPIC  | mailto:greg at linuxtechnologies.co.uk      |
| Consultant         | JID: greg at jabber.linuxtechnologies.co.uk |
| Linux Technologies | http://www.linuxtechnologies.co.uk       |
+---------------------------------------------------------------+
|     Public Jabber server:  jabber.linuxtechnologies.co.uk     |
+---------------------------------------------------------------+

/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
| This e-mail has been digitally signed using PGP (Pretty Good  |
| Privacy) to guarantee authenticity.                           |
|                                                               |
| For more information, see http://www.pgpi.org/doc/overview/.  |
\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAS3ZuS94XrT3lHYkRAovUAKC0fohBVS5/sXRUz4ZMnRxCSiNnEACfRCQu
8L9vKDwW82hdFpMPhWJbeEc=
=WPjx
-----END PGP SIGNATURE-----



More information about the SC mailing list