check_fail2ban

A plugin to use in icinga / nagios that monitors your fail2ban jails.

Log in or register to post comments

  • n1tr0-5urf3r

    Hi, the check_fail2ban script has no -p parameter. Did you check your icinga / nagios config if you've set it somewhere there?

  • Error

    Hello, I have a trouble with check_fail2ban. When I run sudo /usr/lib/nagios/plugins/check_fail2ban on endpoint server every is ok. But In master I see the unknown service. When i inspected the action in master there is executed command 'sudo' '/usr/lib/nagios/plugins/check_fail2ban' '-p' but the -p argument is the issue. Do you know why is executed with argument -p?

  • n1tr0-5urf3r

    The only purpose for this check is to make sure that visudo entries are there. If you manually verified that they're working it's fine too :) Glad that it worked out!

  • minoel1989

    i just commented 53-60 amd is working with this command sudo ./check_fail2ban -t -w 5 -c 10 -j sshd

  • minoel1989

    Just done it but still no working

  • n1tr0-5urf3r

    I see, it fails because it expects (root) as output from the visudo command. Replacing (root) with (ALL) in line 54- 56 should do the trick.

  • minoel1989

    ANd on line 53 i have changed to user1 but didnt worked

  • minoel1989

    Also the home dir of user1 is /home/icinga/ I have add (ALL) NOPASSWD: because i dont use a password for the users . i can run with sudo fail2ban-client status but without sudo it doesnt work

  • minoel1989

    Also the home dir of user1 is /home/icinga/ I have add (ALL) NOPASSWD: because i dont use a password for the users . i can run with sudo fail2ban-client status but without sudo it doesnt worl

  • minoel1989

    User user1 may run the following commands on vm-1: (ALL) NOPASSWD: /usr/bin/fail2ban-client status (ALL) NOPASSWD: /usr/bin/fail2ban-client status (ALL) NOPASSWD: /usr/bin/fail2ban-client get bantime (ALL) NOPASSWD: /home/icinga/nagios-plugins/check_fail2ban (ALL) NOPASSWD: /usr/bin/fail2ban-client

  • n1tr0-5urf3r

    Hi! Make sure to replace all 3 "nagios" with user1 in visudo. Additionally you have to change the user 'nagios' in line 53 too, else it searches for the commands for the wrong user. Does that help you? If it still doesnt work please post the result of the command sudo -l -U user1

  • minoel1989

    Hello I am having trouble executing the plugin.I have changed the user from nagios to user1 because this is my user and have added the visudo .But i get :Error: Not all sudo permissions available! Please refer to documentation Also my user1 have sudo rights.