Browse Source

temperature skipped (OK) for shelly1 - no sensor

master
Dirk Alders 1 year ago
parent
commit
cfdef25501
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      check_shelly

+ 3
- 0
check_shelly View File

19
 #
19
 #
20
 TMP_WARNING = 50
20
 TMP_WARNING = 50
21
 TMP_ERROR = 57
21
 TMP_ERROR = 57
22
+#
22
 
23
 
23
 if __name__ == "__main__":
24
 if __name__ == "__main__":
24
     parser = argparse.ArgumentParser(
25
     parser = argparse.ArgumentParser(
79
     elif args.check == 'temperature':
80
     elif args.check == 'temperature':
80
         temperature = data.get('tmp', {}).get('tC')
81
         temperature = data.get('tmp', {}).get('tC')
81
         if temperature is None:
82
         if temperature is None:
83
+            if args.hostname.startswith('shelly1-'):
84
+                n.exit(n.OK, "Shelly1 has no temperature information")
82
             status = n.UNKNOWN
85
             status = n.UNKNOWN
83
         elif temperature >= TMP_ERROR:
86
         elif temperature >= TMP_ERROR:
84
             status = n.ERROR
87
             status = n.ERROR

Loading…
Cancel
Save