Exchange Perl Scripts via WMI

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

Moderators: Developers, Moderators

User avatar
cpt_ahab
Cacti User
Posts: 61
Joined: Tue Feb 01, 2005 11:34 am

...

Post by cpt_ahab »

Funny. I changed the script back from

my $Win32_Class = "Win32_PerfFormattedData_MSExchangeIS_MSExchangeISPublic";

to

my $Win32_Class = "Win32_PerfFormattedData_MSExchangeIS_MSExchangeISMailbox";

and it seems to work. So you dont have to change this line after you installed Servicepack2. If i look into wmi i could find both classes. Public and Mailbox.
dunno.

Happy that it works

Jan
s24sean
Posts: 14
Joined: Sun Dec 18, 2005 1:34 pm

Re: Wmi on a different domain

Post by s24sean »

This was in a previous post but i didnt see a response...

I need a monitor an exchange server that is on a different domain.

I was wondering if anyone had information on how i could update this script to all for domain / username / password
Brettw wrote:Hi All,


strComputer = "x.x.x.x"
strDomain = "mydomain"
strUser = "myusername"
strPassword = "mywp"

Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objSWbemServices = objSWbemLocator.ConnectServer(strComputer,"root\cimv2",strUser,strPassword,"MS_409","ntlmdomain:" + strDomain)
Set colSwbemObjectSet = objSWbemServices.ExecQuery("Select * From Win32_Process")
For Each objProcess in colSWbemObjectSet
Wscript.Echo "Process Name: " & objProcess.Name
Next

Any help would be great.

Cheers

Brett
zeroy
Posts: 25
Joined: Wed Jan 25, 2006 8:27 am

Post by zeroy »

I've managed to re-create the Perl script for those running Cacti on Linux:

http://forums.cacti.net/viewtopic.php?t=11589
¬¬ZeRoY¬¬
kevinsonney
Posts: 4
Joined: Mon Aug 29, 2005 1:23 pm

Able to run scripts from command but cactid has errors

Post by kevinsonney »

I'm am able to run the exchange scripts from the command line okay but when my poller runs I get ...

01/25/2006 11:07:26 AM - CACTID: Poller[0] Host[18] ERROR: Empty result [10.100.0.20]: 'perl M:/Apache/Apache2/htdocs/scripts/w32_exch_query_isstats.pl 10.100.0.20 get ActiveUserCount,UserCount'
01/25/2006 11:07:26 AM - CACTID: Poller[0] Host[18] DS[270] WARNING: Result from SCRIPT not valid. Partial Result: ...

Any ideas?
User avatar
vedd99
Posts: 32
Joined: Wed Jan 11, 2006 4:51 pm
Contact:

Post by vedd99 »

My Exchange Connections graph only seems to display Active Users and does not include Users. I can run the script from the command line and get the data, it just doesn't make it's way to the graph. Any ideas?

/var/www/localhost/htdocs/cacti/scripts $ perl exchange_users_script.pl 10.x.x.x
UserCount:519 ActiveUserCount:339 ActiveConn:1036
Attachments
exchange-connections.JPG
exchange-connections.JPG (27.69 KiB) Viewed 7382 times
Rene Doove
Posts: 4
Joined: Tue May 04, 2004 7:57 am

Post by Rene Doove »

My Exchange Connections graph only seems to display Active Users and does not include Users. I can run the script from the command line and get the data, it just doesn't make it's way to the graph. Any ideas?
I think it is because the in the data template te maximum limit for Active users is 100. So change it to 0, delete the old RRA and try again.

I believe the all the templates could use some tuning. Like for instances tying the datasource somehow to the hostname. Its kind of weird you have to configure the host in the datasource.

Rene
FreRange
Posts: 23
Joined: Wed Mar 30, 2005 2:13 pm
Location: Irvine, CA

Re: Able to run scripts from command but cactid has errors

Post by FreRange »

kevinsonney wrote:I'm am able to run the exchange scripts from the command line okay but when my poller runs I get ...

01/25/2006 11:07:26 AM - CACTID: Poller[0] Host[18] ERROR: Empty result [10.100.0.20]: 'perl M:/Apache/Apache2/htdocs/scripts/w32_exch_query_isstats.pl 10.100.0.20 get ActiveUserCount,UserCount'
01/25/2006 11:07:26 AM - CACTID: Poller[0] Host[18] DS[270] WARNING: Result from SCRIPT not valid. Partial Result: ...

Any ideas?
Same problem. I can run the script from a command line just fine but if I try to run it from the poller I get the error above. My question is, what account is running this script? The account used for the scheduled tasks? Or the iusr_cacti/iwam_cacti account on the local computer?

I'm looking for a way to correct this issue... Not too sure how cause I'm a noob but I will look at the boards more.

Thanks.
David.
FreRange
Posts: 23
Joined: Wed Mar 30, 2005 2:13 pm
Location: Irvine, CA

Re: Able to run scripts from command but cactid has errors

Post by FreRange »

FreRange wrote:
kevinsonney wrote:I'm am able to run the exchange scripts from the command line okay but when my poller runs I get ...

01/25/2006 11:07:26 AM - CACTID: Poller[0] Host[18] ERROR: Empty result [10.100.0.20]: 'perl M:/Apache/Apache2/htdocs/scripts/w32_exch_query_isstats.pl 10.100.0.20 get ActiveUserCount,UserCount'
01/25/2006 11:07:26 AM - CACTID: Poller[0] Host[18] DS[270] WARNING: Result from SCRIPT not valid. Partial Result: ...

Any ideas?
Same problem. I can run the script from a command line just fine but if I try to run it from the poller I get the error above. My question is, what account is running this script? The account used for the scheduled tasks? Or the iusr_cacti/iwam_cacti account on the local computer?

I'm looking for a way to correct this issue... Not too sure how cause I'm a noob but I will look at the boards more.

Thanks.
David.

Ahhhh crap... I fixed it. With the new version of cactid I had to include the complete path to my perl.exe for this script to work. I went to the Data input Methods and changed the Exchange input string from perl <path_cacti>/scripts..... to c:/perl c:/cacti/scripts....... It all seems to work now.

I did this because of the cactid post http://www.cacti.net/cactid_download.php

It states that shell environment's PATH will no longer work. OY!
ihyln
Posts: 20
Joined: Mon Mar 06, 2006 9:47 pm

Post by ihyln »

nevermind, its updating again with new graphs but I don't think it's collecting the data.. I'll let it sit overnight for now.
User avatar
briealeida
Posts: 19
Joined: Mon Jul 02, 2007 12:15 pm
Location: a pebble
Contact:

Post by briealeida »

Just to confirm. You're totally on, DevilSun.

I've gone through the same issues. Installing nsclient on your machines WILL get the job done.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests