11-09-2023 02:38 AM
Is it possible to generate an alarm with python for nso 6.1.2.
I cannot find a good example here: ncs.alarm - Network Services Orchestrator (NSO) API v6.1 - Document - Cisco DevNet
Solved! Go to Solution.
11-09-2023 03:59 AM
Managed to make it work:
def create_alarm(alarm_content, device):
_alarm = ncs.alarm.Alarm(managed_device=device,
managed_object=ncs.alarm.managed_object_instance("/ncs:devices/ncs:device[ncs:name='" + device + "']"),
alarm_type='revision-error',
specific_problem='error',
severity='warning',
alarm_text='error')
ncs.alarm.raise_alarm(_alarm)
11-09-2023 03:59 AM
Managed to make it work:
def create_alarm(alarm_content, device):
_alarm = ncs.alarm.Alarm(managed_device=device,
managed_object=ncs.alarm.managed_object_instance("/ncs:devices/ncs:device[ncs:name='" + device + "']"),
alarm_type='revision-error',
specific_problem='error',
severity='warning',
alarm_text='error')
ncs.alarm.raise_alarm(_alarm)
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide