Ad Widget

Collapse

Custom Checks

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rbourgaize
    Junior Member
    • Mar 2019
    • 2

    #1

    Custom Checks

    OK, so I am at a loss here.
    Got Zabbix running well, ICMP queries, agent installs and some SNMP stuff. Bloody marvellous stuff!
    But something that I feel should be so simple, is causing me so much of a headache.
    I monitor multiple DNS servers, which due to the nature of the environment they sit it, it is not feasible to have an agent installed on them. All I want to do, is to run a 'dig +short hostname @serverIwantTOtest' against multiple DNS servers. Then compare the result of this against a predefined answer.

    So for example:
    "dig +short www.bbc.net.uk"
    if answer is not 212.58.249.215
    then alert

    But for the life of me, I just cant seem to figure out how to do it.

    If it helps, I am running Zabbix 4

    Many thanks to anyone that can help.
  • max.ch.88
    Senior Member
    • Oct 2018
    • 206

    #2

    You could use the item net.dns.record[<ip>,name,<type>,<timeout>,<count>,<protocol>] or write own script and use it over userparameter https://www.zabbix.com/documentation...userparameters

    Comment

    • rbourgaize
      Junior Member
      • Mar 2019
      • 2

      #3
      Hi Max,

      Thank you for this.
      For example, checking Google's DNS (8.8.8.8) is resolving, what I did was :

      - On Zabbix server, configure the zabbix_agent.conf with:
      UserParameter=ns1dig.dns,dig cisco.co.uk +short @8.8.8.8

      - On Zabbix WebGUI, create a host named 'GoogleDNS' with the Agent Interface IP as the Zabbix server (essentially using the local agent on the server)

      - In the 'GoogleDNS' host, create a new Item:
      Name = DNS Check
      Type = Zabbix Agent
      Key = ns1dig.dns
      Update Interval = 30s

      - In the 'GoogleDNS' host, create a new trigger:
      Name = Name Resolution Failed
      Severity = High
      Expression = {GoogleDNS:ns1dig.dns.str(72.163.4.154,#2)}=0
      OK Event = Expression
      Problem event = Single
      OK Event = All Problems
      Description = DNS Server has failed to resolve DNS query 2 times in a row.

      This now flags an alarm if the DNS resolver fails twice in a row, which can be adjusted by changing the '#2' to any number in the Expression.

      So this works really well which I have now used for some of my DNS hosts, but will take quite a bit of time to do for my 20+ other DNS servers. Any idea on how I could apply this as a template? If not, your advice for this has been very helpful, an I will continue to use it in this way.

      Comment

      • max.ch.88
        Senior Member
        • Oct 2018
        • 206

        #4
        You will get the same result using the item with key net.dns.record[<ip>,name,<type>,<timeout>,<count>,<protocol>]. In that case you don't need to write the userparameter.
        I would advise to create a new template with the item net.dns.record[8.8.8.8,{HOST.HOST},A] and to link it to hosts with names like cisco.co.uk, www.bbc.net.uk ...

        Comment

        Working...