1

I have a java application which I run using yasjw tool as a daemon. I need to monitor it in case it goes down I need some kind of alert or even restart it. Is there any tool can help me do this on centos environment?

The results of ps -ef | grep java

root      3109     1  0 Apr06 ?        00:04:35 /usr/java/jdk1.6.0_18/bin/java -Dwrapper.pidfile=/var/run/wrapper.commServer.pid -Dwrapper.service=true -Dwrapper.visible=false -jar /usr/local/yajsw-beta-10.2/wrapper.jar -c /usr/local/yajsw-beta-10.2/conf/wrapper.conf
root      3132  3109  0 Apr06 ?        00:25:26 /usr/java/jdk1.6.0_18/bin/java -classpath /usr/local/yajsw-beta-10.2/./wrapperApp.jar:/usr/local -Xrs -Dwrapper.service=true -Dwrapper.console.visible=false -Dwrapper.visible=false -Dwrapper.pidfile=/var/run/wrapper.commServer.pid -Dwrapper.config=/usr/local/yajsw-beta-10.2/conf/wrapper.conf -Dwrapper.port=15003 -Dwrapper.key=4276015160565963367 -Dwrapper.teeName=4276015160565963367$1333699547154 -Dwrapper.tmpPath=/tmp org.rzo.yajsw.app.WrapperJVMMain
root     23986 23945  0 16:53 pts/0    00:00:00 grep java

pidof java
3132 3109

1 Answer 1

1

use monit http://mmonit.com/monit/

35
  • so inorder for me to run monit must I monitor the yajsw or the java application itself?
    – user111196
    Feb 22, 2012 at 3:32
  • cmiiw, i think the java process. you may customize fak3r.com/2010/10/07/… or some examples from the site mmonit.com/wiki/Monit/ConfigurationExamples
    – chocripple
    Feb 22, 2012 at 3:47
  • after reading the links you gave me looks like I do not need the yajsw tool is it to run it as a daemon is it? Can monit run the java applicatio as daemon?
    – user111196
    Feb 22, 2012 at 4:09
  • monit only daemon that can monitor process, and there is feature on monit that you can do like restart the service if the process is down (you need specify the command)
    – chocripple
    Feb 22, 2012 at 4:22
  • 1
    on pkgs.repoforge.org/monit there are monit-5.2-1.el6.rf.i686.rpm and monit-5.2-1.el6.rf.x86_64.rpm, just download and rpm -ivh monit-xx.rpm
    – chocripple
    Feb 26, 2012 at 3:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .