Download details

check_deconz check_deconz.php

Informationen
Erstelldatum 25.02.2022
Änderungsdatum 29.03.2022
Version 1.20220328
Dateigröße 72.83 KB
Downloads 65
Lizenz MIT Lizenz external
Preis Donate PayPal

 

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
CRITICAL - Total: 25 OK: 24 Warning: 0 Critical: 0 Offline: 1 (JHSMOTION01)

/usr/bin/php check_deconz.php -H 192.168.3.231 -m gbattery_name -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 gbattery
CRITICAL - Total: 25 OK: 24 Warning: 0 Critical: 0 Offline: 1

/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> 

example: /usr/bin/php deconz_config.php -H 192.168.3.231 -P 80

the app create a config file (f.e. 192.168.3.231.conf) with an apikey to connect to your phoscon app.


 

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     
= warning and critical battery equipment

gbattery
= warning and critical all batteries

gbattery_name
= warning and critical all batteries and name warning/critical/offline equipment

temperature
= warning and critical temperature equipment

humidity
= warning and critical hunidity equipment

pressure
= warning and critical pressure equipment

openclosed
= citical open equipment

closedopen
= citical closed equipment

-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})

 


 


Changelog

Version 1.20220328
correct debug mode


Version 1.20220225
first Release


 

Would you like to support me?
Then donate to PayPal...