My nagios fail with fail2ban service. Whith an other command it's Ok:

nagios@server:/usr/lib/nagios/plugins$ /usr/local/nagios/libexec/check_nrpe -H -c "check_load"

OK - load average: 0.00, 0.06, 0.08|load1=0.000;15.000;30.000;0; load5=0.060;10.000;25.000;0; load15=0.080;5.000;20.000;0;

With fail2ban service it don't work. This fail2ban script test this (see http://pastebin.com/1utP9iM6):

$(ps aux |grep "fail2ban.sock" |grep -v grep| wc -l)

If i test it with nagios user it correctly return 1. But when it's executed by NRPE it fail:

nagios@server:/usr/lib/nagios/plugins$ /usr/local/nagios/libexec/check_nrpe -H -c "check_fail2ban" /var/log/fail2ban.log /etc/fail2ban/jail.conf 10 20


++++ Process is not running ++++

How can i debug more to found what is wrong ?


You could let the script log something to a file, e.g.:

ps aux > /tmp/debugfile

An alternative would be using the generic check_procs:

/usr/lib/nagios/plugins/check_procs -c 1:1 -C fail2ban-server
  • The ps output nothing for fail2ban. Thank's for "check_procs". I finally use it instead of my fail2ban script. – bux Jun 16 '14 at 14:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.