Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Check_MK Pi-Hole monitoring plugin

penzoiders Dec 16th, 2019 265 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2. pihole_status="$(/usr/local/bin/pihole status)"
  3. pihole_error="$(echo "$pihole_status" | grep 'DNS service is NOT running')"
  4. pihole_ok="$(echo "$pihole_status" | xargs | grep -E 'DNS service is running.*Pi-hole blocking is Enabled')"
  5.  
  6. pihole_version="$(/usr/local/bin/pihole -v)"
  7. pihole_installed_version="$(echo "$pihole_version" | awk {'print $4'})"
  8. pihole_last_version="$(echo "$pihole_version" | awk {'print $6'} | sed 's/)//')"
  9.  
  10.  
  11. if [ ! -z "$pihole_error" ]; then
  12.     echo "2 Pi-Hole - CRIT: Pi-Hole service is NOT running"
  13. elif [ ! -z "$pihole_ok" ]; then
  14.     if [ "$pihole_installed_version" != "$pihole_last_version" ]; then
  15.         echo "1 Pi-Hole - WARN: Pi-Hole updates are available"
  16.     else
  17.         echo "0 Pi-Hole - OK: Pi-Hole service is running"
  18.     fi
  19. else
  20.     echo "1 Pi-Hole - WARN: Pi-Hole is partially working, probably not blocking Ads"
  21. fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top