check_fail2ban

This plugins checks your server for banned IPs by fail2ban and lists those and their bantime

Log in or register to post comments

  • 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.