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_PROGRAMS = check_saslauthd
7 +nagiosdir = @libdir@/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/testsaslauthd.c 2004-01-21 21:54:53.000000000 +0200
23 +++ cyrus-sasl-2.1.22-nagios/saslauthd/testsaslauthd.c 2009-01-30 18:36:26.070737112 +0200
30 +#define STATE_WARNING 1
31 +#define STATE_CRITICAL 2
32 +#define STATE_UNKNOWN 3
41 printf("NO \"authentication failed\"\n");
51 " [-r realm] [-s servicename]\n"
52 " [-f socket path] [-R repeatnum]\n",
55 + exit(STATE_UNKNOWN);
61 if (!repeat) repeat = 1;
64 result = saslauthd_verify_password(path, user, password, service, realm);
69 + return STATE_CRITICAL;
74 + case 1: // auth fail
75 + return STATE_WARNING;
78 + return STATE_UNKNOWN;