Imported Upstream version 1.4.5

This commit is contained in:
Jan Wagner 2013-11-26 23:53:19 +01:00
parent 62d1e7d5fe
commit 6a280f6f24
412 changed files with 168642 additions and 0 deletions

6
contrib/aix/CVS/Entries Normal file
View file

@ -0,0 +1,6 @@
/check_failed/1.1.1.1/Thu Feb 28 06:42:55 2002//Tr1_4_5
/check_io/1.1.1.1/Thu Feb 28 06:42:55 2002//Tr1_4_5
/check_kerberos/1.1.1.1/Thu Feb 28 06:42:55 2002//Tr1_4_5
/check_queue/1.1.1.1/Thu Feb 28 06:42:55 2002//Tr1_4_5
/pg_stat/1.1.1.1/Thu Feb 28 06:42:55 2002//Tr1_4_5
D

View file

@ -0,0 +1 @@
nagiosplug/contrib/aix

1
contrib/aix/CVS/Root Normal file
View file

@ -0,0 +1 @@
:ext:tonvoon@nagiosplug.cvs.sourceforge.net:/cvsroot/nagiosplug

1
contrib/aix/CVS/Tag Normal file
View file

@ -0,0 +1 @@
Nr1_4_5

48
contrib/aix/check_failed Normal file
View file

@ -0,0 +1,48 @@
#!/usr/bin/perl
#======================
# Created May 25, 2000
#======================
# This scripts is for checking for failed root login attempts on
# any machine running AIX which has a failedlogin file in /etc/security
# The purpose is to thwart (good word) any unauthorised people from
# even trying to log in as root. This plugin has been developed for Nagios
# running on AIX.
# Lonny Selinger SpEnTBoY lonny@abyss.za.org
# May
my $server = $ARGV[0];
if (!$ARGV[0]) {
print "You must specify a server to check\n";
print "usage: ./check_failed <Server Name>\n";
exit (-1);
} else {
open (DATE, "/bin/date '+%b %d' |");
while (<DATE>) {
$dline = $_;
@dresults = $dline;
chop $dresults[0];
}
open (SULOG, "rsh $server -l root who /etc/security/failedlogin | grep root |");
while (<SULOG>) {
$line = $_;
@results = split (/\s+/,$line);
if ($line =~ /^root/) {
if (join(' ', @results[2,3]) eq $dresults[0]) {
print "FAILED root login on $dresults[0], node: $ARGV[0] from $results[5]\n";
exit(2);
}
}
}
}
if (join(' ', @results[2,3]) ne $dresults[0]) {
print "No Failed Root Logins on This Node\n";
exit(0);
}
exit(0);
close(SULOG);
close(DATE);

69
contrib/aix/check_io Normal file
View file

@ -0,0 +1,69 @@
#! /bin/sh
#=================================================================
#
# I/O Checker (KBPS)
# This Script uses iostat to monitor disk io
# Useful for notifications of disk thrashing.
#
# Authors: TheRocker
# SpEnTBoY
#
# Email: therocker@pawprints.2y.net
# lonny@abyss.za.org
#
#================================================================
NUMBER1=`rsh $1 -l root iostat -d | grep -e "hdisk" | tr -s ' ' | cut -d' ' -f2 | sort -2 -r | cut -c1 | line`
NUMBER2=`rsh $1 -l root iostat -d | grep -e "hdisk" | tr -s ' ' | cut -d' ' -f2 | sort -2 -r | cut -c2 | line`
TMPFILE=/tmp/iotest.hndl
TMPTOO=/tmp/iotwo.hndl
#===========================================================
#
# We do an evaluation on $NUMBER1 and $NUMBER2 to see if
# disk io is exceeding 40%.
#
#===========================================================
if [ "$NUMBER1" -gt 4 ] && [ "$NUMBER2" -gt 0 ]
then
`rsh $1 -l root iostat -d | grep -v cd0 | tr -s ' '| cut -d' ' -f1,2 | grep -e "4[0-9]." >> $TMPFILE`
#====================================================================
#
# Of course, there may be more than one hard disk on the node
# so we use this bit of code to report on more than one instance
# of excessive disk IO.
#
#====================================================================
LINES=`wc -l /tmp/iotest.hndl | cut -c8`
LINESCTL=`wc -l /tmp/iotest.hndl | cut -c8 `
echo "WARNING!!! Disk I/O Exceeding 40% on --> \c"
while [ $LINESCTL != 0 ]
do
cat $TMPFILE | tail -$LINESCTL > $TMPTOO
cat $TMPTOO > $TMPFILE
LINESCTL=$(( $LINESCTL -1 ))
LINES=$(( $LINES -1 ))
DATA=`head -1 /tmp/iotest.hndl`
echo "( $DATA ) "
done
echo "\n"
rm -f $TMPFILE
rm -f $TMPTOO
exit 1
else
print "No Disk I/O Exceeding 40%...OK"
exit 0
fi

View file

@ -0,0 +1,49 @@
#! /bin/sh
#=========================================================================
# Kerberos Ticket Checker
#
# This script is handy if you allow kerberos tickets to expire
# on your nodes. The script will simply warn you when a node has
# kerberos tickets expiring on the current date. This will allow to
# re-initialize the tickets if you wish to do so.
#
# Nothing fancy here, all Nagios will show is the number of tickets
# that are going to (or already have) expired.
#
# An item of note:
#
# We made no provisions for the weekend. If tickets expire on the
# weekend and nobody is around, you won't see a warning on the
# Nagios console because we look for expired on the current day
# only. It's a good idea to have this warning emailed to the
# appropriate admin and if there is something critical that relies
# on Kerberos, you might want to send a page.
#
# Authors: TheRocker
# SpEnTBoY
#
# Email: therocker@pawprints.2y.net
# lonny@abyss.za.org
#=========================================================================
TMPFILE=/tmp/kerbtmp.hndl
DATE=`date +%b' '%d`
rsh $1 -l root /usr/lpp/ssp/kerberos/bin/klist | tr -s ' ' | cut -d' ' -f4,5,6 | grep -e "$DATE" > $TMPFILE
if [ -s $TMPFILE ]
then
LINES=`wc -l /tmp/kerbtmp.hndl | cut -c7-8`
echo "Kerberos Tickets set to expire --> \c"
echo "$LINES \c"
echo "\n"
rm -f $TMPFILE
exit 1
fi
echo "Kerberos Tickets are valid"
exit 0

67
contrib/aix/check_queue Normal file
View file

@ -0,0 +1,67 @@
#! /bin/sh
#===============================================================
# Print Queue Checker
#
# The print queue checker simply looks for an occurance of a
# DOWN queue. A note of warning, if you use remote queues in
# AIX to redirect print jobs from the AIX queue to an NT print
# server that print through DLC rather than IP, it will be very
# s - l - o - w. But it will work.
#
# Author: TheRocker
# Email: therocker@pawprints.2y.net
#===============================================================
TMPFILE=/tmp/qtmp.hndl
TMPTOO=/tmp/qtwo.hndl
#=======================================================================
#
# This script will also work on AIX 4.2.1 BUT you have to change
# the following line. AIX 4.2.1 does not support the -W option
# with lpstat. For AIX 4.2.1 just remove the -W option and it should
# work just fine.
#
#=======================================================================
`rsh $1 -l root lpstat -W | grep -e "DOWN" | tr -s ' ' | cut -d' ' -f1,3 > /tmp/qtmp.hndl 2> /tmp/q_err`
if [ -s $TMPFILE ]
then
#=======================================================
#
# If you've seen the other AIX scripts I wrote you may
# notice that I use this bit of code a lot. Well it
# works and appears to be all purpose.
#
#=======================================================
LINES=`wc -l /tmp/qtmp.hndl | cut -c8`
LINESCTL=`wc -l /tmp/qtmp.hndl | cut -c8`
echo "Print Queue DOWN --> \c"
while [ $LINESCTL != 0 ]
do
cat $TMPFILE | tail -$LINESCTL > $TMPTOO
cat $TMPTOO > $TMPFILE
LINESCTL=$(( $LINESCTL -1 ))
LINES=$(( $LINES -1 ))
DATA=`head -1 /tmp/qtmp.hndl`
echo "( $DATA ) \c"
done
echo "\n"
rm -f $TMPFILE
rm -f $TMPTOO
exit 2
fi
echo "Print Queues Running... OK"
exit 0

45
contrib/aix/pg_stat Normal file
View file

@ -0,0 +1,45 @@
#!/bin/ksh
#==============================================================================
# Script was originally created to collect stats and dump then to a log file
# every five minutes. But we like this better (the log file thing is still
# good if you want to track availability).
#
# Authors: SpEnTBoY
# TheRocker
#
# Email: lonny@abyss.za.org
# therocker@pawprints.2y.net
#==============================================================================
#=========================================================================================
#
# The best way to do this is to use Kerberos but we use rsh here because our monitoring
# workstation doesn't have Kerberos installed. In order for this to work, the remote
# host ($1) must have a .rhosts file that contains a line like:
#
# monitorhost nagiosuser
#
#=========================================================================================
PAGING2=`rsh $1 -l root lsps -a -s | grep -v Paging | tr -s ' '| cut -d' ' -f3 | cut -d'%' -f1`
if [ "$PAGING2" -gt "35" ] && [ "$PAGING2" -lt "50" ]
then
echo "Paging Space is over 35% ("$PAGING2")%"
exit 1
fi
if [ "$PAGING2" -gt "49" ]
then
echo "WARNING! Paging Space is over 50% ("$PAGING2")%"
exit 2
fi
if [ "$PAGING2" -lt "34" ]
then
echo "Paging Space is less than 34% ("$PAGING2")%"
exit 0
fi