0

I am executing an external check which returns me: OK 1 2 0 8 (This values will change every check)

Does anyone knows how can I separate this values into items?

Example:

External check status: OK
In use: 1
Busy: 2
Problem: 0
Free: 8

As each one of the above would be an item.

ledesma
  • 248
  • 1
  • 7
  • 18

1 Answers1

1

Unfortunately, it is currently not possible to destructure a received string value into parts using standard Zabbix means for all item types.

However, some items like vfs.file.regexp[] support applying a regular expression and capturing its output (see documentation for details). In this case, you could write the output of your script into a file and then create five items, approximately as follows:

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]
asaveljevs
  • 2,220
  • 1
  • 16
  • 13
  • Its not the best way... but it worked fine.. thanks... If someone knows another way please let us know. – ledesma Oct 13 '14 at 20:26