Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: Task to check for SQL Server job failures
Topic Summary:
Created On: 07/11/2005 10:49 AM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 07/11/2005 10:49 AM
User is offline View Users Profile Print this message

Author Icon
Noel
AutoMate Coach(200+)

Posts: 237
Joined: 04/01/2005

SQL Server 6.5, SQL Server 7.0, and SQL Server 2000 has a limitation in that you cannot set up SQL Mail on a clustered server  Therefore, if you want to be notified of job failures on a clustered server you must devise a workaround of your own.

Well, here is my AutoMate version of that work-around.

Basically, it querys for job failures in a given date/time range against the sysjobs and sysjobhistory tables in the msdb database of the servers specified in a comma-separated list.  If any job failures are found, an e-mail can be sent to whomever should be notified.

In order to get this working, make sure you have a database user that has access to select from tables in msdb on the servers you are interested in checking.

You will need a registry key to store the last time the task was run.  (Maybe there is some internal AutoMate variable you could access to get this information, but I couldn't locate it.)  Something like this...

HKEY_LOCAL_MACHINE\SOFTWARE\YourCompany\AutoMate\CheckSQLServerJobs

We have set this up to run hourly, looking for failures between that last date/time it ran (from aforementioned registry key) plus 1 second and the current date/time.  At the end of the task, it will save the date/time that was used as the ending date/time range value.

If you don't want to (or don't have the authority to) use the registry, this task could easily be modified to store the last run date/time to a table in a database or even just to text file.

This may not be a long-term solution for us, but it will ease our minds and avoid the hassle of manually going to each of our SQL Server to look for job failures until we figure out something else.


Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)


-------------------------
Thanks,

Noel Scheaffer
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 1423 guests browsing this forum, which makes a total of 1423 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2020 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog