Announcement

Collapse
No announcement yet.

Items return multiple values for each discovered elements

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Items return multiple values for each discovered elements

    Hi, i'm new in Zabbix and i'm testing the tools and it capabilities.

    I saw in the thread "Items return multiple values?" dated 30-12-2013 that it is possible to define a UserParameter script that collecte multiple values and have them send by the zabbix_send command to the server where trapper items have previously been defined. I tried this and it works fine.
    I have defined a discovery rules to retrieve a list of disks and then I would like for each disk to get several I/O stat metrics in one time. I mean to get a set of i/O stat metrics value for each disk the UserParameter script receives as input parameter. Actually, I don't know if it is possible to merge these two facilities: on one side the ability to retrieve multiple value with one UserParameter script (with item trapper on the server) and on the other side to have them retrived for a list of disks which has been filled with a discovery rules.
    Thank's a lot for any help.

    #2
    Found how to do

    Hi, I found how to do what I wanted.

    - First I defined a discovery rule named 'disk.discovery'.

    - The UserParameter script ‘disk_discovery.sh’ on the client returns something like
    {"data":[
    {"{#DDNAME}":"hdisk0"},
    {"{#DDNAME}":"hdisk1"},
    {"{#DDNAME}":"hdisk2"},
    {"{#DDNAME}":"hdisk3"}
    ]}

    - Then, I defined 2 "zabbix trapper" item prototypes
    io.readsvr[{#DDNAME}]
    io.writesvr[{#DDNAME}]

    - I defined a "zabbix active" item prototype named iostat[{#DDNAME}] item which point on a UserParameter C program that takes a disk name as input and return 2 values: the disk read service time and the disk write service time. Then each value is sent back to the appropriate “trapper item” prototype via the zabbix_send command.

    Comment

    Working...
    X