cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
255
Views
10
Helpful
3
Replies
tcragg1
Cisco Employee

Triggering sync-from using SNMP traps

Is it possible to use the NSO SNMP notification receiver to trigger a sync-from operation? If so, does anyone have any example code they can share?

3 REPLIES 3
hniska
Cisco Employee

Yes with a little bit of work you can. Setup NSO to receive the traps you want

https://developer.cisco.com/docs/nso/guides/#!snmp-notification-receiver/snmp-notification-receiver

 

and then setup a kicker that monitors those alarms. Something like

 

admin@ncs% show kickers
data-kicker out-of-sync-alarm {
monitor /al:alarms/alarm-list/alarm;
trigger-expr "type='al:out-of-sync' and is-cleared='false'";
kick-node xxxx;
action-name xxxxx;
}

 

Of course you need to change the trigger-expression to trigger on your SNMP trap and also create a new nice action to parse the device name from the alarm etc so you can execute the sync-from action on the right device :). 

Is it possible to use python for the code for the SNMP notification receiver and the kicker? The docs only appear to mention java for this, and unfortunately I don't speak java.

Kicker is NSO specific and you can write you action in python if you like. The only thing that is in java in the trap stuff and you should be able to handle that piece even if you don't write java. I think the only thing you need to worry about is the one where you match the oid. 

 

            if (vb.getOid().toString().equals("1.3.6.1.6.3.1.1.4.1.0")) etc