Solved

SSIS: Check for Connection Manager Login Fail

Posted on 2014-04-23
2
525 Views
Last Modified: 2016-02-10
Hi Experts,

I have an SSIS package that runs on task scheduler everyday. The main thing is there is an OLE DB connection manager to an SQL server and it's been set on the server that this password must be updated every 3 months which of course causes a package failure.

Now. Is there a way I can somehow capture a login failure in this connection manager and use the send mail task to mail me when this happens? It's not as easy as using an event handler I don't think anyway...

Thanks,

OS
0
Comment
Question by:onesegun
2 Comments
 
LVL 8

Accepted Solution

by:
ProjectChampion earned 100 total points
Comment Utility
There are several ways you can audit failed login attempts to SQL Server, but one way which sounds suitable for your specific case is xp_readerrorlog proc; for instance try the following:
DECLARE
  @StartTime DATETIME = GETDATE() - 100
, @EndTime DATETIME = GETDATE();
EXEC sys.xp_readerrorlog 0, 1, N'Login', N'failed', @starttime, @endtime;

You can modify the WHERE clause to filter the result specifically for the particular login that's used by your SSIS package.
Anyhow after detecting the failure you can use sp_send_dbmail or similar to send a notification to yourself.

Alternatively you can be proactive and check the login in the context of a separate job that runs more frequently or ahead of that SSIS package to allow you detect and resolve the problem before it affects your SSIS.

You can also use this method to proactively monitor all failed login attempts for all other logins (be it accidental or malicious) to stay on top of the game.
0
 

Author Closing Comment

by:onesegun
Comment Utility
Thanks mate! Although it works and I can perhaps try to experiment with a way to pass some variables from the returned results into an SSIS variable and then perhaps use that to trigger a send mail task.

At the moment though I'm unable to execute sproc on the server of interest. Thanks anyway.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now