Monit logs to /var/log/messages and monit.log instead of monit.log only on CentOS 7.3.1611

Issue #566 resolved
Christof Wolf created an issue

Monit (Version 5.20.0) logs to /var/log/monit.log and /var/log/messages. The documentation says, it should log only to the logfile set in the monit configuration file ("set logfile /var/log/monit.log" im my case). The command line option "-l" is not set (it makes no difference if it is set). This is a problem because if i check /var/log/messages for an certain error monit also reports its own messages regarding this error... a never ending story ;)

rsyslog.conf:

*.info;mail.none;authpriv.none;cron.none                /var/log/messages

Comments (9)

  1. Tildeslash repo owner

    I'm unable to reproduce the issue - please can you send your configuration file and sample of monit log from /var/log/messages?

    If you switched the "set logfile" settings from "syslog" to "/var/log/monit.log", did you reload monit? (using for example "monit reload")

  2. Christof Wolf reporter

    This is the complete configuration. "syslog" was never used and yes, i reload monit after every change.

    /var/log/messages: /var/log/messages-20170306:Mar 2 16:17:33 lbmfmi06 monit: Feb 26 03:41:06 lbmfmi06 kernel: exim[13688]: segfault at 0 ip 00007f03043166c6 sp 00007ffe8670c938 error 4 in libc-2.17.so[7f03041b7000+1b6000] /var/log/messages-20170306:Mar 2 16:17:33 lbmfmi06 monit: Feb 26 03:41:06 lbmfmi06 kernel: exim[13689]: segfault at 0 ip 00007f03043166c6 sp 00007ffe8670c938 error 4 in libc-2.17.so[7f03041b7000+1b6000] /var/log/messages-20170306:Mar 2 16:17:33 lbmfmi06 monit: Feb 26 03:41:18 lbmfmi06 kernel: exim[13783]: segfault at 0 ip 00007f03043166c6 sp 00007ffe8670c938 error 4 in libc-2.17.so[7f03041b7000+1b6000] /var/log/messages-20170306:Mar 2 16:17:33 lbmfmi06 monit: Feb 26 03:41:36 lbmfmi06 kernel: exim[13884]: segfault at 0 ip 00007f03043166c6 sp 00007ffe8670c938 error 4 in libc-2.17.so[7f03041b7000+1b6000] /var/log/messages-20170306:Mar 2 16:17:43 lbmfmi06 monit: Mar 2 16:17:33 lbmfmi06 monit: Feb 26 03:41:06 lbmfmi06 kernel: exim[13688]: segfault at 0 ip 00007f03043166c6 sp 00007ffe8670c938 error 4 in libc-2.17.so[7f03041b7000+1b6000] /var/log/messages-20170306:Mar 2 16:17:43 lbmfmi06 monit: Mar 2 16:17:33 lbmfmi06 monit: Feb 26 03:41:06 lbmfmi06 kernel: exim[13689]: segfault at 0 ip 00007f03043166c6 sp 00007ffe8670c938 error 4 in libc-2.17.so[7f03041b7000+1b6000] /var/log/messages-20170306:Mar 2 16:17:43 lbmfmi06 monit: Mar 2 16:17:33 lbmfmi06 monit: Feb 26 03:41:18 lbmfmi06 kernel: exim[13783]: segfault at 0 ip 00007f03043166c6 sp 00007ffe8670c938 error 4 in libc-2.17.so[7f03041b7000+1b6000] /var/log/messages-20170306:Mar 2 16:17:53 lbmfmi06 monit: Mar 2 16:17:43 lbmfmi06 monit: Mar 2 16:17:33 lbmfmi06 monit: Feb 26 03:41:06 lbmfmi06 kernel: exim[13688]: segfault at 0 ip 00007f03043166c6 sp 00007ffe8670c938 error 4 in libc-2.17.so[7f03041b7000+1b6000] /var/log/messages-20170306:Mar 2 16:17:53 lbmfmi06 monit: Mar 2 16:17:43 lbmfmi06 monit: Mar 2 16:17:33 lbmfmi06 monit: Feb 26 03:41:06 lbmfmi06 kernel: exim[13689]: segfault at 0 ip 00007f03043166c6 sp 00007ffe8670c938 error 4 in libc-2.17.so[7f03041b7000+1b6000]

    And the same for /var/log/monit.log:

    Mar 2 16:17:33 lbmfmi06 monit: Feb 26 03:41:06 lbmfmi06 kernel: exim[13688]: segfault at 0 ip 00007f03043166c6 sp 00007ffe8670c938 error 4 in libc-2.17.so[7f03041b7000+1b6000] Mar 2 16:17:33 lbmfmi06 monit: Feb 26 03:41:06 lbmfmi06 kernel: exim[13689]: segfault at 0 ip 00007f03043166c6 sp 00007ffe8670c938 error 4 in libc-2.17.so[7f03041b7000+1b6000] Mar 2 16:17:33 lbmfmi06 monit: Feb 26 03:41:18 lbmfmi06 kernel: exim[13783]: segfault at 0 ip 00007f03043166c6 sp 00007ffe8670c938 error 4 in libc-2.17.so[7f03041b7000+1b6000] ...

    [CET Mar 2 16:17:53] error : 'messages' content match: Mar 2 16:17:43 lbmfmi06 monit: Mar 2 16:17:33 lbmfmi06 monit: Feb 26 03:41:06 lbmfmi06 kernel: exim[13688]: segfault at 0 ip 00007f03043166c6 sp 00007ffe8670c938 error 4 in libc-2.17.so[7f03041b7000+1b6000] Mar 2 16:17:43 lbmfmi06 monit: Mar 2 16:17:33 lbmfmi06 monit: Feb 26 03:41:06 lbmfmi06 kernel: exim[13689]: segfault at 0 ip 00007f03043166c6 sp 00007ffe8670c938 error 4 in libc-2.17.so[7f03041b7000+1b6000] Mar 2 16:17:43 lbmfmi06 monit: Mar 2 16:17:33 lbmfmi06 monit: Feb 26 03:41:18 lbmfmi06 kernel: exim[13783]: segfault at 0 ip 00007f03043166c6 sp 00007ffe8670c938 error 4 in libc-2.17.so[7f03041b7000+1b6000] ...

    [CET Mar 2 16:18:03] error : 'messages' content match: Mar 2 16:17:53 lbmfmi06 monit: Mar 2 16:17:43 lbmfmi06 monit: Mar 2 16:17:33 lbmfmi06 monit: Feb 26 03:41:06 lbmfmi06 kernel: exim[13688]: segfault at 0 ip 00007f03043166c6 sp 00007ffe8670c938 error 4 in libc-2.17.so[7f03041b7000+1b6000] Mar 2 16:17:53 lbmfmi06 monit: Mar 2 16:17:43 lbmfmi06 monit: Mar 2 16:17:33 lbmfmi06 monit: Feb 26 03:41:06 lbmfmi06 kernel: exim[13689]: segfault at 0 ip 00007f03043166c6 sp 00007ffe8670c938 error 4 in libc-2.17.so[7f03041b7000+1b6000] Mar 2 16:17:53 lbmfmi06 monit: Mar 2 16:17:43 lbmfmi06 monit: Mar 2 16:17:33 lbmfmi06 monit: Feb 26 03:41:18 lbmfmi06 kernel: exim[13783]: segfault at 0 ip 00007f03043166c6 sp 00007ffe8670c938 error 4 in libc-2.17.so[7f03041b7000+1b6000]

  3. Christof Wolf reporter

    And this is the systemd configuration file: [@lbmfmi06 system]$ cat monit.service [Unit] Description=Pro-active monitoring utility for unix systems After=network.target [Service] Type=simple ExecStart=/usr/bin/monit -I ExecStop=/usr/bin/monit quit ExecReload=/usr/bin/monit reload

    [Install] WantedBy=multi-user.target [@lbmfmi06 system]$

  4. Tildeslash repo owner

    Thanks for data.

    The messages in /var/log/messages are not logged by monit itself. Monit's own log messages are only in the /var/log/monit.log file and start like this:

    [CET Mar 2 16:18:03] error : 'messages' content match: ...
    
  5. Christof Wolf reporter

    StandardOutput=null in /usr/lib/systemd/system/monit.service did the trick...

    Thank you very much!

  6. Log in to comment