User Tools

Site Tools


blog:how_to_stop_systemd_spamming_syslog_with_messages

how to stop systemd spamming syslog with messages

systemd has a bad habit of spanning the system log with messages every time a user logs in. This is especially annoying on busy systems and/or if using nagios for monitoring it.

To get rid of the logspam:

sudo loginctl enable-linger NAGIOSUSER

After the above, there are still messages about starting and Removing sessions :(

#Add Filter
sudo -s
echo 'if ($programname == "systemd-logind" or $programname == "systemd") and ($msg contains "Starting Session" or $msg contains "Started Session" or $msg contains "Removed session" or $msg contains "New session" or $msg contains "Created slice" or $msg contains "Starting user-") then stop' >/etc/rsyslog.d/ignore-systemd-session-slice.conf
#Restart Syslog
systemctl restart rsyslog

Discussion

Enter your comment. Wiki syntax is allowed:
   ___    _  __   ____     __ ______
  / _ \  | |/_/  /  _/ __ / //_  __/
 / , _/ _>  <   _/ /  / // /  / /   
/_/|_| /_/|_|  /___/  \___/  /_/
 
blog/how_to_stop_systemd_spamming_syslog_with_messages.txt · Last modified: 2017-04-05 09:00 by brb