Page 1 of 1

Check_HTTP Query

Posted: Wed Sep 09, 2015 7:16 am
by neworderfac33
Good afternoon,

First off, it looks like we're going to get the go-ahead with our Nagios implementation, so a big thank you to everyone out there who has helped to make this happen.

Now, to my question. I can check to see if the Tomcat7.exe APPLICATION is running. I can also check to see if the Tomcat7 SERVICE is running.

However, when I try to run the Check_HTTP plugin via:

Code: Select all

define service{
        use                     generic-service
        hostgroup_name          jenkins-test-masters,jenkins-slaves
        service_description     HTTP Server
        check_command           check_http
        }
The first server shows the Tomcat Service stopped and Tomcat7.exe not running and returns "connection refused" (which I would expect).
The second server shows the Tomcat Service started and Tomcat7.exe running and, but returns "HTTP WARNING: HTTP/1.1 403 Forbidden - 1491 bytes in 0.002 second response time ".

I have raised a similar query previously on this forum, so apologies for the repetition, but I still can't get my head around why when Tomcat is running on the second machine, I get the error message. Do I need to try another port, for example?

And, if I can determine if Tomcat is running or not, do I really need to run check_http at all?

Thanks in advance for your assistance.

Pete

Re: Check_HTTP Query

Posted: Wed Sep 09, 2015 9:20 am
by hsmith
peterooney wrote:Good afternoon,

First off, it looks like we're going to get the go-ahead with our Nagios implementation, so a big thank you to everyone out there who has helped to make this happen.

Now, to my question. I can check to see if the Tomcat7.exe APPLICATION is running. I can also check to see if the Tomcat7 SERVICE is running.

However, when I try to run the Check_HTTP plugin via:

Code: Select all

define service{
        use                     generic-service
        hostgroup_name          jenkins-test-masters,jenkins-slaves
        service_description     HTTP Server
        check_command           check_http
        }
The first server shows the Tomcat Service stopped and Tomcat7.exe not running and returns "connection refused" (which I would expect).
The second server shows the Tomcat Service started and Tomcat7.exe running and, but returns "HTTP WARNING: HTTP/1.1 403 Forbidden - 1491 bytes in 0.002 second response time ".

I have raised a similar query previously on this forum, so apologies for the repetition, but I still can't get my head around why when Tomcat is running on the second machine, I get the error message. Do I need to try another port, for example?

And, if I can determine if Tomcat is running or not, do I really need to run check_http at all?

Thanks in advance for your assistance.

Pete
Hi Pete,

I can't say I have any experience with Tomcat personally, but we do have a category of plugins on Nagios Exchange. You could see if these do a better job of the monitoring than the check_http plugin. There are a lot of things you can do with check_http, and you probably need to tweak it to make it work with your particular setup.

Re: Check_HTTP Query

Posted: Wed Sep 09, 2015 9:38 am
by neworderfac33
Thanks for the suggestion, although given the number of hoops we have to go through to get anything past Information Security, I'd prefer to try it with check_http first!

Incidentally, with the plugins on the exchange (as I haven't downloaded any yet), is it just a case of downloading them then copying them into the plugins directory, or does it differ from one to the next?

Cheers

Re: Check_HTTP Query

Posted: Wed Sep 09, 2015 9:59 am
by hsmith
peterooney wrote:Thanks for the suggestion, although given the number of hoops we have to go through to get anything past Information Security, I'd prefer to try it with check_http first!

Incidentally, with the plugins on the exchange (as I haven't downloaded any yet), is it just a case of downloading them then copying them into the plugins directory, or does it differ from one to the next?

Cheers
I'd look at the output of /usr/local/nagios/libexec/check_http -h to see if any of those options can make your query work. I know if you search around the forums a bit this is an issue that has come up quite often, and it's usually a different fix per environment.

My method for installing plugins (cleartext ones, at least) is usually the following:

Find plugin
Make a an empty file
Change permissions to match the rest of the plugins
vim the file and paste in the contents

Or, you could just wget it, but judging by what you've said about information security, the above method is probably the best.

Re: Check_HTTP Query

Posted: Thu Sep 10, 2015 11:10 am
by neworderfac33
Thank you for getting back to me on this.

I finally got to the bottom of it - it was nothing to do with firewalls or OUs.

Both servers had Jenkins installed on them.

On the one the Nagios could talk to, the "Anonymous" user (incorrectly) had "Admin" permissions.

On the one that Nagios couldn't talk to, the "Anonymous" user had "Anonymous" permissions, meaning that requests from Nagios couldn't get through.

Just thought this might be of some use to someone else out there.

Pete

Re: Check_HTTP Query

Posted: Thu Sep 10, 2015 11:32 am
by hsmith
peterooney wrote:Thank you for getting back to me on this.

I finally got to the bottom of it - it was nothing to do with firewalls or OUs.

Both servers had Jenkins installed on them.

On the one the Nagios could talk to, the "Anonymous" user (incorrectly) had "Admin" permissions.

On the one that Nagios couldn't talk to, the "Anonymous" user had "Anonymous" permissions, meaning that requests from Nagios couldn't get through.

Just thought this might be of some use to someone else out there.

Pete
Thanks for providing information on what the issue was!

I will go ahead and lock this one up since it looks like we are done here.

Thanks Pete.