Exchange Perl Scripts via WMI

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

Moderators: Developers, Moderators

DevilSun
Cacti User
Posts: 166
Joined: Fri Jul 16, 2004 1:59 pm
Location: Oregon

Post by DevilSun »

What class and what values are you looking at for those RPC graphs? I've found that some of the "Persecond" type counters are really per second, and are only valid for that second so it doesn't give a very good number because it's only looking at that specific second every 5 minutes as opposed to an average over those 5 minutes, or something like that. Some of thse "cooked" counters are better than they need to be, at least for what I'm doing.
..::BFS::..
Cacti User
Posts: 52
Joined: Fri Mar 12, 2004 3:01 am
Location: Beusichem
Contact:

Post by ..::BFS::.. »

I imported the cacti_graph_template_exchange_connections.xml and copied all of the perl scripts in this topic to my <path>/scripts directory. I added the graphs to our exchange server but it seems to give no output as shown in the picture.

When I look at the graph source I can see the following:

Code: Select all

c:/rrdtool/rrdtool.exe graph - \
--imgformat=PNG \
--start=1095083169 \
--end=1095169569 \
--title="Q-srv2 - Exchange Connections" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
COMMENT:"From 2004/09/13 15:46:09 To 2004/09/14 15:46:09\c" \
COMMENT:"\n" \
--vertical-label="Connections" \
DEF:a="C\:\Apache2\htdocs\cacti/rra/qsrv2_count_active_users_221.rrd":count_users:AVERAGE \
DEF:b="C\:\Apache2\htdocs\cacti/rra/qsrv2_count_active_users_221.rrd":count_active_users:AVERAGE \
AREA:a#005199:"Users"  \
GPRINT:a:LAST:"       Current\:%8.0lf"  \
GPRINT:a:AVERAGE:"Average\:%8.0lf"  \
GPRINT:a:MAX:"Maximum\:%8.0lf\n"  \
LINE2:b#FF4105:"Active Users"  \
GPRINT:b:LAST:"Current\:%8.0lf"  \
GPRINT:b:AVERAGE:"Average\:%8.0lf"  \
GPRINT:b:MAX:"Maximum\:%8.0lf" 
I'm missing something here, can somebody give some advise?
Attachments
1.JPG
1.JPG (115.96 KiB) Viewed 10755 times
DevilSun
Cacti User
Posts: 166
Joined: Fri Jul 16, 2004 1:59 pm
Location: Oregon

Post by DevilSun »

Call the script from a command line using just perl itself and make sure you're calling it correctly. Once you do that, make sure that matches your query...shouldn't be any problems after that. LMK...
..::BFS::..
Cacti User
Posts: 52
Joined: Fri Mar 12, 2004 3:01 am
Location: Beusichem
Contact:

Post by ..::BFS::.. »

I get the following message:

Code: Select all

C:\Documents and Settings\Administrator.QUAERE>perl C:\Apache2\htdocs\cacti\scri
pts\w32_exch_query_isstats.pl q-srv2 get ActiveUserCount,UserCount

    Check the computer and class name.
    No information was found on the specified class!
This should be the command to run the script, shouldn't it?
DevilSun
Cacti User
Posts: 166
Joined: Fri Jul 16, 2004 1:59 pm
Location: Oregon

Post by DevilSun »

What version of OS and Exchange you running? I know this works under Windows 2003 and Exchange 2003 -- can't guarantee others as I have no way of testing against them.

It uses the WMI class "Win32_PerfFormattedData_MSExchangeIS_MSExchangeIS" ... can you use WMI Browser to that machine and see if that exists in \\root\cimv2 WMI namespace?
Jtb
Posts: 30
Joined: Thu Aug 19, 2004 8:13 am
Location: Germany
Contact:

Post by Jtb »

Jens
DevilSun
Cacti User
Posts: 166
Joined: Fri Jul 16, 2004 1:59 pm
Location: Oregon

Post by DevilSun »

JTB, that link you posted made my SQL statistics appear in the WMI a few weeks ago, I however found it about a day before you posted it...none the less I was ECSTATIC to finally get some SQL statistics since SNMP support for SQL can only be obtained at install time if SNMP is installed on the machine. Thanks, I'm sure anyone using WMI will find it useful at least once. Oh, it also made my BackupExec stats show up too ;)
..::BFS::..
Cacti User
Posts: 52
Joined: Fri Mar 12, 2004 3:01 am
Location: Beusichem
Contact:

Post by ..::BFS::.. »

DevilSun wrote:What version of OS and Exchange you running? I know this works under Windows 2003 and Exchange 2003 -- can't guarantee others as I have no way of testing against them.

It uses the WMI class "Win32_PerfFormattedData_MSExchangeIS_MSExchangeIS" ... can you use WMI Browser to that machine and see if that exists in \\root\cimv2 WMI namespace?
I'm testing it on a Win2k Server and Exchange 2000. Maybe that causes the problem. I'll get to testing this on a Win2k3 and Exchange 2003 tommorow.
..::BFS::..
Cacti User
Posts: 52
Joined: Fri Mar 12, 2004 3:01 am
Location: Beusichem
Contact:

Post by ..::BFS::.. »

I tried to use the following line:

Code: Select all

perl C:\Apache2\htdocs\cacti\scripts\w32_exch_query_isstats.pl 'WAN Ipadres' get ActiveUserCount,UserCount 
Outcome was: Can't talk WMI with host.
The WMI services are running on the target host.

So my 2c's are: The firewall is blocking some traffic.
Which port should we open up on the firewall in order to make this work? any suggestions?

[Edit]
I did take a look in the WMI Browser:
Attachments
wmi.JPG
wmi.JPG (34.67 KiB) Viewed 10689 times
Last edited by ..::BFS::.. on Wed Sep 22, 2004 9:18 am, edited 1 time in total.
Guest

Post by Guest »

..::BFS::.. wrote:I tried to use the following line:

Code: Select all

perl C:\Apache2\htdocs\cacti\scripts\w32_exch_query_isstats.pl 'WAN Ipadres' get ActiveUserCount,UserCount 
Outcome was: Can't talk WMI with host.

Which port should we open up on the firewall in order to make this work? any suggestions?

The WMI services are running on the target host.
forget it... opening wmi on the firewall leaves a big hole :(
..::BFS::..
Cacti User
Posts: 52
Joined: Fri Mar 12, 2004 3:01 am
Location: Beusichem
Contact:

Post by ..::BFS::.. »

Anonymous wrote:
forget it... opening wmi on the firewall leaves a big hole :(
Even if you give one ip acces to that port on the firewall?
DevilSun
Cacti User
Posts: 166
Joined: Fri Jul 16, 2004 1:59 pm
Location: Oregon

Post by DevilSun »

WMI uses RPC ports, so I believe it's 135 and 445 initially, then I believe it allocates ports dynamically for use with communication although I'm not sure on that last part.

I've never tried using a computer name in quotes like you did (i.e. 'WAN Ipadres') or whatever...out of curiousity did you try just an ip address, or even any WMI stuff locally on your network the same way?
..::BFS::..
Cacti User
Posts: 52
Joined: Fri Mar 12, 2004 3:01 am
Location: Beusichem
Contact:

Post by ..::BFS::.. »

I typed the WAN Ipadres of the device I tried to monitor. So I didn't use the quotes but used them in my example so you could see that I editted my original command.
dforsdike

Post by dforsdike »

Hi
Using your original Exchange script i have changed the wmi class so it works with Exchange 2000.

The problem is that i get valid data when running via the commandline but when it runs in cacti, the output states output:u and the graphs do not update.

I am running the latest cacti version 8.6b

Has anybody any ideas on this, details are copied below?

CACTI LOG:
10/13/2004 12:29:08 PM - CMDPHP: Poller[0] Host[3] CMD: perl c:\Inetpub\wwwroot\cacti\cacti-0.8.6/scripts/w32_exch_query_mailboxstats.pl 192.168.0.28 get SendQueueSize,ReceiveQueueSize,MessagesSentPermin,MessagesSubmittedPermin,MessagesDeliveredPermin _Total, output: U

COMMANDLINE results:
C:\Documents and Settings\>perl c:\Inetpub\wwwroot\cacti\cacti-0.8.6/scr
ipts/w32_exch_query_mailboxstats.pl 192.168.0.28 get SendQueueSize,ReceiveQueueS
ize,MessagesSentPermin,MessagesSubmittedPermin,MessagesDeliveredPermin _Total
SendQueueSize:0 ReceiveQueueSize:0 MessagesSentPermin:0 MessagesSubmittedPermin:
1 MessagesDeliveredPermin:0
User avatar
Scipio
Posts: 22
Joined: Tue Oct 12, 2004 4:49 am
Location: Switzerland
Contact:

Post by Scipio »

Can I know if it works with NT 4.0 and Exchange 5.5 ?
Cause.. I don't think so.. :-/

Yea yea.. not everybody can play with an Echange 2003 :)
Tiago Coimbra
Gruyère Energie
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests