lets try a different example

I have the following 2 (simplified)  config entries.

if the file /tmp/primary exists then dbtrig will run, if I remove the file
dbtrig is stopped and started every cycle. I expect dbtrig to stop and
remain stopped until the file is created



check process dbtrig with pidfile "/var/run/dbtrig.pid"
start program = "/opt/unb/bin/dbtrig.sh start"
stop program = "/opt/unb/bin/dbtrig.sh stop"
depends on database
depends on primary

check file primary with path /tmp/primary


the log output is

[BST Jun  1 12:23:39] debug    : 'rootfs' space usage check succeeded
[current space usage=10.1%]
[BST Jun  1 12:23:39] error    : 'primary' file doesn't exist
[BST Jun  1 12:23:39] debug    :
-------------------------------------------------------------------------------
[BST Jun  1 12:23:39] debug    :     /usr/bin/monit [0x805442e]
[BST Jun  1 12:23:39] debug    :     /usr/bin/monit(LogError+0x22)
[0x8054842]
[BST Jun  1 12:23:39] debug    :     /usr/bin/monit(Event_post+0x382)
[0x8051f22]
[BST Jun  1 12:23:39] debug    :     /usr/bin/monit(check_file+0x7e9)
[0x8067219]
[BST Jun  1 12:23:39] debug    :     /usr/bin/monit(validate+0x1bf)
[0x80662cf]
[BST Jun  1 12:23:39] debug    :     /usr/bin/monit [0x80567aa]
[BST Jun  1 12:23:39] debug    :     /usr/bin/monit(main+0x55f) [0x805710f]
[BST Jun  1 12:23:39] debug    :     /lib/libc.so.6(__libc_start_main+0xdc)
[0xbfbe9c]
[BST Jun  1 12:23:39] debug    :     /usr/bin/monit [0x804ee51]
[BST Jun  1 12:23:39] debug    :
-------------------------------------------------------------------------------
[BST Jun  1 12:23:39] info     : 'primary' trying to restart

[BST Jun  1 12:23:46] debug    : Monitoring disabled -- service dbtrig
[BST Jun  1 12:23:46] info     : 'dbtrig' stop: /opt/unb/bin/dbtrig.sh
[BST Jun  1 12:23:47] debug    : monit: pidfile '/var/run/dbtrig.pid' does
not exist

[BST Jun  1 12:23:48] debug    : Monitoring disabled -- service primary
[BST Jun  1 12:23:48] debug    : Monitoring enabled -- service primary

[BST Jun  1 12:23:52] debug    : monit: pidfile '/var/run/dbtrig.pid' does
not exist
[BST Jun  1 12:23:52] info     : 'dbtrig' start: /opt/unb/bin/dbtrig.sh
[BST Jun  1 12:23:52] debug    : monit: pidfile '/var/run/dbtrig.pid' does
not exist
[BST Jun  1 12:23:52] debug    : monit: pidfile '/var/run/dbtrig.pid' does
not exist
[BST Jun  1 12:23:53] debug    : Monitoring enabled -- service dbtrig

[BST Jun  1 12:23:56] debug    : 'dbtrig' check skipped -- service already
handled in a dependency chain
[BST Jun  1 12:23:56] debug    : 'dblog' check skipped -- service already
handled in a dependency chain
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to