W32 DNS Statistics Perl Script using WMI

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

User avatar
adrianmarsh
Cacti User
Posts: 437
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

Post by adrianmarsh »

Anyone have an image they could post of what *does* work with a 2000 server - or is it nothing at all?
Orc
Posts: 7
Joined: Wed May 10, 2006 1:33 pm

NAN for response

Post by Orc »

I run the script from the command line get this response:

Total:3259690 Notify:0 Update:168661 TKeyNego:57716 Standard:3033313 A:2114194 NS:308 SOA:92413 MX:1184 PTR:591861 SRV:212699 ALL:187 IXFR:0 AXFR:0 Other:20467

Go to debug the graph on the device and rrdtool runs it course and say "ok"

Cacti logs:

05/10/2006 01:07:08 PM - CACTID: Poller[0] Host[3] DS[117] WARNING: Result from SNMP not valid. Partial Result: ...
05/10/2006 01:07:13 PM - CACTID: Poller[0] Host[4] ERROR: Empty result [host.domain.com]: 'perl c:/apache/apache2/htdocs/cacti/scripts/w32_dns_query_stats_2003.pl'
05/10/2006 01:07:13 PM - CACTID: Poller[0] Host[4] DS[908] WARNING: Result from SCRIPT not valid. Partial Result: ...
05/10/2006 01:07:13 PM - CACTID: Poller[0] Host[4] DS[18] WARNING: Result from SNMP not valid. Partial Result: ...
05/10/2006 01:07:13 PM - CACTID: Poller[0] Host[6] DS[109] WARNING: Result from SNMP not valid. Partial Result: ...
05/10/2006 01:07:13 PM - CACTID: Poller[0] Host[6] DS[108] WARNING: Result from SNMP not valid. Partial Result: ...
05/10/2006 01:07:13 PM - CACTID: Poller[0] Host[6] DS[107] WARNING: Result from SNMP not valid. Partial Result: ...
05/10/2006 01:07:13 PM - CACTID: Poller[0] Host[6] DS[106] WARNING: Result from SNMP not valid. Partial Result: ...
05/10/2006 01:07:13 PM - CACTID: Poller[0] Host[6] DS[105] WARNING: Result from SNMP not valid. Partial Result: ...
05/10/2006 01:07:13 PM - CACTID: Poller[0] Host[6] DS[103] WARNING: Result from SNMP not valid. Partial Result: ...
05/10/2006 01:07:13 PM - CACTID: Poller[0] Host[6] DS[104] WARNING: Result from SNMP not valid. Partial Result: ...
05/10/2006 01:07:13 PM - CACTID: Poller[0] Host[7] DS[150] WARNING: Result from SNMP not valid. Partial Result: ...
05/10/2006 01:07:19 PM - CACTID: Poller[0] Host[8] DS[212] WARNING: Result from SNMP not valid. Partial Result: ...

Stumped. . . I thought feedback from the command line meant I was getting data . . . I've changed the poller per some of the threads I've read elsewhere. ..no change. Using v2 snmp to query off of. . .change to v1 didn't help.

Sorry to bother everyone - usually don't ask questions unless I've exhausted all other options.

Oh and have gone through all the windows documentation on install etc.

Running XP SP2, active-perl 5.8.8.817 , apache 2.0.58, mysql 4.1, have netsnmp installed & cygwin - whatever the latest you can download for them.

Thanks.
User avatar
adrianmarsh
Cacti User
Posts: 437
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

Post by adrianmarsh »

host.domain.com

I think when you define the data source for the graph, it asks for the IP/hostname again. check there.
Orc
Posts: 7
Joined: Wed May 10, 2006 1:33 pm

Post by Orc »

Yeah changed the name of the host for recording to the post here. Sorry - saw somewhere on this forum about not posting server names, domain, etc. I went graph management, filtered by host, click on the dns query graph and the host which the graph belongs to is right there. . .

I just don't get it. Everything looks okay just keep getting a NaN. Obviously I'm missing / overlooking something simple / basic.

Turned up logging a bit:

05/11/2006 09:48:04 AM - CACTID: Poller[0] Host[4] ERROR: Empty result [hostname.domain.com]: 'perl c:/apache/apache2/htdocs/cacti/scripts/w32_dns_query_stats_2003.pl'
05/11/2006 09:48:04 AM - CACTID: Poller[0] Host[4] DS[908] WARNING: Result from SCRIPT not valid. Partial Result: ...
05/11/2006 09:48:04 AM - CACTID: Poller[0] Host[4] DS[908] SCRIPT: perl c:/apache/apache2/htdocs/cacti/scripts/w32_dns_query_stats_2003.pl, output: U

Thanks for responding btw.
User avatar
adrianmarsh
Cacti User
Posts: 437
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

Post by adrianmarsh »

So you have entered a valid host name in the DNS field? Can you enter its IP instead?
Orc
Posts: 7
Joined: Wed May 10, 2006 1:33 pm

Post by Orc »

Sorry didn't clear that up.

If I ping the hostname I get a valid ip address and response.
If I ping the hostname.domain.com I get a valid ip address and response.

Tried to create a device using it's IP but it won't create an RRD file. Fun stuff.
[size=75][b]Cacti:[/b] 0.8.6h[/size] | [size=75][b]Cactid:[/b] 0.8.6f[/size]
[size=75][b]MySQL:[/b] 4.1[/size] | [size=75][b]PHP:[/b] 5.1.4[/size] | [size=75][b]RRDTool:[/b] 1.2.12[/size] | [size=75][b]Net-SNMP:[/b] 5.3.0.1[/size] | [size=75][b]Cygwin:[/b] 1.2.12[/size] | [size=75][b]Perl:[/b] 5.8.8[/size]
Orc
Posts: 7
Joined: Wed May 10, 2006 1:33 pm

Post by Orc »

Not giving up:
ran cactid --verbosity 5 -f 4 -l 4 from command line - this is the results:

CACTID: Host[4] DEBUG: The POPEN returned the following File Descriptor 9
CACTID: Host[4] DS[1081] SCRIPT: perl c:/apache/apache2/htdocs/cacti/scripts/w32_dns_query_stats_2003.pl 192.168.21.207, output: U
CACTID: Host[4] DEBUG: The POPEN returned the following File Descriptor 9
CACTID: Host[4] DS[1080] SCRIPT: perl c:/apache/apache2/htdocs/cacti/scripts/w32_dns_query_stats_2003.pl "hostname", output: U

Still get the partial results issue. . .and empty result.
[size=75][b]Cacti:[/b] 0.8.6h[/size] | [size=75][b]Cactid:[/b] 0.8.6f[/size]
[size=75][b]MySQL:[/b] 4.1[/size] | [size=75][b]PHP:[/b] 5.1.4[/size] | [size=75][b]RRDTool:[/b] 1.2.12[/size] | [size=75][b]Net-SNMP:[/b] 5.3.0.1[/size] | [size=75][b]Cygwin:[/b] 1.2.12[/size] | [size=75][b]Perl:[/b] 5.8.8[/size]
Orc
Posts: 7
Joined: Wed May 10, 2006 1:33 pm

Post by Orc »

Did a reindex of the server per some other threads and this is the result I get:

WARNING: Do not interrupt this script. Reindexing can take quite some time
DEBUG: There are '8' data queries to run
DEBUG: Data query number '1' starting
DEBUG: Data query number '1' ending
DEBUG: Data query number '2' starting
DEBUG: Data query number '2' ending
DEBUG: Data query number '3' starting
DEBUG: Data query number '3' ending
DEBUG: Data query number '4' starting
DEBUG: Data query number '4' ending
DEBUG: Data query number '5' starting
DEBUG: Data query number '5' ending
DEBUG: Data query number '6' starting
DEBUG: Data query number '6' ending
DEBUG: Data query number '7' starting
DEBUG: Data query number '7' ending
DEBUG: Data query number '8' starting

Notice: Undefined index: method in C:\apache\Apache2\htdocs\cacti\lib\data_query.php on line 190

Notice: Undefined index: method in C:\apache\Apache2\htdocs\cacti\lib\data_query.php on line 207

Notice: Undefined index: method in C:\apache\Apache2\htdocs\cacti\lib\data_query.php on line 190

Notice: Undefined index: method in C:\apache\Apache2\htdocs\cacti\lib\data_query.php on line 207

Notice: Undefined index: method in C:\apache\Apache2\htdocs\cacti\lib\data_query.php on line 190

Notice: Undefined index: method in C:\apache\Apache2\htdocs\cacti\lib\data_query.php on line 207

Notice: Undefined index: method in C:\apache\Apache2\htdocs\cacti\lib\data_query.php on line 190

Notice: Undefined index: method in C:\apache\Apache2\htdocs\cacti\lib\data_query.php on line 207

Notice: Undefined index: method in C:\apache\Apache2\htdocs\cacti\lib\data_query.php on line 190

Notice: Undefined index: method in C:\apache\Apache2\htdocs\cacti\lib\data_query.php on line 207

Notice: Undefined index: method in C:\apache\Apache2\htdocs\cacti\lib\data_query.php on line 190

Notice: Undefined index: method in C:\apache\Apache2\htdocs\cacti\lib\data_query.php on line 207

Notice: Undefined index: method in C:\apache\Apache2\htdocs\cacti\lib\data_query.php on line 190

Notice: Undefined index: method in C:\apache\Apache2\htdocs\cacti\lib\data_query.php on line 207
DEBUG: Data query number '8' ending

Obviously I have something setup wrong - too new to this to know where. .but will keep looking.
[size=75][b]Cacti:[/b] 0.8.6h[/size] | [size=75][b]Cactid:[/b] 0.8.6f[/size]
[size=75][b]MySQL:[/b] 4.1[/size] | [size=75][b]PHP:[/b] 5.1.4[/size] | [size=75][b]RRDTool:[/b] 1.2.12[/size] | [size=75][b]Net-SNMP:[/b] 5.3.0.1[/size] | [size=75][b]Cygwin:[/b] 1.2.12[/size] | [size=75][b]Perl:[/b] 5.8.8[/size]
Orc
Posts: 7
Joined: Wed May 10, 2006 1:33 pm

Post by Orc »

rrdtool info servername_total_queries_1094.rrd

captured results to a text file. I'm guessing since perl "filename" returns results that somehow when I'm creating the graphs etc - there's something being altered in the comilation?
Attachments
rrd.txt
(23.01 KiB) Downloaded 504 times
[size=75][b]Cacti:[/b] 0.8.6h[/size] | [size=75][b]Cactid:[/b] 0.8.6f[/size]
[size=75][b]MySQL:[/b] 4.1[/size] | [size=75][b]PHP:[/b] 5.1.4[/size] | [size=75][b]RRDTool:[/b] 1.2.12[/size] | [size=75][b]Net-SNMP:[/b] 5.3.0.1[/size] | [size=75][b]Cygwin:[/b] 1.2.12[/size] | [size=75][b]Perl:[/b] 5.8.8[/size]
Orc
Posts: 7
Joined: Wed May 10, 2006 1:33 pm

Post by Orc »

and the answer to my ills. . .if by chance it helps anyone else:

http://www.cacti.net/cactid_download.php
As of Cactid version 0.8.6g, scripts are no longer executed through the poller with a shell. This greatly increases speed as only one process needs to be created for every script call rather than two.

Because of this change, scripts that rely on the shell environment's PATH will no longer work. You must go through your scripts under "Data Input Methods" and make sure that the "Input Script" field always contains the complete path to any binary that is referenced. After making this change, you should clear your poller cache under "Utilities" for the changes to take effect.

For example, a script that was called as "perl /path/to/my/script.pl", must now be called as "/usr/bin/perl /path/to/my/script.pl". Be sure to update your scripts in "Data Input Methods" before upgrading Cactid to prevent data loss.
just wish I had caught this earlier. In fact I thought I had tried this . . .but - it works now - not gonna complain.
[size=75][b]Cacti:[/b] 0.8.6h[/size] | [size=75][b]Cactid:[/b] 0.8.6f[/size]
[size=75][b]MySQL:[/b] 4.1[/size] | [size=75][b]PHP:[/b] 5.1.4[/size] | [size=75][b]RRDTool:[/b] 1.2.12[/size] | [size=75][b]Net-SNMP:[/b] 5.3.0.1[/size] | [size=75][b]Cygwin:[/b] 1.2.12[/size] | [size=75][b]Perl:[/b] 5.8.8[/size]
msw1970
Cacti User
Posts: 206
Joined: Tue Jan 09, 2007 8:28 am
Location: London, UK

Post by msw1970 »

Anyone get this to work from a Linux Cacti install??
thechicco
Posts: 16
Joined: Fri Jan 12, 2007 9:42 am

Post by thechicco »

I'll second that, anyone got it to work with Linux cacti?

Would be very good to have running against my forest root controllers.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

WMI scripts do not work from Linux against Windows. You must use nsclient to achieve this.
thechicco
Posts: 16
Joined: Fri Jan 12, 2007 9:42 am

Post by thechicco »

Ok no probs, I've installed nsClient on my forest controller now.

What do I have to do to get this working?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

thechicco wrote:What do I have to do to get this working?
I'm not a linux guy so never used it -- just know from this forum that its what others use. Search, there are plenty of posts regarding it.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest