arnaudsj / monit

Monit is a free open source utility for managing and monitoring, processes, files, directories and filesystems on a UNIX system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations. (unofficial mirror)
http://mmonit.com/monit/
Other
515 stars 63 forks source link

warning log lines for failed http test are only written on first restart #16

Open toaler opened 6 years ago

toaler commented 6 years ago

I've been experiementing with monit and noticed that the warning logging for failed HTTP checks, are written as designed up until the monitored process is restarted the first time.

[PDT Aug 23 14:03:20] warning : 'app' failed protocol test [HTTP] at [localhost]:8888/v1/healthcheck/status [TCP/IP] -- HTTP error: Server returned status 503 [PDT Aug 23 14:03:25] warning : 'app' failed protocol test [HTTP] at [localhost]:8888/v1/healthcheck/status [TCP/IP] -- HTTP error: Server returned status 503 [PDT Aug 23 14:03:30] warning : 'app' failed protocol test [HTTP] at [localhost]:8888/v1/healthcheck/status [TCP/IP] -- HTTP error: Server returned status 503 [PDT Aug 23 14:03:35] warning : 'app' failed protocol test [HTTP] at [localhost]:8888/v1/healthcheck/status [TCP/IP] -- HTTP error: Server returned status 503 [PDT Aug 23 14:03:40] error : 'app' failed protocol test [HTTP] at [localhost]:8888/v1/healthcheck/status [TCP/IP] -- HTTP error: Server returned status 503 [PDT Aug 23 14:03:40] info : 'app' trying to restart [PDT Aug 23 14:03:40] info : 'app' stop: '/bin/bash -c /Users/btoal/git/container/container-driver/run.sh stop' [PDT Aug 23 14:03:41] info : 'app' start: '/bin/bash -c /Users/btoal/git/container/container-driver/run.sh start /Users/btoal/git/container/container-example-webapp/target/container-example-webapp-0.0.1-SNAPSHOT.war'

However on subsequent failed checks we dont' see the warning logging, like before, even though the HTTP test failed (5 cycles of http test failures).

[PDT Aug 23 14:04:12] error : 'app' failed protocol test [HTTP] at [localhost]:8888/v1/healthcheck/status [TCP/IP] -- HTTP error: Server returned status 503 [PDT Aug 23 14:04:12] info : 'app' trying to restart [PDT Aug 23 14:04:12] info : 'app' stop: '/bin/bash -c /Users/btoal/git/container/container-driver/run.sh stop' [PDT Aug 23 14:04:13] info : 'app' start: '/bin/bash -c /Users/btoal/git/container/container-driver/run.sh start /Users/btoal/git/container/container-example-webapp/target/container-example-webapp-0.0.1-SNAPSHOT.war'

The warning logging corresponding to failed HTTP tests should still work event after the first restart. This log info is crucial to understanding when the monitored process is unhealthy.