Do not count netdata cleared and undefined alarms as warnings (#37505)
* Add NetdataAlarms alarm sensor to additionally collect alarm information from the netdata host * Incorporate suggested changes by @MartinHjelmare * Change from pictures to icons * Simplify API callbacks following home-assistant-ecosystem/python-netdata/pull/5 and home-assistant-ecosystem/python-netdata/pull/6 * Bring back lost empty line * Update the library version in manifest.json * Update the library version in requirements_all.txt * Linting * Linting * Fix typo * Do not count cleared and undefined alarms as warnings * Do not count cleared, undefined and uninitialized alarms as warnings
This commit is contained in:
parent
f7c4900d5c
commit
988a335e9d
1 changed files with 6 additions and 0 deletions
|
@ -196,6 +196,12 @@ class NetdataAlarms(Entity):
|
||||||
for alarm in alarms:
|
for alarm in alarms:
|
||||||
if alarms[alarm]["recipient"] == "silent":
|
if alarms[alarm]["recipient"] == "silent":
|
||||||
number_of_relevant_alarms = number_of_relevant_alarms - 1
|
number_of_relevant_alarms = number_of_relevant_alarms - 1
|
||||||
|
elif alarms[alarm]["status"] == "CLEAR":
|
||||||
|
number_of_relevant_alarms = number_of_relevant_alarms - 1
|
||||||
|
elif alarms[alarm]["status"] == "UNDEFINED":
|
||||||
|
number_of_relevant_alarms = number_of_relevant_alarms - 1
|
||||||
|
elif alarms[alarm]["status"] == "UNINITIALIZED":
|
||||||
|
number_of_relevant_alarms = number_of_relevant_alarms - 1
|
||||||
elif alarms[alarm]["status"] == "CRITICAL":
|
elif alarms[alarm]["status"] == "CRITICAL":
|
||||||
self._state = "critical"
|
self._state = "critical"
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue