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
   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 :)

  1. What after data template creation?

  2. 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.

  3. Sean says:

    Hi Justin,

    Great instructions!!!

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





  4. Smithe230 says:

    Hmm it looks like your site ate my first comment it was extremely gfcdfdbekkgfdcad

  5. Hi please Create Graph template With XML Format Than Import to Cacti

  6. Any help with creating a corresponding graph template would be awesome. Having to try to figure it out on the go now.


Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">