1

All of the servers in my network are running a Zabbix agent for monitoring, and some of the additional items I've added to them require the use of sudo to execute. Normally this isn't that bad, but for one in particular, this results in about 75 lines every minute in the journal relating to it's usual data gathering.

Is there any way to specifically tell sudo to not log anything for a particular user?

I tried adding

Defaults:zabbix logfile=/dev/null

to my sudoers file, which stopped the session opened and session closed log lines, but isn't stopping this mess:

sudo[12424]:   zabbix : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=...
sudo[12433]:   zabbix : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=...
sudo[12435]:   zabbix : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=...
sudo[12437]:   zabbix : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=...
sudo[12449]:   zabbix : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=...
sudo[12459]:   zabbix : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=...
sudo[12465]:   zabbix : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=...
sudo[12467]:   zabbix : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=...
3
4

Using visudo, you can add this line to your syslog configuration to disable all logging for user zabbix:

Defaults: zabbix  !syslog
1
  • Just a note, that I almost forgot: Shortly after doing this, Zabbix's sessions were hanging and tying up a lot of resources. It turns out that with !syslog, a sudo attempt would hang, indefinitely. A probably incorrect workaround I found was to just drop the lines before recording them using an rsyslog action. – Jackson W Jan 13 at 10:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.