This is an old revision of the document!
RetDS
Author | Wim Nelis |
---|---|
Compatibility | Xymon 4.2 |
Requirements | Perl |
Download | None |
Last Update | 2015-03-17 |
Description
Script retds.pl retrieves the DNS statistics of both BIND named servers and windows DNS servers. A table within this script specifies which statistics are to be extracted and defines the RRD file name and the DS name of these statistics at the same time. The DNS servers to be monitored by this script are defined in the Xymon hosts.cfg file, using keyword RNAMED.
Script retds.pl is a rewrite (in Perl) of script xymon-rnamedstats.sh written by Jerimy Laidman. It is extended to handle Windows DNS servers as well.
Script retds.pl is a server-side script. In keyword RNAMED the parameter 'cmd' is used to retrieve the statistics from the DNS server. It's usage for BIND and it's usage for Windows DNS are different. In case of BIND, the command specified should build a session to a shell running on the server involved. Then the command “cat <statsfile>” is sent to this shell to retrieve the statistics. In case of Windows DNS, the command should result in the statistics to be written to standard output.
Installation
Although script retds.pl is a server-side script, there is some work to do at the client-side as well.
Client side on a BIND server
For a BIND server, periodically the BIND statistics need to be extracted and saved in a file, which can be retrieved by script retds.pl. Typically there will be an entry in crontab for user root which drops the statistics in a file, which is readable by a non-root user.
For example, the statistics could be collected using the following crontab entry of user root:
0-55/5 * * * * /usr/bin/rdnc stats ; mv /var/named/data/named_stats.txt ~AUser/named.stats
The associated RNAMED keyword in the Xymon hosts.cfg is:
RNAMED:”cmd(ssh -T AUser@%{H} 2>/dev/null),statsfile(named.stats)”
Client side on a Windows DNS server
For a Windows DNS server, the command specified in keyword RNAMED should deliver the DNS statistics to standard output. A Windows DNS server does not include the time of retrieval in the statistics, but this information is needed to confirm that the process collecting the statistics is still refreshing the statistics. Therefore, the date and the time need to be added. The first line of the result should contain the date at which the statistics are collected, and the second line the time of day. The following lines contain the output of the `dnsstat` command.
One possible solution is to use a special webpage to publish the DNS statistics. The statistics can be collected using the following script, which is invoked every 5 minutes:
@echo off date /t > c:\temp\dnsstat.txt time /t >> c:\temp\dnsstat.txt dnscmd %COMPUTERNAME% /statistics 0x40010x >> c:\temp\dnsstat.txt copy c:\temp\dnsstat.txt c:\inetpub\wwwroot\dnsstat.txt
This information is retrieved by Xymon using the following RNAMED keyword:
RNAMED:”cmd(wget http://%{H}/dnsstat.txt -o /dev/null -O -),source(dnscmd)”
Server side
Source
myscript.sh
Known Bugs and Issues
By default, the statistics are presented to Xymon using a so-called 'trends' data-message. These type of messages do not carry a status nor a time stamp. Thus problems in collecting the statistics cannot be passed as a status. The independent polling cycles at client and server introduce variable delays, which cannot be accounted for, although the time of data collection is known at the server-side script.
To Do
Credits
Script retds.pl is written using script xymon-rnamedstats.sh written by Jerimy Laidman as the source for inspiration.
Changelog
- 2015-03-17
- Initial release on xymonton