How to monitor Apache Tomcat in Nagios Core
-
neworderfac33
- Posts: 329
- Joined: Fri Jul 24, 2015 11:04 am
How to monitor Apache Tomcat in Nagios Core
Good morning,
Once again encouraged by the expertise within this forum, I have another question.
My two test Windows clients use Apache Tomcat 7 to run the Jenkins continuous integration application.
I would like to be able to send email alerts if Apache is down, but I'm not certain if I can do this using a define service command within windows.cfg or if I need to install a plugin in order to do this?
Thanks in advance
Pete
Once again encouraged by the expertise within this forum, I have another question.
My two test Windows clients use Apache Tomcat 7 to run the Jenkins continuous integration application.
I would like to be able to send email alerts if Apache is down, but I'm not certain if I can do this using a define service command within windows.cfg or if I need to install a plugin in order to do this?
Thanks in advance
Pete
Re: How to monitor Apache Tomcat in Nagios Core
If you want to check that system to see if you can access the WEB interface, you cound use the check_http command from the Nagios system. That will let you know that the web server is up and that it is serving web pages.
If you need to check it to see if a certain port is open on that system, you could use the check_tcp command to do that.
Both of those commands should be already installed on your system.
If this isn't what you are looking for, post back with the details on how you need to monitor those systems and we can better help you.
If you need to check it to see if a certain port is open on that system, you could use the check_tcp command to do that.
Both of those commands should be already installed on your system.
If this isn't what you are looking for, post back with the details on how you need to monitor those systems and we can better help you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
neworderfac33
- Posts: 329
- Joined: Fri Jul 24, 2015 11:04 am
Re: How to monitor Apache Tomcat in Nagios Core
Thank you very much!
Can I utilise this from within my Windows.cfg file?
Pete
Can I utilise this from within my Windows.cfg file?
Pete
Re: How to monitor Apache Tomcat in Nagios Core
Yes, you can add the service to your windows.cfg file.
Here is an example that you will have to edit for your system you want to monitor.
Here is an example that you will have to edit for your system you want to monitor.
Code: Select all
define service {
host_name www.google.com
service_description HTTP
check_command check_http! -f ok -I 74.125.228.212 -u "/" -p 80
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
register 1
}
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
neworderfac33
- Posts: 329
- Joined: Fri Jul 24, 2015 11:04 am
Re: How to monitor Apache Tomcat in Nagios Core
The application that I actually want to check for is Jenkins, which is installed on both the servers I want to monitor - it runs via a .WAR file, located within C:\program Files\Apache Software Foundation\Tomcat 7.0\WebApps\
So, I can either check that Jenkins is running, or that Apache is running as a service - if the latter isn't running, then the former won't be running either - whichever option is easier.
Also, please could you run through the syntax of the check_http command for me?
Regards
Pete
So, I can either check that Jenkins is running, or that Apache is running as a service - if the latter isn't running, then the former won't be running either - whichever option is easier.
Also, please could you run through the syntax of the check_http command for me?
Regards
Pete
Re: How to monitor Apache Tomcat in Nagios Core
If you're looking for all of the details of check_http you can get them by issuing this command:peterooney wrote:The application that I actually want to check for is Jenkins, which is installed on both the servers I want to monitor - it runs via a .WAR file, located within C:\program Files\Apache Software Foundation\Tomcat 7.0\WebApps\
So, I can either check that Jenkins is running, or that Apache is running as a service - if the latter isn't running, then the former won't be running either - whichever option is easier.
Also, please could you run through the syntax of the check_http command for me?
Regards
Pete
Code: Select all
/usr/local/nagios/libexec/check_http -h
Former Nagios Employee.
me.
me.
-
neworderfac33
- Posts: 329
- Joined: Fri Jul 24, 2015 11:04 am
Re: How to monitor Apache Tomcat in Nagios Core
Still struggling, I'm afraid - the latest define service I have is:
but this returns:
HTTP CRITICAL - No data received from host
It isn't a "real" https in that the certificates are only internal ones, so the address bar shows the https part of the URL crossed out
Not sure where to go from here...
Cheers
Pete
Code: Select all
define service {
use generic-service
host_name MYSERVERID
#hostgroup_name windows-servers
service_description Apache
check_command check_http! -p 443 -ssl
}
HTTP CRITICAL - No data received from host
It isn't a "real" https in that the certificates are only internal ones, so the address bar shows the https part of the URL crossed out
Not sure where to go from here...
Cheers
Pete
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: How to monitor Apache Tomcat in Nagios Core
The -p isn't necessary and the -ssl should just be -S:peterooney wrote:Code: Select all
check_command check_http! -p 443 -ssl
Code: Select all
[root@localhost etc]# ../libexec/check_http -I google.com -S
HTTP OK: HTTP/1.0 200 OK - 19432 bytes in 5.239 second response time |time=5.239068s;;;0.000000 size=19432B;;;0-
neworderfac33
- Posts: 329
- Joined: Fri Jul 24, 2015 11:04 am
Re: How to monitor Apache Tomcat in Nagios Core
Thanks for your reply.
I'm running my Nagios on Redhat enterprise 6.6 and when I try to run your command, I get:
bash: ../libexec/check_http: No such file or directory
I have made the changes you suggested
and the web interface returns
HTTP WARNING: HTTP/1.1 403 Forbidden - 1491 bytes in 0.002 second response time
If I add the -S parameter
the web interface returns
check_http: Invalid option - SSL is not available
HELP!
Pete
I'm running my Nagios on Redhat enterprise 6.6 and when I try to run your command, I get:
bash: ../libexec/check_http: No such file or directory
I have made the changes you suggested
Code: Select all
define service {
use generic-service
host_name MYSERVERNAME
#hostgroup_name windows-servers
service_description Apache
check_command check_http! 443
}
HTTP WARNING: HTTP/1.1 403 Forbidden - 1491 bytes in 0.002 second response time
If I add the -S parameter
Code: Select all
define service {
use generic-service
host_name MYSERVERNAME
#hostgroup_name windows-servers
service_description Apache
check_command check_http! 443 -S
}
check_http: Invalid option - SSL is not available
HELP!
Pete
-
neworderfac33
- Posts: 329
- Joined: Fri Jul 24, 2015 11:04 am
Re: How to monitor Apache Tomcat in Nagios Core
Don't worry too much about this - I found another way to get around it, by monitoring the Apache Tomcat7 process instead.
Cheers
Pete
Code: Select all
define service{
use generic-service
#host_name MYFIRSTSERVER, MYSECONDSERVER
hostgroup_name windows-servers
service_description Service - Tomcat7
check_command check_nt!SERVICESTATE!-d SHOWALL -l Tomcat7
}
Pete