Nagios Plugin Bugs?

These seem like bugs. I include the versions of the plugin from the “./plugin -V” output.

./check_http -H -t 20 --url=(actualURLhere) -I (ipAddressHere) -c 2 -w 1
HTTP WARNING: HTTP/1.1 200 OK - 5.572 second response time |time=5.572189s;1.000000;2.000000;0.000000 size=39471B;;;0

So did I not ask a 2-second response time to be critical? And yet, it’s a WARNING despite taking 5.5 seconds.

Version == check_http (nagios-plugins 1.4.2) 1.81

./check_tcp -t 20 -p 3306 -H (actualIPaddrHere) -e ‘A’ --mismatch=crit --refuse=crit --maxbytes=8 -w 1 -c 2
Connection refused

So I passed “–refuse=crit” yet it just returns “Connection refused,” no CRITICAL.

Version == check_TCP (nagios-plugins 1.4.2) 1.66

Am I missing something?

Oh. By the way… I know that the $? of 0/1/2 is what’s used, but I thought the spec called for also outputting "OK: ", "WARNING: " and "CRITICAL: "… :confused:

Yup, check_http looks like -c is treated as if it’s a -w. You can use the plugin without the -w and only specify a -c and it still outputs only a warning. The --help for the plugin does say that only warnings are displayed if the connect is succesfull, but with errors. But that negates the concept of -w and -c. I suppose you could spend some time and tweak the plugin to satisfy your needs if it’s that great.

check_tcp I see that --refuse=warn and --refuse=ok works correctly, but like you said, --refuse=crit doesn’t return the proper response. Another plugin that you would have to tweak and fix. Usually, they aren’t that hard to fix. I looked at it for awhile, but was unable to fix it.