On 30/01/07 04:00 AM, Jan Wagner wrote:
> Hi Thomas,
>
>>> I also see one more possible problem. Should it be CRITICAL instead of
>>> WARNING when the output doesn't match? And do you have an external
>>> jabber host to check against so I can make sure the send/expect rules
>>> are right?
>> The attached patch (Also in CVS) will fix the reporting problem. If
>> there's any problem with the jabber check itself (i.e. warning status)
>> I'll need a server to test with. I guess that a bad server response
>> should mean a CRITICAL failure rather than a WARNING, right?
>
> Try jabber.org as host to check your fixes, this one should be public
> available.
I tried it but I had to remove the SSL flag in the check_jabber-specific
code. It is always possible to check with ssl with the --ssl
command-line option so I guess I should consider removing that flag.
Otherwise you don't have the option and must check with SSL.
I also left the return code on mismatches to WARNING as it is the
default for every other invocations of check_tcp that set expect
strings. This can be changed as well, using the --mismatch (-M) switch.
The patch I'm committing is attached.
Thomas
Index: plugins/check_tcp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_tcp.c,v
retrieving revision 1.84
diff -u -r1.84 check_tcp.c
--- plugins/check_tcp.c 30 Jan 2007 14:24:10 -0000 1.84
+++ plugins/check_tcp.c 31 Jan 2007 04:45:13 -0000
@@ -166,9 +166,9 @@
}
else if (!strncmp(SERVICE, "JABBER", 6)) {
SEND = "<stream:stream to=\'host\' xmlns=\'jabber:client\' xmlns:stream=\'http://etherx.jabber.org/streams\'>\n";
- EXPECT = "<?xml version=\'1.0\'?><stream:stream xmlns:stream=\'http://etherx.jabber.org/streams\'";
+ EXPECT = "<?xml version=\'1.0\'?><stream:stream xmlns=\'jabber:client\' xmlns:stream=\'http://etherx.jabber.org/streams\'";
QUIT = "</stream:stream>\n";
- flags |= FLAG_SSL | FLAG_HIDE_OUTPUT;
+ flags |= FLAG_HIDE_OUTPUT;
PORT = 5222;
}
else if (!strncmp (SERVICE, "NNTPS", 5)) {