Hello,
I got the following problem (based on monit 5.25.2, Mac OS X 10.10).

[CET Nov  3 19:55:57] debug    : 'file.log' content match skipped - file
size nor inode has not changed since last test
[CET Nov  3 19:55:57] info     : 'file.log' content doesn't match
[CET Nov  3 19:55:57] error    : 'file.log' content match:
Sa  3 Nov 2018 19:55:50 CET restart

[CET Nov  3 19:55:57] debug    :
-------------------------------------------------------------------------------
[CET Nov  3 19:55:57] debug    :     0   monit
     0x0000000108259a3a log_backtrace + 74
[CET Nov  3 19:55:57] debug    :     1   monit
     0x0000000108259399 LogError + 169
[CET Nov  3 19:55:57] debug    :     2   monit
     0x0000000108254940 Event_post + 1552
[CET Nov  3 19:55:57] debug    :     3   monit
     0x000000010826a4f3 check_file + 2755
[CET Nov  3 19:55:57] debug    :     4   monit
     0x0000000108252d68 _doStart + 168
[CET Nov  3 19:55:57] debug    :     5   monit
     0x00000001082531a9 _doDepend + 89
[CET Nov  3 19:55:57] debug    :     6   monit
     0x0000000108252c81 control_service + 865
[CET Nov  3 19:55:57] debug    :     7   monit
     0x00000001082558b2 _handleAction + 946
[CET Nov  3 19:55:57] debug    :     8   monit
     0x00000001082548db Event_post + 1451
[CET Nov  3 19:55:57] debug    :     9   monit
     0x000000010826a4f3 check_file + 2755
[CET Nov  3 19:55:57] debug    :     10  monit
     0x0000000108266d64 validate + 660
[CET Nov  3 19:55:57] debug    :     11  monit
     0x000000010825110a main + 3114
[CET Nov  3 19:55:57] debug    :     12  libdyld.dylib
     0x00007fff8f1815c9 start + 1
[CET Nov  3 19:55:57] debug    :     13  ???
     0x0000000000000004 0x0 + 4
[CET Nov  3 19:55:57] debug    :
-------------------------------------------------------------------------------
[CET Nov  3 19:55:57] warning  : 'file.log' content match:
Sa  3 Nov 2018 19:55:50 CET error
Sa  3 Nov 2018 19:55:50 CET error

[CET Nov  3 19:55:57] info     : 'wait.sh' start:
'/usr/local/etc/monit/scripts/wait.sh start'
[CET Nov  3 19:55:57] debug    : 'wait.sh' started
[CET Nov  3 19:55:57] critical : AssertException: S && *S
 raised in StringBuffer_free at src/util/StringBuffer.c:107

I try to use something like this to restart a process based on some
messages.

check process wait.sh matching "sleep"
  start program = "/usr/local/etc/monit/scripts/wait.sh start"
  stop program = "/usr/local/etc/monit/scripts/wait.sh stop"
  if cpu usage > 55% for 10 cycles then stop
  depends on file.log

check file file.log with path "/var/log/file.log"
  if not exist then exec "/usr/bin/touch /var/log/file.log"
  if match "error" then alert
  if match "restart" then restart

But all the time the message matched and try to restart, I got an
exception and monit stop, see above.

Any idea,
Lutz

-- 
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to