[SOLVED]testing negated plugin output
Posted: Tue Apr 05, 2016 8:40 am
Hi all.
I'm trying to test the output of a negated plugin.
How can I see the actual negated output from the wrapped plugin?
At the moment the plugin still shows the original output.
I'd like to test this from the command-line first, to make sure this works as expected before editing the nagios configuration.
/usr/lib/nagios/plugins # ./check_http -I 192.168.3.11 -S -p 4040
HTTP OK: HTTP/1.1 302 Moved Temporarily - 889 bytes in 0.045 second response time |time=0.045459s;;;0.000000 size=889B;;;0
/usr/lib/nagios/plugins #
/usr/lib/nagios/plugins # ./negate --ok=WARNING ./check_http -I 192.168.3.11 -S -p 4040
HTTP OK: HTTP/1.1 302 Moved Temporarily - 889 bytes in 0.041 second response time |time=0.041162s;;;0.000000 size=889B;;;0
Regards,
keith
Got it now
sysadmin:/usr/lib/nagios/plugins # ./check_http -I 192.168.3.11 -S -p 4042
HTTP CRITICAL: HTTP/1.1 500 Internal Server Error - 227 bytes in 0.040 second response time |time=0.039625s;;;0.000000 size=227B;;;0
sysadmin:/usr/lib/nagios/plugins #
sysadmin:/usr/lib/nagios/plugins # echo $?
2
sysadmin:/usr/lib/nagios/plugins #
sysadmin:/usr/lib/nagios/plugins # ./negate ./check_http -I 192.168.3.11 -S -p 4042
HTTP CRITICAL: HTTP/1.1 500 Internal Server Error - 227 bytes in 0.042 second response time |time=0.041964s;;;0.000000 size=227B;;;0
sysadmin:/usr/lib/nagios/plugins #
sysadmin:/usr/lib/nagios/plugins # echo $?
0
I'm trying to test the output of a negated plugin.
How can I see the actual negated output from the wrapped plugin?
At the moment the plugin still shows the original output.
I'd like to test this from the command-line first, to make sure this works as expected before editing the nagios configuration.
/usr/lib/nagios/plugins # ./check_http -I 192.168.3.11 -S -p 4040
HTTP OK: HTTP/1.1 302 Moved Temporarily - 889 bytes in 0.045 second response time |time=0.045459s;;;0.000000 size=889B;;;0
/usr/lib/nagios/plugins #
/usr/lib/nagios/plugins # ./negate --ok=WARNING ./check_http -I 192.168.3.11 -S -p 4040
HTTP OK: HTTP/1.1 302 Moved Temporarily - 889 bytes in 0.041 second response time |time=0.041162s;;;0.000000 size=889B;;;0
Regards,
keith
Got it now
sysadmin:/usr/lib/nagios/plugins # ./check_http -I 192.168.3.11 -S -p 4042
HTTP CRITICAL: HTTP/1.1 500 Internal Server Error - 227 bytes in 0.040 second response time |time=0.039625s;;;0.000000 size=227B;;;0
sysadmin:/usr/lib/nagios/plugins #
sysadmin:/usr/lib/nagios/plugins # echo $?
2
sysadmin:/usr/lib/nagios/plugins #
sysadmin:/usr/lib/nagios/plugins # ./negate ./check_http -I 192.168.3.11 -S -p 4042
HTTP CRITICAL: HTTP/1.1 500 Internal Server Error - 227 bytes in 0.042 second response time |time=0.041964s;;;0.000000 size=227B;;;0
sysadmin:/usr/lib/nagios/plugins #
sysadmin:/usr/lib/nagios/plugins # echo $?
0