summaryrefslogtreecommitdiffstats
path: root/contrib/aix
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/aix')
-rw-r--r--contrib/aix/check_failed48
-rw-r--r--contrib/aix/check_io69
-rw-r--r--contrib/aix/check_kerberos49
-rw-r--r--contrib/aix/check_queue67
-rw-r--r--contrib/aix/pg_stat45
5 files changed, 0 insertions, 278 deletions
diff --git a/contrib/aix/check_failed b/contrib/aix/check_failed
deleted file mode 100644
index 50cdf7e..0000000
--- a/contrib/aix/check_failed
+++ /dev/null
@@ -1,48 +0,0 @@
1#!/usr/bin/perl
2#======================
3# Created May 25, 2000
4#======================
5
6# This scripts is for checking for failed root login attempts on
7# any machine running AIX which has a failedlogin file in /etc/security
8# The purpose is to thwart (good word) any unauthorised people from
9# even trying to log in as root. This plugin has been developed for Nagios
10# running on AIX.
11# Lonny Selinger SpEnTBoY lonny@abyss.za.org
12# May
13
14
15my $server = $ARGV[0];
16
17if (!$ARGV[0]) {
18 print "You must specify a server to check\n";
19 print "usage: ./check_failed <Server Name>\n";
20 exit (-1);
21 } else {
22 open (DATE, "/bin/date '+%b %d' |");
23 while (<DATE>) {
24 $dline = $_;
25 @dresults = $dline;
26 chop $dresults[0];
27 }
28 open (SULOG, "rsh $server -l root who /etc/security/failedlogin | grep root |");
29 while (<SULOG>) {
30 $line = $_;
31 @results = split (/\s+/,$line);
32 if ($line =~ /^root/) {
33 if (join(' ', @results[2,3]) eq $dresults[0]) {
34 print "FAILED root login on $dresults[0], node: $ARGV[0] from $results[5]\n";
35 exit(2);
36 }
37 }
38 }
39}
40if (join(' ', @results[2,3]) ne $dresults[0]) {
41 print "No Failed Root Logins on This Node\n";
42 exit(0);
43}
44exit(0);
45close(SULOG);
46close(DATE);
47
48
diff --git a/contrib/aix/check_io b/contrib/aix/check_io
deleted file mode 100644
index 58b25f6..0000000
--- a/contrib/aix/check_io
+++ /dev/null
@@ -1,69 +0,0 @@
1#! /bin/sh
2
3#=================================================================
4#
5# I/O Checker (KBPS)
6# This Script uses iostat to monitor disk io
7# Useful for notifications of disk thrashing.
8#
9# Authors: TheRocker
10# SpEnTBoY
11#
12# Email: therocker@pawprints.2y.net
13# lonny@abyss.za.org
14#
15#================================================================
16
17NUMBER1=`rsh $1 -l root iostat -d | grep -e "hdisk" | tr -s ' ' | cut -d' ' -f2 | sort -2 -r | cut -c1 | line`
18NUMBER2=`rsh $1 -l root iostat -d | grep -e "hdisk" | tr -s ' ' | cut -d' ' -f2 | sort -2 -r | cut -c2 | line`
19TMPFILE=/tmp/iotest.hndl
20TMPTOO=/tmp/iotwo.hndl
21
22#===========================================================
23#
24# We do an evaluation on $NUMBER1 and $NUMBER2 to see if
25# disk io is exceeding 40%.
26#
27#===========================================================
28
29if [ "$NUMBER1" -gt 4 ] && [ "$NUMBER2" -gt 0 ]
30then
31
32 `rsh $1 -l root iostat -d | grep -v cd0 | tr -s ' '| cut -d' ' -f1,2 | grep -e "4[0-9]." >> $TMPFILE`
33
34#====================================================================
35#
36# Of course, there may be more than one hard disk on the node
37# so we use this bit of code to report on more than one instance
38# of excessive disk IO.
39#
40#====================================================================
41
42 LINES=`wc -l /tmp/iotest.hndl | cut -c8`
43 LINESCTL=`wc -l /tmp/iotest.hndl | cut -c8 `
44 echo "WARNING!!! Disk I/O Exceeding 40% on --> \c"
45
46 while [ $LINESCTL != 0 ]
47 do
48
49 cat $TMPFILE | tail -$LINESCTL > $TMPTOO
50 cat $TMPTOO > $TMPFILE
51 LINESCTL=$(( $LINESCTL -1 ))
52 LINES=$(( $LINES -1 ))
53 DATA=`head -1 /tmp/iotest.hndl`
54 echo "( $DATA ) "
55
56
57 done
58 echo "\n"
59
60 rm -f $TMPFILE
61 rm -f $TMPTOO
62 exit 1
63
64else
65
66 print "No Disk I/O Exceeding 40%...OK"
67 exit 0
68
69fi
diff --git a/contrib/aix/check_kerberos b/contrib/aix/check_kerberos
deleted file mode 100644
index 443ab10..0000000
--- a/contrib/aix/check_kerberos
+++ /dev/null
@@ -1,49 +0,0 @@
1#! /bin/sh
2
3#=========================================================================
4# Kerberos Ticket Checker
5#
6# This script is handy if you allow kerberos tickets to expire
7# on your nodes. The script will simply warn you when a node has
8# kerberos tickets expiring on the current date. This will allow to
9# re-initialize the tickets if you wish to do so.
10#
11# Nothing fancy here, all Nagios will show is the number of tickets
12# that are going to (or already have) expired.
13#
14# An item of note:
15#
16# We made no provisions for the weekend. If tickets expire on the
17# weekend and nobody is around, you won't see a warning on the
18# Nagios console because we look for expired on the current day
19# only. It's a good idea to have this warning emailed to the
20# appropriate admin and if there is something critical that relies
21# on Kerberos, you might want to send a page.
22#
23# Authors: TheRocker
24# SpEnTBoY
25#
26# Email: therocker@pawprints.2y.net
27# lonny@abyss.za.org
28#=========================================================================
29
30TMPFILE=/tmp/kerbtmp.hndl
31DATE=`date +%b' '%d`
32
33rsh $1 -l root /usr/lpp/ssp/kerberos/bin/klist | tr -s ' ' | cut -d' ' -f4,5,6 | grep -e "$DATE" > $TMPFILE
34
35
36if [ -s $TMPFILE ]
37then
38
39 LINES=`wc -l /tmp/kerbtmp.hndl | cut -c7-8`
40 echo "Kerberos Tickets set to expire --> \c"
41 echo "$LINES \c"
42 echo "\n"
43
44 rm -f $TMPFILE
45 exit 1
46
47fi
48 echo "Kerberos Tickets are valid"
49 exit 0
diff --git a/contrib/aix/check_queue b/contrib/aix/check_queue
deleted file mode 100644
index 9f709c5..0000000
--- a/contrib/aix/check_queue
+++ /dev/null
@@ -1,67 +0,0 @@
1#! /bin/sh
2
3#===============================================================
4# Print Queue Checker
5#
6# The print queue checker simply looks for an occurance of a
7# DOWN queue. A note of warning, if you use remote queues in
8# AIX to redirect print jobs from the AIX queue to an NT print
9# server that print through DLC rather than IP, it will be very
10# s - l - o - w. But it will work.
11#
12# Author: TheRocker
13# Email: therocker@pawprints.2y.net
14#===============================================================
15
16TMPFILE=/tmp/qtmp.hndl
17TMPTOO=/tmp/qtwo.hndl
18
19#=======================================================================
20#
21# This script will also work on AIX 4.2.1 BUT you have to change
22# the following line. AIX 4.2.1 does not support the -W option
23# with lpstat. For AIX 4.2.1 just remove the -W option and it should
24# work just fine.
25#
26#=======================================================================
27
28`rsh $1 -l root lpstat -W | grep -e "DOWN" | tr -s ' ' | cut -d' ' -f1,3 > /tmp/qtmp.hndl 2> /tmp/q_err`
29
30if [ -s $TMPFILE ]
31then
32
33#=======================================================
34#
35# If you've seen the other AIX scripts I wrote you may
36# notice that I use this bit of code a lot. Well it
37# works and appears to be all purpose.
38#
39#=======================================================
40
41 LINES=`wc -l /tmp/qtmp.hndl | cut -c8`
42 LINESCTL=`wc -l /tmp/qtmp.hndl | cut -c8`
43
44 echo "Print Queue DOWN --> \c"
45
46 while [ $LINESCTL != 0 ]
47 do
48
49 cat $TMPFILE | tail -$LINESCTL > $TMPTOO
50 cat $TMPTOO > $TMPFILE
51 LINESCTL=$(( $LINESCTL -1 ))
52 LINES=$(( $LINES -1 ))
53 DATA=`head -1 /tmp/qtmp.hndl`
54 echo "( $DATA ) \c"
55
56
57 done
58
59 echo "\n"
60
61 rm -f $TMPFILE
62 rm -f $TMPTOO
63 exit 2
64
65fi
66 echo "Print Queues Running... OK"
67 exit 0
diff --git a/contrib/aix/pg_stat b/contrib/aix/pg_stat
deleted file mode 100644
index e0603ec..0000000
--- a/contrib/aix/pg_stat
+++ /dev/null
@@ -1,45 +0,0 @@
1#!/bin/ksh
2
3#==============================================================================
4# Script was originally created to collect stats and dump then to a log file
5# every five minutes. But we like this better (the log file thing is still
6# good if you want to track availability).
7#
8# Authors: SpEnTBoY
9# TheRocker
10#
11# Email: lonny@abyss.za.org
12# therocker@pawprints.2y.net
13#==============================================================================
14
15#=========================================================================================
16#
17# The best way to do this is to use Kerberos but we use rsh here because our monitoring
18# workstation doesn't have Kerberos installed. In order for this to work, the remote
19# host ($1) must have a .rhosts file that contains a line like:
20#
21# monitorhost nagiosuser
22#
23#=========================================================================================
24
25PAGING2=`rsh $1 -l root lsps -a -s | grep -v Paging | tr -s ' '| cut -d' ' -f3 | cut -d'%' -f1`
26
27
28if [ "$PAGING2" -gt "35" ] && [ "$PAGING2" -lt "50" ]
29then
30 echo "Paging Space is over 35% ("$PAGING2")%"
31exit 1
32fi
33
34if [ "$PAGING2" -gt "49" ]
35then
36 echo "WARNING! Paging Space is over 50% ("$PAGING2")%"
37exit 2
38fi
39
40if [ "$PAGING2" -lt "34" ]
41then
42 echo "Paging Space is less than 34% ("$PAGING2")%"
43exit 0
44fi
45