ZABBIX Forums  

Go Back   ZABBIX Forums > Zabbix Discussions and Feedback > Zabbix Help

Reply
 
Thread Tools Display Modes
  #1  
Old 07-10-2016, 14:07
zunam44 zunam44 is offline
Junior Member
 
Join Date: Oct 2016
Location: France
Posts: 2
Default 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.
Reply With Quote
  #2  
Old 13-10-2016, 14:45
zunam44 zunam44 is offline
Junior Member
 
Join Date: Oct 2016
Location: France
Posts: 2
Default 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.
Reply With Quote
Reply

Tags
discovery rule, item, metric, multiple, trapper

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:52.