Updating Discovery to version 3.x
Requirements
Here are the requirements for this version:
- .Net Framework 4.7.2
- Insight 8.1 or later
Assets Discovery 3.1.9 or later:
- If you are using Assets bundled with Jira Service Management, upgrade to Jira Service Management 5.3 or later.
- If you install Assets via the marketplace, upgrade to Assets 8.10.12 or later.
Upgrade FAQs
Some questions you might have:
Patterns
In Discovery 3.x, the logic of the pattern files has changed in the following way.
Previously, each pattern has returned an object or a list with particular information based on the use case and the internal logic and merged the new information with the previously fetched data.
Example
For example, the pattern used to get the hostname of a Linux system:
- In Discovery 2.x, the pattern has created a new HostInfo-Object and added the Hostname-Attribute from the result to that object.
- In Discovery 3.x, the pattern is reusing the HostInfo-Object that is initially created on the start of the scan and enrich the Hostname-Attribute from the result.
That means that the merge logic has removed and the full transparency of data is moved to the pattern execution.
New command results
In Discovery 3.x, every pattern process type has a command result implementation:
Process type | Command result type |
---|---|
WMIQuery | WMIQueryResult |
WMIRegValue | WMIRegValueResult |
WMIRegValueList | WMIRegValueListResult |
WMIExecute | WMIExecuteResult |
PowerShellExecute | PowerShellExecuteResult |
SSHExecute | SSHExecuteResult |
SNMP_GET | SNMPExecuteResult |
SNMP_WALK | SNMPExecuteResult |
VIMObject | VIMCommandResult |
Adjusting custom patterns
If you created custom patterns, update them in the following way:
SSH Provider
In earlier versions, we parsed the command result directly to the string:
string input = (string)parameters[0];
Now, we parse it to SSHExecuteResult
, which has the command result default Interfaces (clickable and redirecting user to the part of the page that includes the interfaces ( LogResult, IsNullOrEmpty..)):
SSHExecuteResult sshExecuteResult = (SSHExecuteResult)parameters[0];
SshExecuteResult
is a custom implementation of string and if we want to use string methods, we can parse SshExecuteResult to string.
string commandResult = sshExecuteResult;
WMI Provider
Since there are multiple result types, every single one of them will have its own implementation:
WmiExecuteResult
class which is the same as SSH(custom string implementation):
WMIExecuteResult result = (WMIExecuteResult)parameters[0];
WmiPowerShellResult
class which is also a string result:
PowerShellExecuteResult result = (PowerShellExecuteResult)parameters[0];
WmiQueryResult
class which is List of Dictionaries.
ManagementObjectCollection results = (ManagementObjectCollection)parameters[0];
WMIQueryResult commandResult = (WMIQueryResult)parameters[0];
WmiRegistryListResult
which is a list of strings.
WmiRegistryResult
which is a list of objects.
SNMP Provider
SnmpExecuteResult
class is the implementation of Dictionary<string, object>
List<ExtendedInformation> input = (List<ExtendedInformation>)parameters[0];
SNMPExecuteResult commandResult = (SNMPExecuteResult)parameters[0];
VIM Provider
VimCommandResult
is implementation of List<EntityViewBase>
List<EntityViewBase> input = (List<EntityViewBase>)parameters[0];
VIMCommandResult commandResult = (VIMCommandResult)parameters[0];
Default Interfaces
By default, the new CommandResult Classes have useful functions that you can use:
IsNullOrEmpty()
- Checks if object is null or empty.LogResult()
- Log Command with result objects (explanation how to pass log level) .
New object types
Discovery 3.x includes new object types:
- User
- Group
New object attributes
Discovery 3.x includes new object attributes:
Device
- Type
- Model
- Serial Number
- Vendor
Database
- Instance Name
- Port