OpsMgr: Prevent warning event 21405

Written by Ingmar Verheij on March 16th, 2012. Posted in Operations Manager

A System Center Operation Manager (SCOM or OpsMgr) management pack might cause warning event with ID 21405. This event is raised when a script is run without returning any data.

 

Log Name:      Operations Manager
Source:        Health Service Modules
Date:          16-3-2012 16:14:26
Event ID:      21405
Task Category: None
Level:         Warning
Keywords:      Classic
User:          N/A
Computer:     
Description:
The process started at 16:14:26 failed to create System.PropertyBagData, no errors detected in the output.  The process exited with 0

A script is run to discover objects or to query data (to collect data – a rule – or to monitor and object – a monitor) and should return this data to the MOM.ScriptAPI object so it can be processed. If a script is run without returning data OpsMgr suspects an issue. A script might not return data because of antivirus, DEP or by design. If you design a management pack, continue reading.

By design

If you expect a script not to return data you need to make sure that OpsMgr is aware of this so you can prevent the 21405 event. The event can be prevented by adding an event policy, as described by Raphael Burri:

First of all you need to make sure the script ends gracefully (error code 0)

Secondly you need to add an event policy at the end of the datasource tag.

 

DiscoveryData

If you have a script that is used to discover objects and it fails to complete successfully, there is a chance that the objects disappear from OpsMgr. To avoid this you can set the IsSnapshot property of the CreateDiscoveryData to True, as described by Boris Yanushpolsky.

 

Error opening management pack

The first time I tried adding the event policy, as described by Raphael Burri, I got the following error while opening the file in the Authoring Console:

 

This is because the EventPolicy element isn’t defined properly.

 

Example: TimedScript.PerformanceProvider

I’ve got a rule that collect performance data using the Microsoft.Windows.TimedScript.PerformanceProvider data source module. I know that the object I’m querying not always return data because it only generates data at certain moment, so I don’t want to return a PropertyBag.

Before you can add the event policy to a datasource you need to include the CommandExecuterSchema schema and add a EventPolicy element to the DataSourceModule.

Now you can add the event policy to the datasource:

Ingmar Verheij

At the time Ingmar wrote this article he worked for PepperByte as a Senior Consultant (up to May 2014). His work consisted of designing, migrating and troubleshooting Microsoft and Citrix infrastructures. He was working with technologies like Microsoft RDS, user environment management and (performance) monitoring. Ingmar is User Group leader of the Dutch Citrix User Group (DuCUG). RES Software named Ingmar RES Software Valued Professional in 2014.

More Posts - Website

Follow Me:
TwitterLinkedInGoogle Plus

Tags: , , ,

Leave a comment

*

Donate

%d bloggers like this: