for example:
# exim -bpc
12
and
# /usr/lib/nagios/plugins/check_mailq -w 500 -c 1000
OK: mailq is empty|unsent=0;500;1000;0
so, we need write simple shell script, that allow us to monitor exim4 mail queue with nagios.
name it check_exim_mailqueue.sh and drop it into /usr/local/bin/ directory.
name it check_exim_mailqueue.sh and drop it into /usr/local/bin/ directory.
original script is there http://exchange.nagios.org/directory/Plugins/Email-and-Groupware/Exim/check_eximailqueue/details //
We modify it to work in debian and ubuntu/// and we threw unnecessary sudo usage.
All you need : add nagios user to Debian-exim group in /etc/group:
Debian-exim:x:118:nagios
than do this script executable:
# chmod u+x /usr/local/bin/check_exim_mailqueue.sh
# chown nagios:root /usr/local/bin/check_exim_mailqueue.sh
now you can use this script in nagios-nrpe-server: define new command in nrpe configuration file (nrpe.conf ):
command[check_exim_mailq]=/usr/local/bin/check_exim_mailqueue.sh -w 500 -c 1000
# /etc/init.d/nagios-nrpe-server restart
or you an use it directrly with nagios: create new command in nagios config file.
define command{
command_name check_exim_mailq
command_line /usr/local/bin/check_exim_mailqueue.sh -w $ARG1$ -c $ARG2$ }
# /etc/init.d/nagios reload
5 comments:
hi,
It's giving error as (No output returned from plugin)
You've added exim-user group nagios?
what output if You run (as root)
/usr/local/bin/check_exim_mailqueue.sh -w 500 -c 1000 ?
cPanel Admin
Post a Comment