Need to monitor tomcat using Nagios server
Hi Team,
I have a live nagios server(EC2) which is monitoring around number of linux clients(EC2 instances) .I want to monitor tomcat for one linux client .Any help will be highly appreciable . Note :- I can do it using check_http plugin with port no But our development team doesn't like to monitoring it using port no.The plugin available in nagios site needs user name and password to monitor it while we have password less authentication for all the servers . |
Why don't you write your own plugin to either check the output of "pidof catalina" or check the access logs for the last modified date of the access log via NRPE? Nagios plugins are pretty easy to write in Perl. I've done this to monitor all sorts of processes and logs on NRPE clients. That way, you don't need to have the Tomcat instance being constantly hit with unnecessary checks from the Nagios server on non-standard ports and messing up the Tomcat logs - all traffic will just travel via the NRPE port 5666.
|
Hi arashi256 ,
I dont have much knowledge on scripting.Is there readymade script available which I can use for checking. Thanks in advance |
Well, no. Not that I'm aware of. But it's pretty simple. Here is a skeleton Perl plugin for you.
Code:
#!/usr/bin/perl |
Quote:
Thanks , I will use this script .I will check locally. /usr/bin/perl ./check_tomcat 127.0.0.1 Is this argument is fine ? |
The above code is a example framework, it won't actually do anything. As I said, you can add as many arguments as you like and process what you want as long as the end result is one of those three states. I imagine all you'd need to do is to check for the presence of the Tomcat process, so unless you want to write a generalised process watcher, I doubt you'd need any arguments to your plugin.
|
Quote:
|
I did above - all you need to do is set the $state variable depending on your result - $state = 0 : OK, $state = 1: WARNING, $state = 2 : CRITICAL.
|
All times are GMT -5. The time now is 01:28 AM. |