Nagios Plugin to check equipment from a phoscon/deconz server
You need to install php-curl
If you find a bug or have a request, write me.
/usr/bin/php ./check_deconz.php -H 192.168.3.231 -m battery -e JHSWINDOW01 -w ~50 -c ~25
OK - JHSWINDOW01: 100% | battery=100%
/usr/bin/php check_deconz.php -H 192.168.3.231 -m openclosed -e JHSWINDOW04
OK - JHSWINDOW04: closed
/usr/bin/php check_deconz.php -H 192.168.3.231 -m closedopen -e JHSWINDOW04
CRITICAL - JHSWINDOW04: closed
/usr/bin/php ./check_deconz.php -H 192.168.3.231 -m gbattery_name -w ~80 -c ~25
CRITICAL - Total: 25 OK: 22 Warning: 2 (JHSTEMPER01=75%, JHSTEMPER09=58%) Critical: 0 Offline: 1 (JHSMOTION01)
/usr/bin/php check_deconz.php -H 192.168.3.231 -m gbattery -e JHSMOTION01
CRITICAL - Total: 24 OK: 24 Warning: 0 Critical: 0 Offline: 0
/usr/bin/php ./check_deconz.php -H 192.168.3.231 -m temperature -e JHSTEMPER01 -c 8:22 -w 15:20
CRITICAL - JHSTEMPER01: 6.44°C | temperature=6.44°C
/usr/bin/php ./check_deconz.php -H 192.168.3.231 -m pressure -e JHSTEMPER08
OK - JHSTEMPER08: 1007 hPa | pressure=1007hPa
/usr/bin/php ./check_deconz.php -H 192.168.3.231 -m humidity -e JHSTEMPER08
OK - JHSTEMPER08: 51.58% | humidity=51.58%
IMPORTANT:
You must connect your nagios server with your phoscon app.
Step 1:
Download all files to your nagios plugins directory
Step 2:
In a new browser tab open the Phoscon App
Click on Menu → Settings → Gateway
Click on “Advanced” button
Click on the “Authenticate app” button
Step 3:
# /usr/bin/php deconz_config.php -H <phoscon IP> -P <phoscon Port> -m <mode>
example: /usr/bin/php deconz_config.php -H 192.168.3.231 -P 80 -m create
the scipt create a config file (f.e. 192.168.3.231.conf) with an apikey to connect to your phoscon app.
If you want to delete a config file and his apikey, call the script with -m delete
Usage: |
/usr/bin/php check_deconz.php -H [deconz server] -P [port] -m [mode] (-e [equipment] -l label -w warn -c crit -s =https -d =debug -h =help) |
mode |
battery gbattery gbattery_name temperature humidity pressure openclosed closedopen |
-e |
equipment |
-l |
lable |
Example Critical and Warning Numbers: |
|
-w 10 -c 20 | = warning > 10 and critical > 20 |
-w ~20 -c ~10 | = warning < 20 and critical < 10 |
-c @10:20 | = critical ≥ 10 and ≤ 20, (inside the range of {10 .. 20}) |
-c 10:20 | = critical < 10 or > 20, (outside the range of {10 .. 20}) |
-w 10:20 -c 5:25 | = warning < 10 or > 20, (outside the range of {10 .. 20}) and critical < 5 or > 25,(outside the range of {5 .. 25}) |
Version 1.20220614
gbattery_name sorted
add mode to deconz_config.php
(create, delete and config=list all apikeys)
Version 1.20220328
correct debug mode
Version 1.20220225
first Release