[Nagiosplug-help] Inexplicable pattern match failure of check_http since update

Ralph.Grothe at itdz-berlin.de Ralph.Grothe at itdz-berlin.de
Wed Apr 1 18:52:05 CEST 2009


Hi Thomas,

sorry, for the late feedback, had quite a few of temporarily "lost" SAN
disks today which kept me busy.


reply by Thomas Guyot-Sionnest:>
> 
> Are you sure the proper environment is set from nagios? When 
> you run the
> plugin by hands try running it with "env -i".
> 
> Other things you may try:
> - - Try running the plugin with -v in nagios - it should 
> capture plugin
> execution details (if not, redirect to a file).
> - - Try adding "echo" in nagios before the plugin - it will print the
> exact command it's running (without the quotes though). If 
> nagios strips
> some characters you can redirect that to a file too.
> 

I tried to set the environment explicitly already (especially by
prepending LANG=de_DE.utf-8 LC_ALL=de_DE.utf-8 $USER1$/check_http ...),
but that didn't make any difference.

But the prepended echo (which I had forgotten about) really seemded
useful because it showed me that with the \s for whitespace in my
pattern match
the backslashes weren't preserved as such in the call by the nagios
scheduler (this was different with my nagios 2.9 setup as I remember):

[nagios at nagsaz:~]
$ grep aDISWeb\ Tomcat /var/log/nagios/nagios.log|tail -2 
[1238600757] EXTERNAL COMMAND: SCHEDULE_SVC_CHECK;uranus;aDISWeb
Tomcat;1238600864
[1238600867] SERVICE ALERT: uranus;aDISWeb
Tomcat;OK;HARD;5;/opt/nagios/plugins/libexec/check_http -H
123.123.123.123 -p 8081 -u /manager/sessions?path=/aDISWeb -a
bogususer:boguspasswd -l -r ^OK.*:s*[0-9]*sSitzungen


So I next prepended an additional backslash before the whitespace sigil
like \\s in this service's final check_command definition:

check_command
check-aDISWeb-sessions!8081!/manager/sessions?path=/aDISWeb!'^OK.*:\\s*[
0-9]*\\sSitzungen'


Now this seems to work.
This must have changed from version 2.9 where my former pattern worked.

First I thought I also would have to enable the regexp directives
or fumble with the illegal chars directives,
but I hadn't enabled nor had them differently set anyway


[nagios at nagsaz:~]
$ grep -E '^[^#]*(regexp|char)' /opt/nagios/etc/nagios.cfg
illegal_object_name_chars=`~!$%^&*|'"<>?,()=
illegal_macro_output_chars=`~$&|'"<>
use_regexp_matching=0
use_true_regexp_matching=0


> > It's no difference whether I reschedule the check via the 
> web interface or pipe it into the FIFO as done above.
> > 
> > So why does an externally enforced rescheduling of the 
> check then doesn't get executed?
> > Is this due to some clever scheduling algorithm that I have 
> missed here so far, or some neglected config setting?
> 
> It probably does, but unless you enable state stalking Nagios 
> only logs
> state changes.
> 

Is state stalking a new Nagios 3.X feature?
I can't find such a directive in my nagios.cfg

[nagios at nagsaz:~]
$ grep -ci stalk /opt/nagios/etc/nagios.cfg
0


This irritates me a little, that I can't see every externally
rescheduled check in the ascii log.
I would rather like to follow them in the ascii log in the filesystem
than in the web gui
because, even though I have daily log rotation, my browser gets hung if
I click to see the day's event log
because of the many entries (you can notice the scroll bar's click
button getting ever narrower)
So would state stalking care for everything gets logged in the ascii
log?



Regards

Ralph

 




More information about the Help mailing list