Stefan Stranger's Lifestream - tagged with monitor http://www.stranger.nl/feed en-us http://blogs.law.harvard.edu/tech/rss Sweetcron stefan@stranger.nl OpsMgr SQL Full or Differential Backup Check http://www.stranger.nl/items/view/5637

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. Remark: Please read information on System Center Central for more info on this article. 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.    Configure Unhealthy Expression. Property[@Name='NumHours'] Greater Than 1 (threshold when your backup should have been run)
Configure Healthy Expression Property[@Name='NumHours'] Less than or equal to 1 (threshold when your backup should have been run)
Configure Health.
Configure Alerting I used the Reason, BackupType and Number of Hours in the Alert Description.
Open the MP XML file and change the data type in the xml configuration from string to integer. Since making this change, the alerts and state changes seems to occur when at the correct time.More info here: (thanks to Daniele Grandini)<ErrorExpression>             <SimpleExpression>               <ValueExpression>                 <XPathQuery Type="Integer">Property[@Name='NumHours'] </XPathQuery>               </ValueExpression>               <Operator>Greater</Operator>               <ValueExpression>                 <Value Type="Integer">20</Value>               </ValueExpression>             </SimpleExpression>           </ErrorExpression>           <SuccessExpression>             <SimpleExpression>               <ValueExpression>                 <XPathQuery Type="Integer">Property[@Name='NumHours'] </XPathQuery>               </ValueExpression>               <Operator>LessEqual</Operator>               <ValueExpression>                 <Value Type="Integer">20</Value>               </ValueExpression>             </SimpleExpression>           </SuccessExpression> 15. Enable the Monitor via an Override. Remark: You may need to Use a Run As Account with the right permission for this Monitor. Result:

Some time ago I created a Tutorial How to Associate a Run As Account to a Monitor.  

In Operations Manager 2007, Run As Profiles and Run As Accounts are used to select users with the privileges needed for running rules, tasks, and monitors. Management Pack authors create a rule, task, or monitor, and then associate it with a Run As Profile. The named Run As Profile is imported along with the Management Pack into Operations Manager 2007. The Operations Manager 2007 administrator creates a named Run As Account and specifies users and groups. The administrator then adds the Run As Account to the Run As Profile and specifies the target computers that the account should run on. The goal in this short tutorial is to create a Timed Script Two State Monitor and associate a run as account to this monitor and save it all in a Management Pack. The Timed Script Two State Monitor is a vbscript that uses WMI to check if BizTalk orchestrations are not started. I’ve got some great help from Jakub Oleksy (http://blogs.msdn.com/jakuboleksy/default.aspx) and Steve Wilson (http://www.authormps.com/dnn/) You can download the tutorial here.

]]>
Thu, 21 Jan 2010 23:56:00 +0100 http://www.stranger.nl/items/view/5637
OpsMgr can monitor everything: The Coretech Coffee Monitor Management Pack – 0.0.0.1 http://www.stranger.nl/items/view/4645

How cool is this? Coretech has created a coffee monitor MP. This management packs can be used to keep track of the level of coffee in left in the pot. With this management pack, you will never run dry of, what we all know, is the most important part of a productive environment! This is mostly made as a proof of concept, as this technique can be transferred to other monitor types. It could be expanded with other types of sensors, like a weight to check the level of coffee instead of a camera, or a thermometer to check the temperature of the coffee. This is the very first version. It has been tested in test environments. By default, it will trigger a warning when under 50% is left, and a Critical Alert when under 20% is left. Please do not hesitate to report any bugs and please send suggestions for the next version you might have. This was developed by Jakob Gottlieb Svendsen with the help of Kåre Rude Andersen Guys great work! Loving it.

]]>
Thu, 22 Oct 2009 16:17:00 +0200 http://www.stranger.nl/items/view/4645
OpsMgr SQL Full or Differential Backup Check http://www.stranger.nl/items/view/1761

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.    Configure Unhealthy Expression. Property[@Name='NumHours'] Greater Than 1 (threshold when your backup should have been run)
Configure Healthy Expression Property[@Name='NumHours'] Less than or equal to 1 (threshold when your backup should have been run)
Configure Health.
Configure Alerting I used the Reason, BackupType and Number of Hours in the Alert Description.
Enable the Monitor via an Override. Remark: You may need to Use a Run As Account with the right permission for this Monitor. Result:

]]>
Mon, 02 Feb 2009 21:05:00 +0100 http://www.stranger.nl/items/view/1761
Generating an Alert after service being stopped n-times within certain time http://www.stranger.nl/items/view/1058

Scenario: The Windows NT Service of a buggy application crashes regularly and is restarted automatically with an Recovery Task. You only want to receive an Alert if this happens n-times within a specified time. Steps: Create a Basic Service Monitor which does not generate an Alert. Create a Recovery Task for the Basic Service Monitor in Step 1. Create a Windows Event Repeated Event Detection Monitor.   Step 1. Create a Basic Service Monitor which does not generate an Alert Just create a ‘normal’ Windows Service Monitor. Step 2. Create a Recovery Task for the Basic Service Monitor in Step 1. Change working directory to %windir% Tip: On Windows 2000 servers there isn't being logged that a service is stopped in the System Eventlog. Create another Recovery Task which creates an Eventlog if the service is stopped. You can use the LOGEVENT tool in the Windows 2000 Server Reskit if you want. Step 3. Create a Windows Event Repeated Event Detection Monitor. Configure the EventID which shows that a service is being stopped. Or use your own created Windows NT EventID on a Windows 2000 server. Configure the Repeat Settings for your environment. Info from the OpsMgr Helpfile. Enable the monitor with an Override for the correct computers.

]]>
Sun, 07 Dec 2008 14:18:00 +0100 http://www.stranger.nl/items/view/1058