SPDCommand

Purpose

Send a command to the Event Server, which will forward the command to the host system identified by objectClass and objectName.

Syntax

#using Spo.SPDlib
SPD_errorType SPDCommand
(
   string hostName,
   string command,
   string reservedValue,
   SPD_commandCallback callback,
   object passback
);

Description

This function sends the command to the host identified by hostName where hostName is the name of a host managed by Operations Sentinel. The command is in the format that is expected by the host.

reservedValue

is provided for future use. Specify SPD_reservedValue for this parameter.

callback

is invoked when it is known whether the command was successfully received by the host. Specify NULL if you do not want a callback function to be invoked.

passback

is a value passed to the callback function. You can use it to correlate the command submission with the callback function. Specify NULL if there is no value.

The specified host must match the name of a host that is being actively monitored by Operations Sentinel. If not, the command is discarded and the callback is invoked with an error status.

If more than one path exists to a host, the command will be sent along only one of the paths. The path is selected on a “first connected, first selected” basis, meaning that the path that is set up first in Operations Sentinel is the one selected. This multiple path problem exists in the following conditions:

For UNIX hosts, the command might have no effect unless the connection is logged on. There is no way for Operations Sentinel to determine if the connection is logged on, so the command callback will be invoked with a successful status.

Return Value

The return value indicates whether an error occurred, as follows.

Return

Indication

SPD_normal

No error

SPD_notInitialized

SPDInitClient not called previously

SPD_badHostName

Bad hostName parameter

SPD_badCommand

Bad command parameter

SPD_badReservedValue

Reserved value not NULL

SPD_commFailure

Communications problem

SPD_errException

A .NET runtime exception occurs

Note: The return status does not tell the client program if the command was actually sent to the specified host or console. The callback function informs the client of this information.