Graphing DNS queries - gauge or not??

3 messages Options
Embed this post
Permalink
Petr Lázňovský () Graphing DNS queries - gauge or not??
Reply Threaded More More options
Print post
Permalink
Hi all,

I am try to graph nomber of DNS queries of Win32 DNS service. I run perl script which read A/CNAME and PRT records and push those two values into mrtg. Values are increment counters, all new DNS queries are added to existing number. I expect the increment counter should be handled similar as SNMP byte/packet count from iface. By this reason,  I let out the GAUGE option in .cfg file. But in this case, no values going into graph anywise the external script pushing values into mrtg  ok (verified by --debug option), in .log file, there are still only actual value in very top line. Every logrotate ir overwiten by new value.

When I include GAUGE option in .cfg file, then graphs is filled by vallues, but only incrementing sum.

What I am doing wrong???

Petr Laznovsky



----------------------------------------------------------------------

WorkDir: C:\monitoring\dns_queries
IconDir: C:\monitoring\mrtg\images
RunAsDaemon: Yes
Language: Czech

# pocet dotazu na dns

Target[dns]: `c:\scripts\perl\get_dns_stats.cmd`
Title[dns]: Počet dotazů na DNS server
PageTop[dns]: <H1>Počet dotazů na DNS server</H1>
MaxBytes[dns]: 500
AbsMax[dns]: 10001
WithPeak[dns]: ymwd
Options[dns]: growright,unknaszero,nopercent,nobanner,noinfo,integer
Unscaled[dns]: dwmy
YLegend[dns]: # DNS queries
ShortLegend[dns]: #
Legend1[dns]: # Forward DNS queries
Legend2[dns]: # Reverse DNS queries
Legend3[dns]: Maximal 5 Minute # DNS queries
Legend4[dns]: Maximal 5 Minute # DNS queries
LegendI[dns]:  # queries:
LegendO[dns]:  # queries:

---------------------------------------------------------------------

Daemonizing MRTG ...
Do Not close this window. Or MRTG will die
--base: Starting main Loop
--base: Populate Target object by polling SNMP and external Datasources
--base: Act on Router/Target dns
--base: Get Current values: in:20344, out:12129, up:unknown, name:unknown, time:1255942142
--base: Create Graphics
2009-10-19 10:49:02, Rateup WARNING: c:/monitoring/mrtg/bin\rateup could not read the primary log file for dns
2009-10-19 10:49:02, Rateup WARNING: c:/monitoring/mrtg/bin\rateup The backup log file for dns was invalid as well
2009-10-19 10:49:02, Rateup WARNING: c:/monitoring/mrtg/bin\rateup Can't remove dns.old updating log file
2009-10-19 10:49:02, Rateup WARNING: c:/monitoring/mrtg/bin\rateup Can't rename dns.log to dns.old updating log fil
e
--base: Check for Thresholds
--base: Check for Write HTML Pages
--base: Populate Target object by polling SNMP and external Datasources
--base: Act on Router/Target dns
--base: Get Current values: in:20472, out:12193, up:unknown, name:unknown, time:1255942441
--base: Create Graphics
2009-10-19 10:54:01, Rateup WARNING: c:/monitoring/mrtg/bin\rateup Can't remove dns.old updating log file
--base: Check for Thresholds
--base: Check for Write HTML Pages
--base: Populate Target object by polling SNMP and external Datasources
--base: Act on Router/Target dns
--base: Get Current values: in:20659, out:12248, up:unknown, name:unknown, time:1255942745
--base: Create Graphics
--base: Check for Thresholds
--base: Check for Write HTML Pages
--base: Populate Target object by polling SNMP and external Datasources
--base: Act on Router/Target dns
--base: Get Current values: in:20726, out:12248, up:unknown, name:unknown, time:1255943045
--base: Create Graphics
--base: Check for Thresholds
--base: Check for Write HTML Pages
--base: Populate Target object by polling SNMP and external Datasources
--base: Act on Router/Target dns
--base: Get Current values: in:20762, out:12254, up:unknown, name:unknown, time:1255943345
--base: Create Graphics
--base: Check for Thresholds
--base: Check for Write HTML Pages
--base: Populate Target object by polling SNMP and external Datasources
--base: Act on Router/Target dns
--base: Get Current values: in:20806, out:12254, up:unknown, name:unknown, time:1255943645
--base: Create Graphics
--base: Check for Thresholds
--base: Check for Write HTML Pages
--base: Populate Target object by polling SNMP and external Datasources
--base: Act on Router/Target dns
--base: Get Current values: in:20847, out:12254, up:unknown, name:unknown, time:1255943944
--base: Create Graphics
--base: Check for Thresholds
--base: Check for Write HTML Pages
--base: Populate Target object by polling SNMP and external Datasources
--base: Act on Router/Target dns
--base: Get Current values: in:20889, out:12254, up:unknown, name:unknown, time:1255944244
--base: Create Graphics
--base: Check for Thresholds
--base: Check for Write HTML Pages

_______________________________________________
mrtg mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
Sean Cheesman () Re: Graphing DNS queries - gauge or not??
Reply Threaded More More options
Print post
Permalink
You don't state why you think it's not working.  By my calculations, they numbers on your graph should show less than 1.  You have to remember that when you're using MRTG with these options, it's going to take the difference between polling intervals (187 in the first sample) and divide by 300 (it's calculating per-second).  That gives you .623 queries per minute.  The second interval is worse, with .222 queries per second.  With those values, it'll be easy for your graph to show "nothing".

You may be better off using the graph option and redoing your perl script to output the difference, then set up MRTG to show queries per 5 minutes.

________________________________________
From: [hidden email] [[hidden email]] On Behalf Of Petr Lázňovský [[hidden email]]
Sent: Monday, October 19, 2009 2:53 PM
To: MRTG
Subject: [mrtg] Graphing DNS queries - gauge or not??

Hi all,

I am try to graph nomber of DNS queries of Win32 DNS service. I run perl script which read A/CNAME and PRT records and push those two values into mrtg. Values are increment counters, all new DNS queries are added to existing number. I expect the increment counter should be handled similar as SNMP byte/packet count from iface. By this reason,  I let out the GAUGE option in .cfg file. But in this case, no values going into graph anywise the external script pushing values into mrtg  ok (verified by --debug option), in .log file, there are still only actual value in very top line. Every logrotate ir overwiten by new value.

When I include GAUGE option in .cfg file, then graphs is filled by vallues, but only incrementing sum.

What I am doing wrong???

Petr Laznovsky



----------------------------------------------------------------------

WorkDir: C:\monitoring\dns_queries
IconDir: C:\monitoring\mrtg\images
RunAsDaemon: Yes
Language: Czech

# pocet dotazu na dns

Target[dns]: `c:\scripts\perl\get_dns_stats.cmd`
Title[dns]: Počet dotazů na DNS server
PageTop[dns]: <H1>Počet dotazů na DNS server</H1>
MaxBytes[dns]: 500
AbsMax[dns]: 10001
WithPeak[dns]: ymwd
Options[dns]: growright,unknaszero,nopercent,nobanner,noinfo,integer
Unscaled[dns]: dwmy
YLegend[dns]: # DNS queries
ShortLegend[dns]: #
Legend1[dns]: # Forward DNS queries
Legend2[dns]: # Reverse DNS queries
Legend3[dns]: Maximal 5 Minute # DNS queries
Legend4[dns]: Maximal 5 Minute # DNS queries
LegendI[dns]:  # queries:
LegendO[dns]:  # queries:

---------------------------------------------------------------------

Daemonizing MRTG ...
Do Not close this window. Or MRTG will die
--base: Starting main Loop
--base: Populate Target object by polling SNMP and external Datasources
--base: Act on Router/Target dns
--base: Get Current values: in:20344, out:12129, up:unknown, name:unknown, time:1255942142
--base: Create Graphics
2009-10-19 10:49:02, Rateup WARNING: c:/monitoring/mrtg/bin\rateup could not read the primary log file for dns
2009-10-19 10:49:02, Rateup WARNING: c:/monitoring/mrtg/bin\rateup The backup log file for dns was invalid as well
2009-10-19 10:49:02, Rateup WARNING: c:/monitoring/mrtg/bin\rateup Can't remove dns.old updating log file
2009-10-19 10:49:02, Rateup WARNING: c:/monitoring/mrtg/bin\rateup Can't rename dns.log to dns.old updating log fil
e
--base: Check for Thresholds
--base: Check for Write HTML Pages
--base: Populate Target object by polling SNMP and external Datasources
--base: Act on Router/Target dns
--base: Get Current values: in:20472, out:12193, up:unknown, name:unknown, time:1255942441
--base: Create Graphics
2009-10-19 10:54:01, Rateup WARNING: c:/monitoring/mrtg/bin\rateup Can't remove dns.old updating log file
--base: Check for Thresholds
--base: Check for Write HTML Pages
--base: Populate Target object by polling SNMP and external Datasources
--base: Act on Router/Target dns
--base: Get Current values: in:20659, out:12248, up:unknown, name:unknown, time:1255942745
--base: Create Graphics
--base: Check for Thresholds
--base: Check for Write HTML Pages
--base: Populate Target object by polling SNMP and external Datasources
--base: Act on Router/Target dns
--base: Get Current values: in:20726, out:12248, up:unknown, name:unknown, time:1255943045
--base: Create Graphics
--base: Check for Thresholds
--base: Check for Write HTML Pages
--base: Populate Target object by polling SNMP and external Datasources
--base: Act on Router/Target dns
--base: Get Current values: in:20762, out:12254, up:unknown, name:unknown, time:1255943345
--base: Create Graphics
--base: Check for Thresholds
--base: Check for Write HTML Pages
--base: Populate Target object by polling SNMP and external Datasources
--base: Act on Router/Target dns
--base: Get Current values: in:20806, out:12254, up:unknown, name:unknown, time:1255943645
--base: Create Graphics
--base: Check for Thresholds
--base: Check for Write HTML Pages
--base: Populate Target object by polling SNMP and external Datasources
--base: Act on Router/Target dns
--base: Get Current values: in:20847, out:12254, up:unknown, name:unknown, time:1255943944
--base: Create Graphics
--base: Check for Thresholds
--base: Check for Write HTML Pages
--base: Populate Target object by polling SNMP and external Datasources
--base: Act on Router/Target dns
--base: Get Current values: in:20889, out:12254, up:unknown, name:unknown, time:1255944244
--base: Create Graphics
--base: Check for Thresholds
--base: Check for Write HTML Pages

_______________________________________________
mrtg mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
_______________________________________________
mrtg mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
S Shipway () Re: Graphing DNS queries - gauge or not??
Reply Threaded More More options
Print post
Permalink
In reply to this post by Petr Lázňovský
>
> What I am doing wrong???
>

If the values you are collecting are a constantly increasing count, then (assuming you want to graph queries per second) you should omit the gauge option.

However (as Sean says) your values may well be <1.0 queries per second.  You have specified the 'integer' option (you should not do this, probably) and so these are being rounded down to zero!

I would suggest you have 'Options[]:gauge,perminute,nopercent' and NOT 'integer'.  You can have growright, unknaszero, nobanner and noinfo if you want.  You should also suppress the kMG prefix, either by using the kMG[] directive or by the 'fixunit' extended option (if using Routers2/RRD).

You also do not say if you are using RRDTool or not, although it appears that you are running in Native (non-RRDTool) mode.  If you are running in Native mode (no RRDTool) then the decimal values are not supported, so you will get zeros.  You MUST use RRDTool for this to work as the numbers are too small.

Summary:
The values are too small to show.
1. Use RRDTool mode
2. Remove 'integer' option
3. Use 'gauge' mode
4. Probably, use 'perminute' option.
5. Fix the units using kMG or fixunit

Steve

_______________________________________________
mrtg mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg