A
A
Anton B2016-03-03 10:56:59
Zabbix
Anton B, 2016-03-03 10:56:59

Is it possible to pass an argument from the node to the zabbix template?

Hello!
Zabbix 2.4
Let's say I have a template for getting SMART information: smart.get[sda,param].
There are servers that have two disks sda, sdb, who has 4 - sda - sdc.
Now in the template I prescribe all the disk options, but is it possible to somehow transfer the names of the disks from the node to the template for verification?
The same applies to triggers, for some servers some values ​​are critical, for others - others, can these values ​​be transferred from nodes?
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konkase, 2016-03-03
@bigton

Use auto discovery https://www.zabbix.com/documentation/2.4/manual/di...
For smart, you can do this:

JSON="{ \"data\":["
SEP=""; 
for DEV in `smartctl --scan | awk '{print $1}'`; do 
 JSON=$JSON"$SEP{\"{#HDNAME}\":\"$DEV\"}"
 SEP=", "
done
JSON=$JSON"]}"
echo $JSON

T
Talik, 2016-04-07
@Talik0507

I don't quite understand what you are doing. Look towards "Discovery Rules" inside templates. If I understand the problem correctly

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question