Exchange Perl Scripts via WMI

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

Moderators: Developers, Moderators

mbittman
Posts: 2
Joined: Wed Feb 11, 2004 12:32 pm
Location: San Francisco

Linux Exchange Graphs

Post by mbittman »

Can anyone tell me if these can work on Linux? If i'm using NSClient on my windows boxes, will it work? Im get nan on all my graphs.

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

Post by DevilSun »

Can you run the script manually, and what are your results?
mbittman
Posts: 2
Joined: Wed Feb 11, 2004 12:32 pm
Location: San Francisco

Exchange Graphs running Cacti on Linux

Post by mbittman »

I am having trouble on figuring out exactly how to make the Exchange graphs work from Linux box. I am running Nagios and NSClient on my exchange server. But am not sure how to get the graphs to work in cacti. I tried importing the Exchange - Filtering Statistics xml template but graph all show NA. Tried other templates and get the same. I am retarded thanks.
Micah
richardkraal
Posts: 3
Joined: Thu Apr 28, 2005 3:00 pm

Post by richardkraal »

sorry for the little kick ; )

was busy with some of the exchange templates

after some hours a had the connection template working

but w32_exch_query_isstats.pl is after 5 hours still not working :(

when i run the script from cl:

perl c:\Inetpub\wwwroot\cacti\scripts\w32_exch_query_mailboxstats.pl <ip> get SendQueueSize,ReceiveQueueSize,MessagesSe
ntPermin,MessagesSubmittedPermin,MessagesDeliveredPermin <instance>

ip is no problem for me, but the instance namen? do they mean the store name?

when it is the store name I get the following result


Check the computer and class name.
No information was found on the specified class!


has somebody this script working or has an idea what to do with the error
DevilSun
Cacti User
Posts: 166
Joined: Fri Jul 16, 2004 1:59 pm
Location: Oregon

Post by DevilSun »

The normal "instance" is considered "_Total" without quotes.
Brettw
Posts: 26
Joined: Fri Mar 18, 2005 12:25 am

Wmi on a different domain

Post by Brettw »

Hi All,

I have the scripts working fine for our local domain however we have another domain which has an exch server on it that i would like to monitor.

There is a way that you can connect to WMI using with a username and pw however im not sure how or where to put it in the perl scripts.. :-?

The normal code for example would be like the below, excuse the average coding :wink:

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
User avatar
Diggit2001
Cacti User
Posts: 195
Joined: Tue May 03, 2005 4:29 pm
Location: MD, US

Any new info?

Post by Diggit2001 »

Hullo there. I've seen one or two people ask how to get this working on Linux but I havent seen an answer posted yet. I have the NSClient installed on my Exchange 2k3 box but I'm still having no luck. Can anyone help?

Thanks!

-Chris
Brettw
Posts: 26
Joined: Fri Mar 18, 2005 12:25 am

User Count hitting 100 and stopping

Post by Brettw »

Hi All,

Ive just installed the scripts and all seem to be working well however on the Exchange Users graph it seems to peak at 100 then doesnt graph?



Any ideas would be welcome
Attachments
connections.GIF
connections.GIF (13.77 KiB) Viewed 10577 times
Phobos182
Cacti User
Posts: 65
Joined: Tue Sep 21, 2004 2:22 pm
Location: Madison, WI

Post by Phobos182 »

Officially broken. Graph Template is not parsing the output correctly.

[CACTI LOG]
08/08/2005 10:20:15 AM - CACTID: Poller[0] Host[30] ERROR: Empty result [exchange2003.tasconline.com]: 'perl C:\cacti\cacti-0.8.6f\scripts\w32_exch_query_mailboxstats.pl exchange2003 get SendQueueSize,ReceiveQueueSize,MessagesSentPermin,MessagesSubmittedPermin,MessagesDeliveredPermin _Total'

[COMMAND LINE OUTPUT]
C:\cacti\rrdtool>perl C:\cacti\cacti-0.8.6f\scripts\w32_exch_query_mailboxstats.pl exchange2003 get sendQueueSize,ReceiveQueueSize,MessagesSentPermin,MessagesSubmittedPermin,MessagesDeliveredPermin _Total
SendQueueSize:0 ReceiveQueueSize:0 MessagesSentPermin:13 MessagesSubmittedPermin
:12 MessagesDeliveredPermin:16
fode
Posts: 1
Joined: Mon Aug 29, 2005 3:49 pm

Re: Exchange Graphs running Cacti on Linux

Post by fode »

mbittman wrote:I am having trouble on figuring out exactly how to make the Exchange graphs work from Linux box. I am running Nagios and NSClient on my exchange server. But am not sure how to get the graphs to work in cacti. I tried importing the Exchange - Filtering Statistics xml template but graph all show NA. Tried other templates and get the same. I am retarded thanks.
Micah
I hacked up a quick script to query the NSClient on Windows through the check_nt program that comes with Nagios. It uses the same template that is posted in this thread (cacti_graph_template_exchange_delivery_statistics.xml), but ignores the Instance Name parameter... it just uses the Host Parameter for the IP of the Exchange Server.

It's a bit dirty, but it works fine for me.

It assumes that check_nt is in /usr/lib/nagios/plugins. Otherwise, change the script.

If anybody can tell me the WMI Counters to query for a front-end Exchange 2003 box that doesn't host any mailboxes, that would be great... I'm looking for mail in/out, and bounces. I've been fighting with the Performance monitor looking for information regarding this, but none of the counters seem to work.

I'm also wondering exactly how accurate these numbers are, since they are per minute, instead of per 5 minutes. There was a previous question about that here, but nobody answered it.

Enjoy.
Attachments
w32_exch_query_mailboxstats.pl.txt
PERL script to query a Windows NSClient instance from Linux (rename to .pl, of course)
(999 Bytes) Downloaded 630 times
DevilSun
Cacti User
Posts: 166
Joined: Fri Jul 16, 2004 1:59 pm
Location: Oregon

Post by DevilSun »

Phobos182 wrote:Officially broken. Graph Template is not parsing the output correctly.
What is exactly broken about it? Mine seems to be working for about the past year... :roll:
Attachments
exchconn.jpg
exchconn.jpg (20.23 KiB) Viewed 10313 times
DevilSun
Cacti User
Posts: 166
Joined: Fri Jul 16, 2004 1:59 pm
Location: Oregon

Re: User Count hitting 100 and stopping

Post by DevilSun »

Brettw wrote:Ive just installed the scripts and all seem to be working well however on the Exchange Users graph it seems to peak at 100 then doesnt graph?
It appears I had a maximum limit of 100 on one of the data template ("Exchange - I.S. Stats") data source items ("Count Users"). You might be able to change it to 0 and it not have the max and it will be implemented immediately, worst case you'll have to recreate the data source after you change it to 0...I'm not sure -- Give it a try.
thisisharper
Posts: 31
Joined: Fri Jul 01, 2005 12:07 pm

Instance Name on Graph Template?

Post by thisisharper »

Is there a way to automatically put the instance name used on the graph itself?
anzzang77
Posts: 2
Joined: Fri Jul 15, 2005 1:30 am

is this working on Win2000server with exchange2000?

Post by anzzang77 »

is this working on Win2000server with exchange2000?
kermitthefrog
Posts: 9
Joined: Mon Oct 10, 2005 5:45 am

Post by kermitthefrog »

Hi,

I have imported all templates, and etc...
I have some empty graphs.

running: w2k3 and Exchange 2003

:-?

any one willing to help me?
Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest