From 5b37f0dd4a60cc987ebc38fd7433fb987c6b1771 Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Wed, 17 Sep 2003 19:05:49 +0000 Subject: Plugins obsolete from main check_disk and check_ping git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@738 f882894a-f735-0410-b71e-b25c423dba1c diff --git a/contrib/aix/check_crit_dsk b/contrib/aix/check_crit_dsk deleted file mode 100644 index 566e07c..0000000 --- a/contrib/aix/check_crit_dsk +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -#========================================================================= -# Critical Disk Checker utility -# -# This is the same as the disk checker utility but we use it as -# a seperate service in Nagios to report on partitions that -# have reached 100% capacity. -# -# We have excluded /dev/cd0 because the cdrom drive will always -# report 100% capacity if a CD is in the drive. -# -# Authors: TheRocker -# SpEnTBoY -# -# Email: therocker@pawprints.2y.net -# lonny@abyss.za.org -# -#======================================================================= - -NUMBER=`rsh $1 -l root df -kP | grep -vE ":|/dev/cd0" | grep -E "100%" | tr -s ' '| cut -d' ' -f5 | cut -c1-3 | line` -TMPFILE=/tmp/tmpcrit.hndl -TMPTOO=/tmp/twocrit.hndl - -if [ "$NUMBER" -eq 100 ] -then - - `rsh $1 -l root df -kP |grep -vE ":|/dev/cd0" | grep -E "100%" | tr -s ' '| cut -d' ' -f6,5 >> $TMPFILE` - - LINES=`wc -l /tmp/tmpcrit.hndl | cut -c8` - LINESCTL=`wc -l /tmp/tmpcrit.hndl | cut -c8 ` - echo "Filesystems over 99% --> \c" - -#=============================================================== -# Just a little bit to check for multiple occurances of the -# condition. -#=============================================================== - - while [ $LINESCTL != 0 ] - do - - cat $TMPFILE | tail -$LINESCTL > $TMPTOO - cat $TMPTOO > $TMPFILE - LINESCTL=$(( $LINESCTL -1 )) - LINES=$(( $LINES -1 )) - DATA=`head -1 /tmp/tmpcrit.hndl` - echo "( $DATA ) \c" - - - done - echo "\n" - -#=============================================================== -# File clean up. Always pick up after yourself. Disk space -# doesn't grow on trees you know. -#=============================================================== - - rm -f $TMPFILE - rm -f $TMPTOO - exit 2 - -else - - echo "No Filesystems over 99%... OK" - exit 0 -fi diff --git a/contrib/aix/check_dsk b/contrib/aix/check_dsk deleted file mode 100644 index c8ddb3f..0000000 --- a/contrib/aix/check_dsk +++ /dev/null @@ -1,62 +0,0 @@ -#! /bin/sh - -#====================================================================== -# Disk Checker utility -# -# Simple little script that checks the status of all partitions -# on a node's hard disks. It will produce a warning alert and list -# the offending filesystems in nagios. -# -# Authors: SpEnTBoY -# TheRocker -# -# Email: lonny@abyss.za.org -# therocker@pawprints.2y.net -#===================================================================== - -NUMBER=`rsh $1 -l root df -kP | grep -v ":" | grep -E "9[0-9]%" | tr -s ' '| cut -d' ' -f5 | cut -c1-2 | line` -TMPFILE=/tmp/tmp.hndl -TMPTOO=/tmp/two.hndl - -if [ "$NUMBER" -gt 90 ] -then - - `rsh $1 -l root df -kP |grep -v ":" | grep -E "9[0-9]%" | tr -s ' '| cut -d' ' -f6,5 >> $TMPFILE` - - LINES=`wc -l /tmp/tmp.hndl | cut -c8` - LINESCTL=`wc -l /tmp/tmp.hndl | cut -c8 ` - echo "Filesystems over 90% --> \c" - -#====================================================================== -# You'll see this one in a few our shell scripts. Just chcecking for -# multiple occurances of the warnign condition. We gotta list 'em all -#====================================================================== - - while [ $LINESCTL != 0 ] - do - - cat $TMPFILE | tail -$LINESCTL > $TMPTOO - cat $TMPTOO > $TMPFILE - LINESCTL=$(( $LINESCTL -1 )) - LINES=$(( $LINES -1 )) - DATA=`head -1 /tmp/tmp.hndl` - echo "( $DATA ) \c" - - - done - echo "\n" - -#=============================================================== -# Clean up all those nasty tmp files that suck up valuable -# disk realestate. -#=============================================================== - - rm -f $TMPFILE - rm -f $TMPTOO - exit 1 - -else - - echo "No Filesystems over 90%... OK" - exit 0 -fi diff --git a/contrib/aix/check_ping b/contrib/aix/check_ping deleted file mode 100644 index aaa8c84..0000000 --- a/contrib/aix/check_ping +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/perl -w - -#================================================================ -# -# This perl script will accept an argument and simply pass it -# to ping. It works by sending 2 ping to the specified host -# and evaluating on the average delta time of those 2 pings. -# -# Author: SpEnTBoY -# Email: lonny@abyss.za.org -# April 5,2000 -# -#================================================================ - -#============================ -# State predefined stuff and -# requirements -#============================ - -require 5.004; -use POSIX; -use strict; - -sub usage; - -my $ipaddr = $ARGV[0]; - -my $TIMEOUT = 15; - -my %ERRORS = ('UNKNOWN' , '-1', - 'OK' , '0', - 'WARNING', '1', - 'CRITICAL', '2'); - -my $remote = shift || &usage(%ERRORS); -my $warning = shift || 750; -my $critical = shift || 1000; - -my $state = "OK"; -my $answer = undef; -my $offset = undef; -my $line = undef; - -#============================================================ -# If theres no response we can exit the bloody thing cleanly -# last thing I want to do is hang an AIX system ;-) -#============================================================ - -$SIG{'ALRM'} = sub { - print ("ERROR: No response from PING! (alarm)\n"); - exit $ERRORS{"UNKNOWN"}; -}; -alarm($TIMEOUT); - -#================================================ -# Pass stddn from $ARGV to the command and parse -# the info we need (namely the value for "max" -#================================================ - - - -open(PING,"/usr/sbin/ping -c 2 '$ipaddr' >&1|"); -while () { - $line = $_; - if (/round-trip min\/avg\/max = (.+)\/(.+)\/(.+) ms/) { - $offset = $3; - last; - } -} - -#================================================== -# Do some error checking on the output of the file -# and implement values for and -# deffinitions if they were specified by the user -# or sub in the predefined ones -#================================================== - -if (defined $offset) { - if (abs($offset) > $warning) { - if (abs($offset) > $critical) { - $state = "CRITICAL"; - $answer = ": Ping Time $offset MS greater than +/- $critical MS\n"; - } else { - $state = "WARNING"; - $answer = ": Ping Time $offset MS greater than +/- $warning MS\n"; - } - } else { - $state = "OK"; - $answer = ": Ping Time $offset MS\n"; - } -} else { - $state = "UNKNOWN"; - $answer = ": $line\n"; -} -print ("$state$answer"); -exit $ERRORS{$state}; - -sub usage { - print "\n"; - print "#=========================================\n"; - print "Check_Ping 0.02 script by Lonny Selinger\n"; - print "Made with AIX in mind ;-)\n"; - print "#=========================================\n"; - print "\n"; - print "#================================================\n"; - print " I'm going to need a few more arguments from you\n"; - print "#================================================\n"; - print "\n"; - print "#================================================\n"; - print "Usage: check_ping [ []\n"; - print "#================================================\n"; - print "\n"; - print " = Ping in MS at which a warning message will be generated.\n Defaults to 750.\n"; - print " = Ping in MS at which a critical message will be generated.\n Defaults to 1000.\n\n"; - exit $ERRORS{"UNKNOWN"}; -} - -- cgit v0.10-9-g596f