Build precise queries to find exactly what you need
Press ESC to close
In the header block it mentions a staus check being implemented which I think is where this came from at line 18
ps_state=$(ps aux |grep “fail2ban.sock” |grep -v grep| wc -l)
This seems to be an attempt to check if the fail2ban.sock socket has been created by the nagios-server, except this is looking at processes not sockets or at least it is on my Centos 7.7 installation, it always returns zero so the program aborts further down with the message
++++ Process is not running ++++
Change line 18 to this instead
ps_state=$(ss -aux |grep “fail2ban.sock” |grep -v grep| wc -l)
Basically use ss instead of ps and put the – before the aux options.
Then it returns 1 as expected if the fail2ban-server is running and the script works correctly.
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!