Ad Widget

Collapse

calculated item for autodiscovered data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • umask
    Junior Member
    • Apr 2011
    • 6

    #1

    calculated item for autodiscovered data

    Hi!

    I'm using zabbix 1.9.3 (alpha) which supports auto discovery of items.

    Please suggest me how I can create calculated item based on autodiscovered items.

    I was trying few times, but new item in result wasn't calculated.


    Unfortunately autodiscovery not supported on FreeBSDs zabbix-agentd , therefore I'm using zabbix-agentd.conf UserParameter like this:
    UserParameter=ufs_discovery,/sbin/mount -tufs | awk 'BEGIN{S="{\"ufs_discovery\":["} {DEV=$1; S=S "{\"{#FSMOUNTPOINT}\":\""$3"\",\"{#FSDEVICE\":\""D EV"\"},"} END{sub(/,$/,"",S); S=S "]}";print S}'

    which returns JSON data with mountpoints (FSDEVICE meaningless here).

    Zabbix server receive this JSON data and retrieve in next keys autodiscovered items:
    vfs.fs.size["{#FSMOUNTPOINT}",free]
    vfs.fs.size["{#FSMOUNTPOINT}",total]
    vfs.fs.size["{#FSMOUNTPOINT}",used]
    vfs.fs.size["{#FSMOUNTPOINT}",pfree]
    vfs.fs.size["{#FSMOUNTPOINT}",pused]
    etc.

    Due to bug https://support.zabbix.com/browse/ZBX-2966 I cant create triggers for all disks to monitor free (percent) disk space. Therefore I want to create workaround like calculated item.

    My calculated item is (it's second try):
    Type: calculated
    Key: free_space_percent_calculated.root
    Formula: 100*(last("vfs.fs.size[/,total]")-last("vfs.fs.size[/,used]"))/last("vfs.fs.size[/,total]")
    Type of information: Numeric (float)

    and don't work.

    I was tried another variant before (for all discovered items instead single variant above):
    Type: calculated
    Key: free_space_percent_calculated."{#FSMOUNTPOINT}"
    Formula: 100*(last("vfs.fs.size[{#FSMOUNTPOINT},total]")-last("vfs.fs.size[{#FSMOUNTPOINT},used]"))/last("vfs.fs.size[{#FSMOUNTPOINT},total]")
    Type of information: Numeric (float)

    I also tried other combinations with different quotes and quoting position, but nothing helped me.


    Is it possible create calculated item, based on autodiscovered items?
Working...