#!/bin/sh # # Plugin to count the open connections for smtp, pop3 and imap # # Magic markers - optional - used by installation scripts and # munin-config: # #%# family=auto #%# capabilities=autoconf PORTS="25 smtp SMTP 110 pop3 POP3 143 imap IMAP 465 ssmtp SMTP-SSL 587 submission SMTP (submission) 993 imaps IMAP-SSL 995 pop3s POP3-SSL" if [ "$1" = "autoconf" ]; then ports=$(echo "$PORTS" | cut -f 1 -d " ") for port in $ports; do netstat -ln | grep -q ":$port " && echo "yes" && exit 0 done # no open connections for typical mail ports found echo "no (no listeners for smtp/pop3/imap ports found)" exit 0 fi if [ "$1" = "config" ]; then cat <