[mrtg] Re: here's the DNS stats script

Mike lizard at macam98.ac.il
Sat Jul 31 09:11:06 MEST 1999


I tried to use netstat -na |grep 59 but it didn't workd, have any idea why ?

Mike



Adam Bayless wrote:

> Here is the script I use, since many have asked for it. It uses the command
> "ndc stats" which is included with BIND. You'll need to figure out the
> paths for the command on your system and the path to where it writes its
> file out.
>
> DISCLAIMER: this script is a dumb little thing, but it works. I will not be
> held responsible if you can't get it to work on your machine or if it
> causes problems or does not behave the way you expect. Good Luck.
>
> You can call it from MRTG using a config like this:
>
> Target[dnsstats]: `rsh machine_name /path/to/script`
> MaxBytes[dnsstats]: 15000
> AbsMax[dnsstats]: 1500000
> Options[dnsstats]: gauge, nopercent
> Title[dnsstats]: machine_name DNS Statistics
> WithPeak[dnsstats]: dwmy
> YLegend[dnsstats]: Queries
> ShortLegend[dnsstats]: Queries
> LegendI[dnsstats]:  Queries:
> PageTop[dnsstats]: <H1>DNS Stats Report for machine.domain.com</H1>
>
> Or you can figure out a different way to call it if you don't want to rsh
> it. The 'ndc stats' command has to be run as root, i believe, so you may
> want to modify the script to save output to a file if security between the
> two machines is a big concern.
>
> Anyway, here is the script
>
> #!/usr/bin/perl
>
> `/usr/sbin/ndc stats`;
>
> @stats = `head -n 25 /etc/DNS/named.stats`;
>
> foreach $line (@stats) {
> $queries = "";
> ($queries,$rest) = split(" ",$line) if ($line =~ "queries");
> $totalqueries = $totalqueries + $queries;
> }
>
> print "$totalqueries\n$totalqueries\n\n\n";
>
> exit;
>
> Good Luck to all,
>
> Adam
>
> At 09:32 AM 7/30/99 -0600, Adam Bayless wrote:
> >Craig,
> >
> >This is working on one of my Bind 8 boxes, the other needs some work, but
> >it should work for you:
> >
> >I use 'ndc stats' to create a statistics file, then a perl script on the
> >name server to parse out the important stuff and feed it to another script
> >on the mrtg machine, which feeds it to mrtg. It works pretty good.
> >
> >If you would like the scripts, let me know.
> >
> >Adam
> >
> >
> >At 05:20 PM 7/30/99 +0200, Craig Allen wrote:
> >>Good Day All
> >>
> >>Anyone at all monitoring DNS Server (Bind 8.2.1) statistics with MRTG?
> >>
> >>Regards
> >>
> >>Craig Allen
> >>Business Automation Systems
> >>P.O Box 15167
> >>Westmead, 3608
> >>Tel: 031-7009111
> >>Fax: 031-7004598
> >>Cell:083 284 1589
> >>
> >>--
> >>* To unsubscribe from the mrtg mailing list, send a message with the
> >>  subject: unsubscribe to mrtg-request at list.ee.ethz.ch
> >>* The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg
> >>
> >>
> >>
> >
> >
> >------------------------------------------------------------
> >Adam Bayless                    |      vi /etc/aliases
> >Fibernet System Janitor         |      complaints: /dev/null
> >abayless at fiber.net              |      :wq
> >baylessfamily.org/~abayless     |      newaliases
> >------------------------------------------------------------
> >
> >--
> >* To unsubscribe from the mrtg mailing list, send a message with the
> >  subject: unsubscribe to mrtg-request at list.ee.ethz.ch
> >* The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg
> >
> >
> >
>
> ------------------------------------------------------------
> Adam Bayless                    |      vi /etc/aliases
> Fibernet System Janitor         |      complaints: /dev/null
> abayless at fiber.net              |      :wq
> baylessfamily.org/~abayless     |      newaliases
> ------------------------------------------------------------
>
> --
> * To unsubscribe from the mrtg mailing list, send a message with the
>   subject: unsubscribe to mrtg-request at list.ee.ethz.ch
> * The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg

--
* To unsubscribe from the mrtg mailing list, send a message with the
  subject: unsubscribe to mrtg-request at list.ee.ethz.ch
* The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg


More information about the mrtg mailing list