Hi, I'm struggling with discovery action, I want exclude from network discovery hosts with sysname like "POP", "RT-SCM", "SCM", looks pretty simple but isnt working and I'll apreciate some tips if possible.
I have a discovery network rule checking 172.20.0.0/24 and only SNMPv2 agent "1.3.6.1.2.1.1.5.0" (aka SNMPv2-MIB::sysName.0) and this is the uniqueness criteria, and a action rule this way:
Looking the logs, for me looks like he is receiving empty value to compare with the filters, I'm doing something wrong?
Thanks!
The logs:
Looking the logs, to me looks like he's receiving empty value to compare with the strings, am I doing something worng?
I have a discovery network rule checking 172.20.0.0/24 and only SNMPv2 agent "1.3.6.1.2.1.1.5.0" (aka SNMPv2-MIB::sysName.0) and this is the uniqueness criteria, and a action rule this way:
Code:
Discovery check = 172.20.0: SNMPv2 agent "1.3.6.1.2.1.1.5.0" Discovery rule = 172.20.0 Received value not like ^POP Received value not like ^RT-SCM Received value not like RT-SCM Received value not like rt-scm Received value not like pop Received value not like POP
Thanks!
The logs:
Code:
268:20170725:145409.008 In process_check() 268:20170725:145409.008 process_check() port:161 268:20170725:145409.008 In discover_service() 268:20170725:145409.008 In substitute_simple_macros() data:'r0ut3rb0ard' 268:20170725:145409.008 In substitute_key_macros() data:'1.3.6.1.2.1.1.5.0' 268:20170725:145409.008 End of substitute_key_macros():SUCCEED data:'1.3.6.1.2.1.1.5.0' 268:20170725:145409.008 In get_values_snmp() host:'' addr:'172.20.0.9' num:1 268:20170725:145409.008 In zbx_snmp_open_session() 268:20170725:145409.008 SNMP [[email protected]:161] 268:20170725:145409.008 End of zbx_snmp_open_session() 268:20170725:145409.008 In zbx_snmp_process_standard() 268:20170725:145409.008 In zbx_snmp_translate() oid:'1.3.6.1.2.1.1.5.0' 268:20170725:145409.008 End of zbx_snmp_translate() oid_translated:'1.3.6.1.2.1.1.5.0' 268:20170725:145409.008 In zbx_snmp_get_values() num:1 level:0 268:20170725:145409.010 zbx_snmp_get_values() snmp_synch_response() status:0 s_snmp_errno:0 errstat:0 mapping_num:1 268:20170725:145409.010 In zbx_snmp_set_result() type:4 value_type:1 data_type:0 268:20170725:145409.010 In zbx_snmp_get_octet_string() 268:20170725:145409.010 zbx_snmp_get_octet_string() full value:'STRING: POP Granja 4 Irmaos: C.E.' hint:'255a' 268:20170725:145409.010 End of zbx_snmp_get_octet_string():'POP Granja 4 Irmaos: C.E.' 268:20170725:145409.010 End of zbx_snmp_set_result():SUCCEED 268:20170725:145409.010 End of zbx_snmp_get_values():SUCCEED 268:20170725:145409.010 End of zbx_snmp_process_standard():SUCCEED 268:20170725:145409.010 In zbx_snmp_close_session() 268:20170725:145409.010 End of zbx_snmp_close_session() 268:20170725:145409.010 End of get_values_snmp() 268:20170725:145409.010 End of discover_service():SUCCEED 268:20170725:145409.010 query [txnlev:1] [begin;] 268:20170725:145409.011 In DBlock_record() 268:20170725:145409.011 query [txnlev:1] [select null from dchecks where dcheckid=3 and druleid=2 for update] 268:20170725:145409.012 End of DBlock_record():SUCCEED 268:20170725:145409.012 In discovery_update_service() ip:'172.20.0.9' dns:'pop-granja-4-irmaos.noc.dns' port:161 status:0 value:'POP Granja 4 Irmaos: C.E.' 268:20170725:145409.012 In discovery_register_host() ip:'172.20.0.9' status:0 value:'POP Granja 4 Irmaos: C.E.' 268:20170725:145409.012 query [txnlev:1] [select dh.dhostid,dh.status,dh.lastup,dh.lastdown from dhosts dh,dservices ds where ds.dhostid=dh.dhostid and ds.dcheckid=3 and ds.value='POP Granja 4 Irmaos: C.E.' order by dh.dhostid] 268:20170725:145409.014 host at 172.20.0.9 is already in database 268:20170725:145409.014 End of discovery_register_host() 268:20170725:145409.014 In discovery_register_service() ip:'172.20.0.9' port:161 key:'1.3.6.1.2.1.1.5.0' 268:20170725:145409.014 query [txnlev:1] [select dserviceid,dhostid,status,lastup,lastdown,value,dns from dservices where dcheckid=3 and type=11 and key_='1.3.6.1.2.1.1.5.0' and ip='172.20.0.9' and port=161] 268:20170725:145409.015 service is already in database 268:20170725:145409.015 End of discovery_register_service() 268:20170725:145409.015 In discovery_update_service_status() 268:20170725:145409.015 In process_events() events_num:1 268:20170725:145409.015 In correlate_events_by_default_rules() 268:20170725:145409.015 End of correlate_events_by_default_rules() 268:20170725:145409.015 In DCget_nextid() table:'events' num:1 268:20170725:145409.015 End of DCget_nextid() table:'events' [488331:488331] 268:20170725:145409.015 query [txnlev:1] [insert into events (eventid,source,object,objectid,clock,ns,value) values (488331,1,2,188,1501005249,0,0); ] 268:20170725:145409.016 In process_actions() events_num:1 268:20170725:145409.016 In zbx_dc_get_actions_eval() 268:20170725:145409.016 End of zbx_dc_get_actions_eval() actions:2 268:20170725:145409.016 In check_action_conditions() actionid:8 268:20170725:145409.016 In check_action_condition() actionid:8 conditionid:26 cond.value:'RT-SCM' cond.value2:'' 268:20170725:145409.016 In check_discovery_condition() 268:20170725:145409.016 query [txnlev:1] [select value from dservices where dserviceid=188] 268:20170725:145409.017 End of check_discovery_condition():SUCCEED 268:20170725:145409.017 End of check_action_condition():SUCCEED 268:20170725:145409.017 In check_action_condition() actionid:8 conditionid:13 cond.value:'2' cond.value2:'' 268:20170725:145409.017 In check_discovery_condition() 268:20170725:145409.017 query [txnlev:1] [select h.druleid from dhosts h,dservices s where h.dhostid=s.dhostid and h.druleid=2 and s.dserviceid=188] 268:20170725:145409.018 End of check_discovery_condition():SUCCEED 268:20170725:145409.019 End of check_action_condition():SUCCEED 268:20170725:145409.019 In check_action_condition() actionid:8 conditionid:12 cond.value:'3' cond.value2:'' 268:20170725:145409.019 In check_discovery_condition() 268:20170725:145409.019 query [txnlev:1] [select dcheckid from dservices where dcheckid=3 and dserviceid=188] 268:20170725:145409.020 End of check_discovery_condition():SUCCEED 268:20170725:145409.020 End of check_action_condition():SUCCEED 268:20170725:145409.020 End of check_action_conditions():SUCCEED 268:20170725:145409.020 In execute_operations() actionid:8 268:20170725:145409.020 query [txnlev:1] [select o.operationtype,g.groupid,t.templateid,oi.inventory_mode from operations o left join opgroup g on g.operationid=o.operationid left join optemplate t on t.operationid=o.operationid left join opinventory oi on oi.operationid=o.operationid where o.actionid=8] 268:20170725:145409.021 End of execute_operations() 268:20170725:145409.021 In DCget_nextid() table:'escalations' num:1 268:20170725:145409.021 End of DCget_nextid() table:'escalations' [18985:18985] 268:20170725:145409.021 query [txnlev:1] [insert into escalations (escalationid,actionid,status,triggerid,itemid,eventid,r_eventid) values (18985,8,0,null,null,488331,null); ] 268:20170725:145409.022 End of process_actions() 268:20170725:145409.022 End of process_events() 268:20170725:145409.022 End of discovery_update_service_status() 268:20170725:145409.022 End of discovery_update_service() 268:20170725:145409.022 query [txnlev:1] [commit;] 268:20170725:145409.024 End of process_check() 268:20170725:145409.024 query [txnlev:0] [select dcheckid,type,key_,snmp_community,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,snmpv3_authprotocol,snmpv3_privprotocol,ports,snmpv3_contextname from dchecks where druleid=2 and dcheckid<>3 order by dcheckid] 268:20170725:145409.026 query [txnlev:1] [begin;] 268:20170725:145409.027 In DBlock_record() 268:20170725:145409.027 query [txnlev:1] [select null from drules where druleid=2 for update] 268:20170725:145409.027 End of DBlock_record():SUCCEED 268:20170725:145409.027 In discovery_update_host() 268:20170725:145409.027 In process_events() events_num:1 268:20170725:145409.027 In correlate_events_by_default_rules() 268:20170725:145409.027 End of correlate_events_by_default_rules() 268:20170725:145409.027 In DCget_nextid() table:'events' num:1 268:20170725:145409.027 End of DCget_nextid() table:'events' [488332:488332] 268:20170725:145409.027 query [txnlev:1] [insert into events (eventid,source,object,objectid,clock,ns,value) values (488332,1,1,5,1501005249,0,0); ] 268:20170725:145409.028 In process_actions() events_num:1 268:20170725:145409.028 In zbx_dc_get_actions_eval() 268:20170725:145409.029 End of zbx_dc_get_actions_eval() actions:2 268:20170725:145409.029 In check_action_conditions() actionid:8 268:20170725:145409.029 In check_action_condition() actionid:8 conditionid:26 cond.value:'RT-SCM' cond.value2:'' 268:20170725:145409.029 In check_discovery_condition() 268:20170725:145409.029 End of check_discovery_condition():FAIL 268:20170725:145409.029 End of check_action_condition():FAIL 268:20170725:145409.029 In check_action_condition() actionid:8 conditionid:28 cond.value:'pop' cond.value2:'' 268:20170725:145409.029 In check_discovery_condition() 268:20170725:145409.029 End of check_discovery_condition():FAIL 268:20170725:145409.029 End of check_action_condition():FAIL 268:20170725:145409.029 In check_action_condition() actionid:8 conditionid:29 cond.value:'POP' cond.value2:'' 268:20170725:145409.029 In check_discovery_condition() 268:20170725:145409.029 End of check_discovery_condition():FAIL 268:20170725:145409.029 End of check_action_condition():FAIL 268:20170725:145409.029 In check_action_condition() actionid:8 conditionid:27 cond.value:'rt-scm' cond.value2:'' 268:20170725:145409.029 In check_discovery_condition() 268:20170725:145409.029 End of check_discovery_condition():FAIL 268:20170725:145409.029 End of check_action_condition():FAIL 268:20170725:145409.029 In check_action_condition() actionid:8 conditionid:13 cond.value:'2' cond.value2:'' 268:20170725:145409.029 In check_discovery_condition() 268:20170725:145409.029 query [txnlev:1] [select druleid from dhosts where druleid=2 and dhostid=5] 268:20170725:145409.029 End of check_discovery_condition():SUCCEED 268:20170725:145409.029 End of check_action_condition():SUCCEED 268:20170725:145409.029 End of check_action_conditions():FAIL 268:20170725:145409.030 End of process_actions() 268:20170725:145409.030 End of process_events() 268:20170725:145409.030 End of discovery_update_host()