Unixbhaskar's Blog

Thursday, March 10, 2011

Nagios saga

In this post I will tell how I was frustrated by the fact of my own ignorance.I was configuaring nagios host for service check and stumbled with an error spitting out the message like below:

Name or service not known HTTP CRITICAL
- Unable to open TCP socket

I have had looked into nagios FAQ and google all over the place,but to my surprise I haven't had found any solution to this problem and of course the cause of it.Really surprised!!! Now as the great man said once "Given enough eyeball software bug can be detected", it was none other ,but Eric.S. Raymods. Anyway I was taking it easily by knowing that I was doing it correct,Yes I was regarding that configuration. But may be little bit ignorance with conf syntax.Because When I tried to look for a string in specific site I forgot to enquote it ....oooops what a shame. Any how once I checked the command line version of that perticular check and it shows the correct result. Now the command line from nagios one of conf file called command.cfg, which hold a line for checking like below:


check_http -H yourwebsite -p portnumber -u the uri -s "the string" -t time


instead I was doing like below:

check_http -H yourwebsite -p portnumber -u the uri -s the string -t time

If it is a single word , then you can use that word without quote;but having space in between it will not work and throw the above error. It was a basic mistake,a string should always be quoted if that string consists with words separetad by space.

Hope this will help.


No comments:

Post a Comment