- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2020 05:51 PM
Hi All,
I recently reviewed the OOB "Network Switch" infrastructure pattern to get some inspiration for how I might expand some of my companies custom network appliance patterns.
When exploring this pattern I noticed that there are a number of temporary variables available upon load of the pattern i.e. "fqdnRegex" and "hostnameCase".
My question is how and where are these variables defined and set? I thought it may have been in the SNMP classification using the "On classification script" but this is empty for Standard Network Switch classifier.
Any help on this would be much appreciated.
Brent
Solved! Go to Solution.
- Labels:
-
Discovery

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2020 05:22 AM
Those are Discovery Properties: glide.discovery.fqdn.regex and glide.discovery.hostname.case.
They are called during the pre-script "Fetch Hostname Formatting Attributes".

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2020 05:22 AM
Those are Discovery Properties: glide.discovery.fqdn.regex and glide.discovery.hostname.case.
They are called during the pre-script "Fetch Hostname Formatting Attributes".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2020 09:11 PM
Thanks for the information
The pattern pre/post scripts, that set the temporary variables (amongst other things) are held in the [sa_pattern_prepost_script] table.
You can navigate to it through the application menu - Pattern Designer >> Pre Post Processing or use the shortcut sa_pattern_prepost_script.list
The pre-execution script I needed was as follows:
Attribute | Value |
Name | <name of script> |
Pattern/s | <g_list link to your pattern> |
Execution Type | 1 - Horizontal Discovery |
When to execute | 3 - Pre execution |
Script:
/*
* Pre execution: This script will run before the execution of the assigned pattern/s
* it allows the user to add data that can be accessed by the running the pattern
*this is done by adding variables to the scriptable PrePatternExecutionData object
* below is an example of the possible variables that can be added.
*/
var data = new SNC.PrePatternExecutionData();
data.addString('shouldIncludeDomain',gs.getProperty('glide.discovery.hostname.include_domain', 'false'));
data.addString('hostnameCase',gs.getProperty('glide.discovery.hostname.case', 'No change'));
data.addString('fqdnRegex',gs.getProperty('glide.discovery.fqdn.regex', "^([^.]+)\\.((?:[^.]+\\.)+[^.]+)$"));
//must return the data at end
rtrn = data;
Hopes this helps other people,
Brent
P.S. If you found this information useful then please mark this post as helpful so other community members can benefit from this information.