Jump to content
Sign in to follow this  
t-zwck

OpsMgr SQL Full or Differential Backup Check

Recommended Posts

OpsMgr SQL Full or Differential Backup Check

I helped a customer creating a OpsMgr Monitor for checking if the there has been a SQL Full or Differential Backup within a specified number of hours. David Scheltens created the SQL query.

 

This is how you could create this kind of monitor in your own environment.

 

Steps:

 

Create a Timed Script Two State Monitor.

Save Monitor in other MP than Default MP.

Give the Monitor a Name, like “Custom – SQL Full or Differential Backup Check”.

Target the Monitor to SQL Database.

Select a suitable Parent Monitor like Availability.

Disable Monitor (enable by an Override later).

Configure how often this Monitor should run (default is 15 mins, but you could change this depending on the time your SQL backups run)

Copy script from here.

The script uses three parameters (or arguments)

- Param 0: The SQL connection string for the server

- Param 1: The Database to use

- Param 2: The threshold (in hours) to use

Configure the Parameters.

 

Hidden Content

    Give reaction to this post to see the hidden content.

 

Configure Unhealthy Expression.

Property[@Name=NumHours] Greater Than 1 (threshold when your backup should have been

 

Hidden Content

    Give reaction to this post to see the hidden content.

 

Configure Healthy Expression

Property[@Name=NumHours] Less than or equal to 1 (threshold when your backup should have been run)

 

Hidden Content

    Give reaction to this post to see the hidden content.

 

Configure Health.

 

Hidden Content

    Give reaction to this post to see the hidden content.

 

Configure Alerting

I used the Reason, BackupType and Number of Hours in the Alert Description

 

Hidden Content

    Give reaction to this post to see the hidden content.

 

Enable the Monitor via an Override.

Remark: You may need to Use a Run As Account with the right permission for this Monitor.

 

Result:

 

Hidden Content

    Give reaction to this post to see the hidden content.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...