[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cant able to check java process in monit

From: nirmala nirmala
Subject: Cant able to check java process in monit
Date: Thu, 10 May 2007 08:35:05 +0100 (BST)

           I need to process java programs in monit. For this i used to check one sample  program in java and i created pid  for this java program. I used below java program as sample for monitoring.
public class sample
   public static void main(String args[]) throws Throwable 
      int i=0;
       while (i<5)
         System.out.println("thread "
            +Thread.currentThread().getName()+" step "+i);
         Thread.sleep(5000); i++;
For this i created pid file using shell script as follows
   export JAVA_HOME=/usr/java/jdk1.5.0_06
          export DISPLAY=localhost:0.0
          case $1 in
           echo $$ > /var/run/;
           exec 2>&1 /usr/java/jdk1.5.0_06/bin/java -cp ${CLASSPATH} sample\
           kill `cat /var/run/` ;;
           echo "usage: sample {start|stop}" ;;
Now my problem is when i start monit, its running. But whenever i check monit status for this java process, its coming as ".does not exist" . That s below.
Process 'sample'
  status                            Does not exist
  monitoring status             monitored
  data collected                  Thu May 10 12:35:16 2007
and my control file for this java process is below
check process sample with pidfile /var/run/
                start = "/usr/java/jdk1.5.0_06/bin/sample.class start"
                stop = "/usr/java/jdk1.5.0_06/bin/sample.class stop"
So pls let me know what step i have to do for this.

Here’s a new way to find what you're looking for - Yahoo! Answers
reply via email to

[Prev in Thread] Current Thread [Next in Thread]