How to manually trigger a PEND_MACH status for testing purposes
search cancel

How to manually trigger a PEND_MACH status for testing purposes

book

Article ID: 444555

calendar_today

Updated On:

Products

Autosys Workload Automation

Issue/Introduction

Users may need to manually trigger a PEND_MACH status to test automated alerting or incident generation. However, simply MACH_OFFLINE an agent or stopping the agent service and then running a FORCE_STARTJOB results in a STARTJOBFAIL with a communication error (COMM_ERR_5) rather than the expected PEND_MACH state in the event_demon log.

sendevent -E MACH_ONLINE -n <machine_name>

Cause

The FORCE_STARTJOB event is designed to bypass standard machine status checks.

Even if a machine is marked asOFFLINE, a FORCE_STARTJOB will ignore that status and attempt to connect to the agent anyway. If the agent service is unavailable, it results in a communication failure.

A job only enters PEND_MACH status when a standard STARTJOB event is issued against a machine that the Scheduler already knows is in an OFFLINE state.

Resolution

 

To successfully trigger a PEND_MACH event in the event_demon log, follow these steps:

  1. Set the Machine to Offline: Use the sendevent command to manually set the target machine to an OFFLINE status:
    sendevent -E MACH_OFFLINE -n <machine_name>
  2. Verify Machine Status: Confirm that the machine is recognized as offline by the Scheduler:
    autorep -m <machine_name>
  3. Initiate a Standard Start Job: Trigger the job using a standard STARTJOB event. Do not use FORCE_STARTJOB.
    sendevent -E STARTJOB -J <job_name>
  4. Verify the Event: Check the event_demon log. You should see entries similar to the following:
     CAUAJM_I_40245 EVENT: STATE_CHANGE JOB: <job_name>  cannot start due to offline machine(s). Job placed in PEND_MACH status.
  5. Restore Machine Status: Once testing is complete, return the machine to an ONLINE status:
    sendevent -E MACH_ONLINE -n <machine_name>