I copied a previous script from Netflow. I am trying to create a template for my Cisco Devices to add username, remove old usernames, add SNMP and Radius. Copy of my script is below:
/*
.CHANGE_TEMPLATE_DESCRIPTION
This change template configures your Cisco Switches.
.CHANGE_TEMPLATE_TAGS
Cisco, IE2K, SNMP, Radius
.PLATFORM_DESCRIPTION
Cisco Switches
.PARAMETER_LABEL @ContextNode
NCM Node
.PARAMETER_DESCRIPTION @ContextNode
The node the template will operate on. All templates require this by default. The target node is selected during the first part of the wizard so it will not be available for selection when defining values of variables. The script validates correctly. But I need the part in yellow. That is only for Enabling Netflow. I simply want to be able to change the configuration of my device. What needs to go in the place of the yellow commands.
*/
script EnableNetflowOnCiscoASA (
NCM.Nodes @ContextNode,
string @NetFlowCollectorIPAddress,
int @NetFlowExportPort )
{
// Enter configuration mode and generate NetFlow commands
CLI
{
configure terminal
aaa new-model
aaa local authentication attempts max-fail 3
aaa group server radius radius2012
server name radius2012
exit
aaa authentication login default radius group local
aaa authentication enable default group radius enable
aaa authorization exec default radius group local
aaa session-id common
radius-server dead-criteria time 10 tries 3
radius server radius1A
address ipv4 10.x.x.x auth-port 1645 acct-port 1646
timeout 15
retransmit 2
key 7 xxxxxxx
exit
radius server radius2A
address ipv4 10.x.x.x auth-port 1645 acct-port 1646
timeout 15
retransmit 2
key 7 xxxxxxx
exit
no enable password
no enable secret
enable secret 5 xxxxxxxxxxxxxxx
no username xxxx
no username xxxx
username xxxx privilege 15 password 7 xxxxxxxxxx
username xxxx privilege 15 secret 9 xxxxxxxxxxxxxx
snmp-server community xxxxx RO Monitoring
snmp-server group xxxxxx v3 priv
snmp-server user xxxxxxxxxxxx xxxxxxxxxxxxx v3 auth sha xxxxxxxxx priv aes xxxxxxx
snmp-server host 10.x.x.x version 2c xxxxxxxxxxx udp-port 161
snmp-server host 10.x.x.x version 2c xxxxxxxxxxx udp-port 161
snmp-server host 10.x.x.x version 3 priv xxxxxxx
snmp-server host 10.x.x.x version 3 priv xxxxxxx
exit
wri mem
}
}