Syed Jahanzaib Personal Blog to Share Knowledge !

March 13, 2012

IBM Lotus Domino Monitoring via MRTG

Filed under: IBM Related — Tags: , , — Syed Jahanzaib / Pinochio~:) @ 1:10 PM

Recently I was having trouble with Lotus Domino 8.5 Server regarding Mail Waiting / Stats etc. So in order to properly monitor Lotus Domino Server various instances status, I added few stats in MRTG to Admin Persons to troubleshoot problem before they get savior plus having a history always help you in making any decision. zaib

Here is how to enable SNMP Agent on Domino. But first make sure you have installed SNMP service in Domino Server Windows and enable it properly by setting its community name and security setting to allow specific or All host to inquire snmp. 

Configure the Domino LNSNMP agent to run as a service:

Run the following commands in the Domino program directory.

First stop the service if it is already running – in a CMD (admin rights) prompt run commands :

d:\Lotus\domino\net stop lnsnmp
d:\Lotus\domino\net stop snmp

If the service is not already running you may see the error:

    System error 1060 has occurred.
    The specified service does not exist as an installed service.

Now add LNSMP as a service

c:\Lotus\domino\LNSNMP -Sc
( this command is case sensitive )

If it starts you will see :

    Service creation complete

Now start SNMP Service

c:\Lotus\domino\net start snmp
c:\Lotus\domino\net start lnsnmp

If it starts you will see :

    The Lotus Domino SNMP Agent service was started successfully.

Now Run these commands on Domino server console by navigating to SERVER / SERVER CONSOLE

load quryset

Done.

From your MRTG Server (either Windows or Preferably Linux) You can inquire SNMP for Domino instances.
To query MIB/OID‘s, use the following.

http://www.mibdepot.com/cgi-bin/getmib3.cgi?i=1&n=NOTES-MIB&r=cai&f=notes.mib&v=v1&t=tree

For example:

root@zaiblinux:/mrtg# snmpwalk -v 1 -c   community_name   ip_address 1.3.6.1.4.1.334.72.1.1.4.6.0

This will inquire domino MIB for Number of  Waiting Mails and and you will get result like:

SNMPv2-SMI::enterprises.334.72.1.1.4.6.0 = INTEGER: 3

Once the SNMP query is working fine, then you can use the following CFG for various graphing of Lotus.

Following

Title[mailsrv.mempercent]: mailsrv DOMINO MAIL Srver Used Memory in (%)
PageTop[mailsrv.mempercent]: <H1>mailsrv - IBM DOMINO MAIL Server USED Memory in %</H1>
Target[mailsrv.mempercent]: ( hrStorageUsed.5&hrStorageUsed.5:PUBLIC@10.0.0.1) * 100 / ( hrStorageSize.5&hrStorageSize.5:PUBLIC@10.0.0.1)
options[mailsrv.mempercent]: growright, gauge, nopercent, integer
Unscaled[mailsrv.mempercent]: ymwd
MaxBytes[mailsrv.mempercent]: 100
YLegend[mailsrv.mempercent]: Memory %
ShortLegend[mailsrv.mempercent]: Percent
LegendI[mailsrv.mempercent]: Used
LegendO[mailsrv.mempercent]:
Legend1[mailsrv.mempercent]: mailsrv Server Percentage Memory
Legend2[mailsrv.mempercent]:

# mailsrv - Mail Server Availability Index
Title[mailsrv.avindex]: mailsrv - Mail Server Availability Index
PageTop[mailsrv.avindex]:<H1>mailsrv - Mail Server Availability Index</H1>
Target[mailsrv.avindex]: 1.3.6.1.4.1.334.72.1.1.6.3.19.0&1.3.6.1.4.1.334.72.1.1.6.3.19.0:PUBLIC@10.0.0.1
options[mailsrv.avindex]: growright, gauge, nopercent, integer
Unscaled[mailsrv.avindex]: ymwd
MaxBytes[mailsrv.avindex]: 100
YLegend[mailsrv.avindex]: Srv Availability Index
ShortLegend[mailsrv.avindex]: %
LegendI[mailsrv.avindex]: %
LegendO[mailsrv.avindex]:
Legend1[mailsrv.avindex]: mailsrv - Mail Server Availability Index
Legend2[mailsrv.avindex]:

# mailsrv Mail Monitoring (Mail Waiting Usage)
Title[mailsrv.mailwait]: mailsrv DOMINO MAIL Srver - Number of Mails Waiting for Delivery
PageTop[mailsrv.mailwait]:<H1>mailsrv - IBM DOMINO MAIL Server - Mails Waiting for Delivery</H1>
Target[mailsrv.mailwait]: 1.3.6.1.4.1.334.72.1.1.4.6.0&1.3.6.1.4.1.334.72.1.1.4.6.0:PUBLIC@10.0.0.1
options[mailsrv.mailwait]: growright, gauge, nopercent, integer
Unscaled[mailsrv.mailwait]: ymw
MaxBytes[mailsrv.mailwait]: 10000
YLegend[mailsrv.mailwait]: Mail Waiting 4 Delivery
ShortLegend[mailsrv.mailwait]: No.
LegendI[mailsrv.mailwait]: No.
LegendO[mailsrv.mailwait]:
Legend1[mailsrv.mailwait]: mailsrv - Number of Mails Waiting for Delivery
Legend2[mailsrv.mailwait]:

# mailsrv Mail Monitoring (Mails Holding in Queue)
Title[mailsrv.mailhold]: mailsrv DOMINO MAIL Srver - Number of Mails Holding in Queue
PageTop[mailsrv.mailhold]:
<H1>mailsrv - IBM DOMINO MAIL Server - Mails Holding in Queue</H1>

Target[mailsrv.mailhold]: 1.3.6.1.4.1.334.72.1.1.4.21.0&1.3.6.1.4.1.334.72.1.1.4.21.0:PUBLIC@10.0.0.1
options[mailsrv.mailhold]: growright, gauge, nopercent, integer
#Unscaled[mailsrv.mailhold]: ymw
MaxBytes[mailsrv.mailhold]: 10000
YLegend[mailsrv.mailhold]: Mail Holding in Queue
ShortLegend[mailsrv.mailhold]: No.
LegendI[mailsrv.mailhold]: No.
LegendO[mailsrv.mailhold]:
Legend1[mailsrv.mailhold]: mailsrv - Number of Mails Holding in Queue
Legend2[mailsrv.mailhold]:

# mailsrv -
Title[mailsrv.mailusersopensess]: mailsrv - Mail - Number of users with sessions open on the server
PageTop[mailsrv.mailusersopensess]:<H1>mailsrv - Number of users with sessions open on the server</H1>
Target[mailsrv.mailusersopensess]: 1.3.6.1.4.1.334.72.1.1.6.3.6.0&1.3.6.1.4.1.334.72.1.1.6.3.6.0:PUBLIC@10.0.0.1
options[mailsrv.mailusersopensess]: growright, gauge, nopercent, integer
#Unscaled[mailsrv.mailusersopensess]: ymw
MaxBytes[mailsrv.mailusersopensess]: 1000
YLegend[mailsrv.mailusersopensess]: Users Open Sessions
ShortLegend[mailsrv.mailusersopensess]: No.
LegendI[mailsrv.mailusersopensess]: No.
LegendO[mailsrv.mailusersopensess]:
Legend1[mailsrv.mailusersopensess]: mailsrv - Number of users with sessions open on the server
Legend2[mailsrv.mailusersopensess]:

# MAILSRV -
Title[MAILSRV.tnspermnt]: MAILSRV - Mail - Number of transactions per mnt
PageTop[MAILSRV.tnspermnt]: <H1>MAILSRV - Mail - Number of transactions per mnt</H1>
Target[MAILSRV.tnspermnt]: 1.3.6.1.4.1.334.72.1.1.6.3.2.0&1.3.6.1.4.1.334.72.1.1.6.3.2.0:PUBLIC@10.0.0.1
options[MAILSRV.tnspermnt]: growright, gauge, nopercent, integer
Unscaled[MAILSRV.tnspermnt]: ymw
MaxBytes[MAILSRV.tnspermnt]: 1000
YLegend[MAILSRV.tnspermnt]: Users Open Sessions
ShortLegend[MAILSRV.tnspermnt]: No.
LegendI[MAILSRV.tnspermnt]: No.
LegendO[MAILSRV.tnspermnt]:
Legend1[MAILSRV.tnspermnt]: MAILSRV - Number of transactions per mnt
Legend2[MAILSRV.tnspermnt]:

# MAILSRV - total mail routed
Title[MAILSRV.tot.mail.routed]: MAILSRV - Mail - Total Mail Routed in last 5 mnts
PageTop[MAILSRV.tot.mail.routed]: <H1>MAILSRV - Mail - Total Mail Routed in last 5 mnts</H1>
Target[MAILSRV.tot.mail.routed]: ` /temp/MAILSRV.total.mail.routed.sh`
options[MAILSRV.tot.mail.routed]: growright, gauge, nopercent, integer
Colours[MAILSRV.tot.mail.routed]: B#467EEE,R#FF0000,RED#ff4f27,DIRTY YELLOW#E6B420
#Unscaled[MAILSRV.tot.mail.routed]: ymwd
MaxBytes[MAILSRV.tot.mail.routed]: 1000
YLegend[MAILSRV.tot.mail.routed]: Total Mail Routed in 5 mnts
ShortLegend[MAILSRV.tot.mail.routed]: No.
LegendI[MAILSRV.tot.mail.routed]: No.
LegendO[MAILSRV.tot.mail.routed]:
Legend1[MAILSRV.tot.mail.routed]: MAILSRV - Total Mail Routed in last 5 mnts
Legend2[MAILSRV.tot.mail.routed]:

For Total Mail Routed in 5 mnts avg requires following bash script, i made it to get some customized result.


#!/bin/bash
# Script to query SNMP result from Lotus domino server for different stats
# like total mail routed in last XXX seconds, and then reset the counters after X minutes
# Syed Jahanzaib / aacable @ hotmail . com
# 6-JAN-2017
#set -x
IP="192.168.0.1"
OID="1.3.6.1.4.1.334.72.1.1.4.4"
SNMP_CMD_OUTPUT_HOLDER="/tmp/mailrouted.info"

TIMEOUT_TOC_HOLDER="/tmp/mtrad_timeout_holder_old.txt"
TIMEOUT_TCC_HOLDER="/tmp/mtrad_timeout_holder_new.txt"
NO_TIMEOUT_MSG="0
0"

# Seconds Value after which the script will reset the timeout counts
# MNts = 2
SECONDS_THRESHOLD="360"
# 6 Mnts to get 5 mnt avg on MRTG box
MINUTE_THRESHOLD=`echo $(($SECONDS_THRESHOLD/60))`

# Date time values/holders varialbes to comapre script execution in end
CUR_DATE=`(date +%T) | tr -d :`
OLD_DATE_HOLDER="/tmp/oldtime.txt"
if [ ! -f $OLD_DATE_HOLDER ];then
echo $CUR_DATE > $OLD_DATE_HOLDER
fi

OLD_DATE_PRINT_VALUE=`cat $OLD_DATE_HOLDER |sed 's/^0*//'`

# Acquire SNMP OID from HOST using SNMP and output to holder
snmpwalk -v1 -c agp -Onqv $IP $OID > $SNMP_CMD_OUTPUT_HOLDER

# Filter data to get only timeout value from the holder
TIMEOUT=`cat $SNMP_CMD_OUTPUT_HOLDER`

# If holder1 file is not found, create one
if [ ! -f $TIMEOUT_TOC_HOLDER ]; then
touch $TIMEOUT_TOC_HOLDER
fi
# If holder2 file is not found, create one
if [ ! -f $TIMEOUT_TCC_HOLDER ]; then
touch $TIMEOUT_TCC_HOLDER
fi

# If timeout holder is new or have no data, then add the current timeout value
if [ ! -s $TIMEOUT_TOC_HOLDER ] ;then
echo $TIMEOUT > $TIMEOUT_TOC_HOLDER
fi

# Add current Timeout value fetched from the MT to Variable as current value
echo $TIMEOUT > $TIMEOUT_TCC_HOLDER

# Print
TIMEOUT_TOC_VALUE=`cat $TIMEOUT_TOC_HOLDER`
TIMEOUT_TCC_VALUE=`cat $TIMEOUT_TCC_HOLDER`

if [ $TIMEOUT_TCC_VALUE -gt $TIMEOUT_TOC_VALUE ]; then
FINAL_TIMEOUT_VALUE=`echo $(( $TIMEOUT_TCC_VALUE - $TIMEOUT_TOC_VALUE ))`
echo $FINAL_TIMEOUT_VALUE
echo $FINAL_TIMEOUT_VALUE
else
echo "$NO_TIMEOUT_MSG"
fi

# Check if script is excecuted after $THRESHOLD Value, to reset the counts
CUR_DATE=`(date +%T) | tr -d :
#|sed 's/^0*//'`

TIME_MATH=`echo $(($OLD_DATE_PRINT_VALUE-$CUR_DATE)) |tr -d -`
echo $TIME_MATH Seconds difference found.
if [ $TIME_MATH -gt $SECONDS_THRESHOLD ]; then
MINUTE_THRESHOLD=`echo $(($SECONDS_THRESHOLD/60))`
echo "difference is abbove $MINUTE_THRESHOLD Minutes OR $SECONDS_THRESHOLD seconds value, resetting now "
echo $CUR_DATE > $OLD_DATE_HOLDER
# Also reset the total current count so that new value can be obtained per x minutes
echo $TIMEOUT_TCC_VALUE > $TIMEOUT_TOC_HOLDER
fi

# THE END

And its MRTG Graphs result is as follows:

12361-tot-routed-mails-in-5-mnts2-session


That’s how you can create MRTG for any instance for DOMINO 😀

Error “Lotus Domino SNMP Agent is not available”

– If you receive “Error “Lotus Domino SNMP Agent is not available” in domino console, make sure that SNMP and LNSNMP service is running.

– Also check if the Domino is running as Service or Application. Domino should run as SERVICE for quryset task to interact with LNSNMP agent.


Automate “QURYSET” upon Domino Reboot …

After domino reboot, SNMP counters do not work, you have to manually execute “Load quryset” via Domino console. To automate it, edit notes.ini (on server) and add the word “quryset” in ServerTasks line.

Cheer’s

Syed Jahanzaib

Advertisements

1 Comment »

  1. do got any install procedure for router2cgi for mikrotik simple queue. Thanx in advance.

    Like

    Comment by Srijan — September 7, 2012 @ 10:39 PM


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: