cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post

Configuration Template isn't writing to NRAM

I have a simple configuration change template to set the SNMP location & contact of Juniper devices. I created a new Juniper Device template because the default one wasn't working either.

Here is my configuration template.

/*

.CHANGE_TEMPLATE_DESCRIPTION

        This change template configures SNMP base options on JunOS devices.

.PLATFORM_DESCRIPTION

        Juniper, IOS, SNMP

.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.

.PARAMETER_LABEL @Location

        e.g. Office1 or Office2

.PARAMETER_DESCRIPTION @Location

        Specify a location for the SNMP device

*/

script ConfigureSNMPJuniperIOS (

NCM.Nodes @ContextNode,

string @Location

)

{

   string @Contact='"IT help@help.com"'

   string @SNMPLocation='"' + @Location + '"'

  CLI

{

edit

        set snmp location @SNMPLocation

        set snmp contact @Contact

}

}

Here is my device template

<!-- edited with XML Spy v4.4 U (http://www.xmlspy.com) by () -->

<!--SolarWinds Network Management Tools-->

<!--Copyright 2005 SolarWinds.Net All rights reserved-->

<Configuration-Management Device="Juniper Devices" SystemOID=" 1.3.6.1.4.1.2636">

<Commands>

<Command Name="Reset" Value="set cli complete-on-space off${CRLF}set cli screen-width 0${CRLF}set cli screen-length 0"/>

<Command Name="Reboot" Value="request system reboot${CRLF}yes"/>

<Command Name="EnterConfigMode" Value="edit"/>

<Command Name="ExitConfigMode" Value="exit"/>

<Command Name="DownloadConfig" Value="show"/>

<Command Name="UploadConfig" Value="${EnterConfigMode}${CRLF}${ConfigText}${CRLF}${ExitConfigMode}"/>

<Command Name="SaveConfig" Value="commit and-quit"/>

<Command Name="Version" Value="show version brief"/>

</Commands>

</Configuration-Management>

2/17/2020 1:44:52 PM on Corp-VC-Core (10.0.4.1) by HECLA\jsanders

When I run the commands in the CLI statement (set snmp location & contact...) by CLI via Putty and execute a commit I get the following.

{master:1}[edit]

jsanders@Corp-VC-Core# commit and-quit

fpc1:

configuration check succeeds

fpc0:

commit complete

fpc2:

commit complete

fpc3:

commit complete

fpc4:

commit complete

fpc1:

commit complete

Exiting configuration mode

{master:1}

jsanders@Corp-VC-Core>

However, when I run the script via the config template change and choose the write to NVRAM option I get

edit

Entering configuration mode

{master:1}[edit]

{master:1}[edit]

set snmp location "CdA Office"

{master:1}[edit]

set snmp contact "Hecla IT help@hecla-mining.com"

{master:1}[edit]

commit

fpc1:

The change does not commit and if I re-login to the box via putty it tells me I have uncommitted changes and they reflect the script I just ran.

--- JUNOS 12.3R9.4 built 2015-02-12 11:08:41 UTC

{master:1}

jsanders@Corp-VC-Core> edit

Entering configuration mode

The configuration has been changed but not committed

{master:1}[edit]

jsanders@Corp-VC-Core# show | compare

[edit snmp]

-  location Office2;

+  location "Office1";

What am I doing wrong?

Labels (2)
Tags (3)
0 Kudos
0 Replies