|
From: | Bryan Harris |
Subject: | Re: Wrong PID |
Date: | Sat, 26 Aug 2017 06:50:07 -0400 |
Request for helpWhat am i doing wrong?Question 1: Why "/bin/sh -c cd /tmp..." PID is getting loged in pid file, instead of "sleep 1000" pid.Hello all,
I have written check command like
check process sample-test with pidfile /tmp/sample-test.pid
start = "/bin/sh -c 'cd /tmp ; nohup sleep 1000 1>/tmp/sample-test.log 2>/tmp/sample-test.log & echo $! > /tmp/sample-test.pid'" with timeout 10 seconds
stop = "/bin/sh -c 'kill -9 `cat /tmp/sample-test.pid`'"
if does not exist then alert
if does not exist then restart
if 2 restarts within 5 cycles then alert
# cat /tmp/sample-test.pid
#11445
#ps -aux | grep sleep
root 11446 0.0 0.0 107896 608 ? S 15:04 0:00 sleep 1000
root 11445 0.0 0.0 113120 652 ? S 15:04 0:00 /bin/sh -c cd /tmp && nohup sleep 1000 1>/tmp/sample-test.log 2>/tmp/sample-test.log & echo $! > /tmp/sample-test.pid
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
[Prev in Thread] | Current Thread | [Next in Thread] |