[geeks] MRTG

Gregory Leblanc gleblanc at linuxweasel.com
Wed May 29 17:02:54 CDT 2002


On Wed, 2002-05-29 at 14:45, Shawn Wallbridge wrote:
> I found a page at (http://www.ansdell.demon.co.uk/networks/monitor.html)
> that lists some MIB's for HP printers (1.3.6.1.2.1.43.10.2.1.4.1.1 ), but
> they don't say anything about our model.

Do you have Net-SNMP or some other command line SNMP agent installed? 
With Net-SNMP I can do something like:
snmpget hostname public .1.3.6.1.4.1.2021.9.1.9.1

To get % disk usage on one of my disks (I forget which one).  There's
also snmpwalk, which can fetch a whole SNMP tree.  One of those two
should get you descriptions of what your router, err, I mean, printer,
is reporting.  I think I ended up doing an snmpwalk of the entire tree
on my machines, and reading the entire thing, looking for something
useful.  Here's the useful stuff I found for a host, put into a quick
and dirty webpage. 
http://linuxweasel.com/mrtg/Sparc20_Machine_Statistics.html


> Honestly, I don't know squat about SNMP, I just used the config file creator

I knew a bit back when I last set up MRTG for my machines, but I don't
think anybody here really knows a lot about it (at least, nobody
commented on what I was doing when I asked for feedback).  

> (cfgmaker) to make the stuff for MRTG. I have been reading the mrtg docs
> trying to figure out where to put the MIB in the cfgmaker command, but what
> they say to do doesn't seem to work.

I think I gave up on those, and wrote my config file by hand.  

> Here is the config file I have working for the printer that is currently
> monitoring the throughput.
> 
[snip]
> #  to get bits instead of bytes and graphs growing to the right
> # Options[_]: growright, bits

The [_] thing tells it which graph you're talking about.  For example,
my mrtg.cfg has 12 different options inside of [], along the lines of
Options[sparc20.cpusum]: growright,nopercent


> WorkDir: /var/www/mrtg
> Options[_]: bits,growright
> 
[snip]
> ### Interface 1 >> Descr: '' | Name: '' | Ip: '192.168.0.10' | Eth:
> '00-01-e6-5c-0e-e5' ###
> 
> Target[192.168.0.10_1]: 1:public at 192.168.0.10:
> SetEnv[192.168.0.10_1]: MRTG_INT_IP="192.168.0.10" MRTG_INT_DESCR=""
> MaxBytes[192.168.0.10_1]: 1250000
> Title[192.168.0.10_1]: Traffic Analysis for 1 -- LaserJet
> PageTop[192.168.0.10_1]: <H1>Traffic Analysis for 1 -- LaserJet</H1>
>  <TABLE>
>    <TR><TD>System:</TD>     <TD>LaserJet in </TD></TR>
>    <TR><TD>Maintainer:</TD> <TD></TD></TR>
>    <TR><TD>Description:</TD><TD>  </TD></TR>
>    <TR><TD>ifType:</TD>     <TD>ethernetCsmacd (6)</TD></TR>
>    <TR><TD>ifName:</TD>     <TD></TD></TR>
>    <TR><TD>Max Speed:</TD>  <TD>10.0 Mbits/s</TD></TR>
>    <TR><TD>Ip:</TD>         <TD>192.168.0.10 ()</TD></TR>
>  </TABLE>
> 

Hmm, I wonder what's with the HTML code in there.  I don't have any in
my mrtg.cfg.  
> 
> ### Interface 2 >> Descr: '' | Name: '' | Ip: '' | Eth: '' ###
> ### The following interface is commented out because:
> ### * it is a Software Loopback interface
> ### * has a speed of 0 which makes no sense
> #
> # Target[192.168.0.10_2]: 2:public at 192.168.0.10:
> # SetEnv[192.168.0.10_2]: MRTG_INT_IP="" MRTG_INT_DESCR=""
> # MaxBytes[192.168.0.10_2]: 0
> # Title[192.168.0.10_2]: Traffic Analysis for 2 -- LaserJet
> # PageTop[192.168.0.10_2]: <H1>Traffic Analysis for 2 -- LaserJet</H1>
> #  <TABLE>
> #    <TR><TD>System:</TD>     <TD>LaserJet in </TD></TR>
> #    <TR><TD>Maintainer:</TD> <TD></TD></TR>
> #    <TR><TD>Description:</TD><TD>  </TD></TR>
> #    <TR><TD>ifType:</TD>     <TD>softwareLoopback (24)</TD></TR>
> #    <TR><TD>ifName:</TD>     <TD></TD></TR>
> #    <TR><TD>Max Speed:</TD>  <TD>0.0 bits/s</TD></TR>
> #  </TABLE>
	Greg

-- 
Portland, Oregon, USA.
Please don't copy me on replies to the list.



More information about the geeks mailing list