Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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/ -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/ -Dwrapper.config=/usr/local/yajsw-beta-10.2/conf/wrapper.conf -Dwrapper.port=15003 -Dwrapper.key=4276015160565963367 -Dwrapper.teeName=4276015160565963367$1333699547154 -Dwrapper.tmpPath=/tmp
root     23986 23945  0 16:53 pts/0    00:00:00 grep java

pidof java
3132 3109
share|improve this question
up vote 1 down vote accepted

use monit

share|improve this answer
so inorder for me to run monit must I monitor the yajsw or the java application itself? – user111196 Feb 22 '12 at 3:32
cmiiw, i think the java process. you may customize… or some examples from the site – chocripple Feb 22 '12 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 '12 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 '12 at 4:22
on 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 '12 at 3:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.