dtgloop' modify/change time for /var/tmp/dtgloop.txt failed after ip address change (I think)
Posted: Sunday 06 March 2022 16:16
Hello,
Monit constantly reboots DTGBOT service on my raspberry and this happens after I switched internet provider (Ziggo to KPN) and my Raspberry got a new Ip address last week. I have searched through all kinds of configs if it has something to do with the IP address but I can't find the link related to that.
The reason it rebootes is the timestamp check that I have defined in MONIT. This worked Ok before the IP address change, and to my opinion it is a local file check, but I may be wrong.
# Monitor the DTGBOT Service
###check process dtgbot with pidfile /var/run/dtgbot.pid
start program = "/home/pi/dtgbot/restartbot.sh" timeout 20 seconds
stop program = "/home/pi/dtgbot/stopbot.sh" timeout 20 seconds
if 5 restarts within 5 cycles then timeout
# Monitor the DTGBOT loop file which should be updated each minute.
# Restart DTGBOT when not updated in 2 minutes
check file dtgloop with path /var/tmp/dtgloop.txt
start program = "/home/pi/dtgbot/restartbot.sh" timeout 20 seconds
if timestamp > 2 minutes then restart
if 5 restarts within 5 cycles then timeout
In the monit.log I see this alle the time.
[CET Mar 6 15:07:14] info : 'dtgloop' modify/change time test succeeded for /var/tmp/dtgloop.txt [current modify/change time is Sun, 06 Mar 2022 15:06:14]
[CET Mar 6 15:08:15] error : 'dtgloop' modify/change time for /var/tmp/dtgloop.txt failed -- current modify/change time is Sun, 06 Mar 2022 15:06:14
[CET Mar 6 15:08:16] info : 'dtgloop' trying to restart
[CET Mar 6 15:08:16] info : 'dtgloop' start: '/home/pi/dtgbot/restartbot.sh'
[CET Mar 6 15:09:33] info : 'dtgloop' modify/change time test succeeded for /var/tmp/dtgloop.txt [current modify/change time is Sun, 06 Mar 2022 15:08:33]
[CET Mar 6 15:10:34] error : 'dtgloop' modify/change time for /var/tmp/dtgloop.txt failed -- current modify/change time is Sun, 06 Mar 2022 15:08:33
[CET Mar 6 15:10:35] info : 'dtgloop' trying to restart
[CET Mar 6 15:10:35] info : 'dtgloop' start: '/home/pi/dtgbot/restartbot.sh'
[CET Mar 6 15:11:52] info : 'dtgloop' modify/change time test succeeded for /var/tmp/dtgloop.txt [current modify/change time is Sun, 06 Mar 2022 15:10:51]
[CET Mar 6 15:12:53] error : 'dtgloop' modify/change time for /var/tmp/dtgloop.txt failed -- current modify/change time is Sun, 06 Mar 2022 15:10:51
[CET Mar 6 15:12:54] info : 'dtgloop' trying to restart
[CET Mar 6 15:12:54] info : 'dtgloop' start: '/home/pi/dtgbot/restartbot.sh'
[CET Mar 6 15:14:11] info : 'dtgloop' modify/change time test succeeded for /var/tmp/dtgloop.txt [current modify/change time is Sun, 06 Mar 2022 15:13:11]
[CET Mar 6 15:15:12] error : 'dtgloop' modify/change time for /var/tmp/dtgloop.txt failed -- current modify/change time is Sun, 06 Mar 2022 15:13:11
[CET Mar 6 15:15:13] info : 'dtgloop' trying to restart
[CET Mar 6 15:15:13] info : 'dtgloop' start: '/home/pi/dtgbot/restartbot.sh'
[CET Mar 6 15:16:29] info : 'dtgloop' modify/change time test succeeded for /var/tmp/dtgloop.txt [current modify/change time is Sun, 06 Mar 2022 15:15:29]
[CET Mar 6 15:17:30] error : 'dtgloop' modify/change time for /var/tmp/dtgloop.txt failed -- current modify/change time is Sun, 06 Mar 2022 15:15:29
[CET Mar 6 15:17:31] info : 'dtgloop' trying to restart
[CET Mar 6 15:17:31] info : 'dtgloop' start: '/home/pi/dtgbot/restartbot.sh'
[CET Mar 6 15:18:48] info : 'dtgloop' modify/change time test succeeded for /var/tmp/dtgloop.txt [current modify/change time is Sun, 06 Mar 2022 15:17:48]
[CET Mar 6 15:19:49] error : 'dtgloop' modify/change time for /var/tmp/dtgloop.txt failed -- current modify/change time is Sun, 06 Mar 2022 15:17:48
[CET Mar 6 15:19:50] info : 'dtgloop' trying to restart
[CET Mar 6 15:19:50] info : 'dtgloop' start: '/home/pi/dtgbot/restartbot.sh'
[CET Mar 6 15:21:06] info : 'dtgloop' modify/change time test succeeded for /var/tmp/dtgloop.txt [current modify/change time is Sun, 06 Mar 2022 15:20:06]
[CET Mar 6 15:22:07] error : 'dtgloop' modify/change time for /var/tmp/dtgloop.txt failed -- current modify/change time is Sun, 06 Mar 2022 15:20:06
[CET Mar 6 15:22:08] info : 'dtgloop' trying to restart
[CET Mar 6 15:22:08] info : 'dtgloop' start: '/home/pi/dtgbot/restartbot.sh'
[CET Mar 6 15:23:25] info : 'dtgloop' modify/change time test succeeded for /var/tmp/dtgloop.txt [current modify/change time is Sun, 06 Mar 2022 15:22:25]
[CET Mar 6 15:24:26] error : 'dtgloop' modify/change time for /var/tmp/dtgloop.txt failed -- current modify/change time is Sun, 06 Mar 2022 15:22:25
[CET Mar 6 15:24:27] info : 'dtgloop' trying to restart
[CET Mar 6 15:24:27] info : 'dtgloop' start: '/home/pi/dtgbot/restartbot.sh'
[CET Mar 6 15:25:43] info : 'dtgloop' modify/change time test succeeded for /var/tmp/dtgloop.txt [current modify/change time is Sun, 06 Mar 2022 15:24:43]
[CET Mar 6 15:26:44] error : 'dtgloop' modify/change time for /var/tmp/dtgloop.txt failed -- current modify/change time is Sun, 06 Mar 2022 15:24:43
[CET Mar 6 15:26:45] info : 'dtgloop' trying to restart
[CET Mar 6 15:26:45] info : 'dtgloop' start: '/home/pi/dtgbot/restartbot.sh'
I hope someone can help me.
Kind regards, Wilfried
Monit constantly reboots DTGBOT service on my raspberry and this happens after I switched internet provider (Ziggo to KPN) and my Raspberry got a new Ip address last week. I have searched through all kinds of configs if it has something to do with the IP address but I can't find the link related to that.
The reason it rebootes is the timestamp check that I have defined in MONIT. This worked Ok before the IP address change, and to my opinion it is a local file check, but I may be wrong.
# Monitor the DTGBOT Service
###check process dtgbot with pidfile /var/run/dtgbot.pid
start program = "/home/pi/dtgbot/restartbot.sh" timeout 20 seconds
stop program = "/home/pi/dtgbot/stopbot.sh" timeout 20 seconds
if 5 restarts within 5 cycles then timeout
# Monitor the DTGBOT loop file which should be updated each minute.
# Restart DTGBOT when not updated in 2 minutes
check file dtgloop with path /var/tmp/dtgloop.txt
start program = "/home/pi/dtgbot/restartbot.sh" timeout 20 seconds
if timestamp > 2 minutes then restart
if 5 restarts within 5 cycles then timeout
In the monit.log I see this alle the time.
[CET Mar 6 15:07:14] info : 'dtgloop' modify/change time test succeeded for /var/tmp/dtgloop.txt [current modify/change time is Sun, 06 Mar 2022 15:06:14]
[CET Mar 6 15:08:15] error : 'dtgloop' modify/change time for /var/tmp/dtgloop.txt failed -- current modify/change time is Sun, 06 Mar 2022 15:06:14
[CET Mar 6 15:08:16] info : 'dtgloop' trying to restart
[CET Mar 6 15:08:16] info : 'dtgloop' start: '/home/pi/dtgbot/restartbot.sh'
[CET Mar 6 15:09:33] info : 'dtgloop' modify/change time test succeeded for /var/tmp/dtgloop.txt [current modify/change time is Sun, 06 Mar 2022 15:08:33]
[CET Mar 6 15:10:34] error : 'dtgloop' modify/change time for /var/tmp/dtgloop.txt failed -- current modify/change time is Sun, 06 Mar 2022 15:08:33
[CET Mar 6 15:10:35] info : 'dtgloop' trying to restart
[CET Mar 6 15:10:35] info : 'dtgloop' start: '/home/pi/dtgbot/restartbot.sh'
[CET Mar 6 15:11:52] info : 'dtgloop' modify/change time test succeeded for /var/tmp/dtgloop.txt [current modify/change time is Sun, 06 Mar 2022 15:10:51]
[CET Mar 6 15:12:53] error : 'dtgloop' modify/change time for /var/tmp/dtgloop.txt failed -- current modify/change time is Sun, 06 Mar 2022 15:10:51
[CET Mar 6 15:12:54] info : 'dtgloop' trying to restart
[CET Mar 6 15:12:54] info : 'dtgloop' start: '/home/pi/dtgbot/restartbot.sh'
[CET Mar 6 15:14:11] info : 'dtgloop' modify/change time test succeeded for /var/tmp/dtgloop.txt [current modify/change time is Sun, 06 Mar 2022 15:13:11]
[CET Mar 6 15:15:12] error : 'dtgloop' modify/change time for /var/tmp/dtgloop.txt failed -- current modify/change time is Sun, 06 Mar 2022 15:13:11
[CET Mar 6 15:15:13] info : 'dtgloop' trying to restart
[CET Mar 6 15:15:13] info : 'dtgloop' start: '/home/pi/dtgbot/restartbot.sh'
[CET Mar 6 15:16:29] info : 'dtgloop' modify/change time test succeeded for /var/tmp/dtgloop.txt [current modify/change time is Sun, 06 Mar 2022 15:15:29]
[CET Mar 6 15:17:30] error : 'dtgloop' modify/change time for /var/tmp/dtgloop.txt failed -- current modify/change time is Sun, 06 Mar 2022 15:15:29
[CET Mar 6 15:17:31] info : 'dtgloop' trying to restart
[CET Mar 6 15:17:31] info : 'dtgloop' start: '/home/pi/dtgbot/restartbot.sh'
[CET Mar 6 15:18:48] info : 'dtgloop' modify/change time test succeeded for /var/tmp/dtgloop.txt [current modify/change time is Sun, 06 Mar 2022 15:17:48]
[CET Mar 6 15:19:49] error : 'dtgloop' modify/change time for /var/tmp/dtgloop.txt failed -- current modify/change time is Sun, 06 Mar 2022 15:17:48
[CET Mar 6 15:19:50] info : 'dtgloop' trying to restart
[CET Mar 6 15:19:50] info : 'dtgloop' start: '/home/pi/dtgbot/restartbot.sh'
[CET Mar 6 15:21:06] info : 'dtgloop' modify/change time test succeeded for /var/tmp/dtgloop.txt [current modify/change time is Sun, 06 Mar 2022 15:20:06]
[CET Mar 6 15:22:07] error : 'dtgloop' modify/change time for /var/tmp/dtgloop.txt failed -- current modify/change time is Sun, 06 Mar 2022 15:20:06
[CET Mar 6 15:22:08] info : 'dtgloop' trying to restart
[CET Mar 6 15:22:08] info : 'dtgloop' start: '/home/pi/dtgbot/restartbot.sh'
[CET Mar 6 15:23:25] info : 'dtgloop' modify/change time test succeeded for /var/tmp/dtgloop.txt [current modify/change time is Sun, 06 Mar 2022 15:22:25]
[CET Mar 6 15:24:26] error : 'dtgloop' modify/change time for /var/tmp/dtgloop.txt failed -- current modify/change time is Sun, 06 Mar 2022 15:22:25
[CET Mar 6 15:24:27] info : 'dtgloop' trying to restart
[CET Mar 6 15:24:27] info : 'dtgloop' start: '/home/pi/dtgbot/restartbot.sh'
[CET Mar 6 15:25:43] info : 'dtgloop' modify/change time test succeeded for /var/tmp/dtgloop.txt [current modify/change time is Sun, 06 Mar 2022 15:24:43]
[CET Mar 6 15:26:44] error : 'dtgloop' modify/change time for /var/tmp/dtgloop.txt failed -- current modify/change time is Sun, 06 Mar 2022 15:24:43
[CET Mar 6 15:26:45] info : 'dtgloop' trying to restart
[CET Mar 6 15:26:45] info : 'dtgloop' start: '/home/pi/dtgbot/restartbot.sh'
I hope someone can help me.
Kind regards, Wilfried