summaryrefslogtreecommitdiff
path: root/puppet/modules/site_check_mk/files/agent/local_checks/mx/check_leap_mx.sh
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2014-03-03 20:35:18 +0100
committervarac <varacanero@zeromail.org>2014-03-03 20:35:18 +0100
commit468064d2346519eeda7638a185ff5fa6b53d5eb4 (patch)
tree38f446abfb08cfde9e5b4c1ae774d614445e1dfd /puppet/modules/site_check_mk/files/agent/local_checks/mx/check_leap_mx.sh
parent30fde6cd9d57ad554f94b2d6b80ffe29c67bfe5c (diff)
parent984939c4a74b71ce67db27a035ca5017f82c416f (diff)
Merge branch 'improve_monitoring' into 0.6
Diffstat (limited to 'puppet/modules/site_check_mk/files/agent/local_checks/mx/check_leap_mx.sh')
-rwxr-xr-xpuppet/modules/site_check_mk/files/agent/local_checks/mx/check_leap_mx.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/puppet/modules/site_check_mk/files/agent/local_checks/mx/check_leap_mx.sh b/puppet/modules/site_check_mk/files/agent/local_checks/mx/check_leap_mx.sh
new file mode 100755
index 00000000..2958d2ed
--- /dev/null
+++ b/puppet/modules/site_check_mk/files/agent/local_checks/mx/check_leap_mx.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+
+WARN=1
+CRIT=5
+
+# in minutes
+MAXAGE=10
+
+STATUS[0]='OK'
+STATUS[1]='Warning'
+STATUS[2]='Critical'
+CHECKNAME='Leap_MX_Queue'
+
+WATCHDIR='/var/mail/vmail/Maildir/new/'
+
+
+total=`find $WATCHDIR -type f -mmin +$MAXAGE | wc -l`
+
+if [ $total -lt $WARN ]
+then
+ exitcode=0
+else
+ if [ $total -le $CRIT ]
+ then
+ exitcode=1
+ else
+ exitcode=2
+ fi
+fi
+
+echo "$exitcode $CHECKNAME stale_files=$total ${STATUS[exitcode]}: $total stale files (>=$MAXAGE min) in $WATCHDIR."
+