User-defined servers

User-defined servers allow you to add custom servers to the iSeries™ server. This capability enables you to perform administrative tasks, such as stopping, starting, and monitoring servers, in the same way as you administer servers that are included on the iSeries server.

The User-Defined Servers wizard allows you to define servers to be integrated with the iSeries server applications. The wizard requires the following information about a user-defined server:

Access user-defined servers

To create, view, or manage user-defined servers in iSeries Navigator, follow these steps:
  1. In iSeries Navigator, expand your iSeries server > Network > Servers > User-Defined.
  2. To create a new server, right-click User-Defined and select New Server.
  3. To view or change properties of an existing server, right-click the server and click Properties.
Note: Start of changeTo add, change, or remove a user-defined server, you need *IOSYSCFG special authority. To start or stop a user-defined server, you need *ALLOBJ special authority or specific authority to the STRTCPSVR or ENDTCPSVR commands.End of change

Make the job appear as a server job

You can use the Change Job (QWTCHGJB) API to set the server job type for a server that is configured in iSeries Navigator. After you have configured the application's jobs to appear as server jobs, you can monitor the application's server jobs in iSeries Navigator.

The following is an example in C code of how to name the server job using the QWTCHGJB API. The program that is used for the server or client application needs to run as a job. You can define the server or client application as a job with the Submit Job (SBMJOB) command.

Note: By using the following code examples, you agree to the terms of the Code license and disclaimer information.
/* Change job API - server type */
   #include <qusec.h>
#include <QWTCHGJB.h>

typedef struct jobChangeInfo
{
    Qus_Job_Change_Information_t fieldNum;
    Qus_JOBC0100_t format;
    char data[31];
} jobChangeInfo_t;

int main (int argc, char *argv[])
{
  Qus_EC_t     EcStruc;
  Qus_EC_t*    PtrEcStruc;   /* iSeries structure for API errors.      */
  jobChangeInfo_t chg =      /* Job change information for QWTCHGJB    */
{
1,                            /* Number of variable length records.    */
46,                           /* Length of attribute information       */
1911,                         /* Key - Server Type.                    */
'C',                          /* Type of Data - Character.             */
0X40,0X40,0X40,               /* Reserved                              */
30,                           /* Length of data with server name.      */
"YOUR_UNIQUE_SERVER_NAME       "};

  PtrEcStruc = &EcStruc;                 /* API error code structure.  */
  PtrEcStruc->Bytes_Provided = 16;       /* Initalize bytes provided.  */
  PtrEcStruc->Bytes_Available = 0;
  /*-------------------------------------------------------------------*/
  /* API used for defining a server name in the job.                   */
  /*-------------------------------------------------------------------*/
Note: The string in the second line of the following example is padded with blanks to the full 30 characters.
Start of change
QWTCHGJB("*                         ",
           "                              ",
           "JOBC0200",
           &chg,
           PtrEcStruc);
  if ( PtrEcStruc.Bytes_Available != 0 ) {
    printf("Error changing job server name.  Application ended.");
    printf("Error message id %s sent from QWTCHGJB API.",PtrEcStruc.Exception_ID);
    exit(-1);
  }
  return 0;
}
End of change