[ZBXNEXT-2250] Evaluating NULL values in trigger (Combine SNMP-trap item and and SNMP-get item in one trigger expression) Created: 2014 Apr 10 Updated: 2016 Oct 07 Resolved: 2016 Oct 07 |
|
Status: | Closed |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | Server (S) |
Affects Version/s: | 2.2.2, 2.2.3 |
Fix Version/s: | None |
Type: | New Feature Request | Priority: | Major |
Reporter: | Vitaly Zhuravlev | Assignee: | Unassigned |
Resolution: | Duplicate | Votes: | 0 |
Labels: | null, snmp, snmptraps, trigger | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: |
![]() ![]() |
||||||||
Issue Links: |
|
Description |
I'm trying to create one neat trigger for IF-MIB port operational status monitoring, This Trigger is ON when either: ifOperStatus.["1"].last(0)}=2) OR host:snmptrap[interface\s1].str(down)}=1
Trigger is OFF when Complete trigger expression is for if1: ({host:snmptrap[interface\s1].str(down)}=1 & {host:snmptrap[interface\s1].nodata(600)}=0) | ({host:ifOperStatus.["1"].last(0)}=2 & {host:snmptrap[interface\s1].nodata(600)}=1) This trigger is attached to the switch template that is universal. Some switches send traps and some of them don't. Trigger like this gives me all the benefits from SNMP polling and SNMP traps:
But there is one little problem that blocks this trigger from proper working: Problem is that when zabbix never receives a trap from the switch for that interface (since there is individual snmp-trap item for every interface index) Trigger is never evaluated since part of expression: snmptrap[interface\s1] item's last value is NULL (trap is never received) Once you receive a single trap - it's all fine from that moment ___________________________ I suggest: Make evaluation of trigger's expression like: host:snmptrap[interface\s1].str(down)} to return 1 (TRUE) if there are no values collected for that item ( so the triggers are in OK status not UNKNOWN in such a case |
Comments |
Comment by Oleksii Zagorskyi [ 2014 Apr 11 ] |
I don't think that your suggestion could be accepted. Take into account please |
Comment by Vitaly Zhuravlev [ 2014 Apr 11 ] |
Ok, but Completetrigger expression has logical OR. And other part is gathered and evaluated. So in the beggining when no trap was received it's like: ({host:snmptrap[interface\s1].str(down)}=1 & {host:snmptrap[interface\s1].nodata(600)}=0) | ({host:ifOperStatus.["1"].last(0)}=2 & {host:snmptrap[interface\s1].nodata(600)}=1) _____________________________________________________________________ evaluate to: (UNKNOWN & UNKNOWN) Is this illogical to evaluate nodata() as TRUE here as well? Because NULL looks like nodata to me) (UNKNOWN & TRUE) Because two parts are diveded by OR , I agree that things like trigger evaluation affect core logic of the Zabbix and changes must be thought through. |
Comment by Oleksii Zagorskyi [ 2014 Apr 11 ] |
Well, in issue description you wrote:
in a comment above you wrote:
So you mentioned two very different functions. |
Comment by Vitaly Zhuravlev [ 2014 Apr 11 ] |
Neither function str() or nodata() are evaluated if they never receive any value in the past. So you were saying that make str() to be TRUE is illogical in this case. |
Comment by Vitaly Zhuravlev [ 2016 Oct 07 ] |
This is actually was solved in 3.2 |
Comment by Oleksii Zagorskyi [ 2016 Oct 07 ] |
Issue which did not change anything in zabbix code, should not be closed as Fixed |
Comment by Oleksii Zagorskyi [ 2016 Oct 07 ] |
Figured out, Vitaly considers it resolved by |