Need to change permissions on Log files permanently

jtoninger

Dabbler
Joined
Aug 29, 2018
Messages
13
Hi There,

I am trying to set up a zabbix monitoring server, and one of the things I would like to monitor is the logs coming from my FreeNAS/TrueNAS boxes.

I am able to get this working except for the fact that I require the system logs to be set to enable read access to the 'wheel' group. However by default /var/log/messages is set for only the root user to have read or write perms.

Obviously any changes I make to the permissions of the messages logfile are lost after a reboot.

Is there any way to either move the logfile to a directory I can set permissions in persistently, or change the permissions on the logfiles themselves so they apply persistently?

Thanks
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
You could brute-force it with a post-init task to change the permissions, and also a nightly cron job to do the same. However, why not just forward the logs via syslog to your Zabbix box?
 

jtoninger

Dabbler
Joined
Aug 29, 2018
Messages
13
Zabbix seems not that well set up as a syslog server. I could set up a seperate syslog server on the zabbix server but I have no idea how I would pass that to the Zabbix manager. Based on their documentation its meant to rely on the agent software to pass the logs along, I was actually able to get the agent software installed persistently, so everything aside from reading logfiles. The zabbix agent runs with a Zabbix user account, which is why it cannot read the messages logfile. Switching it to run as root seems like a bad idea so I probably will avoid that.
 
Top