Products Downloads


French version


 

It is possible to check certain Job manager functions using a command line: For example, you can stop the Job manager or start an agent in batch mode.

The command enables notifications to be sent to the Job manager.

To use this command, you must have administrator permissions for the Job manager.

 

The syntax of the command is as follows:

gsnotify.exe <IniEnvironmentFile> [<IniUserFile>] [ d<logical_server>] [ u<user>  p<password>] " nnotification" ....

 

The parameters are as follows:

Parameter name

Description

<EnvironmentFile>

The parameter file of the Job manager.

<UserFile>

User parameter file (optional).

-d<logical_server>

Logical server for the connection.

-u<user>

User name.

-p<password>

User password.

-n<notification>

Notification to be sent.

...

Additional parameters specific to notifications.

 

In general, notifications and their parameters (Job manager name, agent name, etc.) are case sensitive.

The status of the command can be checked by referring to the error level ("errorlevel"):

  • errorlevel 0: No errors have occurred.
  • errorlevel 1: Warnings occurred, the process was completed.
  • errorlevel 2: An error occurred, the process was interrupted.

 

Recognised notifications are listed below.

 

<activate_queue> notification

This notification allows you to check whether or not the Job manager queues are activated. Warning: the queue is put on hold immediately.

The parameters are as follows:

Parameter name

Description

-s<JM_list>

List of the Job managers to be notified (for example: -sJM1;JM2).

Default value: *ALL (all active Job managers).

-q<queue_list>

List of queue IDs (for example: -q1;2).

Default value: *ALL (all queues).

-a<0|1>

Queue activation.

Default value: -a1.


For example:

  • To globally deactivate the queues:
    gsnotify -nactivate_queue -a0

  • To activate queues 1 and 2 on JM1 and JM2:
    gsnotify -nactivate_queue -sJM1;JM2 -q1;2 -a1

Top of page

 

<stop_service> notification

This notification is used to force the Job managers that were specified as a parameter to stop.

The parameters are as follows:

Parameter name

Description

-s<JM_list>

List of the Job managers to be notified (for example: -sJM1;JM2).

Default value: *ALL (all active Job managers).


For example:

  • To stop all Job managers:
    gsnotify -nstop_service

  • To stop Job managers JM1 and JM2:
    gsnotify -nstop_service -sJM1;JM2

Top of page

 

<invalidate_host_pool> notification

This notification is used to request the invalidation of the host process pool for Job managers specified in parameters.

The pending processes will be immediately completed, the processes in use will be completed at the end of their execution.

The parameters are as follows:

Parameter name

Description

-s<JM_list>

List of the Job managers to be notified (for example: -sJM1;JM2).

Default value: *ALL (all active Job managers).

For example:

  • Invalidate the pool for all Job managers:
    gsnotify -ninvalidate_host_pool

  • Invalidate the pool for Job managers JM1 and JM2:
    gsnotify -ninvalidate_host_pool -sJM1;JM2

Top of page

 

<kill_job> notification

This notification is used to force specific jobs to stop.

The parameters are as follows:

Parameter name

Description

-j<job_ID_list>

List of the job IDs that you want to stop (for example: -j2236;2238).

No default value.


For example:

  • To stop jobs 2336 and 2337:
    gsnotify -nkill_job -j2336;2337

Top of page

 

<start_agent> notification

This notification is used to run the agents that were specified as a parameter.

The parameters are as follows:

Parameter name

Description

-a<agent_list>

List of agents (for example: -aagent1;agent2).

Default value: *ALL (all agents that have not been started or that are not deactivated).


For example:

  • To start the "test 1" and "test 2" agents:
    gsnotify -nstart_agent "-atest 1;test 2"

 

  • To start all agents:
    gsnotify -nstart_agent

Top of page

 

<stop_agent> notification

This notification is used to stop all agents that were specified as a parameter.

The parameters are as follows:

Parameter name

Description

-a<agent_list>

List of agents (for example: -aagent1;agent2).

Default value: *ALL (all agents that have not been started or that are not deactivated).

-t<timeout>

Time allowed for the agent to stop (for example: -t30s).

Default value: 0 (indefinite wait time).

The possible values are as follows:

-1 immediate stop (equivalent to kill command),

0 indefinite wait time,

>0 specified stop time. The agent will be killed if it does not stop within the specified time.

The default unit is minutes (-t5 = 5 minutes, but it is possible to specify a different unit (h/m/s): -t5h = 5 hours, -t5s = 5 seconds).

-wait

The command checks that the notifications have been taken into account before returning control.

In this case, the command returns control if:

  • the specified agents have finished running,
  • the relevant Job managers are no longer responding (detection can take up to a minute),
  • an error occurs when querying the status of the agents.
-mark-dead

If this parameter is specified, the agents will be flagged as having errors if the Job manager is considered inactive (i.e. if there has been no activity for the previous 30 seconds).

This parameter should be used with caution. It is not possible to be fully certain that a Job manager that is not responding is actually inactive, as it could be that it is simply hanging on an internal process. The fact that the Job manager is not showing any signs of activity does not prove that it has stopped or that the agent is inactive.


For example:

  • To stop the "test 1" and "test 2" agents with an indefinite wait time:
    gsnotify -nstop_agent "-atest 1;test 2" -wait

 

  • To stop all agents with a timeout of 5 minutes, with a wait time applying before the notifications are taken into account and return of control:
    gsnotify -nstop_agent -t5m -wait

Top of page

 

<status_agent> notification

This pseudo-notification can be used to display the status of the agents that have been specified as parameters. For each selected agent, the console displays the name of the agent, its status and if applicable, the name of the Job manager responsible for the agent that is used for the agents that are currently running. If the Job manager appears to be inactive, a question mark will display at the end of the Job manager name.

The parameters are:

Parameter name

Description

-a<agent_list>

List of agents (e.g.: -aagent1;agent2).

Default value: *ALL (all agents)


If there is only one agent, the return code (errorlevel) provided by the program will indicate the status of the agent:

Return code Description

0

The command ran successfully but involved several agents (in this case, refer to the message displayed)

2

Or or more errors occurred (non-existent agent(s) or unexpected error)

10

The agent stopped normally

11

The agent stopped with errors

12

The agent stopped with warnings

13

The agent is currently starting

14

The agent is started

15

The agent is currently stopping

16

The agent status is invalid

<n> + 10

The agent is flagged with the status <n> but the associated executing server does not seem to be responding (inactive for the last 30 seconds)

 

For example:

• To test agents "test 1" and "test 2":

gsnotify –nstatus_agent "-atest 1;test 2"

 

Test 1: Started (jm1?)
Test 2: Errors

 

In this case, the status of "test 1" is "Started" by Job manager "jm1", however this Job manager does not seem to be active (inactive for the past 30 seconds).

 

To test if agent "test 1" is inactive - return code of 24 (= 14 (Started) + 10):
gsnotify –nstatus_agent "-atest 1"

Test 1: Started (jm1?)

echo %errorlevel%
24

 

Top of page


  • Aucune étiquette