Ad Widget

Collapse

Reg. DNS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • deepak.sharma
    Junior Member
    • Apr 2014
    • 14

    #1

    Reg. DNS

    Hi to all..........
    Is there someone who can tell me, how can I see the dns query time made by zabbix client on zabbix server. Like we can see simply by using "dig" command. Watch out BOLD characters line below.

    dig yahoo.com
    ....
    ....
    .....

    ;; Query time: 2 msec
    ;; SERVER: 172.16.0.254#53(172.16.0.254)
    ;; WHEN: Thu May 22 17:58:57 2014
    ;; MSG SIZE rcvd: 174
  • aib
    Senior Member
    • Jan 2014
    • 1615

    #2
    zabbix_agentd.conf on Zabbix Server
    Code:
    UserParameter=dig_time[*], dig $1 | grep "Query time" | awk '{print $$4}'
    Zabbix Server Host configuration
    Code:
    Item: dig yahoo.com
    Type: Zabbix agent
    Key: dig_time[yahoo.com]
    Type of information: Numeric (unsigned)
    Data type: Decimal
    Units: ms
    ....
    Store Value: As is
    Show Value: As is
    Do you need any additional information?
    Sincerely yours,
    Aleksey

    Comment

    • deepak.sharma
      Junior Member
      • Apr 2014
      • 14

      #3
      Thanks aib, once again but I found a error in this it will not check whether a query made by client is correct or not. Kindly see the BOLD character below. Actually I want first to check ANSWER value i.e. it should be greater than zero and then find out the query time.

      dig yahoo.com

      ; <<>> DiG 9.9.3-rpz2+rl.13214.22-P2-Ubuntu-1:9.9.3.dfsg.P2-4ubuntu1.1 <<>> yahoo.com
      ;; global options: +cmd
      ;; Got answer:
      ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24964
      ;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

      dig yahoo.com123

      ; <<>> DiG 9.9.3-rpz2+rl.13214.22-P2-Ubuntu-1:9.9.3.dfsg.P2-4ubuntu1.1 <<>> yahoo.com123
      ;; global options: +cmd
      ;; Got answer:
      ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 42976
      ;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

      And is there any way by which I can see value of not every query made by client but for example average of 5 queries. So that I can calculate how much time it take a query to resolve in a given period. Lets say 10 queries are made in 1 min, thus i can say on a average each query has taken 6 sec to resolve.

      Comment

      • aib
        Senior Member
        • Jan 2014
        • 1615

        #4
        Hi there!

        Well, I see the typical consumer who change his mind every time...

        Anyway, you request is a little bit out of Zabbix ideology.
        Zabbix has the strong rule: one request - one answer.

        You cannot get two different values (ex. Amount of Answers & Query time) from one request.
        It has to be two different requests which completely destroy your plan, because the first DIG-request take 10 msec for real process and all consecutive requests will be serviced from cache for 0 msec each.

        I don't see any options for you to get the result which you dream about.

        Sorry.
        Sincerely yours,
        Aleksey

        Comment

        • deepak.sharma
          Junior Member
          • Apr 2014
          • 14

          #5
          Hi aib, thanks for reply. I got your point. But is there some way by which I can check that the dns I was trying to resolve is correct. As explained in my earlier post i.e. ANSWER value........

          Comment

          • aib
            Senior Member
            • Jan 2014
            • 1615

            #6
            You can create and external script which will collect all information from dig request and use zabbix_sender to put that information into Zabbix DB.
            Sincerely yours,
            Aleksey

            Comment

            Working...