summaryrefslogtreecommitdiffstats
path: root/contrib/aix/check_failed
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2013-09-02 13:16:24 +0200
committerHolger Weiss <holger@zedat.fu-berlin.de>2013-09-02 13:16:24 +0200
commitb15adb7762b6caaecaa83637abfcf5fdb4802092 (patch)
tree64eddbe2aa1a7f98a140be0f7973f05d7a781ae0 /contrib/aix/check_failed
parentc4d5882b9e1d07c7b61091062b7d085fa5f00284 (diff)
downloadmonitoring-plugins-b15adb7762b6caaecaa83637abfcf5fdb4802092.tar.gz
Remove "contrib" plugins
These days, sites such as "Nagios Exchange" are a much better place for publishing plugins not maintained by the Plugins Development Team.
Diffstat (limited to 'contrib/aix/check_failed')
-rw-r--r--contrib/aix/check_failed48
1 files changed, 0 insertions, 48 deletions
diff --git a/contrib/aix/check_failed b/contrib/aix/check_failed
deleted file mode 100644
index 50cdf7e1..00000000
--- 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