Commit 8487e3d5 authored by Olav Morken's avatar Olav Morken

get-triggers: Prepare for adding more options to filter the output.

parent dbba295c
......@@ -265,7 +265,11 @@ def find_empty(args):
def get_triggers(args):
rseverities = {v: k for k, v in SEVERITIES.items()}
print("Triggers with severity {severity} or higher:".format(severity=args.severity))
for trigger in invoke('trigger.get', selectHosts=['name'], min_severity=SEVERITIES[args.severity]):
kwargs = {
'selectHosts': ['name'],
'min_severity': SEVERITIES[args.severity],
for trigger in invoke('trigger.get', **kwargs):
description = trigger['description']
severity = rseverities[int(trigger['priority'])]
for host in trigger['hosts']:
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