24x7 remote control for asp interface reference

49
Copyright © SoftTree Technologies, Inc. 1998-2002 All rights reserved 24x7 Scheduler 3.3 24x7 Remote Control ASP Interface Reference

Upload: others

Post on 26-Mar-2022

15 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 24x7 Remote Control for ASP Interface Reference

Copyright © SoftTree Technologies, Inc. 1998-2002 All rights reserved

24x7 Scheduler™ 3.3

24x7 Remote Control ASP Interface Reference

Page 2: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 2 -

Table of contents TABLE OF CONTENTS.............................................................................................................................2 OVERVIEW ............................................................................................................................................3

About the Component Object Model................................................................................................3 A quick example: VBScript as client................................................................................................3

24X7 REMOTE CONTROL ASP ..............................................................................................................4 Summary...........................................................................................................................................4 Properties ..........................................................................................................................................7 Constants ..........................................................................................................................................7 Functions ..........................................................................................................................................8

AddAgentProfile ...........................................................................................................................................8 AddDatabaseProfile.....................................................................................................................................10 AddHoliday .................................................................................................................................................11 ChangeFolder ..............................................................................................................................................12 CreateFolder ................................................................................................................................................13 CloseSession................................................................................................................................................14 CreateJob.....................................................................................................................................................15 DeleteAgentProfile ......................................................................................................................................16 DeleteDatabaseProfile .................................................................................................................................17 DeleteFolder ................................................................................................................................................18 DeleteHoliday..............................................................................................................................................19 DeleteJob.....................................................................................................................................................20 DisableJob ...................................................................................................................................................21 EnableJob ....................................................................................................................................................22 GetAgentList ...............................................................................................................................................23 GetDatabaseList ..........................................................................................................................................24 GetFolderProperty .......................................................................................................................................25 GetForecast..................................................................................................................................................26 GetGlobalVariable.......................................................................................................................................27 GetHolidays.................................................................................................................................................28 GetJobDefinition .........................................................................................................................................29 GetJobList ...................................................................................................................................................30 GetJobListEx ...............................................................................................................................................31 GetJobLog ...................................................................................................................................................32 GetJobProperty............................................................................................................................................33 GetJobStatus................................................................................................................................................34 GetStatusReport...........................................................................................................................................35 LogMessage ................................................................................................................................................36 OpenSession ................................................................................................................................................37 ProtectJob....................................................................................................................................................39 RunJob.........................................................................................................................................................40 RunScript.....................................................................................................................................................41 RunShellCommand .....................................................................................................................................42 SetFolderProperty........................................................................................................................................44 SetGlobalVariable .......................................................................................................................................45 SetJobProperty.............................................................................................................................................46 Test ..............................................................................................................................................................47 UnprotectJob ...............................................................................................................................................48

INSTALLATION ....................................................................................................................................49 Minimal System Requirements.......................................................................................................49 Installation Steps.............................................................................................................................49 Security issues ................................................................................................................................49

LICENSING ..........................................................................................................................................49

Page 3: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 3 -

Overview

About the Component Object Model The Microsoft Component Object Model (COM) defines a standard way for software components to supply services to each other. 24x7 Scheduler includes a build-in COM automation server called 24x7 Remote Control COM that provides access to the most features of the 24x7 Scheduler. A version of this component optimized for Active Server Pages is called 24x7 Remote Control ASP. Web-based client applications running within ASP can make use of the business logic in the 24x7 object by creating an instance of the object and calling the methods exposed in its interface. 24x7 Remote Control ASP uses a dispatch interface (also called dispinterface) that allows ASP-compliant tools such as VBScript and JavaScript to invoke methods on the 24x7 server using the Invoke method of a standard COM interface called IDispatch.

A quick example: VBScript as client The following paragraph provides a quick example of calling 24x7 Remote Control COM for ASP in VBScript code running inside ASP.

1. Declare 24x7 COM object variable Dim Remote_24x7Dim RetCode

2. Create 24x7 Remote Control, using its programmatic identifier (ProgID="24x7 Remote Control ASP") and check that the creation was successful:

Set Remote_24x7 = Server.CreateObject("24x7 Remote Control ASP")If Remote_24x7 Is Nothing Then ' Report error

Response.Write "<h2>Cannot load 24x7 Remote Control interface</h2>"End If

3. Access functions and properties of the 24x7 Remote Control using automation syntax: ' Open new sessionRetCode = Cint(Remote_24x7.OpenSession(UserName, Password, _

"Winsock", Host, Port, "", False))If RetCode <> 1 Then

' Report errorResponse.Write "<h2>" & Remote_24x7.LastError & "</h2>"

Else' Get job listRetCode = Cint(Remote_24x7.GetJobList(False))If RetCode <> 1 Then

' Report errorResponse.Write "<h2>" & Remote_24x7.LastError & "</h2>"

Else' Print job listResponse.Write "<p>" & Remote_24x7.isStringBuffer & "</p>"

End if' Done. Close sessionRetCode = Remote_24x7.CloseSession()

End If

Page 4: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 4 -

24x7 Remote Control ASP

Summary

Properties (Read Only)Boolean ConnectedToRemoteString LastErrorString TerminalString UserIDString ipStringBufferLong ipLongBuffer

Long RC_ERRORLong RC_INFOLong RC_WARNING

Functions

AddAgentProfile ( String ProfileName,String ComMethod,String Location,String Port,String Options ) returns Long

AddDatabaseProfile ( String ProfileName,String DatabaseDriver,String Server,String DatabaseName,Boolean AutoCommit,String User,String Password ) returns Long

AddHoliday ( Long Year,Long Month,Long Day,String Description ) returns Long

ChangeFolder ( String JobID,String TargetFolderID ) returns Long

CloseSession ( ) returns Long

CreateFolder ( String FolderName,String FolderDescription,ByRef Long FolderID ) returns Long

CreateJob ( String JobDefinition ) returns Long

DeleteAgentProfile ( String ProfileName ) returns Long

DeleteDatabaseProfile ( String ProfileName ) returns Long

Page 5: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 5 -

DeleteFolder ( String FolderID ) returns Long

DeleteHoliday ( Long Year,Long Month,Long Day ) returns Long

DeleteJob ( String JobID ) returns Long

DisableJob ( String JobID ) returns Long

EnableJob ( String JobID ) returns Long

GetAgentList ( Boolean HTMLFormat ) returns Long

GetDatabaseList ( Boolean HTMLFormat ) returns Long

GetFolderProperty ( String FolderID, StringPropertyName ) returns Long

GetForecast (Long Interval,Boolean HTMLFormat ) returns Long

GetGlobalVariable ( String VariableName ) returns Long

GetHolidays (Long Year,Boolean HTMLFormat ) returns Long

GetJobDefinition ( String JobID,Boolean HTMLFormat ) returns Long

GetJobList (Boolean HTMLFormat ) returns Long

GetJobListEx (Boolean HTMLFormat,String PropertyList ) returns Long

GetJobLog ( String JobID,Boolean HTMLFormat ) returns Long

GetJobProperty ( String JobID, StringPropertyName ) returns Long

GetJobStatus ( String JobID ) returns Long

GetStatusReport ( String DestinDir ) returns Long

Page 6: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 6 -

LogMessage ( Long SourceID,String SourceName,Long EventSeverity,String Message,Boolean ForceReportUpdate ) returns Long

OpenSession ( String User,String Password,String ComMethod,String ServerLocation,String ServerPort,String Options,Boolean Trace ) returns Long

ProtectJob ( String JobID,String ProtectionType,String JobPassword ) returns Long

RunJob ( String JobID,Boolean Detached ) returns Long

RunScript ( String Script ) returns Long

RunShellCommand ( String CommandLine,String Dir,Boolean Async,Long Timeout ) returns Long

SetFolderProperty ( String FolderID,String PropertyName,String NewValue ) returns Long

SetGlobalVariable ( String VariableName,String NewValue ) returns Long

SetJobProperty ( String JobID,String PropertyName,String NewValue ) returns Long

Test ( Long x ) returns Long

UnprotectJob ( String JobID,String JobPassword ) returns Long

Page 7: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 7 -

Properties

Boolean ConnectedToRemote Indicates session status• TRUE – session is opened• FALSE – session is closedSee OpenSession( ) function for details.

String LastError LastError stores the error text for the lastcaptured error.

You can use this property to obtain the error textwhen a function’s return value indicates that itfailed. Retrieve LastError immediately after afunction call fails.

String Terminal Network name of the computer where 24x7 COM+interface is invoked.

String UserID User name passed as a parameter to the last calledOpenSession( ) function. If an empty string waspassed, UserID contains network name of the userlogged on the computer where 24x7 COM+ interface isinvoked.

String ipStringBuffer This parameter is used to pass results of calls toGet methods. See method descriptions for moredetails.

Long ipLongBuffer This parameter is used to pass results of calls toGet methods. See method descriptions for moredetails.

Constants

Long RC_ERRORLong RC_INFOLong RC_WARNING

Constants that can be used with the LogMessage( )functions for the Severity argument.

Page 8: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 8 -

Functions

AddAgentProfile

Long AddAgentProfile ( String ProfileName,

String ComMethod,String Location,String Port,String Options )

The AddAgentProfile function creates new 24x7 Remote Agent or 24x7 MasterScheduler profile.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters:

ProfileName Name of the new Remote Agent Profile. This name must beunique.

ComMethod Name of the communication driver to be used for theconnections to the AgentValues are:

• WinSock• NamedPipes

Location The location of the Agent.

For the WinSock driver: Specifies one of the followingvalues:

• The IP address (for example, 199.99.99.91)• The host name of the remote computer (network

computer name in workgroup)• LocalHost (this indicates that the Agent resides

on the local machine)

For the NamedPipes driver: Specifies the locationportion of the pipe name. The combination of theLocation and Application values forms the pipe name. Thepipe name is constructed as follows:\\location\PIPE\application. If no location isspecified, a local pipe name is constructed using a dot(.) in the machine name portion.

Port For the WinSock driver: Specifies either of thefollowing:

• The port number for the Agent (for example,10099). Each server application requires a uniqueport number on the server machine. If you specifya port number, select a number that is greaterthan 4096 and less than 65536.

• The service name for Agent. The service name isan indirect reference to the port number. Themapping of the service name to the port number is

Page 9: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 9 -

specified in the TCP/IP services file. Normally,this file (SERVICES) is located in the Windowsdirectory for Win95/98 and in theC:\WINNT\SYSTEM32\DRIVERS\ETC directory forWinNT. You may need to edit this file manually toadd 24x7 Port or Service.

For the NamedPipes driver: Specifies the applicationportion of the pipe name. The combination of theLocation and Application values forms the pipe name. Thepipe name is constructed as follows:\\location\PIPE\application. The Application must beunique for the Location you specify.

Options Specifies one or more additional communications options.If you specify more than one option, you need toseparate the options with commas. For the Local driverthis property is ignored.

BufSize=n Sets the connection buffer size to thevalue specified.

MaxListeningThreads=n Determines the maximum numberof listening threads available on the MasterScheduler and Remote Agents.

MaxRetry=n Specifies how many times the Remote Controlwill try to connect when the Agent’s listening portis busy. Applies to the WinSock driver only.

NoDelay=1 Specifies that each packet be sent withoutdelay. Corresponds to the TCP_NODELAY option. Settingthis option may degrade performance significantly. Donot use this option unless you thoroughly understandits implications. Applies to the WinSock driver only.

RawData=1 Specifies that raw data be passed over thenetwork. By default, the WinSock driver obscures thedata that is passed over the network. Setting thisoption to 1 overrides the default behavior. Both theRemote Control and Agent must have the same setting.If there is a discrepancy between the Remote Controland Agent's settings, the communication fails.Setting this option to 1 may improve performanceslightly. Applies to the WinSock driver only.

Page 10: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 10 -

AddDatabaseProfile

Long AddDatabaseProfile ( String ProfileName,

String DatabaseDriver,String Server,String DatabaseName,Boolean AutoCommit,String User,String Password )

The AddDatabaseProfile function creates new database profile.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters:

ProfileName Name of the new Database Profile. This name should beunique.

DatabaseDriver The name of the database driver that you want to use forconnection. This name must much any supported DBMS nameas they are specified in the Database Profiles dialog in24x7 Scheduler (see Tools/Database Profiles menu).

Server (Optional) The database server name. The format forthe name differs for different database systems. Specifyan empty string "" if you connect to a local databaseand the server name is not required for connection. Ifyou connect using ODBC (DatabaseDriver="ODBC") specifyname of the desired ODBC profile as the Server name.

DatabaseName (Optional) The name of the database. Specify an emptystring "" if the database name is not required forconnection.

AutoCommit AutoCommit mode. Some databases support AutoCommit mode.Specify TRUE to turn AutoCommit on or specify FALSEotherwise. If DBMS does not support AutoCommit then thisparameter is ignored.

User The name of the user to log on to the database.

Password The password to use to log on to the database.

Page 11: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 11 -

AddHoliday

Long AddHoliday ( Long Year,

Long Month,Long Day,String Description )

The AddHoliday function adds new holiday to the 24x7 Holiday Table.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters:

Year Year part of the holiday date. Supported range 1900-3000

Month Month part of the holiday date. Supported range 1-12

Day Day part of the holiday date. Supported range 1-31. Daymust be a valid day for the specified Year and Month.

Description Holiday name or description limited by 50 characters.

Page 12: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 12 -

ChangeFolder

Long ChangeFolder ( String JobID,

String TargetFolderID )

The ChangeFolder function moves a job with the specified JobID to a jobfolder specified by the TargetFolderID value.Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters:

JobID Job ID converted to string or job name.

TargetFolderID Folder ID converted to string or folder name.

Page 13: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 13 -

CreateFolder

Long CreateFolder ( String FolderName, String FolderDescription)

The CreateFolder function creates new job folder.

Return: Returns 1 if the function succeeds or a negative number if an erroroccurs. Use the LastError property to obtain error description. If thefunction succeeds, the ipLongBuffer parameter is populated with the ID ofthe new folder. Folder ID can be used in other functions as a unique folderidentifier.

Parameters:

FolderName The name of the new folder

FolderDescription The description that you want to attach to the folder soother people can see how this folder should be used. Youcan specify an empty string if no description is needed.

Page 14: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 14 -

CloseSession

Long CloseSession ( )

The CloseSession function closes work session with the 24x7 Master Scheduleror 24x7 Remote Agent and terminates the connection. The session must bepreviously opened using the OpenSession function.The CloseSession function does not destroy 24x7 Remote Control COM object.The object can be reused to open another session. You must destroy theobject yourself using the appropriate command of the environment in which24x7 Remote Control COM was created. For example in VB it is Set object =Nothing. Failure to close the session may cause your program to hang orcrash. Failure to destroy the COM object may lead to a memory leak.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters: None

Example:

' create COM objectDim Remote_24x7 As Object

Set Remote_24x7 = CreateObject("24x7 Remote Control")

' open sessionRemote_24x7.OpenSession( "john_doe", "password", "WinSock", "LocalHost","10099", "", False)

' ... do something here ...

' close sessionRemote_24x7.CloseSession()

' destroy COM objectSet remote24x7 = Nothing

Page 15: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 15 -

CreateJob

Long CreateJob ( String JobDefinition )

The CreateJob function creates new job and adds it to the active job pool.

Return: Job ID of the created job as a positive number or a negative numberif an error occurs. Use the LastError property to obtain error description.

Parameters:

JobDefinition The Job definition in JDL format. For a wide variety ofexamples see job templates available in the [24x7 installdirectory]/Template subdirectory. The default path isC:\Program Files\24x7 Scheduler 2.0\Template.

For supported job properties and JDL properties see 24x7User's Guide.

Page 16: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 16 -

DeleteAgentProfile

Long DeleteAgentProfile ( String ProfileName )

The DeleteAgentProfile function deletes existing profile of 24x7 RemoteAgent or 24x7 Master Scheduler.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters:

ProfileName Name of the existing Remote Agent Profile.

Page 17: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 17 -

DeleteDatabaseProfile

Long DeleteDatabaseProfile ( String ProfileName )

The DeleteDatabaseProfile function deletes existing database profile.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters:

ProfileName Name of the existing Database Profile.

Page 18: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 18 -

DeleteFolder

Long DeleteFolder ( String FolderID )

The DeleteFolder function deletes job folder from 24x7 Job Database. If thespecified folder contains jobs, all these jobs are also deleted.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters:

JobID Folder ID converted to string or folder name.

Page 19: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 19 -

DeleteHoliday

Long DeleteHoliday ( Long Year,

Long Month,Long Day )

The DeleteHoliday function deletes holiday record from the 24x7 HolidayTable.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters:

Year Year part of the holiday date. Supported range 1900-3000

Month Month part of the holiday date. Supported range 1-12

Day Day part of the holiday date. Supported range 1-31. Daymust be a valid day for the specified Year and Month.

Page 20: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 20 -

DeleteJob

Long DeleteJob ( String JobID )

The DeleteJob function deletes job from both the active job pool and the24x7 Job Database.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters:

JobID Job ID converted to string or job name.

Page 21: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 21 -

DisableJob

Long DisableJob ( String JobID )

The DisableJob function disables job and removes it from both the active jobpool. The job is not deleted from the 24x7 Job Database and can be laterenabled again.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters:

JobID Job ID converted to string or job name

Page 22: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 22 -

EnableJob

Long EnableJob ( String JobID )

The EnableJob function enables job and places it backs to the active jobpool.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters:

JobID Job ID converted to string or job name.

Page 23: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 23 -

GetAgentList

Long GetAgentList ( Boolean HTMLFormat )

The GetAgentList function obtains name list of configured 24x7 Remote AgentProfiles. If HTMLFormat is TRUE, the ipStringBuffer property is populatedwith a text formatted as a HTML table; otherwise it is populated with aplain text containing each entry on a new line.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description. In case ofsuccessful function execution, the profile list is copied to theipStringBuffer.

Parameters:

HTMLFormat The output format in which you want to obtain the list of24x7 Remote Agent Profile names.

Value MeaningTrue format output as HTML textFalse format output as plain text

Page 24: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 24 -

GetDatabaseList

Long GetDatabaseList ( Boolean HTMLFormat )

The GetDatabaseList function obtains name list of configured DatabaseProfiles. If HTMLFormat is TRUE, the ipStringBuffer property is populatedwith a text formatted as a HTML table; otherwise it is populated with aplain text containing each entry on a new line.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description. In case ofsuccessful function execution, the profile list is copied to theipStringBuffer.

Parameters:

HTMLFormat The output format in which you want to obtain the list ofDatabase Profile names.

Value MeaningTrue format output as HTML textFalse format output as plain text

Page 25: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 25 -

GetFolderProperty

Long GetFolderProperty ( String FolderID,

String PropertyName )

The GetFolderProperty function obtains value of the specified jobPropertyName for the specified JobID. The PropertyName must be a valid JDLjob property name. The following folder properties are supported:"FOLDER_NAME", "DESCRIPTION", "FOLDER", "MODIFY_TIME", "MODIFY_USER","MODIFY_TERMINAL"

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description. In case ofsuccessful function execution, the property value is copied to theipStringBuffer.

Parameters:

FolderID Folder ID converted to string or Folder name.

PropertyName The folder property name.

Page 26: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 26 -

GetForecast

Long GetForecast ( Long Interval,

Boolean HTMLFormat )

The GetForecast function obtains list of pending jobs in the specified timeinterval (hours). If HTMLFormat is TRUE, the ipStringBuffer property ispopulated with a text formatted as a HTML table; otherwise it is populatedwith a plain text containing each entry on a new line. Only currently activeand time based jobs are forecasted. Jobs having non-time based schedules arenot included as the 24x7 Scheduler has now way to know when such jobs startconditions will be satisfied.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description. In case ofsuccessful function execution, the job list is copied to the ipStringBuffer.

Parameters:

Interval The time interval within which the forecast is created.The interval is specified in hours.

HTMLFormat The output format in which you want to obtain the list offorecasted jobs.

Value MeaningTrue format output as HTML textFalse format output as plain text

Page 27: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 27 -

GetGlobalVariable

Long GetGlobalVariable ( String VariableName )

The GetGlobalVariable function obtains value of the global variable on thetarget 24x7 Remote Agent or 24x7 Master Scheduler.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description. In case ofsuccessful function execution, the value of the specified global variable iscopied to the ipStringBuffer.

Parameters:

VariableName The name of the global variable that must exist on thetarget 24x7 Agent or Master Scheduler.

Page 28: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 28 -

GetHolidays

Long GetHolidays ( Long Year,

Boolean HTMLFormat )

The GetHolidays function obtains list of holidays in the specified Year. IfHTMLFormat is TRUE, the ipStringBuffer property is populated with a textformatted as a HTML table; otherwise it is populated with a plain text. Inthe last case each entry appears on a new line and holiday date/descriptionfields separated by tab characters.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description. In case ofsuccessful function execution, the holiday list is copied to theipStringBuffer.

Parameters:

Year The year for which you want to obtain the list ofholidays.

HTMLFormat The output format in which you want to obtain the list ofHolidays.

Value MeaningTrue format output as HTML textFalse format output as plain text

Page 29: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 29 -

GetJobDefinition

Long GetJobDefinition ( String JobID,

Boolean HTMLFormat )

The GetJobDefinition function obtains values of all job properties for thespecified JobID. If HTMLFormat is TRUE, the ipStringBuffer property ispopulated with a text formatted as an HTML table. When displayed in a Webbrowser the table looks like the Job Properties View presented in the 24x7GUI. If HTMLFormat is FALSE, the Buffer variable is populated with a plaintext containing all job properties in JDL file format. The returned data iscompatible with the CreateJob function.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description. In case ofsuccessful function execution, the job properties are copied to theipStringBuffer.

Parameters:

JobID Job ID converted to string or job name.

HTMLFormat The output format in which you want to obtain the result.

Value MeaningTrue format output as HTML textFalse format output as plain text

Page 30: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 30 -

GetJobList

Long GetJobList ( Boolean HTMLFormat )

The GetJobList function obtains list of all jobs. If the HTMLFormat is TRUE,the Buffer variable is populated with a text formatted as an HTML table;otherwise the ipStringBuffer property is populated with a plain textcontaining all job IDs and names. Each job appears on a new line. Job IDsand names are separated by tab characters.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description. In case ofsuccessful function execution, the job list is copied to the ipStringBuffer.

Parameters:

HTMLFormat The output format in which you want to obtain the result.

Value MeaningTrue format output as HTML textFalse format output as plain text

Page 31: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 31 -

GetJobListEx

Long GetJobListEx (ByRef String Buffer,Boolean HTMLFormat,String PropertyList )

The GetJobListEx is similar to GetJobList function that obtains list of alljobs, with the exception that it allows specifying which job propertiesshould be included in the returned list. Using this function is often moreefficient than obtaining list using GetJobList and then calling GetJobPropertyfunction for every returned job. Two properties always included in the listare: Job ID and Job Name. To specify additional JDL properties, use thePropertyList parameter. Separate multiple properties by commas. For example:"FOLDER_NAME,DISABLED,MODIFY_TIME". For a list of supported properties see"Job Property Names" topic in the 24x7 on-line help file.

If the HTMLFormat is TRUE, the ipStringBuffer property is populated with atext formatted as an HTML table; otherwise the ipStringBuffer property ispopulated with a plain text containing all job IDs and names. Each jobappears on a new line. Job Ids, names, and additional properties specifiedby PropertyList are separated by tab characters.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description. In case ofsuccessful function execution, the job list is copied to the ipStringBuffer.

Parameters:

HTMLFormat The output format in which you want to obtain the result.

Value MeaningTrue format output as HTML textFalse format output as plain text

PropertyList A comma separated list of job property names.

Page 32: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 32 -

GetJobLog

Long GetJobLog ( String JobID,

Boolean HTMLFormat )

The GetJobLog function obtains all log records for the specified JobID. IfHTMLFormat is TRUE, the ipStringBuffer property is populated with a textformatted as an HTML table. When displayed in a Web browser the table lookslike the Job Log in the 24x7 GUI. If HTMLFormat is FALSE, the ipStringBufferproperty is populated with a plain text containing log records. Each recordappears on a new line with columns separated by tab characters. The formatof the text is the same as format of the job log file SCHEDULE.LOG.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description. In case ofsuccessful function execution, the job log is copied to the ipStringBuffer.

Parameters:

JobID Job ID converted to string or job name.

HTMLFormat The output format in which you want to obtain the result.

Value MeaningTrue format output as HTML textFalse format output as plain text

Page 33: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 33 -

GetJobProperty

Long GetJobProperty ( String JobID,

String PropertyName )

The GetJobProperty function obtains value of the specified job PropertyNamefor the specified JobID. The PropertyName must be a valid JDL job propertyname. For more details see "Job Property Names" topic in the 24x7 on-linehelp file.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description. In case ofsuccessful function execution, the property value is copied to theipStringBuffer.

Parameters:

JobID Job ID converted to string or job name.

PropertyName The job property name.

Page 34: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 34 -

GetJobStatus

Long GetJobStatus ( String JobID )

The GetJobStatus function obtains the status of the specified job.

Return: Returns a number indicating job status, which could be one of thefollowing:

-1 Error job. Job may have this status because of incomplete jobdefinition or if an error occurred while 24x7 was executing thisjob.

-2 Job is performing notification action after or before job run,such as sending email message, executing database command, etc.

-3 Job is running.-5 First job run is pending. Such job has been never started

before.-6 Unknown status. Job may have an unknown status when it is a

"Program" type job running asynchronously.0 Successfully finished. Note: an asynchronous job of "Program"

type also may have this status after it successfully started thespecified program and the started program is still running.

other Successfully finished (valid for jobs of "Program" type only). Ajob may have this status after it successfully started thespecified program and the program is still running.

Parameters:

JobID Job ID converted to string or job name.

Page 35: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 35 -

GetStatusReport

Long GetStatusReport ( String DestinDir )

The GetStatusReport function obtains 24x7 Status Report from the 24x7 MasterScheduler and copies it to the destination directory specified in theDestinDir variable.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters:

DestinDir The name of the directory into which the 24x7 StatusReport files will be copied. The DestinDir can containeither an absolute path to the directory in the formatdisk:\dir\subdir1\...\subdirX ora relative path in the format subdir1\...\sudirX or anetwork path name like\\SERVER\VOLUME:\dir\subdir1\...\subdirX

Page 36: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 36 -

LogMessage

Long LogMessage ( Long SourceID,

String SourceName,Long EventSeverity,String Message,Boolean ForceReportUpdate )

The LogMessage function adds new record to the 24x7 Scheduler event log. Ifparallel logging to the Windows NT event log is enabled, LogMessage alsowrites an entry at the end of the Windows NT application event log.

Note: 24x7 Scheduler does not verify SourceID and SourceName values.Normally you should use them to specify job ID and job name that the loggedmessage belongs to.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters:

SourceID ID of the job for which you add the new message. Toadd a job independent message specify 0 for theSourceID.

SourceName Descriptive name of the message source.

EventSeverity The event severity. It can be one of the following:• RC_ERROR• RC_WARNING• RC_INFO

Message The message that you want to add to the 24x7 eventlog.

ForceReportUpdate A Boolean whose value indicates whether 24x7Scheduler must perform an immediate update of the24x7 Status Report or perform a deferred update.

Value MeaningTrue update immediatelyFalse don't update immediately

Important Notes:• If the 24x7 Status Report is not enabled,

ForceReportUpdate parameter is ignored.

• "ForceReportUpdate = True" ensures the report isupdated immediately so other people who monitorthat report can see this change in a real-time.However, immediate updates have some impact on theperformance of the 24x7 Scheduler.

Page 37: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 37 -

OpenSession

Long OpenSession ( String User,

String Password,String ComMethod,String ServerLocation,String ServerPort,String Options,Boolean Trace )

The OpenSession function establishes new connection between 24x7 RemoteControl COM control and the specified target 24x7 Scheduler running ineither Master or Agent mode. The target 24x7 Scheduler can run on the samecomputer or a remote computer

Notes:• You must open a session using the OpenSession function before you call

other 24x7 Remote Control COM functions.• Use the CloseSession function to close the session after you don't need

it anymore.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters:

User The user ID that you want to use for the connection.If an empty string is specified for the User, 24x7Remote Control COM automatically obtains user ID ofthe user logged on the computer running 24x7 RemoteControl COM.

Password Reserved. A String value. In the current version youshould use the 24x7 serial number.

ComMethod Name of the communication driver to be used for theconnections to the AgentValues are:

• WinSock• NamedPipes

ServerLocation The location of the Agent.

For the WinSock driver specify either of thefollowing values:

• The IP address (for example, 199.99.99.91)• The host name of the remote computer (network

computer name in workgroup)• LocalHost (this indicates that the Agent

resides on the local machine)

For the NamedPipes driver specify the locationportion of the pipe name. The combination of theLocation and Application values forms the pipe name.The pipe name is constructed as follows:\\location\PIPE\application. If no location isspecified, a local pipe name is constructed using adot (.) in the machine name portion.

Page 38: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 38 -

ServerPort For the WinSock driver specify either of thefollowing:

• The port number for the Agent (for example,10099). Each server application requires aunique port number on the server machine. Theport number must be greater than 4096 and lessthan 65536.

• The service name (port alias) for Agent. Theservice name is an indirect reference to theport number. The mapping of the service name tothe port number is specified in the TCP/IPservices file. Normally, this file (SERVICES)is located in the Windows directory forWin95/98 and in theC:\WINNT\SYSTEM32\DRIVERS\ETC directory forWinNT. You may need to edit this file manuallyto add 24x7 Port or Service.

For the NamedPipes driver specify the applicationportion of the pipe name. The combination of theLocation and Application values forms the pipe name.The pipe name is constructed as follows:\\location\PIPE\application. The Application must beunique for the Location you specify.

Options Additional communications options. If you specifymore than one option, you need to separate theoptions with commas. For the Local driver thisproperty is ignored.

BufSize=n Sets the connection buffer size to thevalue specified.

The following options apply to the WinSock driveronly.

MaxRetry=n Specifies how many times the RemoteControl will try to connect when the Agent’slistening port is busy.

NoDelay=1 Specifies that each packet be sentwithout delay. Corresponds to the TCP_NODELAYoption. Setting this option may degradeperformance significantly. Do not use this optionunless you thoroughly understand its implications.

RawData=1 Specifies that raw data be passed overthe network. By default, the WinSock driverobscures the data that is passed over the network.Setting this option to 1 overrides the defaultbehavior. Both the Remote Control and Agent musthave the same setting. If there is a discrepancybetween the Remote Control and Agent's settings,the communication fails. Setting this option to 1may improve performance slightly.

Page 39: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 39 -

ProtectJob

Long ProtectJob ( String JobID,

String ProtectionType,String JobPassword )

The ProtectJob function can be used to change protection type for an alreadyprotected job or setup protection on an unprotected job. If the job isalready protected you must specify valid JobPassword that matches existingjob password.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters:

JobID Job ID converted to string or job name

ProtectionType Job protection code. The following values are supported:F – Full protection – job definition cannot be seen,changed or deleted and the job cannot be runmanually.R – Read only protection – job definition can beseen and the job can be run manually, but the jobcannot be changed or deleted.E – Execute only – job definition cannot be seen,changed or deleted, but the job can be run manually.

JobPassword Job password

Page 40: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 40 -

RunJob

Long RunJob ( String JobID,

Boolean Detached )

The RunJob function starts the specified job. The job is executed on thecomputer where the target 24x7 Scheduler is running.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters:

JobID Job ID converted to string or job name.

Detached Controls how the job is processed.

Value MeaningTrue Run the job using a separate instance of

24x7 SchedulerFalse Run the job using the same instance of

24x7 Scheduler

Note: Depending on the job specifics each method may havesome advantages and disadvantage. Using Detached propertyyou can select the more appropriate method.

Page 41: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 41 -

RunScript

Long RunScript ( String Script )

The RunScript function executes the specified JAL script. The effect of thisfunction is similar to running a job with the same script. The script isexecuted on the computer where the target 24x7 Scheduler is running.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters:

Script JAL script that you want to execute.

Page 42: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 42 -

RunShellCommand

Long RunShellCommand ( String CommandLine,

String Dir,Boolean Async,Long Timeout )

The RunShellCommand function executes the specified Operation System commandor program. The command is executed on the computer where the target 24x7Scheduler is running.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters:

CommandLine The full or partial path and filename of the module toexecute. The module may be a .COM, .BAT, .EXE, orassociated file type. If a partial name is specified, thecurrent drive and current directory are used by default.The module name must be the first white space-delimitedtoken in the Program name field. The specified module canbe a Win32-based application, or it can be some other typeof module (for example, MS-DOS or OS/2) if the appropriatesubsystem is available on the local computer. If thefilename does not contain an extension, .EXE is assumed.If the filename ends in a "." with no extension, or thefilename contains a path, .EXE is not appended. If thefilename does not contain a directory path, Windowssearches for the executable file in the followingsequence:1 The directory from which the 24x7 Scheduler loaded.2 The current directory.3 The 32-bit Windows system directory. The name of

this directory is SYSTEM32.4 The 16-bit Windows system directory. The name of

this directory is SYSTEM.5 The Windows directory. The name of this directory is

WINDOWS or WINNT.6 The directories that are listed in the PATH

environment variable.Notes:

• You should always include the full path - don’t rely onthe PATH environment variable, because this may bedifferent at the time the program runs, depending onwhat account the program is being run under. Also, keepin minds that other programs can modify the PATHenvironment variable as well.

• Program name can be followed by command lineparameters. You can use 24x7 supported macro-parametersinside program name and command line parameters Stringto pass dynamic information (such as the current month)to the scheduled program.

Dir The directory where the program executable findsassociated files that are required to run the program.Most programs do not require an entry in this field sothat you can specify an empty string (""). Occasionallyhowever, a program will refuse to run properly unless itis specifically told where to find other program files.

Page 43: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 43 -

The 24x7 Scheduler will change to this directory whenrunning the program or document.

Async This controls how the 24x7 Scheduler executes the processspecified in the CommandLine.

Value MeaningTrue Start the specified command and return

control back to the 24x7 Scheduler. TheTimeout argument is ignored in this case.

False Start the specified command and wait forthat command to complete before returningcontrol back to the 24x7 Scheduler.

Note: When running the command synchronously (Async=False)24x7 Scheduler enters an efficient wait state until thiscommand finishes or the Timeout interval elapses. In thelatter case, the 24x7 Scheduler forcedly terminates theprocess created by the specified CommandLine.

Timeout The maximum time interval (in seconds) within which youallow the process (as specified in the CommandLine) torun. Use 0 Timeout to allow infinite waiting.

Page 44: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 44 -

SetFolderProperty

Long SetFolderProperty ( String FolderID,

String PropertyName,String NewValue )

The SetFolderProperty function changes value of the specified folderPropertyName for the specified FolderID. The PropertyName must be a validJDL job property name. The following folder properties are supported:"FOLDER_NAME", "DESCRIPTION".

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters:

FolderID Folder ID converted to string or folder name.

PropertyName The folder property name.

NewValue Then new property value.

Page 45: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 45 -

SetGlobalVariable

Long SetGlobalVariable ( String VariableName,

String NewValue )

The SetGlobalVariable function changes the value of the global variable onthe target 24x7 Remote Agent or 24x7 Master Scheduler.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters:

VariableName The name of the global variable that must exist on thetarget 24x7 Agent or Master Scheduler.

NewValue The new value converted to string format.

Page 46: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 46 -

SetJobProperty

Long SetJobProperty ( String JobID,

String PropertyName,String NewValue )

The SetJobProperty function changes value of the specified job PropertyNamefor the specified JobID. The PropertyName must be a valid JDL job propertyname. For more details see "Job Property Names" topic in the 24x7 on-linehelp file.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters:

JobID Job ID converted to string or job name.

PropertyName The job property name.

NewValue Then new value converted to string format.

Page 47: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 47 -

Test

Long Test ( Long x )

The Test function is provided exclusively for your convenience so you cantest whether you can load and call 24x7 Remote Control COM functions.

Return: The returned value must be the same as the x value specified for thefunction argument.

Page 48: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 48 -

UnprotectJob

Long UnprotectJob ( String JobID,

String JobPassword )

The UnprotectJob function can be used to remove protection from a protectedjob. You must specify valid JobPassword that matches the existing jobpassword.

Return: Returns 1 if it succeeds or a negative number if an error occurs.Use the LastError property to obtain error description.

Parameters:

JobID Job ID converted to string or job name

JobPassword Job password

Page 49: 24x7 Remote Control for ASP Interface Reference

24x7 Remote Control ASP Interface - 49 -

Installation

Minimal System Requirements

1. 24x7 Scheduler v3.0.1 or later

2. 250 Kbytes additional free disk space

3. Web server supporting Active Server Pages (ASP) and ASP compatible scripting environment.

Installation Steps

Run 24x7 Automation Suite installation program 247setup.exe. Follow instructions provided by the installation program.

Security issues Use existing Windows security features to restrict undesired access to the 24x7 Scheduler files installed on the computer where you are invoking 24x7 Remote Control COM interface. By protecting access to these files you prevent unauthorized users from accessing and using 24x7 Remote Control ASP.

To secure access to the remote 24x7 Scheduler servers enable security options on these servers. For more information please "Security" topic in the 24x7 Automation Suite manual and/or on-line help file.

Licensing 1. Web server usage: You must obtain 24x7 Scheduler site license before you can use 24x7

Remote Control ASP on your server. A separate site license is required for every web server utilizing 24x7 Remote Control COM.

2. Single installation license: A separate single installation license is required for every 24x7 Remote Control ASP installation if the control is used in an non web-based environment. That’s it, you need at least 2 single licenses (or a site license) for using 24x7 Remote Control ASP to control and manipulate 24x7 Scheduler or 24x7 Remote Agent. In case of 2 single licenses, one license is applied to the 24x7 Scheduler server or 24x7 Remote Agent and another license is applied to the 24x7 Remote Control ASP.

3. Site license: 24x7 Scheduler site license covers unlimited usage of 24x7 Remote Control ASP. Site license users can use 24x7 Remote Control ASP just as they use other parts of the 24x7 Automation Suite. The usage of 24x7 Scheduler, 24x7 Remote Agents, 24x7 Remote Control, 24x7 Remote Control Java, 24x7 Remote Control ASP and 24x7 Remote Control COM is governed by their site license agreement. The site license also allows installing and using 24x7 Remote Control ASP on one Web server. You may not install or run it on multiple servers using the same license.

4. Redistribution: You must obtain 24x7 Remote Control ASP redistribution license before you can redistribute it with your program.

The LICENSE.TXT file congaing text of the single installation license can be found in the 24x7 Scheduler home directory. If you would like to obtain the redistribution license, please email your request to mailto:[email protected].