Git Product home page Git Product logo

nagios-check_dnsbl's People

Stargazers

 avatar  avatar

Watchers

 avatar

nagios-check_dnsbl's Issues

fails when one DNSBL was a match and also reports the wrong DNSBL

I have added also some other DNSBLs to the list and then one IP address I am monitoring was listed in one of them, the script reported this (IP changed for privacy):

$ check_dnsbl.sh -H 192.0.2.41
check_dnsbl.sh: FOUND_BLACKLISTS[1]=dnsbl-3.uceprotect.net: not found
192.0.2.41 is blacklisted in 1 DNSBLs
#1: zombie.dnsbl.sorbs.net

The first output line is an error because my /bin/sh is not a bash (may be the case on your system, so /bin/sh may understand bash syntax as well). It seems that /bin/sh does not support arrays, so I changed to bash, which fixed that.

Then the real error is that the IP address is listed in 'dnsbl-3.uceprotect.net' and not in the reported 'zombie.dnsbl.sorbs.net', which was the last DNSBL in my list.

Here the diff what I changed to get that working as well:

--- check_dnsbl.sh.orig	2022-12-25 19:38:16.000000000 +0100
+++ check_dnsbl.sh	2022-12-25 19:39:49.000000000 +0100
@@ -71,7 +71,7 @@
 	for BL in "$FOUND_BLACKLISTS[@]"
 	do
 		count=$(($count + 1))
-		echo "#${count}: $i"
+		echo "#${count}: ${FOUND_BLACKLISTS[$count]}"
 	done
  	exit 2
  fi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.