cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
712
Views
10
Helpful
3
Replies

Triggering sync-from using SNMP traps

tcragg1
Cisco Employee
Cisco Employee

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
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
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: