Back to index

nagios-plugins  1.4.16
Functions | Variables
check_pcpmetric Namespace Reference

Functions

def usage

Variables

int DEBUG = 0
float nagios_pcpclient_version = 0.01
string PMVAL = '/usr/bin/pmval'
string COMMANDLINE = " -s 1"
string METRIC = 'undefined'
int CRITICAL = 0
int WARNING = 0
tuple p = popen2.Popen4(COMMANDLINE)
tuple exitcode = p.wait()
tuple buffer = p.fromchild.readline()
 output = buffer
tuple returndata = string.split(output)
tuple retval = string.atof(returndata)
int EXITCODE = 0

Function Documentation

def check_pcpmetric.usage ( void  )

Definition at line 19 of file check_pcpmetric.py.

00019 
00020 def usage():
00021        print "Usage:", argv[0], "[options]"
00022        print "Options:"
00023        print "\t[-H host]\tHostname to contact"
00024        print "\t[-m metric]\tPCP metric to check"
00025        print "\t[-i instance]\tPCP metric instance"
00026        print "\t[-w warn]\tIssue warning alert if value is larger than this"
00027        print "\t[-c critical]\tIssue critical alert value is larger than this"
00028        print "\t[-V]\t\tProgram version"
00029        print "\t[-h]\t\tThis helptext"
00030        print ""
00031        print "F.ex. to check 5 minute loadaverage, warn if the load is above 2,"
00032        print "and give critical warning if it's above 10:"
00033        print "\n\t%", argv[0], " -i 5 -m kernel.all.load -w 2 -c 10"
00034        print ""
00035        print "A list of all PCP metrics can be found with the command 'pminfo'."
00036        print "A list of all instances within a metric can be found with 'pminfo -f metric'."
00037        print "F.ex. to see all available instances of 'filesys.full' execute:"
00038        print "\n\t% pminfo -f filesys.full"
00039        print "\tfilesys.full"
00040        print """\t\tinst [0 or "/dev/root"] value 45.35514044640914"""
00041        print """\t\tinst [1 or "/dev/sda1"] value 46.74285959344712"""
00042        print """\t\tinst [2 or "/dev/sdb1"] value 0.807766570678168"""
00043        print ""
00044        print "And the command to have nagios monitor the /dev/sda1 filesystem would be:"
00045        print "\n\t", argv[0], " -i /dev/sda1 -m filesys.full -w 70 -c 90"
00046 
00047 
opts, args = getopt.getopt(argv[1:],'hH:c:w:m:i:V')

Here is the caller graph for this function:


Variable Documentation

tuple check_pcpmetric.buffer = p.fromchild.readline()

Definition at line 78 of file check_pcpmetric.py.

string check_pcpmetric.COMMANDLINE = " -s 1"

Definition at line 14 of file check_pcpmetric.py.

Definition at line 16 of file check_pcpmetric.py.

Definition at line 10 of file check_pcpmetric.py.

tuple check_pcpmetric.exitcode = p.wait()

Definition at line 75 of file check_pcpmetric.py.

Definition at line 97 of file check_pcpmetric.py.

check_pcpmetric.METRIC = 'undefined'

Definition at line 15 of file check_pcpmetric.py.

Definition at line 12 of file check_pcpmetric.py.

Definition at line 80 of file check_pcpmetric.py.

tuple check_pcpmetric.p = popen2.Popen4(COMMANDLINE)

Definition at line 74 of file check_pcpmetric.py.

string check_pcpmetric.PMVAL = '/usr/bin/pmval'

Definition at line 13 of file check_pcpmetric.py.

tuple check_pcpmetric.returndata = string.split(output)

Definition at line 83 of file check_pcpmetric.py.

tuple check_pcpmetric.retval = string.atof(returndata)

Definition at line 91 of file check_pcpmetric.py.

Definition at line 17 of file check_pcpmetric.py.