SPD_Command

Purpose

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

The destination of the command submitted by SPD_Command cannot be a Windows host.

Syntax

#include "spd.h"
 
SPD_errorTP SPD_Command(
   char *objectClass,
   char *objectName,
   char *command,
   void *reservedValue,
   SPD_commandCallbackTP callback,
   SPD_passbackTP passback,
   char *application,
   char *applicationQualifier,
   time_t timeValue
);

Description

objectClass

is the class of the host system that is to receive the command. You can specify "host" if you do not need to further qualify the type of host system.

objectName

is the name of the host system that is to receive the command.

command

is the command being submitted to the host and must be in a format that the host expects.

reservedValue

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

callback

is the callback function that is invoked to return a status from the host system regarding the submission of the command. This callback function is described in 8.2. 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 you specify NULL for callback, or if there is no value.

application

identifies the application that is submitting the command. Specify NULL if the application is the same as the application that you specified on the call to SPD_InitClient.

applicationQualifier

further qualifies the application in the case where more than one instance of the application may be present. Specify NULL if the application qualifier is the same as the application qualifier that you specified on the call to SPD_InitClient.

timeValue

is the local time to be associated with the command. Specify the result of the C time function or 0 if no local time is to be associated with the command.

The host is actively managed if it has an active console connection. This eliminates Windows hosts, systems monitored using “spo_ping”, and UNIX systems that do not have a console to which an Operations Sentinel user is logged in. In addition, the configured Command Security for the host must allow an API client to submit commands to the host. If any active Operations Sentinel configuration has a value other than “Unlimited Access” for the host, the command is rejected.

If more than one path exists to a host, the command is sent along only one of these paths. The path is selected on a first-connected, first-selected basis: The path that is set up first by Operations Sentinel is the one selected. Multiple paths occur for UNIX hosts when more than one connection exists to the host. Multiple paths occur for OS 2200 hosts when more than one console is connected to the host, and each console is actively connected with the Operations Sentinel server.

For a UNIX system, the command has no effect unless the system’s console is accepting input (this normally requires that the console be logged in). Operations Sentinel cannot determine whether the console is accepting input, so the command callback is invoked with a successful status, even though an error occurs. If the console is not logged in, the UNIX system interprets the command as a response to the login prompt. For more information about login requirements, see 5.4.

Return Value

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

Return

Indication

SPD_normalCN

No error

SPD_notInitializedCN

SPD_InitClient not called previously

SPD_badClassCN

Bad objectClass parameter

SPD_badHostCN

Bad objectName parameter

SPD_badCommandCN

Bad command parameter

SPD_badReservedValueCN

Value other than SPD_reservedValueCN specified for reservedValue

SPD_commFailureCN

Communications problem

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.

See Also

Use of this function is illustrated in 6.7.