Server Management Hook Event

Overview

In order to track server management operations, such as adding a new node, importing a hook script, etc., a new management hook event has been added to the PBS server. Registered management hook scripts are executed once the management operation has completed. Each script is provided information about the requested operation, any associated attributes, and the status of the completed operation.

Technical Details

Python constant:

  • pbs.MANAGMENT
  • pbs.REVERSE_MGR_CMDS
  • pbs.REVERSE_MGR_OBJS
  • pbs.REVERSE_BRP_CHOICES
  • pbs.REVERSE_BATCH_OPS
  • pbs.REVERSE_ATR_VFLAGS
  • pbs.MGR_CMD_NONE

  • pbs.MGR_CMD_CREATE

  • pbs.MGR_CMD_DELETE

  • pbs.MGR_CMD_SET

  • pbs.MGR_CMD_UNSET

  • pbs.MGR_CMD_LIST

  • pbs.MGR_CMD_PRINT

  • pbs.MGR_CMD_ACTIVE

  • pbs.MGR_CMD_IMPORT

  • pbs.MGR_CMD_EXPORT

  • pbs.MGR_CMD_LAST

  • pbs.MGR_OBJ_NONE

  • pbs.MGR_OBJ_SERVER

  • pbs.MGR_OBJ_QUEUE

  • pbs.MGR_OBJ_JOB

  • pbs.MGR_OBJ_NODE

  • pbs.MGR_OBJ_RESV

  • pbs.MGR_OBJ_RSC

  • pbs.MGR_OBJ_SCHED

  • pbs.MGR_OBJ_HOST

  • pbs.MGR_OBJ_HOOK

  • pbs.MGR_OBJ_PBS_HOOK

  • pbs.MGR_OBJ_LAST

  • pbs.BRP_CHOICE_NULL

  • pbs.BRP_CHOICE_Queue

  • pbs.BRP_CHOICE_RdytoCom

  • pbs.BRP_CHOICE_Commit

  • pbs.BRP_CHOICE_Select

  • pbs.BRP_CHOICE_Status

  • pbs.BRP_CHOICE_Text

  • pbs.BRP_CHOICE_Locate

  • pbs.BRP_CHOICE_RescQuery

  • pbs.BRP_CHOICE_PreemptJobs

  • pbs.BATCH_OP_SET

  • pbs.BATCH_OP_UNSET

  • pbs.BATCH_OP_INCR

  • pbs.BATCH_OP_DECR

  • pbs.BATCH_OP_EQ

  • pbs.BATCH_OP_NE

  • pbs.BATCH_OP_GE

  • pbs.BATCH_OP_GT

  • pbs.BATCH_OP_LE

  • pbs.BATCH_OP_LT

  • pbs.BATCH_OP_DFLT

  • pbs.ATR_VFLAG_SET

  • pbs.ATR_VFLAG_MODIFY

  • pbs.ATR_VFLAG_DEFLT

  • pbs.ATR_VFLAG_MODCACHE

  • pbs.ATR_VFLAG_INDIRECT

  • pbs.ATR_VFLAG_TARGET

  • pbs.ATR_VFLAG_HOOK

Event Parameters:

  • pbs.event().management - A pbs.management object representing the PBS server management operation that was executed. The management object and thus operation cannot be modified with this hook event.


  • pbs.event().management.attribs - A list of pbs.server_attribute objects representing the attributes associated with server management operation. The server attribute objects are read-only.

Event Classes:

  • pbs.event().management: _management
    • cmd: integer value of the server management operation, constants defined in pbs.MGR_CMD_*, translation to text is found in pbs.REVERSE_MGR_CMDS
    • objname: name of the object, such as the hook name.
    • objtype: integer value of the server management operation type, constants defined in pbs.MGR_OBJ_*, translation to text is found in pbs.REVERSE_MGR_OBJS
    • request_time: time of the request in seconds since epoch
    • reply_text: text returned to the user via the server management operation
    • reply_code: code returned to the user via the server management operation
    • reply_choice: request choice, constants defined in pbs.BRP_CHOICE_*, translation to text is found in pbs.REVERSE_BRP_CHOICES
    • reply_auxcode: Auxiliary error code
    • attribs: List of server_attribute class objects
  • pbs.event().management.rq_attrs: List[_server_attribute]
    • name: name of the attribute
    • resource: resource of the attribute
    • value: value of the attribute
    • op: integer value of the attribute operation, constants defined in pbs.BATCH_OP_*, translation to text is found in pbs.REVERSE_BATCH_OPS
    • flags: integer value of the attribute flags, constants defined in pbs.ATR_VFLAG_*, translation to text is found in pbs.REVERSE_ATR_VFLAGS
    • sisters: list of co-resources for the attribute

Details:

  • A management hook script is executed by the server after a server management operation is completed.

  • The event will contain data if the server management operation succeeded or failed.

  • Keeping with the hook design, if one management hook is rejected, the other management hooks with a higher order value will not run.  A reject, will not revert the change.
  • If the management hook script encounters an unexpected error causing an unhandled exception, or times out due to the hook's alarm setting, the hook will act similar to a pbs.event().reject().

Internal Details:

  • All management hooks are executed after the server management operation is completed by the req_manager function in req_manager.c.

Additional Details:

  • Other than adding a step to run the hooks, this hook event does not change the flow of the server management operations.

Consumer:

  • Metadata collection by an outside system.

OSS Site Map

Project Documentation Main Page

Developer Guide Pages