Skip to content

Commit

Permalink
#2 - fix check that 'performance_data' is not None.
Browse files Browse the repository at this point in the history
  • Loading branch information
thenodon committed Sep 2, 2019
1 parent 36b77b4 commit 5417f33
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion icinga2_exporter/perfdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def get_perfdata(self) -> dict:
if 'results' in data_json:
for serivce_attrs in data_json['results']:
if 'attrs' in serivce_attrs and 'last_check_result' in serivce_attrs['attrs'] and 'performance_data' in \
serivce_attrs['attrs']['last_check_result']:
serivce_attrs['attrs']['last_check_result'] and \
serivce_attrs['attrs']['last_check_result']['performance_data'] is not None:
check_command = serivce_attrs['attrs']['check_command']
# Get default labels
labels = {'hostname': serivce_attrs['attrs']['host_name'],
Expand Down

0 comments on commit 5417f33

Please sign in to comment.