Search code examples
xmlzabbix

Zabbix HTTP agent trim xml


Good day everyone!

New Zabbix 4.0 has HTTP agent, so you don't need to execute scripts anymore to get values from web-server.

Right now I have page with answer:

<boolean class=" FB_FW_ext BlitzScPluginAdapter">true</boolean>

I need to convert it to true-1 and false-0. I can use trim and Boolean to decimal, but it takes lots of steps (9 steps + 1 to convert).

enter image description here Is it possible to make less steps?


Solution

  • Use a regex to extract true or false, something like <.*>(.*)<.*>$(see here), then use a value map to convert true and false to 0 and 1