-
assigned issue to
- edited description
Monit logs to /var/log/messages and monit.log instead of monit.log only on CentOS 7.3.1611
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)
-
repo owner -
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")
-
reporter - attached monitrc
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]
-
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]$
-
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: ...
-
repo owner The log messages may also come from systemd ... as your monit service configuration includes the "-I" option, monit will log errors to standard output too. It is possible that systemd collects this output and logs it via syslog.
The systemd's StandardOutput option may probably solve the problem: https://www.freedesktop.org/software/systemd/man/systemd.exec.html#StandardOutput=
-
reporter - changed status to resolved
StandardOutput=null in /usr/lib/systemd/system/monit.service did the trick...
Thank you very much!
-
repo owner Fixed: Issue
#566: Systemd template for Monit: Added StandardOutput=null option to prevent systemd to duplicate Monit log output.→ <<cset 8348a39a227c>>
-
repo owner Issue
#590was marked as a duplicate of this issue. - Log in to comment