Setup Alert New Job created

  • Disregard this question, a trigger could complete this request, I need a way to be notify when a new job has been created on my SQL Server.  Any ideas, I was thinking to write something to monitor inserts on sysjobs table.

    • This topic was modified 4 years, 12 months ago by  rr_littletons.
  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

  • I would:

    • Create a log table
    • Insert all jobs into it
    • Create a proc to check for any jobs not in the log table

      • if it finds anything, insert the job into the log table and notify
      • these must be done within a single transaction

    • Create a scheduled job to execute the proc

    Very simple.  You could easily add this process to any server needing to be monitored.

  • I'd create a morning report for all jobs.  It's not difficult to do and will teach you a lot about the tables in MSDB.  I render the report in T-SQL as HTML and when a new job appears, its modification data (which is a creation date the first time) is colored in Light Green for a week.  That also helps me keep track of if and when a job changed.

     

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • rr_littletons wrote:

    Disregard this question, a trigger could complete this request, I need a way to be notify when a new job has been created on my SQL Server.  Any ideas, I was thinking to write something to monitor inserts on sysjobs table.

    Years ago I created triggers for this table and they worked fine for several years helping to be notified (email) when anyone of my colleagues disable/enable jobs, create new ones and delete existing.

    Have to admit, it's not recommended way, but it helped in my circumstances.

     

     

  • Reports and dashboards are great.  I use them regularly for monitoring.  The downsides for me have been time delay and oversights.  An alert could be set to near real-time.  Also, an alert would not require me catching a warning on a report or dashboard.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply