Exchange 2003 scripts from Windows Cacti

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

Moderators: Moderators, Developers

Post Reply
Author
Message
DAP
Posts: 43
Joined: Mon Jul 18, 2005 10:42 pm
Location: Melbourne, Australia

Exchange 2003 scripts from Windows Cacti

#1 Post by DAP » Thu Mar 09, 2006 3:25 am

I have setup some nice exchange 2003 scripts (well I think so :wink: )which work well for me and I wanted to share with community. I have taken some ideas from other exchange scripts in these forums.

These will work with Cacti on Windows and require WMI access. The below examples are from Windows 2003 SP1/Exchange 2003 SP1 server.

Cheers
Attachments
exchange_database.JPG
Exchange Database
exchange_database.JPG (42.91 KiB) Viewed 80316 times
exchange_memory.JPG
Exchange Memory
exchange_memory.JPG (53.91 KiB) Viewed 80315 times
exchange_messages.JPG
Exchange Messages
exchange_messages.JPG (52.32 KiB) Viewed 80315 times
exchange_queues.JPG
Exchange Queues
exchange_queues.JPG (39.23 KiB) Viewed 80315 times
exchange_latency.JPG
Exchange Client Latency
exchange_latency.JPG (41.08 KiB) Viewed 80315 times
Last edited by DAP on Thu Mar 09, 2006 4:11 am, edited 2 times in total.

DAP
Posts: 43
Joined: Mon Jul 18, 2005 10:42 pm
Location: Melbourne, Australia

#2 Post by DAP » Thu Mar 09, 2006 3:30 am

Here are the scripts. Put these in your <cacti dir>\scripts folder.

Rename to *.pl extension (ie, remove the .txt extension)
Attachments
windows_exchangedb.pl.txt
Exchange Database script
(823 Bytes) Downloaded 5077 times
windows_exchangelatency.pl.txt
Exchange Client Latency script
(884 Bytes) Downloaded 4822 times
windows_exchangemessages.pl.txt
Exchange Message stats script
(1.41 KiB) Downloaded 5715 times
windows_exchangequeues.pl.txt
Exchange Queues script
(1.26 KiB) Downloaded 6040 times
windows_memory.pl.txt
Exchange memory script (this can obviously apply to any Windows server)
(1.22 KiB) Downloaded 7906 times

DAP
Posts: 43
Joined: Mon Jul 18, 2005 10:42 pm
Location: Melbourne, Australia

#3 Post by DAP » Thu Mar 09, 2006 3:30 am

Here are the Data Templates.

Import using Cacti.

Important: Once imported, edit the script command to include your paths.
Attachments
cacti_data_template_windows_exchange_latency.xml
Exchange Client Latency data template
(5.54 KiB) Downloaded 4132 times
cacti_data_template_windows_exchange_messages.xml
Exchange message stats data template
(10.41 KiB) Downloaded 4633 times
cacti_data_template_windows_exchange_queues.xml
Exchange Queues data template
(7.45 KiB) Downloaded 4604 times
cacti_data_template_windows_memory_utilisation.xml
Memory data template
(8.44 KiB) Downloaded 5473 times
cacti_data_template_windows_exchange_database.xml
Exchange Database data template
(6.32 KiB) Downloaded 4259 times
Last edited by DAP on Tue May 23, 2006 9:00 am, edited 3 times in total.

DAP
Posts: 43
Joined: Mon Jul 18, 2005 10:42 pm
Location: Melbourne, Australia

#4 Post by DAP » Thu Mar 09, 2006 3:36 am

Here are the Graph Templates.

Import using Cacti.
Attachments
cacti_graph_template_windows_exchange_database.xml
Exchange database graph template
(17.72 KiB) Downloaded 4143 times
cacti_graph_template_windows_exchange_latency.xml
Exchange client latency graph template
(14.37 KiB) Downloaded 4045 times
cacti_graph_template_windows_exchange_messages.xml
Exchange message stats graph template
(31.72 KiB) Downloaded 4247 times
cacti_graph_template_windows_exchange_queues.xml
Exchange Queues graph template
(21.28 KiB) Downloaded 4386 times
cacti_graph_template_windows_memory_utilisation.xml
Memory graph template
(25.52 KiB) Downloaded 4442 times

ihyln
Posts: 20
Joined: Mon Mar 06, 2006 9:47 pm

#5 Post by ihyln » Thu Mar 09, 2006 9:56 am

these work much better than the others. good job!

joex51
Posts: 32
Joined: Sun Mar 05, 2006 4:05 am
Location: Connecticut
Contact:

#6 Post by joex51 » Sun Mar 12, 2006 2:14 am

Graphs Look nice unfortunately I cant seem to get them to retreive data from My exchange Server. I have WMI snmp Provider installed as well as SNMP on the exchange server, But I am Getting nan on my graphs.
Is there some permission issue I have to address. cacti Box is not joined to 2003 domain but Obviously the Exchange server is.
does this need a Domain account to run?
are there any tweaks to WMI on the exchange server or to the scripts I might need to Do.

I am getting data from SNMP queries that go to the Exchange server.

DAP
Posts: 43
Joined: Mon Jul 18, 2005 10:42 pm
Location: Melbourne, Australia

#7 Post by DAP » Sun Mar 12, 2006 7:20 pm

[Edit] Very first thing to check is the Data Input Method. Edit the script command to reflect your path structure. Then try below.



-------------------------

The first thing to try is run the script on your Cacti box and see if you get results.

eg, perl windows_exchangemessages.pl <servername>

You should see something like,
c:\skilled-rrdtool\cacti\scripts>perl windows_exchangemessages.pl semelex02
MB_MsgsSubmitted:89017 MB_MsgsDelivered:445191 MB_MsgsSent:95136 SMTP_MsgBytesRe
ceived:19829668735 SMTP_MsgBytesSent:4887490719 SMTP_MsgsDelivered:344614 SMTP_M
sgsReceived:179101 SMTP_MsgsSent:36968


If you don't see results, or see some WMI error, try the next step below.

On your exchange server, run "wmimgmt.msc", right-click "WMI Control" and select Properties. Click on Security tab and then Security button. Add "Everyone" and tick "Remote Enable". Restart WMI service on your server.

Now re-run the script manually again.

NOTE: If this works, change "Everyone" to a secure domain account.


If you still don't see any results (which happened to me a few times), try running this command on your exchange server,

wmiadap /f

Restart the WMI service and run the script once again.

Also, the database script will only work on Exchange SP1.

The key is making sure the script returns results when run manually. I did run into these same problems you are so keep trying.

Hope this helps.
Attachments
wmimgmt_security.JPG
WMI Security
wmimgmt_security.JPG (32.18 KiB) Viewed 80166 times
Last edited by DAP on Sun Mar 12, 2006 8:53 pm, edited 1 time in total.

joex51
Posts: 32
Joined: Sun Mar 05, 2006 4:05 am
Location: Connecticut
Contact:

#8 Post by joex51 » Sun Mar 12, 2006 8:52 pm

OK I ran the scripts manuallythe windows_memory scripts on both my cacti box and my exchange server.
They both returned results correctly But I am still not getting any Data in my graphs.
Do I have to change the script to include the server I am trying to get data from?
Do you think that the DB script will work on SP2 for exchange 2003?
i.e. from
my $objWMIService = Win32::OLE->GetObject("winmgmts:\\\\$computer\\root\\CIMV2")

to
my $objWMIService = Win32::OLE->GetObject("winmgmts:\\\\$computer\\myservername\\CIMV2")

DAP
Posts: 43
Joined: Mon Jul 18, 2005 10:42 pm
Location: Melbourne, Australia

#9 Post by DAP » Sun Mar 12, 2006 9:06 pm

You shouldn't need to include the server name in the script. That should be done automatically when you create the graphs.

Check Cacti logs. Do you report any errors?


*Database script will work for Exchange SP1 and SP2.

joex51
Posts: 32
Joined: Sun Mar 05, 2006 4:05 am
Location: Connecticut
Contact:

#10 Post by joex51 » Sun Mar 12, 2006 10:01 pm

DAP,
i am getting a warning.
03/12/2006 09:55:18 PM - CACTID: Poller[0] Host[10] DS[128] WARNING: Result from SCRIPT not valid. Partial Result: ...

should make my time out longer?

DAP
Posts: 43
Joined: Mon Jul 18, 2005 10:42 pm
Location: Melbourne, Australia

#11 Post by DAP » Sun Mar 12, 2006 10:30 pm

Which particular graph are you getting this error? Are others working?

Can you post the results from running the script manually?

joex51
Posts: 32
Joined: Sun Mar 05, 2006 4:05 am
Location: Connecticut
Contact:

#12 Post by joex51 » Mon Mar 13, 2006 12:21 am

DAP,
I ran the memory.pl script against my exchange server and it ran correctly.(but there is no data in the graphs.
None of the exchange scripts have run correctly manually yet.
as I said I did run the memory script but no data.
SO on the off chance I decided to check my event log on my exchange server and this is what i found.

WMI ADAP was unable to create the object Win32_PerfFormattedData_MSExchangeUCF_MSExchangeIntelligentMessageFilter for Performance Library MSExchangeUCF because error 0x80041002 was returned

According to microsoft this has something to do with namespace of the object being called and that it does not exist there.
This looks like something on the exchang server not with cacti.
I will run the wmiadap /f and try restarting the service and change the security. then get back to you about this.

DAP
Posts: 43
Joined: Mon Jul 18, 2005 10:42 pm
Location: Melbourne, Australia

#13 Post by DAP » Mon Mar 13, 2006 12:40 am

What version of Windows server? You will need Windows Server 2003 to be able to query Win32_PerfFormattedData*.

Your event log error refers to Microsoft Intelligent Message filter (IMF). Do you have that installed? None of these queries get any IMF information.

I did find this which may help with those errors (http://www.webservertalk.com/archive128 ... 41415.html)

joex51
Posts: 32
Joined: Sun Mar 05, 2006 4:05 am
Location: Connecticut
Contact:

#14 Post by joex51 » Mon Mar 13, 2006 12:34 pm

windows 2003 server SP1
and no I dont have IMF turned on

DAP
Posts: 43
Joined: Mon Jul 18, 2005 10:42 pm
Location: Melbourne, Australia

#15 Post by DAP » Mon Mar 13, 2006 7:34 pm

Try running WMI Scriptomatic (http://www.microsoft.com/downloads/deta ... layLang=en) to see if you can see the performance counters on the exchange server.

This is what I use to see what I can graph.

Post Reply