[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mon
Subject:    Another patch for snmpdiskspace.monitor (swapspace)
From:       Hans Kinwel <hansk () momac ! net>
Date:       2005-11-16 14:53:05
Message-ID: 437B47D1.3080102 () momac ! net
[Download RAW message or body]

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
                                                    | H.Kinwel@momac.net

["snmpdiskspace.monitor.patch2" (text/plain)]

*** 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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic