Giter Club home page Giter Club logo

icinga2_check_pihole's Introduction

icinga2_check_pihole

Icinga2/Nagios plugin to check Pi-hole status.

usage: check_pihole.py [-h] -H HOST [-P PORT] [-C] [-W] [-t TIMEOUT]

Check Pi-hole status

optional arguments:
  -h, --help            show this help message and exit
  -H HOST, --host HOST  Pi-hole ip address or hostname
  -P PORT, --port PORT  Port number for Pi-Hole web UI
  -C, --status_critical
                        Forces CRITICAL when Pi-hole is disabled
  -W, --status_warning  Forces WARNING when Pi-hole is disabled
  -t TIMEOUT, --timeout TIMEOUT
                        Timeout for request. Default 10 seconds

check_pihole.py: v.0.2.1 by Dmytro Prokhorenkov

icinga2_check_pihole's People

Contributors

l13t avatar n1tr0-5urf3r avatar

Stargazers

 avatar  avatar  avatar

icinga2_check_pihole's Issues

Pi-hole requires API token now

Hi,
I've updated my Pi-hole today. After that, the check script doesn't work any longer.

The error shown is:

...
    if url_output["status"] != "enabled":
TypeError: list indices must be integers or slices, not str

There's no result when querying Pi-Hole, since there's no authentication. Access to some API endpoints requires authentication now.
This is the official blog post:
https://pi-hole.net/blog/2022/11/17/upcoming-changes-authentication-for-more-api-endpoints-required/#page-content

I only have a quick-and-dirty solution right now. I've hardcoded the token in the check script.

    token = "TOKEN-FROM-PI-HOLE"
    status_url = 'http://' + host + ('' if port == 80 else ":"+str(port)) + '/admin/api.php?summaryRaw&auth=' + token

This change happens in line 42:
https://github.com/l13t/icinga2_check_pihole/blob/master/check_pihole.py#L42

I'll have a look if I can create a PR some time, passing the auth token as a parameter to the script.

Regards,
Bernd

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.