summaryrefslogtreecommitdiffstats
path: root/Monitoring/nagios/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'Monitoring/nagios/plugins')
-rwxr-xr-xMonitoring/nagios/plugins/check.bat0
-rwxr-xr-xMonitoring/nagios/plugins/check.sh5
-rwxr-xr-xMonitoring/nagios/plugins/check_aptbin106120 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_bgpstate215
-rwxr-xr-xMonitoring/nagios/plugins/check_breeze87
-rwxr-xr-xMonitoring/nagios/plugins/check_btcguild_miner36
-rwxr-xr-xMonitoring/nagios/plugins/check_by_sshbin46192 -> 0 bytes
l---------Monitoring/nagios/plugins/check_clamd1
-rwxr-xr-xMonitoring/nagios/plugins/check_clusterbin32072 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_cpu165
-rwxr-xr-xMonitoring/nagios/plugins/check_dhcpbin44816 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_digbin41392 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_diskbin119216 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_disk_smb307
-rwxr-xr-xMonitoring/nagios/plugins/check_dnsbin45488 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_dummybin28968 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_dummy.sh5
-rwxr-xr-xMonitoring/nagios/plugins/check_file_age112
-rwxr-xr-xMonitoring/nagios/plugins/check_flexlm244
-rwxr-xr-xMonitoring/nagios/plugins/check_fpingbin44656 -> 0 bytes
l---------Monitoring/nagios/plugins/check_ftp1
-rwxr-xr-xMonitoring/nagios/plugins/check_gamebin36584 -> 0 bytes
l---------Monitoring/nagios/plugins/check_host1
-rwxr-xr-xMonitoring/nagios/plugins/check_hpjdbin41136 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_httpbin164624 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_icmpbin49264 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_ide_smartbin34536 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_ifoperstatus472
-rwxr-xr-xMonitoring/nagios/plugins/check_ifstatus425
l---------Monitoring/nagios/plugins/check_imap1
-rwxr-xr-xMonitoring/nagios/plugins/check_ircd239
l---------Monitoring/nagios/plugins/check_jabber1
-rwxr-xr-xMonitoring/nagios/plugins/check_ldapbin40816 -> 0 bytes
l---------Monitoring/nagios/plugins/check_ldaps1
-rwxr-xr-xMonitoring/nagios/plugins/check_linux_raid115
-rwxr-xr-xMonitoring/nagios/plugins/check_loadbin36168 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_log219
-rwxr-xr-xMonitoring/nagios/plugins/check_mailq608
-rwxr-xr-xMonitoring/nagios/plugins/check_mem.pl263
-rwxr-xr-xMonitoring/nagios/plugins/check_mrtgbin36264 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_mrtgtrafbin34440 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_mysqlbin45936 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_mysql_querybin44688 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_nagiosbin36616 -> 0 bytes
l---------Monitoring/nagios/plugins/check_nntp1
l---------Monitoring/nagios/plugins/check_nntps1
-rwxr-xr-xMonitoring/nagios/plugins/check_ntbin48720 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_ntpbin46288 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_ntp_peerbin44880 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_ntp_timebin42224 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_nwstatbin60912 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_oracle287
-rwxr-xr-xMonitoring/nagios/plugins/check_overcrbin40400 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_pgsqlbin40656 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_pingbin48848 -> 0 bytes
l---------Monitoring/nagios/plugins/check_pop1
-rwxr-xr-xMonitoring/nagios/plugins/check_procsbin114640 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_radiusbin40624 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_realbin40464 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_rpc375
l---------Monitoring/nagios/plugins/check_rta_multi1
-rwxr-xr-xMonitoring/nagios/plugins/check_sensors65
-rwxr-xr-xMonitoring/nagios/plugins/check_shinken.py157
l---------Monitoring/nagios/plugins/check_simap1
-rwxr-xr-xMonitoring/nagios/plugins/check_sip252
-rwxr-xr-xMonitoring/nagios/plugins/check_smtpbin127216 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_snmpbin152008 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_speed34
l---------Monitoring/nagios/plugins/check_spop1
-rwxr-xr-xMonitoring/nagios/plugins/check_sshbin36688 -> 0 bytes
l---------Monitoring/nagios/plugins/check_ssmtp1
-rwxr-xr-xMonitoring/nagios/plugins/check_swapbin37832 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_tcpbin49328 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_temper31
-rwxr-xr-xMonitoring/nagios/plugins/check_timebin38128 -> 0 bytes
l---------Monitoring/nagios/plugins/check_udp1
-rwxr-xr-xMonitoring/nagios/plugins/check_upsbin44560 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_usersbin36168 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/check_wave122
-rwxr-xr-xMonitoring/nagios/plugins/getwmic.sh7
-rwxr-xr-xMonitoring/nagios/plugins/link_vmware_host_vm.py184
-rwxr-xr-xMonitoring/nagios/plugins/negatebin38152 -> 0 bytes
-rwxr-xr-xMonitoring/nagios/plugins/nmap_discovery_runner.py419
-rwxr-xr-xMonitoring/nagios/plugins/notify.sh6
-rwxr-xr-xMonitoring/nagios/plugins/notify_irc87
-rwxr-xr-xMonitoring/nagios/plugins/nsca_client.py184
-rwxr-xr-xMonitoring/nagios/plugins/sendmailhost.pl96
-rwxr-xr-xMonitoring/nagios/plugins/sendmailservices.pl105
-rwxr-xr-xMonitoring/nagios/plugins/urlizebin36104 -> 0 bytes
-rw-r--r--Monitoring/nagios/plugins/utils.pm67
-rwxr-xr-xMonitoring/nagios/plugins/utils.sh23
-rwxr-xr-xMonitoring/nagios/plugins/vmware_discovery_runner.py225
92 files changed, 0 insertions, 6257 deletions
diff --git a/Monitoring/nagios/plugins/check.bat b/Monitoring/nagios/plugins/check.bat
deleted file mode 100755
index e69de29b..00000000
--- a/Monitoring/nagios/plugins/check.bat
+++ /dev/null
diff --git a/Monitoring/nagios/plugins/check.sh b/Monitoring/nagios/plugins/check.sh
deleted file mode 100755
index 9e62fbee..00000000
--- a/Monitoring/nagios/plugins/check.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-echo "When in doubt... blow it up. | cpu=100%"
-#sleep 1.5
-exit 0
diff --git a/Monitoring/nagios/plugins/check_apt b/Monitoring/nagios/plugins/check_apt
deleted file mode 100755
index 2371c32d..00000000
--- a/Monitoring/nagios/plugins/check_apt
+++ /dev/null
Binary files differ
diff --git a/Monitoring/nagios/plugins/check_bgpstate b/Monitoring/nagios/plugins/check_bgpstate
deleted file mode 100755
index 645d7505..00000000
--- a/Monitoring/nagios/plugins/check_bgpstate
+++ /dev/null
@@ -1,215 +0,0 @@
-#!/usr/bin/perl -w
-#
-# check_bgpstate.pl - nagios plugin
-#
-# Copyright (C) 2000 Christoph Kron
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-#
-# Report bugs to: ck@zet.net
-#
-# 11.01.2000 Version 1.0
-
-
-
-use strict;
-
-use Net::SNMP;
-use Getopt::Long;
-&Getopt::Long::config('auto_abbrev');
-
-
-# whois programm for RIPE database queries
-my $whois = '/usr/bin/whois';
-my $status;
-my $TIMEOUT = 30;
-
-# critical bgp sessions
-my %uplinks = ( 1273, 'Uplink ECRC',
- 1755, 'Uplink EBONE',
- 3300, 'Uplink AUCS'
- );
-
-my %ERRORS = ('UNKNOWN' , '-1',
- 'OK' , '0',
- 'WARNING', '1',
- 'CRITICAL', '2');
-
-
-my %bgpPeerState = (
- '1',"idle",
- '2',"connect",
- '3',"active",
- '4',"opensent",
- '5',"openconfirm",
- '6',"established"
- );
-my $state = "UNKNOWN";
-my $answer = "";
-my $snmpkey;
-my $snmpoid;
-my $key;
-my $community = "public";
-my $port = 161;
-my @snmpoids;
-my $snmpbgpPeerState = '1.3.6.1.2.1.15.3.1.2';
-my $snmpbgpPeerLocalAddr = '1.3.6.1.2.1.15.3.1.5';
-my $snmpbgpPeerRemoteAddr = '1.3.6.1.2.1.15.3.1.7';
-my $snmpbgpPeerRemoteAs = '1.3.6.1.2.1.15.3.1.9';
-my $hostname;
-my $session;
-my $error;
-my $response;
-my %bgpStatus;
-my $bgpestablished =0 ;
-my $bgpcritical =0;
-my $bgpdown =0;
-my $bgpidle =0;
-my $bgpmessage;
-my $asname;
-my $remoteas;
-my @output;
-
-sub usage {
- printf "\nMissing arguments!\n";
- printf "\n";
- printf "Perl bgpstate plugin for Nagios\n";
- printf "monitors all BGP sessions\n";
- printf "usage: \n";
- printf "check_bgpstate.pl -c <READCOMMUNITY> -p <PORT> <HOSTNAME>\n";
- printf "Copyright (C) 2000 Christoph Kron\n";
- printf "check_bgpstate.pl comes with ABSOLUTELY NO WARRANTY\n";
- printf "This programm is licensed under the terms of the ";
- printf "GNU General Public License\n(check source code for details)\n";
- printf "\n\n";
- exit $ERRORS{"UNKNOWN"};
-}
-
-# Just in case of problems, let's not hang Nagios
-$SIG{'ALRM'} = sub {
- print ("ERROR: No snmp response from $hostname (alarm)\n");
- exit $ERRORS{"UNKNOWN"};
-};
-alarm($TIMEOUT);
-
-
-$status = GetOptions("community=s",\$community,
- "port=i",\$port);
-if ($status == 0)
-{
- &usage;
-}
-
- #shift;
- $hostname = shift || &usage;
-
-
-push(@snmpoids, $snmpbgpPeerState);
-push(@snmpoids, $snmpbgpPeerLocalAddr);
-push(@snmpoids, $snmpbgpPeerRemoteAddr);
-push(@snmpoids, $snmpbgpPeerRemoteAs);
-
-foreach $snmpoid (@snmpoids) {
-
- ($session, $error) = Net::SNMP->session(
- -hostname => $hostname,
- -community => $community,
- -port => $port
- );
-
- if (!defined($session)) {
- $state='UNKNOWN';
- $answer=$error;
- print ("$state: $answer");
- exit $ERRORS{$state};
- }
-
- if (!defined($response = $session->get_table($snmpoid))) {
- $answer=$session->error;
- $session->close;
- $state = 'CRITICAL';
- print ("$state: $answer,$snmpkey");
- exit $ERRORS{$state};
- }
-
- foreach $snmpkey (keys %{$response}) {
- $snmpkey =~ m/.*\.(\d+\.\d+\.\d+\.\d+$)/;
- $key = $1;
-# printf "debug: $snmpkey: $key -> $response->{$snmpkey}\n";
- $bgpStatus{$key}{$snmpoid} = $response->{$snmpkey};
- }
- $session->close;
-}
-
-foreach $key (keys %bgpStatus) {
- if ($bgpStatus{$key}{$snmpbgpPeerState} == 6 ) {
- $bgpestablished++;
- }
- elsif ($bgpStatus{$key}{$snmpbgpPeerState} == 1 ) {
- $bgpidle++;
- }
- else {
- $bgpdown++ ;
- if (exists($uplinks{$bgpStatus{$key}{$snmpbgpPeerRemoteAs}}) ) {
- $bgpcritical++;
- }
- @output = `$whois -T aut-num AS$bgpStatus{$key}{$snmpbgpPeerRemoteAs}`;
-
- $asname = "";
- foreach (@output) {
- if (m/as-name/) {
- $asname = $_;
- $asname =~ s/as-name://;
- last;
- }
- if ( $asname =~ "" && m/descr/ ) {
- $asname = $_;
- $asname =~ s/descr://;
- }
- }
- $asname =~ s/^\s*//;
- $asname =~ s/\s*$//;
- $bgpmessage .= sprintf("Peering with AS%s not established -> %s<BR>",
- $bgpStatus{$key}{$snmpbgpPeerRemoteAs},
- $asname);
- }
-}
-
-
- if ($bgpdown > 0) {
- if ($bgpcritical > 0) {
- $state = 'CRITICAL';
- }
- else {
- $state = 'WARNING';
- }
- $answer = sprintf("host '%s', sessions up: %d, down: %d, shutdown: %d<BR>",
- $hostname,
- $bgpestablished,
- $bgpdown, $bgpidle);
- $answer = $answer . $bgpmessage . "\n";
- }
- else {
- $state = 'OK';
- $answer = sprintf("host '%s', sessions up: %d, down: %d, shutdown: %d\n",
- $hostname,
- $bgpestablished,
- $bgpdown,$bgpidle);
- }
-
-print ("$state: $answer");
-exit $ERRORS{$state};
-
diff --git a/Monitoring/nagios/plugins/check_breeze b/Monitoring/nagios/plugins/check_breeze
deleted file mode 100755
index d0382e69..00000000
--- a/Monitoring/nagios/plugins/check_breeze
+++ /dev/null
@@ -1,87 +0,0 @@
-#! /usr/bin/perl -wT
-
-
-use strict;
-use Getopt::Long;
-use vars qw($opt_V $opt_h $opt_w $opt_c $opt_H $opt_C $PROGNAME);
-use lib "/usr/lib/nagios/plugins" ;
-use utils qw(%ERRORS &print_revision &support &usage);
-
-$PROGNAME = "check_breeze";
-
-sub print_help ();
-sub print_usage ();
-
-$ENV{'PATH'}='';
-$ENV{'BASH_ENV'}='';
-$ENV{'ENV'}='';
-
-Getopt::Long::Configure('bundling');
-GetOptions
- ("V" => \$opt_V, "version" => \$opt_V,
- "h" => \$opt_h, "help" => \$opt_h,
- "w=s" => \$opt_w, "warning=s" => \$opt_w,
- "c=s" => \$opt_c, "critical=s" => \$opt_c,
- "H=s" => \$opt_H, "hostname=s" => \$opt_H,
- "C=s" => \$opt_C, "community=s" => \$opt_C);
-
-if ($opt_V) {
- print_revision($PROGNAME,'1.4.15');
- exit $ERRORS{'OK'};
-}
-
-if ($opt_h) {print_help(); exit $ERRORS{'OK'};}
-
-($opt_H) || usage("Host name/address not specified\n");
-my $host = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/);
-($host) || usage("Invalid host: $opt_H\n");
-
-($opt_w) || usage("Warning threshold not specified\n");
-my $warning = $1 if ($opt_w =~ /([0-9]{1,2}|100)+/);
-($warning) || usage("Invalid warning threshold: $opt_w\n");
-
-($opt_c) || usage("Critical threshold not specified\n");
-my $critical = $1 if ($opt_c =~ /([0-9]{1,2}|100)/);
-($critical) || usage("Invalid critical threshold: $opt_c\n");
-
-($opt_C) || ($opt_C = "public") ;
-
-my $sig=0;
-$sig = `snmpget $host $opt_C .1.3.6.1.4.1.710.3.2.3.1.3.0`;
-my @test=split(/ /,$sig);
-$sig=$test[2];
-$sig=int($sig);
-if ($sig>100){$sig=100}
-
-print "Signal Strength at: $sig%\n";
-
-exit $ERRORS{'CRITICAL'} if ($sig<$critical);
-exit $ERRORS{'WARNING'} if ($sig<$warning);
-exit $ERRORS{'OK'};
-
-
-sub print_usage () {
- print "Usage: $PROGNAME -H <host> [-C community] -w <warn> -c <crit>\n";
-}
-
-sub print_help () {
- print_revision($PROGNAME,'1.4.15');
- print "Copyright (c) 2000 Jeffrey Blank/Karl DeBisschop
-
-This plugin reports the signal strength of a Breezecom wireless equipment
-
-";
- print_usage();
- print "
--H, --hostname=HOST
- Name or IP address of host to check
--C, --community=community
- SNMPv1 community (default public)
--w, --warning=INTEGER
- Percentage strength below which a WARNING status will result
--c, --critical=INTEGER
- Percentage strength below which a CRITICAL status will result
-
-";
- support();
-}
diff --git a/Monitoring/nagios/plugins/check_btcguild_miner b/Monitoring/nagios/plugins/check_btcguild_miner
deleted file mode 100755
index 2e6a8de3..00000000
--- a/Monitoring/nagios/plugins/check_btcguild_miner
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/python
-
-import sys
-from urllib2 import urlopen
-try:
- import json
- getattr(json,"load")
-except: #deal with it
- import simplejson as json
-
-if len(sys.argv) != 4 :
- print "** Usage: %s APIKEY WORKER_NAME LOW_WORKER_SPEED" % sys.argv[0]
- print "** aka YOU ARE MADE OF STUPID"
- exit (3)
-
-API_KEY=sys.argv[1]
-WORKER_NAME=sys.argv[2]
-LOW_WORKER_SPEED=float(sys.argv[3])
-url="http://www.btcguild.com/api.php?api_key=%s" % API_KEY
-try:
- fh = urlopen(url)
- result = json.load(fh)
-except Exception,e:
- print "?? cannot parse json or connect to server: %s"% str(e)
- exit (1)
-
-for k,v in result["workers"].iteritems():
- if v["worker_name"] == WORKER_NAME:
- curr = v["hash_rate"]
- if curr < LOW_WORKER_SPEED:
- print "!! %f is below expected %f" % (curr,LOW_WORKER_SPEED)
- exit (2)
- else:
- print "++ everything fine, current speed is %f" % curr
- exit(0)
-
diff --git a/Monitoring/nagios/plugins/check_by_ssh b/Monitoring/nagios/plugins/check_by_ssh
deleted file mode 100755
index 5f969058..00000000
--- a/Monitoring/nagios/plugins/check_by_ssh
+++ /dev/null
Binary files differ
diff --git a/Monitoring/nagios/plugins/check_clamd b/Monitoring/nagios/plugins/check_clamd
deleted file mode 120000
index e838da97..00000000
--- a/Monitoring/nagios/plugins/check_clamd
+++ /dev/null
@@ -1 +0,0 @@
-check_tcp \ No newline at end of file
diff --git a/Monitoring/nagios/plugins/check_cluster b/Monitoring/nagios/plugins/check_cluster
deleted file mode 100755
index 8d6dbb90..00000000
--- a/Monitoring/nagios/plugins/check_cluster
+++ /dev/null
Binary files differ
diff --git a/Monitoring/nagios/plugins/check_cpu b/Monitoring/nagios/plugins/check_cpu
deleted file mode 100755
index 26a93da5..00000000
--- a/Monitoring/nagios/plugins/check_cpu
+++ /dev/null
@@ -1,165 +0,0 @@
-#!/usr/bin/python
-
-import string, os, sys, re
-#from optik import OptionParser
-from optparse import OptionParser
-
-
-
-#######################################
-### Define a set of strings to handle
-### any info output requirements.
-
-
-check_cpu_version = "check_cpu (nagios-plugins 1.5.1!?) 0.4.0a\n"
-
-intro = "The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute\ncopies of the plugins under the terms of the GNU General Public License.\nFor more information about these matters, see the file named COPYING.\nCopyright (c) 2004 Ethan Galstad/Karl DeBisschop\n\n"
-
-preamble = "This plugin will check the percent of idle CPU usage on the system it is\nexecuted on and generate an alert if the percentage is below\none of the threshold values.\n\n"
-
-use = "Usage:\tcheck_cpu -w limit -c limit [-t timeout]\n\tcheck_cpu (-h|--help)\n\tcheck_cpu (-V|--version)\n"
-
-options = "\n -w, --warning=PERCENT\n\tExit with WARNING status if idle CPU percentage is less than PERCENT\n -c, --critical=PERCENT\n\tExit with CRITICAL status if idle CPU percentage is less than PERCENT\n -t, --timeout=INTEGER\n\tSeconds before check attempt times out (default: 10)\n -s, --sample=INTEGER\n\tSeconds to use as sample time. (default: 5)\n -h, --help\n\tPrint detailed help screen\n -V, --version\n\tPrint version information\n\n"
-
-bugs = "Bugs:\tTimeout does not do what has been documented here. Rather, it does \nnothing. The plugin seems to ignore characters that are not attached to \nparameter syntax. This has been tested on RedHat 8.0+, Fedora Core 1 & 2, \nOpenBSD 3.x and Debian. I would appreciate feedback and/or patches if it doesn't\nfunction under your chosen operating system.\n\n"
-
-query = "Send email to nagios-users@lists.sourceforge.net if you have questions\nregarding the use of this software. To submit patches or suggest improvements,\nsend email to nagiosplug-devel@lists.sourceforge.net.\n\nFor questions and suggestions pertaining to the check_cpu plugin,\nplease send email to nemir@hotmail.com.\n"
-
-fullHelp = check_cpu_version + intro + preamble + use + options + bugs + query
-
-
-
-
-
-def helpFunc(option, opt, value, parser):
- print fullHelp
- sys.exit(3)
-
-def verFunc(option, opt, value, parser):
- print check_cpu_version
- sys.exit(3)
-
-
-
-
-#######################################
-### Parse all the parameters. Define
-### variables for later use.
-
-
-
-parser = OptionParser(add_help_option=0)
-
-parser.add_option("-h", "--help", action="callback", callback=helpFunc)
-parser.add_option("-V", "--version", action="callback", callback=verFunc)
-parser.add_option("-w", "--warning", action="store", type="int", dest="warn", default=-1)
-parser.add_option("-c", "--critical", action="store", type="int", dest="crit", default=-2)
-parser.add_option("-s", "--sample", action="store", type="int", dest="sample", default=5)
-parser.add_option("-t", "--timeout", action="store", type="int", dest="timeout", default=10)
-
-(options, args) = parser.parse_args()
-
-critical = options.crit
-warning = options.warn
-sample = options.sample
-timeout = options.timeout
-
-
-if -3 > critical or 101 < critical:
- print "Critical value is a percentage and must be between 0 and 100.\n" + use
- sys.exit(3)
-
-if -2 > warning or 101 < warning:
- print "Warning value is a percentage and must be between 0 and 100.\n" + use
- sys.exit(3)
-
-if critical >= warning:
- print "Critical value must be less than the warning value.\n" + use
- sys.exit(3)
-
-if sample >= timeout -1:
- print "Sample time must be 2 seconds less than timeout.\n" + use
- sys.exit(3)
-
-strSample = str(sample)
-
-
-#######################################
-### Determine what OS we are being run
-### on, to figure syntax required.
-
-
-v = os.popen("uname", "r")
-l = v.read()
-
-if l == "Linux\n":
- vmcmd = "/usr/bin/vmstat " + strSample + " 2"
-elif l == "OpenBSD\n":
- vmcmd = "/usr/bin/vmstat -c 2 -w " + strSample
-elif l == "FreeBSD\n":
- vmcmd = "/usr/bin/vmstat -c 2 -w " + strSample
-elif l == "NetBSD\n":
- vmcmd = "/usr/bin/vmstat -c 2 -w " + strSample
-elif l == "SunOS\n":
- vmcmd = "/usr/bin/vmstat " + strSample + " 2"
-else:
- print "Unknown operating system, unable to continue.\n"
- sys.exit(3)
-
-
-#######################################
-### Grab the CPU sample and convert the
-### the relevent info to an int.
-
-
-vmstat = os.popen( vmcmd, "r" )
-statOut = vmstat.read()
-
-
-statLines = string.split( statOut, '\n')