Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Sun Jun 16, 2019 11:47 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 49 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: W32 DNS Statistics Perl Script using WMI
PostPosted: Fri Jul 23, 2004 12:36 pm 
Offline
Cacti User

Joined: Fri Jul 16, 2004 1:59 pm
Posts: 166
Location: Oregon
Here is another Perl script for graphing DNS usage via WMI from a Windows 2003 Server box (may work with others)


Attachments:
File comment: Perl Script
w32_dns_query_stats.pl.txt [3.86 KiB]
Downloaded 3950 times
File comment: Graph Template
cacti_graph_template_dns_dns_queries.xml [55.23 KiB]
Downloaded 2760 times
File comment: Data Template
cacti_data_template_dns_queries.xml [16.93 KiB]
Downloaded 2279 times


Last edited by DevilSun on Fri Jul 23, 2004 12:40 pm, edited 1 time in total.
Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 23, 2004 12:37 pm 
Offline
Cacti User

Joined: Fri Jul 16, 2004 1:59 pm
Posts: 166
Location: Oregon
Screenshot...


Attachments:
File comment: DNS Usage Graph
dns_graph.gif
dns_graph.gif [ 12.9 KiB | Viewed 39237 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 29, 2004 9:55 pm 
Offline

Joined: Fri Sep 26, 2003 2:46 pm
Posts: 4
FYI: This will only work with DNS on Win2k3. The WMI DNS Provider for Win2000 doesn't include the entire MicrosoftDNS_Statistics class at all for some reason.

There are still stats you can pull, but you can't get any of the per-record type counters. Bummer.

JDooley


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 16, 2004 9:01 pm 
Offline

Joined: Sat May 01, 2004 11:01 pm
Posts: 24
How can these be modified to work with w2k?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 18, 2004 10:35 am 
Offline
Cacti User

Joined: Fri Jul 16, 2004 1:59 pm
Posts: 166
Location: Oregon
I don't believe it can...Microsoft is finally "coming around" and realizing that people use program statistics, and now they're starting to keep track of these statistics and use them themselves...but it seems only newer versions have these types of good statistics.

There might be some DNS statistics in Win2000 somewhere, but I doubt it'll be anything like what they expose in Win2003.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 22, 2004 3:55 pm 
How can I interpret the graph? Is the m mili?


Top
  
 
 Post subject: graph these on a linux cacti box
PostPosted: Tue Dec 07, 2004 12:15 pm 
so this only works when running cacti on windows. What if i want to graph dns queries on a remote win2003 dns server from a cacti box runnig linux ?
SOL ?


Top
  
 
 Post subject:
PostPosted: Tue Dec 14, 2004 4:33 am 
Offline
Cacti User
User avatar

Joined: Thu Nov 18, 2004 5:25 am
Posts: 60
Location: Hyderabad, India
http://msdn.microsoft.com/library/defau ... erview.asp

here is the link to work with the script

but, I still have the problem,
i am qurieng from win2k3 to win2k server which is my dns server
I have searched for the classes using wmi stuio (comes with the wmi tools , available at microsoft.com)
didnt find the namespace MicrosoftDNS

is there any steps I am missing?

_________________
Why me lord?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 16, 2004 7:56 am 
Offline
Cacti User
User avatar

Joined: Thu Nov 18, 2004 5:25 am
Posts: 60
Location: Hyderabad, India
http://msdn.microsoft.com/library/en-us ... ovider.asp

_________________
Why me lord?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 11, 2005 10:31 am 
Offline
Cacti User

Joined: Wed Dec 29, 2004 7:37 am
Posts: 79
Location: Sweden
There's a bug in the perl script.

There sould be no delimiter (space) at the end of the output or cactid will fail.

something like below would do the trick.

$output =~ s/.$//;

Christofer


Top
 Profile  
 
 Post subject: Newbie - Can't get this to work
PostPosted: Fri Feb 11, 2005 5:44 pm 
Offline

Joined: Fri Feb 11, 2005 5:32 pm
Posts: 37
Running the .pl script from the command line works (test DNS server box on being queried so really no value expected):

C:\Inetpub\wwwroot\cacti\scripts>w32_dns_query_stats.pl myserver
Total:59 Notify:0 Update:0 TKeyNego:0 Standard:59 A:59 NS:0 SOA:0 MX:0 PTR:0 SRV:0 ALL:0 IXFR:0 AXFR:0 Other:0

But I can't get any data in the graphs. Here is the Cacti Log:
02/11/2005 02:27:29 PM - SYSTEM STATS: Time: 3.3612 s, Method: cmd.php, Processes: 1, Threads: N/A, Hosts: 2, Hosts/Process: 2
02/11/2005 02:27:29 PM - POLLER: Poller[0] CACTI2RRD: c:\rrdtool\rrdtool.exe update c:\Inetpub\wwwroot\cacti\rra\myserver_total_connections_22.rrd --template 1108160846:U
02/11/2005 02:27:29 PM - POLLER: Poller[0] CACTI2RRD: c:\rrdtool\rrdtool.exe update c:\Inetpub\wwwroot\cacti\rra\myserver_total_queries_21.rrd --template 1108160846:U
02/11/2005 02:27:29 PM - CMDPHP: Poller[0] Time: 2.7863 s, Theads: N/A, Hosts: 1
02/11/2005 02:27:29 PM - PHPSVR: Poller[0] DEBUG: PHP Script Server Shutdown request received, exiting
02/11/2005 02:27:29 PM - CMDPHP: Poller[0] Host[17] CMD: perl lt;path_cactigt;/scripts/w32_iis_query_w3svc.pl lt;hostnamegt; get CurrentConnections,CurrentAnonymousUsers,CurrentNonAnonymousUsers lt;instancegt;, output: U
02/11/2005 02:27:29 PM - CMDPHP: Poller[0] Host[17] WARNING: Result from CMD not valid. Partial Result:
02/11/2005 02:27:29 PM - CMDPHP: Poller[0] Host[17] CMD: perl lt;path_cactigt;/scripts/w32_dns_query_stats.pl lt;hostnamegt;, output: U
02/11/2005 02:27:29 PM - CMDPHP: Poller[0] Host[17] WARNING: Result from CMD not valid. Partial Result:
02/11/2005 02:27:27 PM - CMDPHP: Poller[0] Host[17] RECACHE: Processing 3 items in the auto reindex cache for 'myserver'.
02/11/2005 02:27:27 PM - CMDPHP: Poller[0] Host[17] SNMP: Host responded to SNMP
02/11/2005 02:27:27 PM - CMDPHP: Poller[0] PHP Script Server Started Properly
02/11/2005 02:27:27 PM - PHPSVR: Poller[0] PHP Script Server has Started - Parent is cmd
02/11/2005 02:27:27 PM - PHPSVR: Poller[0] DEBUG: FILENM: c:\Inetpub\wwwroot\cacti\script_server.php
02/11/2005 02:27:27 PM - PHPSVR: Poller[0] DEBUG: DIRNAM: c:/inetpub/wwwroot/cacti
02/11/2005 02:27:27 PM - PHPSVR: Poller[0] DEBUG: GETCWD: c:/inetpub/wwwroot/cacti/scripts
02/11/2005 02:27:27 PM - PHPSVR: Poller[0] DEBUG: SERVER: cmd
02/11/2005 02:27:26 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: c:\php\php-win.exe, ARGS: -q c:\inetpub\wwwroot\cacti/cmd.php 0 17]

Also when manuall run poller.php I get an "ERROR: Not enough arguments"

Attached is a screenshot of an error I get with viewing the details of the Data query. "Notice: Undefined variable: array_field_names in c:\inetpub\wwwroot\cacti\data_input.php on line 217

I'm also having problems getting downloaded scripts to work in general. All of them exibit this same behavior.

IIS6.0
PHP 5.0.3
rrdtool 1.0.49
mysql 4.1.9
cacti 0.8.6c

Any help is greatly appreciated.

thnx,
kevin_taco


Attachments:
ss.JPG
ss.JPG [ 82.75 KiB | Viewed 38134 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 12, 2005 1:57 pm 
Offline
Cacti User

Joined: Wed Dec 29, 2004 7:37 am
Posts: 79
Location: Sweden
Are you missing the input hostname stanza?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 12, 2005 10:17 pm 
Offline

Joined: Fri Feb 11, 2005 5:32 pm
Posts: 37
What is the hostname stanza? Am I supposed to create a hostname stanza?

Thanks,

-kevin_taco


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 13, 2005 6:27 am 
Offline
Cacti User

Joined: Wed Dec 29, 2004 7:37 am
Posts: 79
Location: Sweden
There should be valid entries in the Field [Input]. I assume they are missing because there are missing input-fields in the page before the one you posted. i.e. Data template Methods.

Christofer


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 13, 2005 10:18 am 
Offline

Joined: Fri Feb 11, 2005 5:32 pm
Posts: 37
Thanks for the information.

Could this be my general problem? If so how do I fix this? How do I get he Field [Input] working?

Thanks again,
kevin_taco


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 49 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group