Reputation: 43
i use
UserParameter=Firebird[*],F:\tools\zabbix_agent\firebird\Firebird.bat $1
How can I get for 1 run bat file two or more values?
Upvotes: 3
Views: 11367
Reputation: 791
You are looking for https://www.zabbix.com/documentation/3.4/manual/introduction/whatsnew340#bulk_metrics_and_dependent_items
reference: https://support.zabbix.com/browse/ZBXNEXT-3006 Has been merged .
Upvotes: 3
Reputation: 28724
It's impossible - it's zabbix agent architecture. One item = one value.
But you can use some workaround: 1.) zabbix_sender you script (bat file) implement your monitoring logic and collected metrics will be sent by zabbix_sender. These zabbix sender items must be Zabbix trapper type. You can send also many metrics in one go (see manual -i)
Manual: https://www.zabbix.com/documentation/2.4/manpages/zabbix_sender
Zabbix item will be type Zabbix trapper in this case.
2.) save value into file your script will save all collected metrics into tmp file and then you have to create special items for parsing this tmp file. Key vfs.file.regexp is the best for this job:
vfs.file.regexp[/tmp/file.txt,^(\w+),,,,\1]
vfs.file.regexp[/tmp/file.txt,^\w+ (\w+),,,,\1]
vfs.file.regexp[/tmp/file.txt,^\w+ \w+ (\w+),,,,\1]
vfs.file.regexp[/tmp/file.txt,^\w+ \w+ \w+ (\w+),,,,\1]
vfs.file.regexp[/tmp/file.txt,^\w+ \w+ \w+ \w+ (\w+),,,,\1]
Source: Zabbix external checks
3.) similar concept as 2nd one, but instead of file you will use shared memory it can be over engineering, but if you care about IOps.
I use https://gist.github.com/jangaraj/edc9dde939cbd577bbba for Raspberry Pi - system on SD card so I need to minimize IOPs. I'll store ping output into shared memory segment and then I'm parsing ping output from different items (ping.max, ping.avg, ping.min, ...)
Upvotes: 0