Here's another patch for snmpdiskspace.monitor; this one's even more impressive: two lines of code changed.
Yet I consider it quite an important patch myself: with this patch also swapspace get monitored for "disk full". I don't know about you guys, but when one of my production servers runs out of swapspace it is just as bad as any other partition filling up, maybe even more so.
The change is extremely trivial, and reporting and configuration in the .cf file works straight out of the box without any extra effort needed.
Cheers, -- | Hans Kinwel | [EMAIL PROTECTED]
*** snmpdiskspace.monitor.old 2005-11-16 15:36:48.000000000 +0100 --- snmpdiskspace.monitor.new 2005-11-16 15:43:06.000000000 +0100 *************** *** 393,399 **** # Using the Empire agent, this will eliminate drive types other # than hard disks. The UCD agent is not as good as determining # drive types under the HOST mib. ! next if ($Type !~ /\.1\.3\.6\.1\.2\.1\.25\.2\.1\.4/); if ($Size != 0) { $Percent= ($Used / $Size) * 100.0; --- 393,402 ---- # Using the Empire agent, this will eliminate drive types other # than hard disks. The UCD agent is not as good as determining # drive types under the HOST mib. ! # We do not only monitor "FixedDevice" type (4), but also ! # "Virtual Memory type (3), as running out of swap is as bad as ! # running out of other diskspace. ! next if ($Type !~ /\.1\.3\.6\.1\.2\.1\.25\.2\.1\.[34]/); if ($Size != 0) { $Percent= ($Used / $Size) * 100.0; *************** *** 431,437 **** while (defined $s->getnext($v)) { # Make sure we are still in relevant portion of MIB ! last if ($v->[1]->val !~ /^\.1\.3\.6\.1\.2\.1\.25\.2\.1\.4/); last if ($v->[0]->val =~ /Total/); $Descr = ( $v->[0]->val =~ /.*:.*:(\w+:)$/gi)[-1] ; --- 434,440 ---- while (defined $s->getnext($v)) { # Make sure we are still in relevant portion of MIB ! last if ($v->[1]->val !~ /^\.1\.3\.6\.1\.2\.1\.25\.2\.1\.[34]/); last if ($v->[0]->val =~ /Total/); $Descr = ( $v->[0]->val =~ /.*:.*:(\w+:)$/gi)[-1] ;
_______________________________________________ mon mailing list mon@linux.kernel.org http://linux.kernel.org/mailman/listinfo/mon