Align Nagios plugins with Python3
This commit aligns Nagios plugins with Python3. Since dict.iteritems() was removed in Python3 and substituted with ditc.items() we have to change them in plugins. Change-Id: I782f90a91e8dadd959c4d8537a80c44180c0b78d
This commit is contained in:
parent
f3744bea22
commit
548c599498
|
@ -73,7 +73,7 @@ def main():
|
|||
if metrics:
|
||||
criticalMessages = []
|
||||
warningMessages = []
|
||||
for key, value in metrics.iteritems():
|
||||
for key, value in metrics.items():
|
||||
if value == args.critical:
|
||||
criticalMessages.append("Critical: {metric_name} metric is a critical value of {metric_value}({detail})".format(
|
||||
metric_name=args.health_metric, metric_value=value, detail=key))
|
||||
|
|
|
@ -118,7 +118,7 @@ def update_config_file(object_file_loc):
|
|||
def get_nagios_hostgroups(node_list):
|
||||
hostgroup_labels = set()
|
||||
for host, labels in get_nagios_hostgroups_dictionary(
|
||||
node_list).iteritems():
|
||||
node_list).items():
|
||||
hostgroup_labels.update(labels)
|
||||
|
||||
nagios_hostgroups = []
|
||||
|
|
Loading…
Reference in New Issue