How to Setup DNS Monitoring with the dnsMonitor ZenPack.
From SysAdminWiki
Here is a tutorial which explains how to setup DNS monitoring using the DnsMonitor-zenoss--1.0.0-el5-i686.zip zenpack. The methods should be similar for older and future releases however.
- 1. Download and install the ZenPack from here. If your not sure how to install a ZenPack yet follow this article.
- 2. Once installed you will have a new datasource available to you called dnsMonitor. So lets start by creating a new template under the /Devices/Server section.
- Once under /Devices/Server click on the Templates Tab. This is a list of templates currently associated with all the servers you put here. We are going to add a new one.
- Click the drop down arrow next to Available Performance Templates and select Add New Template.
- Name each monitor something unique. I went with dnsMonitor - <dnsservername>. Ex. dnsMonitor - jugface.domain.com.
- Your new template should show up in the list. Click on it to go to the actual template itself.
- 3. Next we are going to build the template.
- Under Description put "Real time DNS Monitor and Performance Graphs." Click Save.
- Click the drop down menu next to Data Sources and select Add DataSource.
- From the Add a New DataSource Box type a name of dnsRtime-dns1. Note: i would change -dns1 to the name of your dns server. dnsRtime-hector would be an example.
- In the Type box choose dnsMonitor and hit OK.
- 4. You should now be in Data Source properties. Here we will set the values of our dns server, url to check (hostname) and the expected ip address the host should resolve to.
- So under Name it would be dnsRtime-dns1 in our case.
- Source Type should be dnsMonitor.
- Enabled should be True.
- Component can be set to dns_monitor.
- Event Class should be set to /Net/NS (nameserver)
- Event Key can be blank.
- Severity should be set accordingly. In my case its critical if it fails.
- Timeout i left at 15 seconds.
- Cycletime i left at 300 seconds.
- Hostname: set this to the url you will want to lookup. Ex. www.sysadminwiki.net.
- DNS Server: set this to the IP of your DNS Server you want to test.
- Expected URL: set this to the IP you expect the hostname to resolve to. Our case for sysadminwiki.net would be 208.113.253.69.
- Click Save. Notice you now have a new datapoint called 'time' below under datapoints.
Note: you may want to test more than 1 website against your given dns server. I actually test 4. So repeat these steps to add a couple more datapoints for some different websites. All the settings will be the same except the actual DataSource name, Hostname and Expected url.
- 5. Next we will want to go back to the Template Overview page. Easiest way to do this is look above the Data Source tab and you will see your current path. Click the link for /dnsMonitor - dns1 and you will be brought to the Overview. Next we are going to setup the graphs for the response time.
- Click on Add Graph from the drop down menu next to Graphs.
- Name the graph: DNS Response Time - dns1
- On the Graph Definitions tab click the drop down next to Graph Points and select Add DataPoint.
- If you did the above steps correctly you will see a point for each datasource defined. Click the appropiate ones. In our case dnsRtime-dns1_time. Select it and hit ok. If you have more points add them the same way. Mine has a total of 4 points, one for each website tested.
- Under units set it to 's' for seconds.
- 6. Ok so thats about all you need to do get the realtime monitoring and graphing working for DNS. Setting thresholds is not covered where they will be specific for your needs and i'm feeling somewhat winded at this point. I might explain later. All you need to do now is apply the template to whatever device you want this to run on. This is done by navigating to your device, and clicking on the drop down next to Status. Then click More -> Templates.
- 7. Click the drop down next to Performance Templates and click Add Template.
- Type in dnsMonitor - dns1 and hit OK. Note Substite name if needed.
- 8. Wait some time check out the perf tab of your device for the graphs.
Other Useful Info
The dnsMonitor uses the check_dns plugin behind the scenes. To get more info regarding it run the following command.
$ cd $ZENHOME/libexec $ ./check_dns --help
