Page 1 of 1

using Nagios XI for Auto restart Jbos Servervice on Linux

Posted: Thu Mar 30, 2017 12:45 am
by venugopaldigital
Hi Support team,
Does Nagios support to auto restart the Jbos service on Linux environment.If so which module ? Nagios Reactor or Event module or through new Plugins?
Or is there any other way to implement my requirement?

Use case
--------------
1.Monitor Jbos service.
2.If it goes down, check the logs if it is really down why it went down(Here some pre defined rules before simply restarting).
3.Based on log information restart the JBOS service.

Thanks
Venu

Re: using Nagios XI for Auto restart Jbos Servervice on Linu

Posted: Thu Mar 30, 2017 1:35 pm
by mcapra
You would first need to define your JBoss service check command and use that in a Service check. If you wanted to then run some other script when the Service check returns a "Problem State" such as warning/critical/unknown, you would define an "Event Handler" to handle that behavior.

A summary:
Event handlers are optional system commands (scripts or executables) that are run when a host or service state change occurs. These
commands include, but are not limited to, restarting services, parsing logs, checking other host or service states, making database
calls, etc. The possibilities are near limitless. Essentially, through event handlers, Nagios XI is capable of running any operation that
can be performed from the command line with the added ability of utilizing macros passed by Nagios XI.
Documentation:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Essentially, your Service's check command would be this:
1. Monitor Jbos service.
And the event handler would be a script that contains some logic to tackle this:
2.If it goes down, check the logs if it is really down why it went down(Here some pre defined rules before simply restarting).
3.Based on log information restart the JBOS service.
The logic of parsing out the JBoss log information is most of the heavy lifting. There isn't anything native to Nagios XI that handles log parsing (we have Nagios Log Server for that).