Commit 6f6c57b4 authored by Hamza Dely's avatar Hamza Dely
Browse files

[Icinga] Gestion séparée de l'autonomie et du niveau de la batteriedes onduleurs

parent 8ee52edf
......@@ -165,13 +165,13 @@ class UPS(nagiosplugin.Resource):
if self.oid_type == 'IETF':
res = OrderedDict({
'Etat' : Probe(int(b_state[0]), None, None, None, 'batt_state'),
'Autonomie' : Probe(int(b_state[2]), 'mn', 0, None, 'level'),
'Autonomie' : Probe(int(b_state[2])*60, 's', 0, None, 'autonomy'),
'Niveau' : Probe(int(b_state[3]), '%', 0, 100, 'level'),
})
else:
res = OrderedDict({
'Autonomie' : Probe(int(b_state[0]), 's', 0, None, 'level'),
'Autonomie' : Probe(int(b_state[0]), 's', 0, None, 'autonomy'),
'Niveau' : Probe(int(b_state[1]), '%', 0, 100, 'level'),
})
......@@ -254,6 +254,7 @@ def main():
nagiosplugin.ScalarContext('temperature', '10:20', '0:30'),
nagiosplugin.ScalarContext('hygrometry', '65', '85'),
nagiosplugin.ScalarContext('level', '20:', '5:'),
nagiosplugin.ScalarContext('autonomy', '1200:', '600:'),
StateContext('batt_state'),
StateContext('out_state'),
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment