Running commands to create a custom configuration file
You can run commands on a target system and store the results in a custom configuration file.
You might want to do this to record a portion of the Windows Registry in a configuration file, for instance. You can save the results in a custom
configuration file to access the information using the Discovery Management Console.
Note: Output
that is captured by the
CMD:CONFCONTENT directives is displayed on the
Configuration Files tab in the Discovery Management Console if the target
type that is discovered has this tab in the Discovery Management Console.For example, assume that you wrote a custom server template called HomePageWebServer that subcategorizes Microsoft IIS. You can create a directive file with the same name, stored in the $COLLATION_HOME/etc/templates/commands directory, containing the following line:
CMD:NOP=reg export HKLM\Software\Microsoft\InetStp c:\windows\temp\iis.reg /y
CMD:CONFCONTENT.iisREG=cmd.exe /c type c:\windows\temp\iis.reg
When the commands in the directive file are run, the results of the Registry export (reg export)
are stored in a configuration file with the name iisREG.
Limitation: If
you use the
CMD:CONFCONTENT directive to extend the existing sensor, custom
application server sensor is run in addition to the existing sensor. In such case, the configuration
files are stored only for the sensor that stores the results last. For example, if you use the
directive to extend the Oracle sensor, both the Oracle and custom application server sensors are
run. If the Oracle sensor stores the results as last, the configuration files are collected only for
this sensor. If you want to store the configuration files that are captured by both sensors, you can
use prioritization rules to specify which sensor to store as last. For example, to store the
configuration files that are defined for both the Oracle sensor and the extension that you created,
you must first edit the extension to also collect all files that the Oracle sensor stores. Then, you
must set the custom application server sensor to have priority over the Oracle sensor. As a result,
the configuration files that are stored for the Oracle sensor and extension are captured by the
custom application server sensor. As an alternative, you can use custom template sensor extension.
The only difference in comparison to the custom application server sensor is that the results of the
existing sensor, for example the Oracle sensor, are included in the custom template sensor
extension. Therefore, you do not need to edit the extension, but the prioritization rules still
apply.For more information about the prioritization rules, see Adding prioritization rules to your configuration items (model objects).