Heya All,
I am trying to monitor an Exchange server for various counters. The host is running nsclient properly, it seems. I created the following script using another as a template:
#!/usr/bin/perl
$a = q!-p 1248 -v COUNTER -l!;
$b = q!"\\MSExchangeIS Mailbox(!;
$c = q!)\\Client Logons"!;
$d = q!"\\MSExchangeIS Mailbox(!;
$e = q!)"\\Active Client Logons"!;
$client = `/srv/www/htdocs/cacti/scripts/check_nt -H 172.16.1.5 $a $b$ARGV[1]$c`;
$aclient = `/srv/www/htdocs/cacti/scripts/check_nt -H 172.16.1.5 $a $d$ARGV[1]$e`;
chomp ($client);
print "$client\n";
chomp ($aclient);
print "$aclient\n";
This is my test version I run directly against the target from the CLI. It returns 0 for both values like so:
perl Test_MsExchangeIS_User_Conn.pl
0
0
The same counters, checked directly on the machine using Performance Monitor, were returning values >0. When put into Cacti, the graphs are created but all values are nan. The Cacti logs say:
10/12/2005 10:05:01 AM - CMDPHP: Poller[0] Host[1] DS[3] WARNING: Result from CMD not valid. Partial Result:
10/12/2005 10:05:01 AM - CMDPHP: Poller[0] Host[1] DS[4] WARNING: Result from CMD not valid. Partial Result:
10/12/2005 10:05:01 AM - CMDPHP: Poller[0] Host[1] DS[5] WARNING: Result from CMD not valid. Partial Result:
10/12/2005 10:05:01 AM - CMDPHP: Poller[0] Host[1] DS[6] WARNING: Result from CMD not valid. Partial Result:
10/12/2005 10:05:01 AM - CMDPHP: Poller[0] Host[1] DS[7] WARNING: Result from CMD not valid. Partial Result:
10/12/2005 10:05:57 AM - CMDPHP: Poller[0] Host[20] DS[384] WARNING: Result from CMD not valid. Partial Result:
10/12/2005 10:05:58 AM - CMDPHP: Poller[0] Host[20] DS[385] WARNING: Result from CMD not valid. Partial Result:
10/12/2005 10:05:58 AM - CMDPHP: Poller[0] Host[20] DS[386] WARNING: Result from CMD not valid. Partial Result:
10/12/2005 10:05:59 AM - SYSTEM STATS: Time:58.8637 Method:cmd.php Processes:1 Threads:N/A Hosts:18 HostsPerProcess:18 DataSources:935 RRDsProcessed:361
I am unclear on how to troubleshoot this issue. I don't write Perl scripts. I can't seem to figure out where to find host or DS numbers to tell what is failing here. I am at a loss at this point.
Any help at all would be GREATLY appreciated.
Regards,
Chumley
Need help with scripts please...
Moderators: Developers, Moderators
-
- Posts: 19
- Joined: Tue Jan 25, 2005 2:17 pm
More things I've tried...
Heya Again!
OK...so looking at the properties of the Perfmon Counter it looks like the proper syntax, including the value of $ARGV[1] should be:
Still returns a value of zero, when running the corresponding Perfmon Counter directly on the target machine says 47.
I have tried every permutation of this I can think of...one slash, 2 slashes..spaces..no spaces....\\HOSTNAME\\MSEch.... all to no avail.
Can anyone tell me where I am going wrong here?
I'm going to run some simpler scripts from the board against this box now to verify the nsclient install..it shows as a service etc tho..and I expect I'd get a timeout if it wasn't there to answer at all...
Umm...also..if you could clue me in on how to get ARGV[1] into the mix when the graph is set for the device....but I have to make it work from CLI first, lol.
S! (Salute!)
Chum
OK...so looking at the properties of the Perfmon Counter it looks like the proper syntax, including the value of $ARGV[1] should be:
yet running this from the CLI:$client = `/srv/www/htdocs/cacti/scripts/check_nt -H 172.16.1.5 -p 1248 -v COUNTER -l \\MSExchangeIS Mailbox[_Total]\\Client Logons`;
Code: Select all
$client = `/srv/www/htdocs/cacti/scripts/check_nt -H 172.16.1.5 -p 1248 -v COUNTER -l \\MSExchangeIS Mailbox[_Total]\\Client Logons`;
chomp ($client);
print "$client\n";
I have tried every permutation of this I can think of...one slash, 2 slashes..spaces..no spaces....\\HOSTNAME\\MSEch.... all to no avail.
Can anyone tell me where I am going wrong here?
I'm going to run some simpler scripts from the board against this box now to verify the nsclient install..it shows as a service etc tho..and I expect I'd get a timeout if it wasn't there to answer at all...
Umm...also..if you could clue me in on how to get ARGV[1] into the mix when the graph is set for the device....but I have to make it work from CLI first, lol.
S! (Salute!)
Chum
Who is online
Users browsing this forum: No registered users and 0 guests