From 80d3417de80d4c98140ca5f2e000f1f81bd39dec Mon Sep 17 00:00:00 2001 From: Lukas Macura Date: Sun, 19 Mar 2017 23:23:15 +0100 Subject: [PATCH] Added first try of dovecot plugin Removed dash dependency from zaf plugin --- dovecot/control.zaf | 124 ++++++++++++++++++++++++++++++++++++++++++++ zaf/control.zaf | 1 - 2 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 dovecot/control.zaf diff --git a/dovecot/control.zaf b/dovecot/control.zaf new file mode 100644 index 0000000..03ce542 --- /dev/null +++ b/dovecot/control.zaf @@ -0,0 +1,124 @@ + +Plugin: dovecot +Description:: + Plugin for monitoring dovecot and its sync status +:: + +Version: 0.1 +Url: https://raw.githubusercontent.com/limosek/zaf-plugins/master/dovecot +Web: https://github.com/limosek/zaf-plugins/ +Maintainer: Lukas Macura + +# Dependencies +Depends-dpkg: dash +Depends-opkg: busybox + +Item mailboxes.count: +Description:: + Count number of mailboxes +:: +Parameters:: + maildir '.*' '' # global mail dir + partitions '(y|n)' 'y' # If use partitions or not (y/n) +:: +Script:: +if [ "$partitions" = "y" ]; then + ls -d ${maildir}/*/* | wc -l +else + ls -d ${maildir}/* | wc -l +fi +:: +/Item + +Item sieve.count: +Description:: + Count number of sieve scripts +:: +Parameters:: + sievedir '.*' '' # global sieve dir +:: +Script:: + +find ${sievedir} -type f -a -name '*.sieve' | wc -l + +:: +/Item + +Item sievec.count: +Description:: + Count number of compiled sieve scripts +:: +Parameters:: + sievedir '.*' '' # global sieve dir +:: +Script:: + +find ${sievedir} -type f -a -name '*.svbin' | wc -l + +:: +/Item + +Item replicator.total: +Description:: + Total number of users to sync +:: +Script:: + +doveadm replicator status |grep Total | tr -s ' ' | cut -d ' ' -f 6 + +:: +/Item + +Item replicator.qrequests: +Description:: + Number of queued sync requests +:: +Parameters:: + type '.*' '' # Type +:: +Script:: + +doveadm replicator status | grep ^Queued | grep "'{$type}'" | tr -s ' ' | cut -d ' ' -f 4 + +:: +/Item + +Item replicator.wrequests: +Description:: + Number of waiting sync requests +:: +Parameters:: + type '.*' '' # Type +:: +Script:: + +doveadm replicator status | grep ^Waiting | grep "'{$type}'" | tr -s ' ' | cut -d ' ' -f 4 + +:: +/Item + +Item dsync.active: +Description:: + Number of active dsync processes +:: + +Script:: + +doveadm replicator dsync-status 2>/dev/null | grep -v "Not connected" | wc -l + +:: +/Item + +Item dsync.inactive: +Description:: + Number of inactive dsync processes +:: + +Script:: + +doveadm replicator dsync-status 2>/dev/null | grep "Not connected" | wc -l + +:: +/Item + + diff --git a/zaf/control.zaf b/zaf/control.zaf index 4b991bd..1767b76 100644 --- a/zaf/control.zaf +++ b/zaf/control.zaf @@ -22,7 +22,6 @@ Maintainer: Lukas Macura # Dependencies Depends-dpkg: dash Depends-opkg: busybox -Depends-rpm: dash Item framework_version: Description::