Atom Feed
Comments Atom Feed

Similar Articles

2009-10-31 14:46
SMART stats on Cacti (via SNMP)
2009-10-31 11:03
Linux (Debian, Ubuntu) SNMP basics
2015-01-08 22:58
Nginx on Cacti via SNMP
2015-01-08 22:59
php-fpm on Cacti via SNMP
2011-06-15 09:34
Universal Log Analyser and snmpd extension scripts

Recent Articles

2019-07-28 16:35
git http with Nginx via Flask wsgi application (git4nginx)
2018-05-15 16:48
Raspberry Pi Camera, IR Lights and more
2017-04-23 14:21
Raspberry Pi SD Card Test
2017-04-07 10:54
DNS Firewall (blackhole malicious, like Pi-hole) with bind9
2017-03-28 13:07
Kubernetes to learn Part 4

Glen Pitt-Pladdy :: Blog

Dovecot stats on Cacti (via SNMP)

As promised in the comments about the Postfix stats article, this posting kicks off support for Dovecot stats with Cacti, extending the original Postfix only stats.

This uses my Universal Log Analyser providing a plugin for Dovecot. You will need to get this installed and working before you can use the plugin here, and have it running from a cron job every 5 minutes (or whatever your sample times is for Cacti) so that it can parse the logs.

At this stage I am only producing stats for IMAP, but with the nice consistent log format it should be easy to add POP3 and SIEVE later.

Dovecot Plugin

Throw in your plugin directory for the Universal Log Analyser, and add "dovecot" as a module to the command line so that this module gets loaded.

Download: Universal Log Analyser plugin and Cacti template for Dovecot are on GitHub

Not much more to it than that. The remainder of the article assumes your stats file is /var/local/snmp/mail so if it isn't you will need to tweak things to match your install.

It's worth checking the stats file to verify that dovecot stats are in fact being picked up by the plugin.

SNMP Scripts

First, ensure that your SNMP is configured and working as described in my SNMP basics article.

These provide the link for snmpd to pick up the stats and assuming they are in /etc/snmp the config in /etc/snmp/snmpd.conf is:

extend dovecotauth /etc/snmp/dovecot-stats-auth
extend dovecotdeliver /etc/snmp/dovecot-stats-deliver
extend dovecotimapcrypto /etc/snmp/dovecot-stats-imap-crypto
extend dovecotimapdata /etc/snmp/dovecot-stats-imap-data
extend dovecotimapdisconnect /etc/snmp/dovecot-stats-imap-disconnect
extend dovecotimaplogin /etc/snmp/dovecot-stats-imap-login
extend dovecotimaploginmethod /etc/snmp/dovecot-stats-imap-loginmethod
extend dovecotpop3crypto /etc/snmp/dovecot-stats-pop3-crypto
extend dovecotpop3data /etc/snmp/dovecot-stats-pop3-data
extend dovecotpop3disconnect /etc/snmp/dovecot-stats-pop3-disconnect
extend dovecotpop3login /etc/snmp/dovecot-stats-pop3-login
extend dovecotpop3loginmethod /etc/snmp/dovecot-stats-pop3-loginmethod
extend dovecotmanagesievecrypto /etc/snmp/dovecot-stats-managesieve-crypto
extend dovecotmanagesievedata /etc/snmp/dovecot-stats-managesieve-data
extend dovecotmanagesievedisconnect /etc/snmp/dovecot-stats-managesieve-disconnect
extend dovecotmanagesievelogin /etc/snmp/dovecot-stats-managesieve-login
extend dovecotmanagesieveloginmethod /etc/snmp/dovecot-stats-managesieve-loginmethod
extend dovecotsessions /etc/snmp/dovecot-stats-sessions

Extension scripts for snmpd are named dovecot-stats-* - put them in a suitable place.... like /etc/snmp

You should be able to run these scripts manually and they should spit back the current info from the stats file. Remember to restart snmpd so that the new config is picked up and we should be ready to go.

Cacti Template

Import this into your Cacti and add graphs as usual.

After that, assuming everything is working then after a couple data samples content should start to appear on the graphs.

If not then check the data at each step: the stats file, SNMP scripts, snmpwalk from the Cacti server, check Cacti Poller log for errors, and try Cacti in debug mode for graphs and data sources to see if that shows anything.

I will post example graphs once my ones are mature enough to have some useful data on them.

The Graphs

Dovecot Crytogrphy Stats with Cacti

Dovecot Data Stats with Cacti

Dovecot Disconnect Stats with Cacti

Dovecot Login Stats with Cacti

Dovecot Login Stats with Cacti

Dovecot Auth Error Stats with Cacti

Dovecot Delivery Stats with Cacti