fibbs / nagios-check_dnsbl Goto Github PK
View Code? Open in Web Editor NEWNagios plugin to check an IP address against various DNS black lists
Nagios plugin to check an IP address against various DNS black lists
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.