Using Nagios-Naemon monitoring plugins in monit

Using Nagios-Naemon monitoring plugins in monit

This is the way I use external Naemon plugin for SMTP authentication in Monit.

Create file /etc/monit/naemon_smtp_auth.sh with following content.

#!/bin/bash
/usr/lib/naemon/plugins/check_smtp -H mail.example.com -A LOGIN -U [email protected] -P PASSWORD | grep -q "SMTP OK"
exit $?

Create file /etc/monit/conf.d/mail/naemon_smtp_auth with following content.

check program naemon_smtp_auth with path /etc/monit/naemon_smtp_auth.sh
with timeout 500 seconds
start program = "/etc/init.d/saslauthd start"
stop program = "/etc/init.d/saslauthd stop"
if status != 0 then restart
if status != 0 then alert
if 5 restarts within 5 cycles then timeout

Download naemon plugins at https://www.monitoring-plugins.org/ .

Rating: