1 --- cyrus-sasl-2.1.22-nagios/saslauthd/Makefile.am 2009-01-30 18:09:01.984198032 +0200
2 +++ cyrus-sasl-2.1.22/saslauthd/Makefile.am 2009-01-30 18:43:20.796560455 +0200
5 sbin_PROGRAMS = saslauthd testsaslauthd
6 +nagios_PROGRAM = check_saslauthd
7 +nagiosdir = @libexecdir@/nagios/plugins
8 EXTRA_PROGRAMS = saslcache
10 saslauthd_SOURCES = mechanisms.c globals.h \
12 testsaslauthd_SOURCES = testsaslauthd.c utils.c
13 testsaslauthd_LDADD = @LIB_SOCKET@
15 +check_saslauthd_SOURCES = testsaslauthd.c utils.c
16 +check_saslauthd_LDADD = @LIB_SOCKET@
17 +check_saslauthd_CFLAGS = -DNAGIOS_PLUGIN
19 saslcache_SOURCES = saslcache.c
21 EXTRA_DIST = saslauthd.8 saslauthd.mdoc config include \
22 --- cyrus-sasl-2.1.22/saslauthd/saslauthd.h.in 2006-05-18 22:38:27.000000000 +0300
23 +++ cyrus-sasl-2.1.22-nagios/saslauthd/saslauthd.h.in 2009-01-30 13:47:59.582432052 +0200
25 /* define if your compiler has __attribute__ */
26 #undef HAVE___ATTRIBUTE__
35 /* Use NDBM for SASLdb */
38 -/* The size of a `long', as computed by sizeof. */
39 +/* The size of `long', as computed by sizeof. */
42 /* User KERBEROS_V4 Staticly */
43 --- cyrus-sasl-2.1.22/saslauthd/testsaslauthd.c 2004-01-21 21:54:53.000000000 +0200
44 +++ cyrus-sasl-2.1.22-nagios/saslauthd/testsaslauthd.c 2009-01-30 18:36:26.070737112 +0200
51 +#define STATE_WARNING 1
52 +#define STATE_CRITICAL 2
53 +#define STATE_UNKNOWN 3
62 printf("NO \"authentication failed\"\n");
72 " [-r realm] [-s servicename]\n"
73 " [-f socket path] [-R repeatnum]\n",
76 + exit(STATE_UNKNOWN);
82 if (!repeat) repeat = 1;
85 result = saslauthd_verify_password(path, user, password, service, realm);
90 + return STATE_CRITICAL;
95 + case 1: // auth fail
96 + return STATE_WARNING;
99 + return STATE_UNKNOWN;