Event Handlers, start a java program, nohup issues.

Marco Tirado marco.tirado at gmail.com
Fri Jul 3 10:45:40 CEST 2009


Hello users:

Thank you for all the answers. I have made some changes to my command: I
added a space before the "&" character and I explicitly piped the "stdout"
and "stderr" to my log file to avoid missunderstandings. The command looks
like this now:

nohup $JAVA_CMD -cp $CLASSPATH $JVM_OPTIONS JMXServer.JMXServerDispatcher
$PORT </dev/null >>$LOG_FILE 2>>$LOG_FILE &

The result however is much worst in this case, instead of seeing a timeout
in the logs, the whole nagios process hangs (that is the logs freeze and no
new tests are performed). I believe these issues have to do with how nagios
handles the "&" character or processes in the background in general.

Any thoughts? other suggestions?


//Marco


By the way David:

We have used the check_jmx plugin in the past with out own modifications,
however we have a very large system with around 1000 JMX queries running
each 5 minutes and the check_jmx solution is not very scalable. If we use
check_jmx that means starting 1000 JVM (and all the resources that come with
it) every five minutes, that consumes a lot of resources and generates a lot
of load on the monitoring server. Our system is continuously growing and new
JMX queries are added quite frequently.

To solve that issue we have developed a JMX server that takes care of all
the JMX queries and a light weight client that is run by nagios. This is a
much more scalable solution that decouples the whole JMX processing from
nagios (the JMX server can be running in any machine not only the nagios
server).

Cheers





On Thu, Jul 2, 2009 at 4:43 PM, Marc Powell <marc at ena.com> wrote:

>
> On Jul 2, 2009, at 9:16 AM, Marco Tirado wrote:
>
> >
> > That is exactly what I am doing (or trying to do with) the "&"
> > character at the end of my command. But it does not appear to be
> > working, the command looks like this:
> >
> > nohup $JAVA_CMD -cp $CLASSPATH $JVM_OPTIONS JMXServer $PORT </dev/
> > null 2>&1 >> $LOG_FILE&
>
> Do you really intend to set the output of /dev/null as the STDIN for
> nohup? I expect you meant to use '>/dev/null'.
>
> --
> Marc
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when
> reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20090703/0cc9e60d/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list