Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Community Member

Using DEVICE_TYPE in DCNM Templates

I'm running DCNM 6.3.1 and am trying to build a template for pushing out SNMP configurations.  I need to have the script evaluate the DEVICE_TYPE value and send commands based on if the device is a 7K or a 5K.  For some reason when I deploy the script, it does not match any of the IF statements and sends the default.  Can someone take a look at this script and tell me what I'm doing wrong?

##template properties
name =New_SNMP_Config;
description = Pushes new SNMP standard config to devices.;
tags = SNMP;
userDefined= true;
supportedPlatforms = All;
##

##template variables

string snmpContact; // the contact field in SNMP
string snmpLocation; // Device Location.  Should contain City, State and Rack Location
string ROString; //Read Only String
string RWString; //Read/Write String

##
##template content

snmp-server contact $$snmpContact$$
snmp-server location $$snmpLocation$$
snmp-server community $$ROString$$ use-acl 50
snmp-server community $$RWString$$ use-acl 50

if ($$DEVICE_TYPE$$ == "N7K") {
snmp-server community $$RWString$$ group vdc-admin
}
else if ($$DEVICE_TYPE$$ == "N5K") {
snmp-server community $$RWString$$ group network-admin

else if ($$DEVICE_TYPE$$ == "N5500") {
snmp-server community $$RWString$$ group network-admin

else {
snmp-server community $$RWString$$ group vdc-admin
}
##

38
Views
0
Helpful
0
Replies
CreatePlease to create content