Monitor Kerio Connect

Overview

This will show you how to monitor Kerio Connect, running on Linux, with op5 Monitor.

NRPE

The following plugin requires NRPE to execute, please make sure that NRPE is installed and functioning on your Kerio Connect server.

Download this plugin: https://github.com/jedda/OSX-Monitoring-Tools/blob/master/check_kerio_connect_stats.sh

Save the file in /opt/plugins/custom/ on the mail server. Don't forget to edit the script so that the path and url to the mailserver is correct.

edit this

# START CONFIG SECTION# the local path to your kerio connect mailstore. change if differentkerioStore="/usr/local/kerio/mailserver"# put your kerio admin url, username and password below. this is used to reset your kerio stats after we are done.kerioAdminURL="https://your.server.url:4040"kerioAdminUser="Admin"kerioAdminPass="*YourPassword*"# END CONFIG SECTION

Edit /etc/nrpe.d/custom.cfg and add

custom.cfg

command[check_kerio]=/opt/plugins/custom/check_kerio_connect_stats.sh -n $ARG1$ -w $ARG2$ -c $ARG3$

Now add a new check command in nacoma:

name: check_kerio

command: $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_kerio -a $ARG1$ $ARG2$ $ARG3$

$ARG1$ = what counter to monitor

$ARG2$ = Warning threshold

$ARG3$ = Critical threshold

So now we need to find out what counter we want to monitor. All the counters can be found in the file stats.dat in the kerio connect folder, usually /opt/kerio/mailserver/stats.dat or /usr/local/kerio/mailserver. Add the counter name as $ARG1$.

This is how a stats.dat file can look like:

stats.dat

<statistics timestamp="1348813526">  <counter name="mtaReceivedMessages">0</counter>  <counter name="mtaReceivedVolume">0</counter>  <counter name="mtaReceivedRecipients">0</counter>  <counter name="mtaTransmittedMessages">0</counter>  <counter name="mtaTransmittedVolume">0</counter>  <counter name="mtaTransmittedRecipients">0</counter>  <counter name="mtaLocalMessages">0</counter>  <counter name="mtaLocalVolume">0</counter>  <counter name="mtaLocalRecipients">0</counter>  <counter name="mtaMXMessages">0</counter>  <counter name="mtaMXVolume">0</counter>  <counter name="mtaMXRecipients">0</counter>  <counter name="mtaRelayMessages">0</counter>  <counter name="mtaRelayVolume">0</counter>  <counter name="mtaRelayRecipients">0</counter>  <counter name="mtaFailedSoft">0</counter>  <counter name="mtaFailedHard">0</counter>  <counter name="mtaDsnSentSuccess">0</counter>  <counter name="mtaDsnSentDelay">0</counter>  <counter name="mtaDsnSentFailure">0</counter>  <counter name="mtaAntivirChecked">0</counter>  <counter name="mtaAntivirVirusFound">0</counter>  <counter name="mtaAntivirAttachFound">0</counter>  <counter name="mtaSpamChecked">0</counter>  <counter name="mtaSpamDetected">0</counter>  <counter name="mtaSpamTagged">0</counter>  <counter name="mtaSpamBlocked">0</counter>  <counter name="mtaLargestSize">0</counter>  <counter name="mtaLoopsDetected">0</counter>  <counter name="SMTPConnections">0</counter>  <counter name="SMTPConnLost">0</counter>  <counter name="SMTPRejectedRBL">0</counter>  <counter name="SMTPAuthReceived">0</counter>  <counter name="SMTPAuthFailed">0</counter>  <counter name="SMTPRelaysDenied">0</counter>  <counter name="SMTPMsgsAccepted">0</counter>  <counter name="SMTPDelayClosed">0</counter>  <counter name="SMTPDelayData">0</counter>  <counter name="SMTPClientAttempts">0</counter>  <counter name="SMTPClientDnsFailed">0</counter>  <counter name="SMTPClientConnLost">0</counter>  <counter name="POP3Connections">0</counter>  <counter name="POP3Logins">0</counter>  <counter name="POP3AuthFailed">0</counter>  <counter name="POP3MessagesSent">0</counter>  <counter name="POP3BytesSent">0</counter>  <counter name="POP3ClientAttempts">0</counter>  <counter name="POP3ClientConnsFailed">0</counter>  <counter name="POP3ClientAuthFailed">0</counter>  <counter name="POP3ClientMsgsDownloaded">0</counter>  <counter name="IMAPConnections">1</counter>  <counter name="IMAPLogins">0</counter>  <counter name="IMAPAuthFailed">0</counter>  <counter name="IMAPMessagesSent">0</counter>  <counter name="IMAPBytesSent">0</counter>  <counter name="HTTPConnections">1</counter>  <counter name="LDAPServerConnections">0</counter>  <counter name="LDAPServerAuthFailed">0</counter>  <counter name="LDAPServerMessagesSent">0</counter>  <counter name="DNSQueriesHost">0</counter>  <counter name="DNSQueriesHostCached">0</counter>  <counter name="DNSQueriesMx">0</counter>  <counter name="DNSQueriesMxCached">0</counter>  <counter name="DNSQueriesNS">0</counter>  <counter name="DNSQueriesNSCached">0</counter>  <counter name="AbombConnectionsRejected">0</counter>  <counter name="AbombMessagesRejected">0</counter>  <counter name="AbombHarvestDetected">0</counter>  <counter name="UserLookup">0</counter>  <counter name="UserLookupCached">0</counter>  <counter name="MarkedAsJunk">0</counter>  <counter name="MarkedAsNotJunk">0</counter>  <counter name="SPFresultFail">0</counter>  <counter name="SPFresultSoftFail">0</counter>  <counter name="SPFresultNeutral">0</counter>  <counter name="SPFresultPass">0</counter>  <counter name="SPFresultNone">0</counter>  <counter name="SPFresultTempErr">0</counter>  <counter name="SPFresultPermErr">0</counter>  <counter name="DNSQueriesSPF">0</counter> <counter name="glCacheApprovedSize">0</counter>  <counter name="glCacheDisapprovedSize">0</counter>  <counter name="glWhitelistAccepted">0</counter>  <counter name="glGreylistAccepted">0</counter>  <counter name="glGreylistRejected">0</counter>  <counter name="glAcceptedByMask">0</counter>  <counter name="glEmailsResentTooSoon">0</counter></statistics>