Saturday, April 05, 2008

Monitoring Tiger via SNMPD over the network (II)

Today while I was over looking some looooooong backups from server to server, continued enabling/ testing the hard disk drive monitoring with SNMPD on Tiger, the plain vanilla one, not the server version.

After enabling SNMPD on Thor, I'm using it to report the percentage of HDD used, running snmpdf, one of the programs from the net-snmp suite.
On Thor I have 2 HDDs, spliced onto 3 partitions.

When executed, the command returns info on all of the HDDs that box you are monitoring has, so the biggest annoyance it parsing the result, but it only takes a couple of minutes to figure it how to get the desired result printed.

This is the result, without parsing:

$ /usr/local/bin/snmpdf -v 2c -Oqv -Cu -c XXXXXXXXXXXXXXXXX thor
Description size (kB) Used Available Used%
/ 25952256 4844504 21107752 18%
/Volumes/data1 51936304 21595244 30341060 41%
/Volumes/data2 79912152 60396756 19515396 75%

And here is the snip from the /etc/mrtg.cfg file from Judith:

Title[thor_root_df]: Percentage use /dev/disk1s3 file system
PageTop[thor_root_df]: Use /dev/disk1s3/ file system
Target[thor_root_df]: `/usr/local/bin/snmpdf -v 2c -Cu -c XXXXXXXXXXXXXXXX thor | awk '{print $5}' | tail -r -n 3 | tail -n 1 | cut -d% -f 1`
options[thor_root_df]: gauge,transparent,nopercent,noinfo,nobanner
Unscaled[thor_root_df]: ymwd
MaxBytes[thor_root_df]: 100
YLegend[thor_root_df]: Use %
ShortLegend[thor_root_df]: Percent
LegendI[thor_root_df]: Use
LegendO[thor_root_df]: Use
Legend1[thor_root_df]: Use /dev/disk1s3/ file system
Legend2[thor_root_df]: Use /dev/disk1s3/ file system

Title[thor_root_data1]: Percentage use /dev/disk1s5/ file system
PageTop[thor_root_data1]: Use /dev/disk1s5/ file system
Target[thor_root_data1]: `/usr/local/bin/snmpdf -v 2c -Cu -c XXXXXXXXXXXXXXXX thor | awk '{print $5}' | tail -r -n 2 | tail -n 1 | cut -d% -f 1`
options[thor_root_data1]: gauge,transparent,nopercent,noinfo,nobanner
Unscaled[thor_root_data1]: ymwd
MaxBytes[thor_root_data1]: 100
YLegend[thor_root_data1]: Use %
ShortLegend[thor_root_data1]: Percent
LegendI[thor_root_data1]: Use
LegendO[thor_root_data1]: Use
Legend1[thor_root_data1]: Use /dev/disk1s5/ file system
Legend2[thor_root_data1]: Use /dev/disk1s5/ file system

Title[thor_root_data2]: Percentage use /dev/disk0s3/ file system
PageTop[thor_root_data2]: Use /dev/disk0s3/ file system
Target[thor_root_data2]: `/usr/local/bin/snmpdf -v 2c -Cu -c XXXXXXXXXXXXXXXX thor | awk '{print $5}' | tail -n 1 | cut -d% -f 1`
options[thor_root_data2]: gauge,transparent,nopercent,noinfo,nobanner
Unscaled[thor_root_data2]: ymwd
MaxBytes[thor_root_data2]: 100
YLegend[thor_root_data2]: Use %
ShortLegend[thor_root_data2]: Percent
LegendI[thor_root_data2]: Use
LegendO[thor_root_data2]: Use
Legend1[thor_root_data2]: Use /dev/disk0s3/ file system
Legend2[thor_root_data2]: Use /dev/disk0s3/ file system

I'm looking at other options available, so I can avoid making all those operations to parse the data.

Labels: , , ,


Post a Comment

<< Home