I need to monitor the uptime of some objects (serial interfaces, PVCs) of a telecommunications equipment (multimedia router). There is a private snmp object that returns different strings for the status of these interfaces: when the interface is up, it returns DATA, and when it returns any other string (DOWN, IDLE, OFF, TEST, CALL) the interface is not transmitting and can be considered down.
I would like to set up an item that would graph the up (value 1) or down (value 0) state of the interface, in the same way as the ping simple check. I expected that this could be done by value mapping, but it does not seem to be available for text index.
So, I am trying to use the new preprocessing feature of new 3.4.1 zabbix version, with regular expression. I can get the DATA to 1 conversion using Regular expression pattern DATA and output 1,then Hexa to Numeric conversion, but I do not understand how to get the 0 value when the regular expression result is false.
I am new to regular expressions. I have tried to use regular expression numbered grouping (Pattern: (DATA)|(OFF|CALL|IDLE|TEST) ), but I do not understand how I could substitute 1 to \1 and 0 to \2 and get the result in the output for the group whose result is true. I thought that regular expression could easily make this type of substitutions. Would someone have an example of the way this can be done in Zabbix?
I would like to set up an item that would graph the up (value 1) or down (value 0) state of the interface, in the same way as the ping simple check. I expected that this could be done by value mapping, but it does not seem to be available for text index.
So, I am trying to use the new preprocessing feature of new 3.4.1 zabbix version, with regular expression. I can get the DATA to 1 conversion using Regular expression pattern DATA and output 1,then Hexa to Numeric conversion, but I do not understand how to get the 0 value when the regular expression result is false.
I am new to regular expressions. I have tried to use regular expression numbered grouping (Pattern: (DATA)|(OFF|CALL|IDLE|TEST) ), but I do not understand how I could substitute 1 to \1 and 0 to \2 and get the result in the output for the group whose result is true. I thought that regular expression could easily make this type of substitutions. Would someone have an example of the way this can be done in Zabbix?
Comment