Information here covers memory & CPU loading, hard disk
temperatures, and Cable Modem monitoring. I have also used MRTG for monitoring
signal levels and error rates on the EUMETCast satellite data service, and
for monitoring timekeeping using NTP.
Once you have installed: SNMP Informant on each PC you wish to monitor, you can access the data directly from MRTG, as it has a specific SNMP object ID (OID), so the script fragments are as shown below. To keep the configuration file clean, I actually used include statements in the mrtg.cfg file, such as:
Include: narvik-monitor.inc
As PC Narvik has two CPUs, there are two instances 48 and 49 listed in the [Target] line in the sample below.
|
Contents of narvik-monitor.inc |
#--------------------------------------------------------------- # PC Narvik - Memory #--------------------------------------------------------------- Target[Narvik-mem]: 1.3.6.1.4.1.9600.1.1.2.4.0&1.3.6.1.4.1.9600.1.1.2.1.0:public@narvik MaxBytes[Narvik-mem]: 4000000000 Options[Narvik-mem]: integer, gauge, nopercent, growright, unknaszero YLegend[Narvik-mem]: Memory ShortLegend[Narvik-mem]: B LegendI[Narvik-mem]: Used LegendO[Narvik-mem]: Avail Legend1[Narvik-mem]: Memory committed Legend2[Narvik-mem]: Memory available Title[Narvik-mem]: Narvik Memory PageTop[Narvik-mem]: <H2>PC Narvik - Memory</H2> #--------------------------------------------------------------- # PC Narvik - CPU load, dual-core CPU #--------------------------------------------------------------- Target[Narvik-CPU]: 1.3.6.1.4.1.9600.1.1.5.1.5.1.48&1.3.6.1.4.1.9600.1.1.5.1.5.1.49:public@narvik MaxBytes[Narvik-CPU]: 100 YLegend[Narvik-CPU]: CPU % ShortLegend[Narvik-CPU]: % LegendI[Narvik-CPU]: CPU 1 LegendO[Narvik-CPU]: CPU 2 Legend1[Narvik-CPU]: CPU 1 usage Legend2[Narvik-CPU]: CPU 2 usage Options[Narvik-CPU]: integer, gauge, nopercent, growright, unknaszero Title[Narvik-CPU]: Narvik CPU PageTop[Narvik-CPU]: <H2>PC Narvik - CPU load</H2> # If PC Narvik were a single-core CPU, use two instances of object 48, as MRTG requires that # you have two variables returned. You may also want to prevent display of the second output # line by adding the "no-ouput" option (noo) to the Options line: Target[Narvik-CPU]: 1.3.6.1.4.1.9600.1.1.5.1.5.1.48&1.3.6.1.4.1.9600.1.1.5.1.5.1.48:public@narvik Options[Narvik-CPU]: integer, gauge, nopercent, growright, noo # I found that on a lower-spec PC (Bacchus), returning the CPU twice caused an artificially # high value to be returned for the second call (presumably the CPU busy processing the first # request?!), so I actually changed to using the SNMP value: Maximum Number of Process Contexts # i.e. .1.3.6.1.2.1.25.1.7.0 (check this on your system using GetIF), which returns integer 0. Target[Bacchus-CPU]: 1.3.6.1.4.1.9600.1.1.5.1.5.1.48&1.3.6.1.2.1.25.1.7.0:public@192.168.0.4 |
As this is my first attempt, any suggestions for improvements are welcome.
The only thing noticeably different is using OIDs in the [Target] line, as described
here, and I used the GetIF program and the MIBs from SNMP Informant to work out
what to monitor. There are a lot more parameters available from the free SNMP Informant.
I added the unknaszero option so that when the PC is offline, the zero CPU and
memory usage are clearly visible.
All running under Windows, including Vista! Here's some current data:
![]() |
Memory Used Free |
![]() |
CPU 1 & 2 usage |
If you are fortunate enough to have a PC which is supported by the Mother Board Monitor program, you can just use that and add the appropriate SNMP objects as described above. My PCs did not support MBM, so I wrote a small program which accesses the S.M.A.R.T. data provided by some hard disks and the BIOS. Not all PCs do this, and not all PCs make all of the data accessible. To test your PC, download the DiskTemp.exe program, and run it from the command-line. You should see four lines like:
C:\>DiskTemp.exe 30 33 0 0 C:\> |
So as the program returns the disk temperatures, you can plot it in MRTG like this, using the ability of MRTG to read the output of a command-line program.
|
Contents of narvik-disk-temp.inc |
#--------------------------------------------------------------- # PC Narvik - disk temperatures #--------------------------------------------------------------- Target[narvik_disk_temp]: `DiskTemp` MaxBytes[narvik_disk_temp]: 100 MaxBytes2[narvik_disk_temp]: 100 Title[narvik_disk_temp]: Disk temperatures for PC Narvik Options[narvik_disk_temp]: integer, gauge, nopercent, growright, unknaszero YLegend[narvik_disk_temp]: Temperature °C ShortLegend[narvik_disk_temp]: °C Legend1[narvik_disk_temp]: Disk 0 temperature in °C Legend2[narvik_disk_temp]: Disk 1 temperature in °C LegendI[narvik_disk_temp]: Disk 0: LegendO[narvik_disk_temp]: Disk 1: PageTop[narvik_disk_temp]: <H1>PC Narvik -- Disk Temperatures</H1> |
![]() |
PC Narvik Disk temperature 750GB Samsung HD753LJ 1TB Samsung HD103SI |
Here's another example, showing what happened when I replaced
a 750GB 7200rpm standard disk with a 1TB "eco" disk spinning at just
5400rpm, and with a slower seek speed. While the green line is more or
less constant allowing for the daily temperature changes, the blue line showing
the second disk on PC Narvik has dropped significantly from being a few degrees
above the 750GB disk to being a degree or three below. A lower working
temperature should produce greater reliability, and it's a few watts less power
consumption. Performance of the PC appears to be unaffected.
The horizontal lines from before 0800 to after 1100 were the nonexistent values
while the PC was powered down for the disk clone. After seeing those
misleading values, I added unknaszero to the options shown above.

I found that the Motorola Cable Modem I have happens to report its signal levels via SNMP, provided you know the right object ID (OID). I'm not sure where I found this data from, but you might want to search Google with "snmp oid docsIfDownChannelPower" or look here:
http://www.oidview.com/mibs/0/DOCS-IF-MIB.html
http://support.ipmonitor.com/mibs/DOCS-IF-MIB/item.aspx?id=docsIfDownChannelPower
The only thing of note is that I put the IP address for the cable modem into my Hosts file as "cm-hfc", since my ISP only provides a dynamic IP.
|
Contents of: cable-modem.inc |
#--------------------------------------------------------------- # Cable modem RF signal levels #--------------------------------------------------------------- Target[CM-levels]: 1.3.6.1.2.1.10.127.1.1.1.1.6.3&1.3.6.1.2.1.10.127.1.2.2.1.3.2:public@cm-hfc / 10 AbsMax[CM-levels]: 70 MaxBytes[CM-levels]: 70 Title[CM-levels]: Motorola SB5101E Cable Modem - RF Signal Levels Options[CM-levels]: integer, gauge, nopercent, growright, unknaszero ShortLegend[CM-levels]: dBmV YLegend[CM-levels]: dBmV LegendO[CM-levels]: Transmit level LegendI[CM-levels]: Received level Legend2[CM-levels]: Transmit (upstream) level: +30..+56dBmV is OK Legend1[CM-levels]: Received (downstream) level: -10..+10dBmV is OK PageTop[CM-levels]: <H2>Motorola SB5101E Cable Modem - RF Signal Levels</H2> #--------------------------------------------------------------- # Cable modem SNR #--------------------------------------------------------------- Target[CM-SNR]: 1.3.6.1.2.1.10.127.1.1.4.1.5.3&1.3.6.1.2.1.10.127.1.1.4.1.5.3:public@cm-hfc / 10 AbsMax[CM-SNR]: 70 MaxBytes[CM-SNR]: 70 Title[CM-SNR]: Motorola SB5101E Cable Modem - SNR & bandwidth Options[CM-SNR]: integer, gauge, nopercent, growright, unknaszero, noo ShortLegend[CM-SNR]: dB YLegend[CM-SNR]: dB LegendI[CM-SNR]: RX SNR Legend1[CM-SNR]: Received SNR (dB) PageTop[CM-SNR]: <H2>Motorola SB5101E Cable Modem - SNR</H2> #--------------------------------------------------------------- |
Acknowledgements: the SNMP work was triggered by an e-mail exchange with Lonni J Friedman who asked how I got MRTG working under Vista (answer: Run As Administrator, having added SNMP and allowed it through the firewall), but who had the performance monitoring working under Windows XP! Steve Catto first introduced me to MRTG - thanks Steve!
Update: I just found this PDF document which covers monitoring a Windows system with MRTG.
| Copyright © David Taylor, Edinburgh | Last modified: 2009 Dec 13 at 16:51:49 |