Nagios için PowerMTA status check plugin
Lazım oldu yazdık. Güle güle kullanın geliştirin. Bize bu kadarı yeterli.
#
#
# PowerMTA status check plugin for nagios
# Kursad DARA [mkursaddara@gmail.com]
# http://www.serbestkose.net
# 20 December 2012, the day before Maya's Armageddon.
#
#
#!/bin/bash
lynx="/usr/bin/lynx"
if [ -z "$1" ]; then
echo "Usage : $0 [powermta_host_name or powermta_host_ip]"
else
response=`$lynx --head http://$1/status --dump |head -n1 | awk {'print $2'}`
if [ "$response" = "200" ]; then
status=`$lynx -dump http://$1/status |grep Status | tail -n1|awk {'print $2'}`
if [ "$status" = "running" ]; then
qcount=`$lynx -dump http://$1/status |grep Spool -A1 |tail -n1 |awk {'print $2'}`
echo "OK - PowerMTA is running [ Queue : $qcount ]"
exit 0;
else
echo "CRITICAL - PowerMTA is not running"
exit 2;
fi
else
echo "CRITICAL - PowerMTA is not running"
exit 2;
fi
fi
Posted in Linux, Mail Servers, Nagios, PowerMTA on December 20th, 2012 by Kürşad DARA | | 0 Comments
