How to use custom variables in cnMaestro for a Switch/Switches

Summary: This article demonstrates how to update the System location from the cnMaestro instead of logging in to each Switch locally and updating. When we have multiple Switches managed by a single Switch Group in cnMaestro, and all the Switches belong to a different location.

What’s User-Overrides: The User-Defined Overrides methods let you set the value within cnMaestro per device so the same value isn’t sent to all devices/Switches in the Switch Group. User-defined Overrides are partial device templates that can be attached to a Switch Group. Any configuration entered here is given preference over any values set in the Switch Group.

What’s Customer Variables: Custom variables will allow you to do advanced and customized configuration at the device level. We can create a custom variable using User-Defined Overrides which takes precedence over the Switch Group configuration.

Note: I have taken the example of adding System contact & location details to a Switch using a custom variable in cnMaestro.

Step 1: To add custom variables via cnMaestro, please navigate to Switch group > Configuration > User Overrides and add the values as follows

Values/command/variables:

!

system contact ${Contact= “”}

system location ${Location= “”}

!

Note: " " [Can be filled with any value or leave it without any value]

Since we are adding the variable and location globally (under Switch Group), it will push the location to all the Switches.

Step 2: Once the overrides are added, we can see an additional option called “Configuration Variables (Advanced)” under Switch > Configuration

1st way of configuring:

We can configure from Monitor and Manage → System → Configuration → Device type “cnMatrix” → Select the Switch Group → Go to the setting option of every Switch (right hand side) → we will have an advanced option (Configuration Variables (Advanced)) → Expand that → provide the location accordingly → select the Switch and apply the configuration from the bottom of the page.

2nd way of configuring:

Note: We can’t use space while providing location value. If we want to give space, then we need to give values under “_” (like: “The Cambium Networks”) and the result of this would be:

(" value ")

Criteria while using the custom variable: When we use custom variables to configure Switch’s contact & location from cnMaestro and using the following config format, in that case, we will not see information on Switch’s WebUI and can only be seen via Switch CLI.

Refer to the below screenshots:

image

However, if we have done the config like the following, then we will see the config on Switch WebUI:

Switch-WebUI:

Switch-CLI:

2 Likes