if not exists (select * from [master].dbo.sysprocesses where left(program_name,8)='SQLAgent')
@profile_name ='Database Mail',
@body ='Please look into the issue; Scheduled Jobs will not run if the SQL Server Agent Service remains stopped.',
@subject ='SQL Agent Stopped,Please Check' ;
I am using above script to find out whether SQL Agent Stopped is stoped or Running , I want to add IP address and Server name in subject line.
And I also want to monitor it for 40+ servers please help me for how above script can be used for monitoring the same .