diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000000000000000000000000000000000000..c06afbeb7fd01991da2f32a9385d67df7a09b742 --- /dev/null +++ b/Readme.md @@ -0,0 +1,10 @@ +# check-mk-postfix-logstats + +This is a fairly simple plugin for linux check_mk agents which parses your postfix logfile and returns a bunch of numbers. + +# Installation + +* Clone this repository into e.g. `/opt/check-mk-postfix-stats`. +* Edit the `settings.sh` (There is not much to do) +* Symlink `postfix-stats.sh` to `/usr/lib/check_mk_agent/plugins` + diff --git a/postfix-stats.sh b/postfix-stats.sh index 7cb70447a24f255f0f8c9b9d5e9b44ec1016a90c..aafac3c159ce975b0bea7f57516487bb67f01e2c 100755 --- a/postfix-stats.sh +++ b/postfix-stats.sh @@ -81,8 +81,7 @@ mo_deferred=$( sed -n "$old_log_position","$new_log_position"p $LOGFILE mo_deliverable=$( sed -n "$old_log_position","$new_log_position"p $LOGFILE | grep '\/smtp\[' | grep 'status=deliverable' | grep -v 'relay=127\.0\.0\.1\|relay=localhost\|relay=::1' | wc -l) mo_undeliverable=$( sed -n "$old_log_position","$new_log_position"p $LOGFILE | grep '\/smtp\[' | grep 'status=undeliverable' | grep -v 'relay=127\.0\.0\.1\|relay=localhost\|relay=::1' | wc -l) mo_bncd_total=$( sed -n "$old_log_position","$new_log_position"p $LOGFILE | grep '\/smtp\[' | grep 'status=bounced' | grep -v 'relay=127\.0\.0\.1\|relay=localhost\|relay=::1' | wc -l) -mo_bncd_spam=$( sed -n "$old_log_position","$new_log_position"p $LOGFILE | grep '\/smtp\[' | grep 'status=bounced' | grep -i 'spam' | grep -v 'relay=127\.0\.0\.1\|relay=localhost\|relay=::1' | wc --l) +mo_bncd_spam=$( sed -n "$old_log_position","$new_log_position"p $LOGFILE | grep '\/smtp\[' | grep 'status=bounced' | grep -i 'spam' | grep -v 'relay=127\.0\.0\.1\|relay=localhost\|relay=::1' | wc -l) mo_bncd_reputation=$( sed -n "$old_log_position","$new_log_position"p $LOGFILE | grep '\/smtp\[' | grep -i 'reputation' | grep -v 'relay=127\.0\.0\.1\|relay=localhost\|relay=::1' | wc -l) # Collect inbound email statistics