SQL Server Agent status


Job details

Name: SQL Server Agent status
Platform: Sqlserver
Category: Availability
Description: Checks if the SQL Server Agent is running.
Long description: This alert checks the master.dbo.sysprocesses table for the program_name value for the SQL Server Agent process. The program name value is controlled by the dbWatch parameter ‘sqlserver agent process name’. Besides this parameter values, the following program names are checked too: ‘SQLAgent – Generic Refresher’ and ‘SQLAgent – Job invocation engine’.
Version: 1.3
Default schedule: 0,15,30,45 * * *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘sqlserver’]/instance[maj_version > ‘1999′ & hasengine=‘YES’ & engine_edition = ‘Microsoft SQL Server’ & eng_inst_priv = 0]

Parameters

Name Default value Description
sqlserver agent process name SQLAgent – Generic Refresher The program_name column value for the SQL Server Agent as it appears in the master.dbo.sysprocesses table.
return status 1 Return status value (ALARM – 2, WARNING – 1, or OK – 0) when SQL Server Agent is not running.

Job Summary

SELECT name, status, last_run_outcome, last_run_date, last_run_time FROM msdb.dbo.sysjobs;

Report Presentation Structure

The job report provides a detailed view from the sysprocesses table about the SQL Server Agent status. This includes the following information in a structured table format:

SPID Login Time Last Batch Status Program Name Command NT Username Loginame

Here, variables like SPID, Login Time, Last Batch, and others give a comprehensive insight into the processes related to the SQL Server Agent, helping in monitoring and troubleshooting.

Implementation Details

Auto-Installation and Upgrades

This structure and functionality are designed to maintain the high availability and reliability of SQL Server instances by ensuring the SQL Server Agent is active and operational, aligning with system automation and scheduled tasks management.