Steps to Integrate AutoSys with ServiceNow
search cancel

Steps to Integrate AutoSys with ServiceNow

book

Article ID: 371870

calendar_today

Updated On:

Products

Autosys Workload Automation

Issue/Introduction

Integration with ServiceNow (SNOW) is a new feature as of the 12.1.01 release of AutoSys Workload Automation and is currently limited to job related alarms only. It is not applicable to any release previous to 12.1.01.

Environment

AutoSys Workload Automation 12.1.01

Resolution

FAQ's:
  • Can AutoSys be configured to send the alarms/events to an event handler instead of Incident Table in ServiceNow?
    No. Under the current state of the SNOW integration with AutoSys, alarms can only be sent directly to the Incident Table.

Steps: 

  • Open the helpdesk configuration file (helpdesk.XYZ) located in the autouser.XYZ directory of your AutoSys server.
    Note: XYZ is the three character AutoSys Instance name.

    The following are minimum requirements. Addition parameters can be tweaked as needed.

    • helpdesk_url needs to be defined as the direct link to the Incident Table within SNOW.

      Example:

      helpdesk_url=https://instance.service-now.com/api/now


    • helpdesk_access parameter will be set as the SNOW account and encrypted password.
      You'll encrypt the password using the password encryption within autosys_secure (Option 6, then option 1).

      Example:

      helpdesk_access=your_user/encrypted_password


    • helpdesk_alarm_types parameter needs to be defined for the alarms which need to have an Incident generated.

      Example:

      helpdesk_alarm_types=JOBFAILURE,EVENT_HDLR_ERROR,MAXRUNALARM,MUST_START_ALARM,MUST_COMPLETE_ALARM

    • Pause and Resume the scheduler process.
      • On Windows, Pause and Resume the scheduler process using the AutoSys Admin GUI.
      • On Linux, send a SIGHUP signal the the scheduler process.
        • ps -ef | grep event_demon to obtain the PID.
        • kill -HUP <PID>

    • Check the event_demon log for messages similar to the following. The values should match what was defined in the helpdesk.XYZ file.

      [07/10/2024 21:17:32]      CAUAJM_I_40295 helpdesk_access set to <your_user/encrypted_password>.

      [07/10/2024 21:17:32]      CAUAJM_I_40295 helpdesk_alarm_types set to <JOBFAILURE,EVENT_HDLR_ERROR,MAXRUNALARM,MUST_START_ALARM,MUST_COMPLETE_ALARM>.
      [07/10/2024 21:17:32]      CAUAJM_I_40295 helpdesk_url set to <https://instance.service-now.com/api/now>.

    • For any additional parameters, reference Parameters for ServiceNow Integration for available parameters.

  • Create the helpdesk template. There is a sample_template located in the install/helpdesk_templates beneath the AutoSys installation path.

    • Make a copy of the sample_template and modify the copy accordingly to suit your business needs.
      Reference the Define Help Desk Template section in the documentation, which provides details regarding the various Payload Variables and Attributes that are available for configuration.

  • Create a JIL file to use to Define the Help Desk Template as GLOB Object.

    Example:
    insert_glob: HelpdeskTemplateForJobStatusFailures
    blob_mode: text
    blob_file: /opt/CA/WorkloadAutomationAE/autosys/install/helpdesk_templates/JobStatusFailureTemplate
    blob_type: helpdesktemplate


    Note: For paths containing spaces, surround the value of the blob_file attribute in double-quotes, as illustrated in the example below for a Windows implementation.

    insert_glob: HelpdeskTemplateForJobStatusFailures
    blob_mode: text
    blob_file: "C:\Program Files (x86)\CA\WorkloadAutomationAE\autosys\install\JobStatusFailureTemplate"
    blob_type: helpdesktemplate


  • Test the integration by executing the command auto_helpdesk -G

    Example:

    [autosys@hostname ]$ auto_helpdesk -G
    CAUAJM_I_61026 Generic Help desk ticket creation pending.
    CAUAJM_I_61018 Generic Help desk request creation successful, TICKET_NUMBER: INC0010021 TICKET_ID: d49f4775935b8e1080a07fddfaba10f6

  • If the above test proved successful, the configuration is complete.

  • Further validation, Define and run a test job that is designed to fail. Be sure to include the necessary helpdesk related attributes in the job definition.

    Example:
    /* ----------------- TestJob ----------------- */

    insert_job: TestJob   job_type: CMD
    command: as_test -e 1
    machine: localhost
    owner: autosys@localhost
    permission:
    date_conditions: 0
    alarm_if_fail: 1
    alarm_if_terminated: 1
    helpdesk: y
    helpdesk_template: HelpdeskTemplateForJobStatusFailure
    helpdesk_attr: urgency=3
    helpdesk_attr: impact=3
    helpdesk_attr: priority=5
    helpdesk_attr: caller_id="System Administrator"

  • Finally, if the configuration is correct, messages similar to below can be seen in the event_demon log and an incident should be generated in ServiceNow.

    [07/10/2024 21:38:41]      CAUAJM_I_61015 Help desk request pending for JOB: TestJob RUN_NUMBER: 321.1 ALARM: JOBFAILURE

    [07/10/2024 21:38:41]      CAUAJM_I_61017 Help desk request creation successful for JOB: TestJob RUN_NUMBER: 321.1 ALARM: JOBFAILURE TICKET_NUMBER: INC0010023 TICKET_ID: 877d6f7993db8e1080a07fddfaba1023

Additional Information

For Use Case examples, please reference ServiceNow Ticket Creation Use Cases.