Jump to content

Reeses4brkfst

Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

My Information

  • Location
    PA, USA
  • Agent Count
    < 500 Agents
  1. Reeses4brkfst

    Check if Agent is Online

    I'm very new to SQL scripting and automation scripting in general, so pardon if this is a silly question... At the start of a script I am writing I want to ensure the target computer is online and exit the script if it is not (since the script will just queue up to run when the computer does come online by default, which is not what I want in this instance). My thought process was... Check if agent is online. Log a script log message if the agent is offline and exit the script. To check if the agent is online I imagine I could either check if the one of the core agent services is running on the target computer, though I'm not sure which service I'd check, or I would use a SQL Get Value function and store the results into a variable, but I'm not sure what SQL value I'd be looking for to see if the agent is online. Aside from some help in figuring out how to script one of these methods, preferably the SQL Get Value option, can someone clarify for me if the script will execute until it reaches a step it cannot because the target computer is offline, or if the entire script will just queue when the agent is offline? Maybe I'm going about this the wrong way and what I really need is a monitor which alerts me if a script is queued because the target computer was offline and so it could not/did not attempt to execute... Thoughts? Thanks,
×