Ad Widget

Collapse

Script and low level discovery

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ufocek
    Senior Member
    • Aug 2006
    • 161

    #1

    Script and low level discovery

    Hi,

    I have postgresql 9.4 and catalog pg_xlog I put on different disk

    Code:
    /dev/xvda1            7.6G  1.9G  5.4G  26% /
    tmpfs                 500M     0  500M   0% /lib/init/rw
    udev                  486M   88K  485M   1% /dev
    tmpfs                 500M  4.0K  500M   1% /dev/shm
    /dev/xvdc             5.0G  154M  4.6G   4% /var/lib/postgresql/9.4/main/pg_xlog
    Root partition is discovered with LLD but /var/lib/postgresql/9.4/main/pg_xlog not because I have permission denied. I can't change 0700, postgresql can't start after I change a permission.

    I create a simple script:
    Code:
    #!/bin/bash
    
    MOUNTPOINT='\/var\/lib\/postgresql\/9.4\/main\/pg_xlog'
    
    echo '{"data":[{"{#FSNAME}":"'$MOUNTPOINT'"}]'};
    I add to the zabbix_agentd.conf
    UserParameter=pxlog.disk,/usr/bin/sudo /home/zabbix/lld.sh


    When I checjk zabbix_get -s 192.168.1.143 -k pxlog.disk, I get result:
    Code:
    {"data":[{"{#FSNAME}":"\/var\/lib\/postgresql\/9.4\/main\/pg_xlog"}]}
    In zabbix I add a discovery rules on host:

    Type:zabbix_agent
    Keygxlog.disk
    Filters:{#FSTYPE} matches

    then I create a intem prototypes:
    vfs.fs.size[{#FSNAME},pfree]

    Unfortunately it does not work, and the question of where is the problem?
Working...