monit-general
[Top][All Lists]
Advanced

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

RE: [monit] monit , monitor a procces without a pid file


From: Cryer,Phil
Subject: RE: [monit] monit , monitor a procces without a pid file
Date: Thu, 8 Nov 2007 10:18:42 -0600

>Have a questions: monit can monitor a process without a pid file , but
have a pid number?
>So let say have some process called test.
>If give the command ps auxww | egrep test and the result is root 4435
0.0 0.1 2332 148 ? 
>Ss 06:33 0:00 test the pid is 4435, how can I put somenthing like that
in monit conf file 
>to check that program  test is working.It si possible to create a
virtual pid file as result 
>ps command? I have let say the stop and start commands....

Here's a simple way to do it, in the beginning of your startup script,
define the PIDFILE, and then dump the PID from the output of the PS
command into it: /var/run 

        export PIDFILE=/var/run/test.pid
        ps -fe | grep test | head -n1 | cut -d" " -f 6 > $PIDFILE

Then, on exit, you'll want a line removing $PIDFILE

P
 
 If you are not the intended recipient of this message (including attachments), 
or if you have received this message in error, immediately notify us and delete 
it and any attachments.  If you no longer wish to receive e-mail from Edward 
Jones, please send this request to address@hidden  You must include the e-mail 
address that you wish not to receive e-mail communications.  For important 
additional information related to this e-mail, visit 
www.edwardjones.com/US_email_disclosure




reply via email to

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