Monitoring Exchange 2003 from Linux Cacti

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

Moderators: Developers, Moderators

Post Reply
User avatar
hemul
Posts: 10
Joined: Mon Nov 20, 2006 7:57 am
Contact:

Exchnage Data Sources Problem

Post by hemul »

Hello all .
I have cacti on Linux Fedora , and nagios plugins.
I've added Mailbox Performance data Source but i cannot see files in thr RRA directory , but in the DataSource Debug mode i can see this command , and if i run it it's work

/usr/bin/rrdtool create \
/var/www/html/cacti/rra/x1xch2_sendq_33.rrd \
--step 300 \
DS:SendQ:GAUGE:600:0:U \
DS:ReceiveQ:GAUGE:600:0:100 \
DS:MessagesDelivered:GAUGE:600:0:100 \
DS:MessagesSent:GAUGE:600:0:100 \
DS:MessagesSubmitted:GAUGE:600:0:100 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MIN:0.5:1:600 \
RRA:MIN:0.5:6:700 \
RRA:MIN:0.5:24:775 \
RRA:MIN:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
RRA:LAST:0.5:1:600 \
RRA:LAST:0.5:6:700 \
RRA:LAST:0.5:24:775 \
RRA:LAST:0.5:288:797 \
Attachments
Exchange DS problem
Exchange DS problem
CactiExchangeProblem.JPG (44.51 KiB) Viewed 13428 times
michael.williams
Posts: 30
Joined: Tue Oct 24, 2006 11:02 am

Post by michael.williams »

Streaker, I just added your new xml file. What else do I need to add to get this working? any .pl files or anything else? Do I need snmp informant or nsclient installed onto my exchange box? If you can think of any steps I need to do to make sure I don't forget anything, please let me know.
User avatar
streaker69
Cacti Pro User
Posts: 712
Joined: Mon Mar 27, 2006 10:35 am
Location: Psychic Amish Network Administrator

Post by streaker69 »

michael.williams wrote:Streaker, I just added your new xml file. What else do I need to add to get this working? any .pl files or anything else? Do I need snmp informant or nsclient installed onto my exchange box? If you can think of any steps I need to do to make sure I don't forget anything, please let me know.
You need the .pl file that's I believe on page 4 of this thread. The XML file that's at the end of Page 5 on this thread.

Follow the instructions on the XML post on page 5 for what you need to to do make it work at least on the recent CactiEZ ISO.

You'll need the NSclient installed on your Exchange machine, if your Exchange machine is a Win2k (not Win2k3) you'll need the WMISNMP file from Microsoft installed.
setenza
Posts: 5
Joined: Thu Nov 23, 2006 6:23 am

Post by setenza »

Giorgio wrote:Hi guys,

To begin i want to thanks argon0 for his help.

I've included an XML export of a Host Template that should include all the graphs and data sources.

The only one Data template that i changed is "Exchange - Mailbox Performance v2". So now you can graph the messages sent, delivered etc.. for the last five minutes.

I changed the data source type to Counter rather than Gauge. So now you take the current PDP (primary data point) you substract it to the PDP 5 minutes before and divise the whole with the steps (300s). To fix it i made a CDEF function that multiply the data value by 300s.

I've not include my scripts because i have a W2K3 in french. So i query the performance counter of windows in french.

Don't forget to modify you script "exchange_emails_scriptv2" to request the total of messages sent, delivered etc.. and not the messages sent, delivered per min.

Giorgio.

"A man who doesn't spend time with his family can never be a real man. "
Hello Giorgio,

Can you post your script in french ? I have an Exchange 2003 in french version to.

Thanks
Shuyun
Posts: 5
Joined: Thu Dec 28, 2006 3:48 pm
Location: Dalla, TX

Post by Shuyun »

streaker69

I am having the same problem as hemul. There are no RRD files created for my exchange server. I used your instructions from page 6 that said to go to page 4 & 5 respectively and uploaded your files. If I run check_nt or the .pl scripts from the command line I get results from the exchange server, but there are no graphs created when I look into them (the debug mode for the graphs says there are no rrd files to graph from). When I look at my exchange server under devices it shows a general SNMP error at the top of the page. Not sure where the problem is, but any help that can be provided would be appreciated

Like Hemul I am running Fedora.

Thanks,
Shuyun
User avatar
adrianmarsh
Cacti User
Posts: 437
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

Post by adrianmarsh »

Cacti doesn't run scripts against a host if :

a) Its configured that the host uses SNMP.. and
b) SNMP fails, and Cacti marks the host as "down"

(I think)

Do you have any other SNMP graphs for that host? (eg Network interfaces?)

If Cacti never marks a host as "up", then it'll never generate the .rrd files (and hence Cacti shows "no rrd" graphics).

If you've no other SNMP graphs for the host then make sure the SNMP community key (usually "public") is cleared for that device.. This way Cacti doesn't try to use SNMP, assumes the host is up and should run the .pl script against the host anyway.

If you do have SNMP graphs, then you need to figure out why SNMP is failing (and marking the host as "down"). Most likely the snmp community key is different on the server compared to Cacti.

I believe its the former, as you describe that Cacti shows the host as "SNMP failed"
michael.williams
Posts: 30
Joined: Tue Oct 24, 2006 11:02 am

Post by michael.williams »

Would anyone be able to upload your working scripts including perl files and xml templates or anything else? I'm having "0" returned for all values, even when running script manually (Running latest CactiEZ). This thread has old and new files scattered throughout. If I could get a good, working possibly updated set to try out, that would be great.

thanks,
Michael
michael.williams
Posts: 30
Joined: Tue Oct 24, 2006 11:02 am

Post by michael.williams »

Also, should the permissions/info on my /var/www/html/scripts/check_nt be set to octal 0777 and User: Apache, Group: Apache?
Do I need to set that to "root" instead?


Also, is there anything else to installing check NT on my linux box other than to place it in a directory somewhere, and make perl scripts point to it?

I'm using CactiEZ, latest version.

Also, if anyone could post an updated version of xml files along with perl scripts to gather exchange information, that would be great.
Shuyun
Posts: 5
Joined: Thu Dec 28, 2006 3:48 pm
Location: Dalla, TX

Post by Shuyun »

adrianmarsh thanks. You were right about SNMP not working.

I played with Nagios a little and that has helped me understand how this plug-in works. Thank you to those who have worked on it and posted here. Here is a copy of my working templates. I've added a couple of more graphs, SMTP Queues and Information Store RPC values as suggested monitoring from Microsoft...

http://technet.microsoft.com/en-us/libr ... 24472.aspx

If anyone has other metrics that are worth while to monitor please let me know.

Make sure...

$CheckNTPath='/var/lib/cacti/scripts';

in the script files points to the actual place where your check_nt binary is. This is not running on CactiEZ so I don't know what is needed to make it work on CactiEZ. Also this works with Exchange 2003, but I don't know about 2000 or 2007.

michael.williams hope this helps.
Attachments
cacti_host_template_ms_exchange_server_2k3.xml
(138.93 KiB) Downloaded 1727 times
Exchange Scripts.zip
(2.92 KiB) Downloaded 1437 times
michael.williams
Posts: 30
Joined: Tue Oct 24, 2006 11:02 am

Post by michael.williams »

Thanks for posting those shuyun. Most, I can run manually and see good results. However, when I run exchange_emails_scriptv2.pl, I get "0" back for all 4 results. This is actually the main one I'm wanting to run - to be able to see the queue size.

Can you think of anything I need to change?
michael.williams
Posts: 30
Joined: Tue Oct 24, 2006 11:02 am

Post by michael.williams »

I copied your perl files to my scripts directory and changed the checkNT path to point to the appropriate location. I was returned all zeros resulting from running exchange_emails_scriptv2.pl manually. However, perl exchange_smtp_queue_script.pl 10.xx.xx.xx ran manually returns "smtp_remote_queue:4 smtp_categorizer_queue:0 smtp_local_queue:0". Having these results graphed in cacti might be suitable.
Keep in mind that i'm using cactiEZ. I started from scratch, deleting all previous templates, data sources, and anything I could find in cacti that I previously imported that had anything to do with Exchange stats.

I went to Import Templates and imported your cacti_host_template_ms_exchange_server_2k3_117 xml file. That seemed to import just fine. I then clicked save.

Next, I added a new device, gave it the hostname ip, selected MS exchange server 2k3 as host template, clicked monitor host and clicked create.

Once I clicked create, under associated graph templates, the following populated:
Status
1) Exchange - Connections Not Being Graphed
2) Exchange - Delivery Statistics v2a Not Being Graphed
3) Exchange - Filtering Statistics Not Being Graphed
4) Exchange - Intelligent Message Filter Statistics Not Being Graphed
5) Exchange - RPC Not Being Graphed
6) Exchange - SMTP Not Being Graphed
7) Host MIB - Available Disk Space Not Being Graphed
8) Host MIB - CPU Utilization Not Being Graphed
9) Interface - Traffic (bits/sec, Total Bandwidth) Not Being Graphed

"not being graphed" is under the status of each, and nothing is listed under associated data queries. I Clicked save.

When I went to the monitor tab and selected the new device, no graphs were there at all trying to be graphed. I was thinking that selecting a Host Template tells cacti to create a certain set of graphs for that device. Is this not correct?

Then, I went to "new graphs" and selected my device from the list and selected all the graph templates listed. See pic below.

Image

The pic above also shows what resulted from selecting all those templates and clicking create. I'm not sure what I need to put in all those blanks. Did you encounter this or do you know what to put for things like index type and index value? Maybe I'm misssing a file somewhere that's supposed to fill in those values.

I filled in the hostname ip in the proper fields from the pic above. Your "exchange smtp queues" seems to be graphing fine. it's showing remote queue as being 5 currently, while local and categorizer queue is at 0. This graph may be all that I need. My question is this... should the remote queue under "exchange smtp queues" be the same as the send and receive queues under the "exchange delivery stats v2a" graph? Does remote queues mean message/mail queues? Because I'm still getting all zeros for fields within "exchange delivery stats v2a", and what I need to see is the send and receive queues. Can anyone think of why I would be getting zeros from "exchange delivery stats v2a"? I know I can interact with check_nt when the perl scripts run, because I get good results from other scripts using check_nt.

Any help would be greatly appreciated.
Shuyun
Posts: 5
Joined: Thu Dec 28, 2006 3:48 pm
Location: Dalla, TX

Post by Shuyun »

Ok, from the above for all except...

7) Host MIB - Available Disk Space Not Being Graphed
8) Host MIB - CPU Utilization Not Being Graphed
9) Interface - Traffic (bits/sec, Total Bandwidth) Not Being Graphed

You just put in the IP Address of your Exchange server.

As far as the send/receive queues they are different. One is for the SMTP queues (incoming and outgoing mail from the server), and the other is for the Information Store (incoming and outgoing to all of the information stores - I think). Most of the time I get 0's for the information store queues except rarely I'll get a small number for the send queue. You should be getting values for Messages Delivered/Submitted/Sent if mail is going through your server though.
michael.williams
Posts: 30
Joined: Tue Oct 24, 2006 11:02 am

Post by michael.williams »

Thanks again. I'd like to be able to create my own scripts calling nagios. I pasted a line from your exchange_smtp_queue_script.pl file...

$smtp_remote_queue = `$CheckNTPath/check_nt -H $ARGV[0] -p 1248 -v COUNTER -l "\\SMTP Server(_Total)\\Remote Queue Length"`;
chomp $smtp_remote_queue;

Is it correct that the "chomp $smtp_remote_queue" line is what is sent to check_nt, and check_nt interprets that and gets values? If that is the case, is there a site showing a list of commands that you can throw at check_nt to return values for certain things?

mw
Shuyun
Posts: 5
Joined: Thu Dec 28, 2006 3:48 pm
Location: Dalla, TX

Post by Shuyun »

To be honest I'm not familiar with perl. I'm guessing "chomp" just gets rid of leading and ending "space" characters from the "check_nt" script for output to Cacti (or your screen if you run this on the command line).

Actually with "check_nt" you can get any value that you can get through perfmon on the server itself. Just change...

"\\SMTP Server(_Total)\\Remote Queue Length"

to what ever you want to get from perfmon. For example if you want to get the percent the processor is being used change it to this...

"\\Processor(_Total)\\% Processor Time"

where (_Total) is the instance.
michael.williams
Posts: 30
Joined: Tue Oct 24, 2006 11:02 am

Post by michael.williams »

Thanks. I'll give that a shot. Do you have a link to a set of commands that you can give check_nt like...
\\Processor(_Total)\\% Processor Time" ?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest