Automic Workload Automation

  • 1.  SQL to get Agent Status

    Posted Jun 29, 2015 04:51 AM
    Hi Everyone.. Does anyone have any example SQL that gets the status of all agent assigned to a client? Although we can get the status via command line utilities for all Linux agents, this does not get the status for our Windows agents, so looking to see if we can do this via SQL to the backend database instead & get the status of all agents. Thanks! Colin.


  • 2.  SQL to get Agent Status

    Posted Jun 29, 2015 06:45 AM
    What do you mean with agent status?

    You could put all agents of a client to an agent group and use in a script:

    PREP_PROCESS_AGENTGROUP
    with SYS_HOST_ALIVE

    they you get a list which agent is up and which is not.


  • 3.  SQL to get Agent Status

    Posted Jun 29, 2015 06:58 AM
    I just found an example in documentation - without SYS_HOST_ALIVE

    :SET &HND# = PREP_PROCESS_AGENTGROUP("HOSTG.EXAMPLE.PREP_PROC_AGENTGRP","*",ALL)

    :PROCESS &HND#
    :   SET &AGENT# = GET_PROCESS_LINE(&HND#,1)
    :   SET &STATUS# = GET_PROCESS_LINE(&HND#,2)
    :   PRINT "Agent: &AGENT#"
    :   PRINT "Status: &STATUS#"
    :ENDPROCESS

    :CLOSE_PROCESS &HND#

    http://docs.automic.com/documentation/AE/10.0.5/english/AE_WEBHELP/help.htm#ucaclv.htm?Highlight=PREP_PROCESS_AGENTGROUP







  • 4.  SQL to get Agent Status

    Posted Jun 29, 2015 08:51 AM
    Thanks for the responses. With both of these we have to remember to setup all the agents into a agent/host group by the looks of it. I've already written similar UC4 scripts that check using SYS_HOST_ALIVE. What I'm looking for SQL command(s) that would check the up/down status of all the agents within a given client. But can't seem to find the agent status within the db schema.


  • 5.  SQL to get Agent Status

    Posted Jun 29, 2015 09:54 AM
    While I don't have any SQL to satisfy your requirements, I might suggest that you review this discussion regarding how SYS_HOST_ALIVE appears to operate at least under our current V8.  It is still an occasional issue for us as we yet to have developed a 100% satisfactory solution.


  • 6.  SQL to get Agent Status

    Posted Jun 29, 2015 02:58 PM
    Hi Colin.

    I used to execute a sql statement like this one:

    select OH_Name from ah,oh where AH_OType='HOST' and AH_OH_Idnr=OH_Idnr and AH_TimeStamp4='NULL'

    NULL as this timestamp means that the agent has not ended. So, this statement will return all the "active" agents. I'm not sure that's a 100% errorfree solution but you can use this on a SQLI vara and compare with the UC_EX_HOSTCHAR (contains the name of all your agents) vara. But I was not able to find the table/field that stores the client definitions for the agents. By default, the agents belong all to the client 0.

    Hope this helps.



  • 7.  SQL to get Agent Status

    Posted Jun 30, 2015 08:01 AM
    the Client authorizations for HOSTS (Agents) is stored in the HACL table.

    http://docs.automic.com/documentation/AE/10.0.0/english/AE_DB_TABLES/tables/HACL.html