The Monitoring utilities consist of:
1. immonitor queues : Monitors the Message Transport (IMTA) Queue
Also the monitoring utilities provide commands for moving messages between2. immonitor access : Monitors the availability of the Message Access (IMAP, POP) and Directory (LDAP) services
3. immonitor system : Monitors System Utilization
These utilities must be run on a SIMS server that is running the pre-requisite service, such as the IMTA or Message Store.4. immonitor reenqueue : Re-submits messages to queues for reprocessing.
5. immonitor users : Generates reports on user activity.
The monitoring utilities take snapshots of the status of the SIMS components.
To provide ongoing coverage we recommend that the utilities be run periodically
using a facility such as cron(1M). This document describes
how to use cron to monitor a SIMS server.
For example, if the sizes of any of the IMTA queues are unusually large or there are a large number of messages in the HELD queue, this can indicate message delivery or addressing problems. The monitoring utilities can be configured to automatically detect these scenarios and send alerts.
The monitoring utilities use a threshold based alerting system. The
Administrator needs to set some threshold values and take some corrective
action when they are exceeded. The monitoring utilities take threshold
values
and alert the administrator when any of the thresholds are exceeded.
For the purpose of illustration let us assume a threshold of 500 messages for Queue size, 100 HELD messages, 2 gigabyte /var/optSUNWmail/ims utilization, 200 megabytes for / utilization, 90% for swap space, 2000 SMTP ESTABLISHED connections, 2 minute total response time for SMTP connection, 5 minutes each for IMAP/POP and LDAP and a total message delivery time of 5 minutes. Also let us assume that inetmail is the user to be notified when any threshold is exceeded. "inetmail" is the SIMS Postmaster.
The threshold values used here are only as an example and are not applicable
to every installation. The table shows the Monitored Values and the limits:
Monitored value |
Threshold |
IMTA queue size | 500 messages |
No. of HELD Messages | 100 messages |
Message store size (/var/opt/SUNWmail/ims) | 2 Gb |
Root partition size (/) | 200Mb |
Virtual memory (swap) | 90% utilization |
SMTP connections | 2000 (in ESTABLISHED state) |
SMTP message delivery time | 2 minutes |
POP/IMAP message retrieval time | 5 minutes |
Message delivery round trip time | 5 minutes |
In this case the various components of SIMS (IMTA, Message Access, Admin server) and the Directory services are installed on the same system. So all the monitoring utilities are scheduled to run on a single system.The commands to use are:
To alert "inetmail" when the Queue size exceeds 500 Messages OR when the number of HELD messages exceeds 100, use:
immonitor queues -s 500 -H 100 -r inetmailTo alert "inetmail" when utilization of /var/optSUNWmail/ims exceeds 2 gigabytes OR when the utilization of "/" exceeds 200 Megabytes OR when the number of SMTP ESTABLISHED connections exceeds 2000, use:
immonitor system -f /var/opt/SUNWmail/ims=2g -f /=200m -m 90% -p smtp=2000 -r inetmail
To alert "inetmail" when the LDAP response time exceeds 5 minutes OR when mail sending time exceeds 2 minutes OR when the mail retrieval time with POP/IMAP exceeds 5 minutes OR when the total round-trip time exceeds 5 minutes, use:
immonitor access -u test_user -w passwd -L localhost:=300 -S localhost:=120 -I localhost:=300 -P localhost:=300 -D 300 -r inetmail
For optimal monitoring schedule the utilities to run at an interval of 30 minutes.
Assuming that immonitor is in the PATH, the corresponding crontab entries are: (If not in PATH, use complete pathname /opt/SUNWmail/sbin/immonitor)30 * * * * immonitor queues -s 500 -H 100 -r inetmail > /dev/null 2>&1
30 * * * * immonitor system -f /var/opt/SUNWmail/ims=2g -f /=200m -m 90\% -p smtp=2000 -r inetmail > /dev/null 2>&1
30 * * * * immonitor access -u test_user -w passwd -L localhost:=300 -S localhost:=120 -I localhost:=300 -P localhost:=300 -D 300 -r inetmail > /dev/null 2>&1Look at crontab (1) for description regarding the entry format.
The alert mechanism uses e-mail and if the SIMS server is having mail delivery problems the alerts may not be received, use the -A option to specify an alternate SMTP server for the alert delivery channel.
The backslash (\) before the "%" is required since "%" is a keyword for crontab.
Assume that the setup consists of a Proxy server proxysrvr, Directory server dirsrvr, Message Store and Access server msmasrvr.For information regarding the syntax and description of the utilities look at the manpages of immonitor(1M), immonitor-system (1M), immonitor-access (1M), immonitor-queues(1M), immonitor-users(1M) and immonitor-reenqueue(1M). Also look at SIMS Administrator's Guide and SIMS Reference Manual.Since each server isn't running the full set of SIMS services, we need to tailor the monitoring configuration on each server.
So, In this case the services we need to monitor in the various systems are:
1. proxysrvr : Queue Sizes, System utilization and SMTP response time.
2. dirsrvr : LDAP response time and System utilization.
3. msmasrvr : IMAP/POP response times, System utilization and delivery times.So, the crontab entries for proxysrvr look like:
To monitor Queue size and number of HELD messages:
30 * * * * immonitor queues -s 500 -H 100 -r inetmail > /dev/null 2>&1To monitor /var/opt,/, ESTABLISHED connections and virtual memory usage:
30 * * * * immonitor system -f /var/opt=2g -f /=200m -m 90\% -p smtp=2000 -r inetmail > /dev/null 2>&1To monitor the SMTP service response time:
30 * * * * immonitor access -u test_user -S proxysrvr:=1 -r inetmail -k "Testing" > /dev/null 2>&1The messages sent with -S accumulate in the users mailbox and they need to be deleted periodically. To delete the mail sent earlier:
40 * * * * immonitor access -u test_user -w passwd -Imsmasrvr:=300 -z -k "Testing" > /dev/null 2>&1For the Directory Server 'dirsrvr', the most important criteria to monitor is the responsiveness of the LDAP service. The following crontab(1) entry measures the response time of a directory look up for a user named 'test_user':
30 * * * * immonitor access -u test_user -L dirsrvr:=1 -r inetmail > /dev/null 2>&1
We also need to monitor various aspects of the operating system environment, including the usage of the root (/) and /var/opt file systems and the amount of virtual memory available:
30 * * * * immonitor system -f /var/optSUNWmail/ims=2g -f /=200m -m 90\% -r inetmail > /dev/null 2>&1
And the crontab entries for msmasrvr:
To monitor /var/opt, /, swap space, 1000 IMAP ESTABLISHED connections and 500 ESTABLISHED POP connections:
30 * * * * immonitor system -f /var/opt=2g -f /=200m -m 90\% -p imap=1000 -p pop=500 -r inetmail > /dev/null 2>&1To monitor the IMAP, POP response times and the Round-trip time:
30 * * * * immonitor access -u test_user -w passwd -S proxysrvr:=120 -I msmasrvr:=300 -P msmasrvr:=300 -D 300 -r inetmail > /dev/null 2>&1The backslash (\) before the "%" is required since "%" is a keyword for crontab. cron sends a mail if the executed command produces any output. To prevent cron from sending mails to the invoker, the stdin and stderr of the utilities are redirected to /dev/null.