Last active
December 9, 2015 18:14
-
-
Save stephen-soltesz/28fe82b9436a12473e27 to your computer and use it in GitHub Desktop.
compare nagios services
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
set -e | |
URLBASE='http://nagios.measurementlab.net/baseList?show_state=1&plugin_output=1' | |
for service in ndt ndt_ssl ; do | |
curl -s --anyauth --basic --user $USERNAME:$PASSWORD \ | |
"${URLBASE}&service_name=$service" \ | |
| grep "$service 0" \ | |
| tr '/' ' ' \ | |
| sort \ | |
| awk '{print $1}' > good.$service.txt | |
done | |
# Lines unique to file1. | |
comm -2 -3 good.ndt.txt good.ndt_ssl.txt | sort > ndt-only.txt | |
echo "Nodes who are running ndt but NOT ndt_ssl" | |
cat ndt-only.txt | |
echo "Summary of good service counts" | |
wc good.ndt* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment