From a413157b26bf5d920bd33b80e1e0c4bf82c679a5 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Tue, 29 Nov 2022 18:18:13 -0500 Subject: [PATCH] Add a basic README.md --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..564691a --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# Check Home Assistant State # + +A check plugin for [Nagios](https://www.nagios.org/)/[Icinga](https://icinga.com/)/etc. that queries [Home Assistant](https://www.home-assistant.io/) for the current state of entities. + +## Requirements ## + +- [Python](https://www.python.org/) >= 3.7 +- [requests](https://pypi.org/project/requests) +- [nagiosplugin](https://pypi.org/project/nagiosplugin/) + +## Usage ## + +You will need a token for Home Assistant's REST API. +[Instructions to aquire one can be found here](https://developers.home-assistant.io/docs/api/rest/). + +At a minimum, you need to specify the token, home assistant url, a device class to filter by, and warning/critical ranges. +Example: +```sh +./check_home_assistant_state.py --token $HASS_TOKEN --url $HASS_URL --device-class battery --warning 20:100 --critical 10:100 +``` +See `--help` for more features/arguments. + +A CheckCommand config for Icinga2 can be generated with `--make-icinga-conf`.