02-25-2015 03:11 PM
Device Group based on config
Greetings, I am trying to figure out if I can create a device group based on the content of the config.
Use case, some of the devices have a line starting like this -
monitor session xxx xxx xxxx
I want to put all the devices in a Device Group if contains that line. Is this possible to do within the tool or from API?
02-25-2015 05:12 PM
You can not create a Group base off the of something in the Running/Starting Config in NetMRI
You can do either one of these:
1 - Create a simple rule that any config should not contain:
monitor session .+
This will generate an issue that you can setup to email you
2 - You can do a Config Search of all the current running configs and it will tell you
Let me know if this helps
02-26-2015 09:54 AM
Config Search will work for now.
Thanks for the idea on the Rule, that will let me see the devices on an ongoing basis.
thanks again for the response.
09-08-2015 09:56 PM
Tito and team, you can now do this... :-). As of NetMRI 7.0, you may use custom fields to define device groups. Thus, to accomplish this use case, you would run a recurring job to extract the configuration data of interest, or simply insert a binary "yes" or "no" for all devices into a custom field, with one custom field for each criteria you want to group by, then use that custom field to define a group.
Below is the content from our updated NetMRI documentation on how to use custom fields in device group definitions.
Device Group Criteria and Device Custom Fields
Device Groups offer the flexibility to specify custom fields data as matching information against custom fields identification values defined on individual devices. You specify custom fields information in device groups through the Device Group Criteria. Doing so, you can craft device groups that match specific types of information, such as Business Units, operational function, and so on. Based on the information in the section Defining and Using Custom Fields, you can create device custom fields (“device” is a specific type of custom field that you can create and use for data matching) that are referenced by specific device groups for collection of devices into logically-named groups in Network Automation for asset manageability.
Supporting custom fields in device groups requires some specific Device Group Criteria syntax. Because a custom field can use the same nomenclature as a standard device attribute (for example, the Custom Fields feature does not prevent you from creating a custom field named “Type,” “Vendor” or “Model”), the device group criteria uses a convention to prevent conflicts. To do so, you prefix every Device Group Criteria reference to a device custom field with a syntax constant:
Consider the creation of a device custom field called “business_unit.” (For information on how to create custom fields in Network Automation, see Defining and Using Custom Fields.) Editing the Device Group Criteria field for a device group called “Consumer Banking Group” to support a device custom field, typical syntax is as follows:
$Assurance > 65 and $Type in ["Router","Switch-Router",”Switch”,”Firewall”] and $custom_business_unit = "Consumer Banking"
You prepend the constant $custom_ to the value “business_unit” to create the expression $custom_business_unit = “Consumer Banking”. Doing so in the Device Group Criteria ensures that any device that possesses a matching field value will match the “Consumer Banking Group” device group.
02-22-2018 01:16 PM
Since the last update on this thread, has there been any added functionality to NetMRI that will allow devices to be grouped based on a specific line of configuration? I have an active case open with support and I was told the only option at this point would be to create interface groups. This does not really help as I am trying to deploy policy rules against a very specific set of devices that would have a unique line of configuration.
Background info – simply trying to create a device group for devices that match an Interface description of “AT&T INET”.
Thanks in advance!
02-23-2018 08:22 AM
a month ago
I just wanted to circle back on this and see if there has been any added functionality or workarounds regarding device group creation for devices matching specific lines of config?
I tried the earlier suggestion which was simply to create a custom field and manually change that value for each device under the custom data screen and it did successfully add my test device after creating a group with that membership criteria.
However - I'm still looking for a way to have this done dynamically since there will be hundreds of devices and counting that need to be added into this group. How exactly would I be able to run a recurring job that simply sets the custom field based on the contents of the config?