Ad Widget

Collapse

Zabbix discovery dead hosts detection

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jmalinovski
    Junior Member
    • May 2021
    • 1

    #1

    Zabbix discovery dead hosts detection

    Hello,

    Please someone explain to me how zabbix discovery works (not related with template's discovery).
    I've created discovery rule (for example discovery rule name "check smtp", check 192.168.0.0/24 subnet for tcp port 25 every 1 hour), and created discovery action - (when discovery rule == "check smpt", then add template "smtp" to host). Ok, zabbix found 192.168.0.1 host, applied discovery action and added this host to own database as discovered host. Success.
    But what happened, if 192.168.0.1 host goes south and removed from zabbix? In my case, zabbix marks this host as dead (not sure about lost or offline status, just red colour status in UI) and...applies discovery action again (creates this dead host in zabbix and adds "smtp" template). Ok, I've slightly modified discovery action rule to exclude dead hosts - when discovery rule == "check smpt" and (discovery status == Up or discovery status = Discovered), then add template "smtp" to host. Seems it works, zabbix doesn't recreate dead host again, but what happened if host is discovered and up and has
    been removed from zabbix database or "smtp" template has been removed unintentionally from host itself? Because host is alive and has running zabbix agent, zabbix will create empty host soon by autoregistration action, but discovery action "check smtp" will skip this host, because host still has status up and discovered in zabbix database. And the worst thing that it's hard to detect.
    The other oddity that I noticed, sometimes discovery actions overlaps each other in a strange way. For example one action adds template1 and host group1 and other action adds template2 and host group2 to host. After a while zabbix host has been discovered by both rules and has group1 and group2, but neither template1, nor template2. No idea.
    And how discovery rule works? If I'll create common discovery rule - "just remove all hosts with status == lost and offline status > 7d, this rule will never work, because has no discovery rule trigger ?
    So my question - is there any method to avoid dead hosts in zabbix discovery and keep full discovery functionality as well?
    Last edited by jmalinovski; 08-05-2021, 11:42.
Working...