-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_all_netatmo
executable file
·35 lines (30 loc) · 2.15 KB
/
check_all_netatmo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
#
# Check_MK local agent extension.
# Use this script to poll all Netatmo sensors through check_mk agent.
# Install in $OMD_ROOT/local/bin together with the check_netatmo script.
#
# Soren Juul Moller, November 2018
VERSION=`check_netatmo -v | cut -d' ' -f2`
DEVICEID="$1"
echo '<<<check_mk>>>'
echo "Version: $VERSION"
echo 'AgentOS: linux'
echo 'OnlyFrom:'
echo '<<<local>>>'
check_netatmo -d $DEVICEID -L Indoor_temp -a '{last_status_store}' -T -w3600 -c7200 -p '3600:7200' -m 'Indoor last seen %t ago'
check_netatmo -d $DEVICEID -L Netatmo_server_status -a '{status}' -e ok
check_netatmo -d $DEVICEID -M Outdoor -L Outdoor_RF_status -a '{rf_status}' -w120 -c150 -p '120:150:40:200'
check_netatmo -d $DEVICEID -M Outdoor -L Outdoor_batteri_pct -a '{battery_percent}' -w12: -c6: -p '12:6:0:100'
check_netatmo -d $DEVICEID -M Outdoor -L Outdoor_batteri_voltage -a '{battery_vp}' -w4500: -c4000: -p '4500:4000:3500:6500'
check_netatmo -d $DEVICEID -M Outdoor -L Outdoor_timestamp -a '{last_seen}' -T -w3600 -c7200 -p '3600:7200' -m 'Outdoor last seen %t ago'
check_netatmo -d $DEVICEID -M 'Rain Gauge' -L Rain_Gauge_RF_status -a '{rf_status}' -w:120 -c:150 -p '120:150:40:200'
check_netatmo -d $DEVICEID -M 'Rain Gauge' -L Rain_Gauge_battery_pct -a '{battery_percent}' -w12: -c6: -p '12:6:0:100'
check_netatmo -d $DEVICEID -M 'Rain Gauge' -L Rain_Gauge_battery_voltage -a '{battery_vp}' -w4770: -c4360: -p '4770:4360:3500:6500'
check_netatmo -d $DEVICEID -M 'Rain Gauge' -L Rain_Gauge_timestamp -a '{last_seen}' -T -w3600 -c7200 -p '3600:7200' -m 'Rain Gauge last seen %t ago'
check_netatmo -d $DEVICEID -L WiFi_status -a '{wifi_status}' -w75 -c86 -p '75:86:40:100'
check_netatmo -d $DEVICEID -M 'Wind Gauge' -L Wind_Gauge_RF_status -a '{rf_status}' -w120 -c150 -p '120:150:40:200'
check_netatmo -d $DEVICEID -M 'Wind Gauge' -L Wind_Gauge_battery_pct -a '{battery_percent}' -w12: -c6: -p '12:6:0:100'
check_netatmo -d $DEVICEID -M 'Wind Gauge' -L Wind_Gauge_battery_voltage -a '{battery_vp}' -w4770: -c4360: -p '4770:4360:3500:6500'
check_netatmo -d $DEVICEID -M 'Wind Gauge' -L Wind_Gauge_timestamp -a '{last_seen}' -T -w3600 -c7200 -p '3600:7200' -m 'Wind Gauge last seen %t ago'
exit $?