I want to have something like this in a trigger (using Zabbix 7.2):
except the 51,61,91 part should be customizable through a user macro.
Writing something like
does not work, because the value of the user macro gets quoted as a single string argument instead of being split to multiple arguments.
I have been able to implement the desired behavior using the count() function with the "regexp" matching:
with {$PSU.HH3C.STATUS.CRIT.MATCHES} containing something like ^(51|61|91)$.
Is there any better way to do that, or would the regexp matching be the only solution here?
(Actually this solution is more versatile than in(last(...),...), because it is possible to check more than a single value from history; could the regexp matching be a performance problem here?)
The stock template does things like
which allows customization of the numeric values, but does not allow adding extra matching values.
Code:
in(last(//sensor.psu.status[hh3cEntityExtErrorStatus.9]),51,61,91)
Writing something like
Code:
in(last(//sensor.psu.status[hh3cEntityExtErrorStatus.9]),{$PSU.HH3C.STATUS.CRIT.VALUES})
I have been able to implement the desired behavior using the count() function with the "regexp" matching:
Code:
count(//sensor.psu.status[hh3cEntityExtErrorStatus.9],#1,"regexp",{$PSU.HH3C.STATUS.CRIT.MATCHES})>=1
Is there any better way to do that, or would the regexp matching be the only solution here?
(Actually this solution is more versatile than in(last(...),...), because it is possible to check more than a single value from history; could the regexp matching be a performance problem here?)
The stock template does things like
Code:
count(/HP Comware HH3C by SNMP/sensor.psu.status[hh3cEntityExtErrorStatus.{#SNMPINDEX}],#1,"eq","{$PSU_CRIT_STATUS:\"psuError\"}")=1