Ad Widget

Collapse

zabbix active log file permission problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • conehead
    Junior Member
    • Nov 2019
    • 9

    #1

    zabbix active log file permission problem

    Hi,
    I work mostly on windows but i have a zabbix server for monitoring which works great. Recently i created a debian server and installed rsyslog on it to monitor some switches which is working as expected. But have a problem reading the logs from zabbix using the zabbix agent active. I am sure it is a permission problem but i am not sure how to resolve it. I allso tried reading the zabbix log files for which the user zabbix has the permissions and that is working.

    when i run the following command:
    sudo ls -all /var/log/remotelogs/

    i get to see the following permissions (for now i just want to test the 10.0.10.179.log for which syslog user and group is the owner.

    drwx------ 2 syslog syslog 4096 Mar 5 11:14 .
    drwxrwxr-x 10 root syslog 4096 Mar 5 11:49 ..
    -rw-r--r-- 1 syslog syslog 27304 Mar 5 12:09 10.0.10.179.log
    -rw-r--r-- 1 syslog syslog 1850429 Mar 5 12:17 127.0.0.1.log
    -rw-r--r-- 1 root root 50 Mar 5 11:14 test.log

    When i try to add that log to monitor in zabbix i allways get a permission denied which is logic because the user zabbix has no permission on that file. So i added the user zabbix to the syslog group by running

    usermod -a -G syslog zabbix

    But that is still not working

    when i run groups zabbix i get the following

    zabbix : zabbix adm syslog

    I allso tried running the agent as root following this procedure but problem remains

    9 Running agent as root (zabbix.com)

    My question: how to set the right permissions in order for zabbix to read the log files?

    thanks in advance
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    Your file already has read permissions for all (3x r there). As you list files via sudo, you probably lack some permissions on the directory, where those logfiles are. That "remotelogs" directory.
    Show us out put of "namei -mo /var/log/remotelogs/", if possible

    Comment

    • conehead
      Junior Member
      • Nov 2019
      • 9

      #3
      Hi, the result gave me the following

      : Click image for larger version

Name:	image.png
Views:	960
Size:	3.6 KB
ID:	480282

      Now i did an sudo chmod g+wrx /var/log/remotelogs
      result
      Click image for larger version

Name:	image.png
Views:	946
Size:	3.4 KB
ID:	480283
      But it is still not working and if i understand correctly syslog as a group should have all the rights on that folder

      the rights on the folder above

      Click image for larger version

Name:	image.png
Views:	941
Size:	2.7 KB
ID:	480284​​

      Comment

      • conehead
        Junior Member
        • Nov 2019
        • 9

        #4
        i restarted the zabbix agent and the results are coming in know

        thanks for the help, i think just the read rights would be sufficient

        Comment

        • cyber
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • Dec 2006
          • 4807

          #5
          To enter a directory and read files from it you need both r and x. so g+rx should have been enough.

          Comment

          Working...