Ad Widget

Collapse

ERROR: Zabbix log item permission denied - Zabbix Proxy 3.4

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lpossamai
    Senior Member
    • Jun 2018
    • 119

    #1

    ERROR: Zabbix log item permission denied - Zabbix Proxy 3.4

    Hey guys.

    I'm trying to get PostgreSQL's logs to Zabbix, but only when a certain expression is found.
    Code:
    MESSAGE: Thu Sep 13 18:52:29 AEST 2018 sending [/pgsql/main/pg_wal/000000010000001F0000006A] to [proddb2.datacentre.com] /data/wal_archive
    So, on Zabbix, I've created the following item for that:
    Code:
    log[/var/lib/zabbix/postgresql-10.log,"proddb2.datacentre.com",,,,\1]
    - Being "proddb2.datacentre.com " the filtered expression.

    Click image for larger version

Name:	Screen Shot 2018-09-13 at 9.14.10 PM.png
Views:	4840
Size:	28.3 KB
ID:	365732

    On the host that I'm trying to get the logs from, zabbix_agent.conf is like this; where "192.168.1.13" is the Zabbix-Proxy on that network:
    Code:
    Server=192.168.1.13
    ServerActive=192.168.1.13
    However, I am getting this error:
    Code:
      1176:20180913:191003.525 suppressing log(rt) processing error #2: Cannot open file "/var/lib/zabbix/postgresql-10.log": [13] Permission denied
    But I can access that log file as the Zabbix user:
    Code:
    [root@proddb ~]# su - zabbix
    [zabbix@proddb ~]$ tail -n 5 /var/lib/zabbix/postgresql-10.log 
    2018-09-13 19:09:11 AEST [11011]: [742-1] user=,db=,app=,client=LOG:  checkpoint complete: wrote 860 buffers (0.2%); 0 WAL file(s) added, 0 removed, 1 recycled; write=86.012 s, sync=0.004 s, total=86.024 s; sync files=28, longest=0.001 s, average=0.000 s; distance=6795 kB, estimate=6795 kB
    2018-09-13 19:12:45 AEST [11011]: [743-1] user=,db=,app=,client=LOG:  checkpoint starting: time
    2018-09-13 19:14:42 AEST [11011]: [744-1] user=,db=,app=,client=LOG:  checkpoint complete: wrote 1166 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=116.572 s, sync=0.003 s, total=116.581 s; sync files=28, longest=0.000 s, average=0.000 s; distance=9251 kB, estimate=9251 kB
    2018-09-13 19:17:45 AEST [11011]: [745-1] user=,db=,app=,client=LOG:  checkpoint starting: time
    2018-09-13 19:18:23 AEST [11011]: [746-1] user=,db=,app=,client=LOG:  checkpoint complete: wrote 383 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=38.397 s, sync=0.004 s, total=38.407 s; sync files=28, longest=0.000 s, average=0.000 s; distance=2980 kB, estimate=8624 kB
    So, I am not sure why Zabbix keeps saying it can't access it when it looks like it can?
    Does anybody have any idea on this, please?
  • DmitryL
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2016
    • 278

    #2
    rhel with selinux enabled?

    Comment

    • lpossamai
      Senior Member
      • Jun 2018
      • 119

      #3
      Originally posted by Dmitryb
      rhel with selinux enabled?
      Code:
      [B][root@proddb ~]#[/B] cat /etc/selinux/config 
      SELINUX=disabled
      SELINUXTYPE=targeted
      
      [B][root@proddb ~]#[/B] getenforce
      Disabled
      Selinux is disabled...

      Comment

      • lpossamai
        Senior Member
        • Jun 2018
        • 119

        #4
        FYI:

        I was able to get it working by changing
        Code:
        AllowRoot = 0 to AllowRoot = 1
        .

        Comment

        Working...