Cacti – DNS response time

When you google for a cacti template for DNS response time, there’s not a whole lot out there, and what is; is pretty out dated or involves too much fidgetry.

This post assumes you’re comfortable with cacti – you should be able to at least initialize a graph and fill one in using datasources for a host. Must also be using linux. BSD has a different pecking order of commands.

This guide shows you how to slap together a quick DNS response data input method that will allow you to setup graphs on a nameserver/domain pair granularity. (Meaning, you can graph the same domain across several NS’s, or vice versa).

So here’s a quick rundown on creating a “data input method” and a “data template” for cacti to utilize for your nameservers.

1. Create a new data input method
1a.
   Name: (anything you want)
   Input type: Script/Command
   Input string:

The 1-liner above should get you the msec for given domain (dom) at given nameserver (ns). To test completely, replace the dom and ns lines with something valid:

   1b. Add the two ‘input fields’, ns and dom.
   1c. Add “ResponseTime” as an ‘output field’.

If done correctly, it should look similar to this:

2. Create the data template – Fill out the values to look similar to the screenshot below. Note, you will probably have to hit ‘create’ after selecting the data input method under “data source”. This will detect the “output field” for the “Data Source Item” values.

Here’s what one of mine looks like:

 I’ve omitted the target host/ns from this example image of course :)

6 thoughts on “Cacti – DNS response time

  1. After you've made the data template,
    create a graph that will plot the response time. (if I get time I'll dump the XML from mine and add it to the post.)

    Then, add your data demplate to an existing 'device'/'host', or create a new one and use it.

    Then, create the graph for that host like your normally would using it's data source.

  2. Hi Justin,

    Great instructions!!!

    Unfortunately I know next to nothing about XML, I too was hoping you would publish the XML –

     

    Regards,

    Sean

     

Leave a Reply

Your email address will not be published. Required fields are marked *