Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions icinga2_exporter/perfdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,9 @@ def add_labels_by_items(label: str, key: str) -> dict:
@staticmethod
def get_host_meta_custom_vars(host_attrs):
labels = {}
for custom_vars_key, custom_vars_value in host_attrs['attrs']['vars'].items():
labels[custom_vars_key.lower()] = Perfdata.valid_prometheus_label_values(custom_vars_value)
if type(host_attrs['attrs']['vars']) == dict:
for custom_vars_key, custom_vars_value in host_attrs['attrs']['vars'].items():
labels[custom_vars_key.lower()] = Perfdata.valid_prometheus_label_values(custom_vars_value)

return labels

Expand Down