summaryrefslogtreecommitdiffstats
path: root/contrib/aix/check_kerberos
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/aix/check_kerberos')
-rw-r--r--contrib/aix/check_kerberos49
1 files changed, 49 insertions, 0 deletions
diff --git a/contrib/aix/check_kerberos b/contrib/aix/check_kerberos
new file mode 100644
index 00000000..443ab109
--- /dev/null
+++ b/contrib/aix/check_kerberos
@@ -0,0 +1,49 @@
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