3

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?

xVlady
  • 33
  • 1
  • 1
  • 4

2 Answers2

3

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 .

ritzk
  • 761
  • 6
  • 3
0

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, ...)

Community
  • 1
  • 1
Jan Garaj
  • 25,598
  • 3
  • 38
  • 59
  • 1. zabbix_sender = trapper? – xVlady Dec 29 '14 at 12:35
  • 3. I will be very thankful for example, or a little more detailed direction? – xVlady Dec 29 '14 at 12:39
  • use String and Calculated items? (https://www.zabbix.com/documentation/2.2/manual/config/items/itemtypes/calculated) – xVlady Dec 29 '14 at 13:54
  • Yes, you can use string, but how do you want to parse string into values then with Calculated items - again it's not possible. Zabbix doesn't provide suitable parsing (sub)string functions for calculated items. – Jan Garaj Dec 30 '14 at 16:15
  • You can do it using runcached (run cached) https://bitbucket.org/sivann/runcached/overview . It automates caching the command output and parsing different parts of it. – sivann Feb 18 '15 at 18:47