Input Configuration Parameters for the monitor instance also serve as useful parameters for user-defined scripts. To access the parameters, you must know their names internal to BMC ProactiveNet. The procedure to obtain the names is
described as follows:
■ Run the command pw device help -mlist to obtain a list monitor names. Monitor type names are in the extreme right column of the output.
Run the command pw export meta config MonitorTypeName to retrieve a list of configuration parameters for the given monitor type.
For example:
$ pw export meta config MSSQLServerQuery MSSQLServerQuery (25061) CONN_TYPE (250602) DATA_SOURCE (250606) DB (250611) INI_FILE (250603) INSTANCE_NAME (250601) PASSWORD (250605) PORT (250610) PW_MON_VER (250626) SQL (250607) SRCIP (250615) TARGETIP (250693) USER_NAME (250604)
With this monitor type, the possible parameters are $INSTANCE_NAME, $USER_NAME, $PASSWORD, $PORT, etc.
Note
If you use this option, you must ensure that this command is attached to the right monitor type. In this example, the command should only be attached to 'MS SQL Server Query'. Refer 'attaching the command under a 'Monitor Type' section for further information.
Example command:
/usr/bin/sh -c 'cd /home/kchong; find . -name "*.java" -print' $pronethome/scripts/querydb.sh $USER_NAME $PASSWORD $PORT
■ Show Output - This option is displayed only if Command is selected as the Processing Option. Determines whether to display the output or not while
executing the command. If this option is not selected, BMC ProactiveNet launches the script without waiting for its completion, but reports back right away whether the script has been successfully launched or not. There is a default timeout period of 300 secs for executing a user command.
Note
If the operation times out, the script that is still being executed on the agent is terminated.
■ Configuration Diagnostic - Select this option to qualify this Detailed Diagnostic command to be run with every configuration poll of select system monitors (AIX, HPUX, Linux, Solaris, Windows, and X86).
■ Timeout - Specify the duration (between 5 and 55 minutes) the system must wait before timing out this command.
■ Agent from which CMD is launched - This option is displayed only if Command is selected as the Processing Option. When you are registering a command, you must select the Agent where this command will be executed. In using a URL the agent selection is not required. You need not select an agent if you are registering a URL.
■ Use Agent on which the monitor is running - This enables running the command on the agent to which the command’s monitor belongs.
■ Prompt for Agent - In this case, the Agent is known when the command is being executed. This option is ignored if the command was triggered by an event rule. It defaults to as if the first option was selected.
■ Predefined Agent - Choose the Agent from the list of predefined agents.
■ Use Agent on which the monitor is targeted – This enables running the command on the agent to which the command’s monitor is targeted.
1 Click Next.
Select the Device OS on the new window. —The left list contains all available OS. —The right list contains all selected OS.
—Click >> to move a selected OS from the left list to the right. —Click << to move a selected OS from the right list to the left. —Select All to select all items in the left list.
—Select None to not attach any specific OS type.
2 Click Next after selecting the required OS.
—The left list contains all available Monitor Types.
—The right list contains all selected Monitor Types under which you want to attach this command.
—Click >> to move a selected monitor from the left list to the right. —Click << to move a selected monitor from the right list to the left. —Select All to select all items in the left list.
—Select None to not attach any specific monitory type. Note
If you choose to use instance configuration parameters to define the command, the parameters selected should be in the monitor type selected.
3 Click Next. Select the User Groups on the new screen. —The left list contains all available User Groups. —The right list contains all selected User Groups.
—Click >> to move a selected User Group from the left list to the right. —Click << to move a selected User Group from the right list to the left. —Select All to select all items in the left list.
—Select None to not attach any specific User Group. Note
The access permissions that are set while defining the User groups takes precedence, that is, if the user group is defined with “All Diagnostics” in the Diagnostics tab, then the newly created diagnostics will be available to those user groups irrespective of whether they are selected/non-selected in the Add to User Group screen in the Add Command module of the Diagnostics wizard.
4 Click Finish.
This registers the commands with BMC ProactiveNet Server and opens a 'Test' window, if the command type is 'Command'.
5 Click Transfer. No need to define script if you use this option.
To transfer the script, see Transfering files to agentsAfter a script monitor is defined, the corresponding script(s) and any dependent file(s) need to be
deployed on the required agent(s) so that monitor instances may be created and run from those agents. Script(s) and any dependent file(s) needed for the
operation of Script DDs may also need to be deployed on required agent(s) in order to run those DDs on those agent(s). A need may also arise to distribute arbitrary file(s) (Example: keystore file containing new self-signed or CA- signed certificates) from BMC ProactiveNet Server to various connected agents. This can be done using the transfer files to agents functionality. Transfer Files to Agents enables the user to select files that need to be transferred to agent(s) and optionally also specify a single destination directory on the agent(s) where all the files will be transferred. The user can also select the agent(s) to transfer file(s). If you do not have the proper access rights, then the Transfer files to agents feature is disabled. .
Once transferring is finished BMC ProactiveNet returns to Test Your Command screen.
6 Test the Command in the Test Your Command window.
a From the Source Agent list, select the Agent on which you want to test the command.
b Use Target IP to execute the command on the given target IP. If the required Target IP is not available in the list, use 'Edit Target IP', which will bring editable Target IP text fields as shown in the Administration console, from the list. This is applicable only if $ip is one of the parameters.
c Click Test to invoke a test.
The output is displayed in the Output area and the status is displayed at the bottom of the window. Data returned from the Detail Diagnostic history output is ordered by the timestamp when the data is gathered.
■ Server Time - Time when the action is triggered.
■ Agent Time - Time when the agent actually executes the action. Agent Time could be different from the Server Time for the following reasons:
The Agent is a remote agent and its time is different from the server's.
The Agent is a local agent but the action didn't take place immediately after the event has occurred. Depending on the state of the server, a busy server could cause some delay.
1 Click Ok to close the window and bring up a list of all commands that have been registered.
These diagnostic commands will now be available from the Operations Console's Tools menu as well as from the Event Rule Creation/Edit page.
a Check Event Summary tables.
Verify that the command is available in the Tools menu from the Device Matrix, Service Matrix, and All Events tables. If it is present, then the new command is available for use.
Note
From the Service Matrix table you need to drill down to the Show Monitor level to access the Tools menu.
You can now:
—Execute this command manually from the Tools menu, and
—Attach it to an event rule so that it executes automatically when an event is triggered (recommended).
Note
These commands will only be displayed in the Tools menu against the monitor types where the diagnostic was registered.
1 Attach Script Command to an Event Rule.
Once you register the Script Command, it is recommended that you attach it to an event rule so that it executes automatically when an event is triggered. Check the thresholds to ensure that the attributes you want are enabled.
1 Options => Edit Thresholds
2 Modify the default settings, if necessary.
3 Select Enabled for the attributes required.
4 Click Apply.
a Create the Event Rule.
Once you have selected and edited the thresholds as required, you can create the rule and attach it to an event.
1 Click Options => Event Rule Admin. A list of default scripts appears on the Event Rule Administration screen. These are the Preconfigured Commands that come with BMC ProactiveNet.
2 Click Add. The Create Event Rule screen is displayed.
Follow the instructions to create and attach the event rule to the new command you just registered.
Diagnostics that are auto-triggered have their output saved in the database and
table. The Diagnostics Double Arrow icon is displayed when an event has been triggered. When it is displayed, click the Double Arrow icon to show the
diagnostic output. If this column displays None, then there are no diagnostics for that event.