From dff386e49e19598da710c2a4db9c1c1e0d6782fa Mon Sep 17 00:00:00 2001 From: n Date: Sat, 5 Oct 2019 18:29:04 +0200 Subject: [PATCH] check_rspamc for rspamd monitoring --- README.md | 1 + monitoring/check_rspamc | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100755 monitoring/check_rspamc diff --git a/README.md b/README.md index 4ec2817..8580a07 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ Monitoring * [check_ntppool_score](https://forge.tourmentine.com/n/scripts/src/master/monitoring/check_ntppool_score) => Simple shell script to check score on NTP Pool Project (score must be over 10 to serve NTP). Requires Curl and bc, fits for Nagios/Shinken/Icinga/etc. * [collectd_ntppool_score](https://forge.tourmentine.com/n/scripts/src/master/monitoring/collectd_ntppool_score) => Same as [check_ntppool_score](https://forge.tourmentine.com/n/scripts/src/master/monitoring/check_ntppool_score) but for collectd graphing. * [check_postgresql_replication.sh](https://forge.tourmentine.com/n/scripts/src/master/monitoring/check_postgresql_replication.sh) => check postgresql's replication lag. + * [check_rspamc](https://forge.tourmentine.com/n/scripts/src/master/monitoring/check_rspamc) => Check rspamd status. Heavily based on [check_spamc](https://www.vanheusden.com/Linux/check_spamc-0.1.tgz). * [GonKyrellM](https://forge.tourmentine.com/n/scripts/src/master/monitoring/GonKyrellM) => Conky, GKrellM style - with "invisible" theme (well, sort of) * [collectweather.sh](https://forge.tourmentine.com/n/scripts/src/master/monitoring/collectweather.sh) => get weather data from https://darksky.net/ and feed collectd with it. needs jq as Dark Sky provides data in json format. diff --git a/monitoring/check_rspamc b/monitoring/check_rspamc new file mode 100755 index 0000000..f51045f --- /dev/null +++ b/monitoring/check_rspamc @@ -0,0 +1,12 @@ +#!/bin/sh + +echo test | /usr/local/bin/rspamc > /dev/null 2> /dev/null +RC=$? + +if [ $RC -gt 0 ] ; then + echo CRITICAL - rspamc returned $RC + exit 2 +fi + +echo OK - all fine +exit 0