Automic Workload Automation

Expand all | Collapse all

Monitoring active\sleeping jobs

Clint_Knight_843

Clint_Knight_843Apr 26, 2017 02:25 PM

Anon Anon

Anon AnonApr 26, 2017 03:03 PM

Anon Anon

Anon AnonApr 27, 2017 02:18 PM

  • 1.  Monitoring active\sleeping jobs

    Posted Mar 20, 2017 07:33 AM

    Hi Guys

    I need to find a way of monitoring our active jobs, as I recently found that an EVNT had been cancelled that should be running daily.

    I could do with knowing which DB table the active jobs and their statuses are listed OR the Automic script for checking the status of an active job (if I put a list of known jobs into a VARA and do a FOREACH maybe?).

    If anyone has any known working method for checking their jobs and that they are indeed sleeping or active, if they wouldn’t mind sharing so I can start alerting to jobs that are missing that would be great.

    Thanks, in advance.



  • 2.  Monitoring active\sleeping jobs

    Posted Mar 20, 2017 07:43 AM
    Database-wise, active executions and their status are stored in the EH table (https://docs.automic.com/documentation/webhelp/english/ARA/12.0/AE/12.0/DB%20Schema/db/_structure/HTML/EH.html), but if you are looking for return codes you'll need to cross-reference the AH table (https://docs.automic.com/documentation/webhelp/english/ARA/12.0/AE/12.0/DB%20Schema/db/_structure/HTML/AH.html).


  • 3.  Monitoring active\sleeping jobs

    Posted Mar 20, 2017 08:44 AM
    thanks for the table links Michael, i have now got a sql query running with the data i need now.

    Thanks again


  • 4.  Monitoring active\sleeping jobs

    Posted Mar 20, 2017 09:41 AM
    Last year I had the same issue - I cancelled a job and forgot to restart it.

    I created a script that checks the activity window and compares it with a VARA object that stores all objects that should be in running status.

    If you want I can share it with you.


  • 5.  Monitoring active\sleeping jobs

    Posted Apr 26, 2017 02:05 PM
      |   view attached
    Clint_Knight_843

    here you go..

    the script iterates through VARA.CHECKPERMANENTJOBS and checks if every job is in an active state.

    config:
    first row ist just an incremental number
    second row - Object name that should be running
    third row - if the check for an object should be ignored enter the date (today) Format: YYMMDD

    if an object is not in an active state, it gets started automatically by the script and a call object (not included in the xml) gets executed.


    you can run the script as often as you want during the day.

    If you have any questions, let me know.

    have fun :-)

    Attachment(s)

    xml
    V9_checkpermanentjobs.xml   4 KB 1 version


  • 6.  Monitoring active\sleeping jobs

    Posted Apr 26, 2017 02:25 PM
    thank you ... i will let you know how it works


  • 7.  Monitoring active\sleeping jobs

    Posted Apr 26, 2017 03:03 PM
    you re welcome :-)


  • 8.  Monitoring active\sleeping jobs

    Posted Apr 27, 2017 08:50 AM
      |   view attached
    Clint_Knight_843

    While my wife was watching Greys Anatomy in the evening I got very bored and extended the checkscript a bit.

    now the checkscript is more configurable.
    zafs7noqes8r.jpghttps://us.v-cdn.net/5019921/uploads/editor/g6/zafs7noqes8r.jpg" width="513">

    enter object name if an alert should be sent if its not found in activities window and if it should be (re-) started automatically and the mailadress for the alert mails (semicolon seperated)

    Report would look like this:
    2017-04-27 14:33:32 - U0020408 JOBS.WIN.PING120       Mail: uc4@local.com;outside@local.com
    2017-04-27 14:33:32 - U0020408 EH_Name:       EH_RUNID:
    2017-04-27 14:33:32 - U0020408 EH_Status:        EH_Queue:
    2017-04-27 14:33:32 - U0020408 alert: Y      autostart: Y
    2017-04-27 14:33:32 - U0020408 adding JOBS.WIN.PING120 to alertlist
    2017-04-27 14:33:32 - U0020408 starting object JOBS.WIN.PING120...
    2017-04-27 14:33:32 - U0007000 'JOBS.WIN.PING120' activated with RunID '0001153155'.
    2017-04-27 14:33:32 - U0020408 ===================================================
    2017-04-27 14:33:32 - U0020408 JOBS.WIN.PING300       Mail: uc4@local.com
    2017-04-27 14:33:32 - U0020408 EH_Name: JOBS.WIN.PING300     EH_RUNID: 1153152
    2017-04-27 14:33:32 - U0020408 EH_Status: 1550      EH_Queue: CLIENT_QUEUE
    2017-04-27 14:33:32 - U0020408 alert: N      autostart: Y
    2017-04-27 14:33:32 - U0020408 object running, no action necessary in this case
    2017-04-27 14:33:32 - U0020408 ===================================================

    First and fourth  line of every section is the content of the cinfig vara for this object.
    second and third line content of Activities window - if found

    alertlist is the list of not-running objects for the email.

    thats it - should be more flexible as the previous version....

    have fun!

    Attachment(s)



  • 9.  Monitoring active\sleeping jobs

    Posted Apr 27, 2017 09:31 AM
    FrankMuffke  are you hard coding your vara table or running a script to put the values in?


  • 10.  Monitoring active\sleeping jobs

    Posted Apr 27, 2017 02:14 PM
    Hi Clint_Knight_843

    yes the config VARA entries are hardcoded. Once you ave to defin what should happen if object xy is not running.


  • 11.  Monitoring active\sleeping jobs

    Posted Apr 27, 2017 02:18 PM
    Thanks FrankMuffke....this seems to be working like we hoped. Big help!


  • 12.  Monitoring active\sleeping jobs

    Posted Apr 27, 2017 02:18 PM
    you are welcome :-)


  • 13.  Monitoring active\sleeping jobs

    Posted Jan 26, 2018 09:08 PM
    Hello Community - I am adding on to this post, as I started using the logic made available by FrankMuffke to send email notifications about job status at the end of a day. With a combination of SQLI to read the job run-id and saving the job report with the utility ucybdbar, I am able to save the necessary job reports that I want to send as an email attachment. However, I am running into this error that I cant seem to get around. Any suggestions?

    50014: Attachment does not exist

    Thanks,
    Latha Vijayagopal


  • 14.  Monitoring active\sleeping jobs

    Posted Jan 27, 2018 05:34 AM
    If you use a shared environment (=2 physical AE Servers or more) then here is one answer:

    https://community.automic.com/discussion/1051/attach-a-file-to-an-e-mail-notification

    cheers, Wolfgang



  • 15.  Monitoring active\sleeping jobs

    Posted Jan 27, 2018 12:26 PM
    Thanks for the quick response, FrankMuffke. The surprising thing is that this is in my Dev environment, where we have a single AE server, which is what had me stumped. Anyways, it might be better to go with the UNC approach as we do have more than one server in our Production. Alternatively, I am also trying to send the emails via Powershell, if that turns out easier.

    Happy weekend!
    Latha Vijayagopal


  • 16.  Monitoring active\sleeping jobs

    Posted Jan 28, 2018 08:42 AM
    Hi

    then I would suppose its a credentials issue.

    If you want to investigate further, i would check if the user who starts your AE Services ( and your SQL Agent) is allowed to access those files as well.

    cheers, Wolfgang