Post dated data – reprise


I wrote about the effects of post dated data flowing in the OpsMgr db in this post of mine The case of post dated monitoring data. There I focused on health state issues caused by off time data, but I hadn’t realized, until today, that post dated data affects disocvery as well in a more subtle way. In fact I didn’t notice the stale discovery data until I updated to R2 CU1 and checked for agent update status. With my disconcert some agents, even if correctly updated, were not reflecting their status in console. After a quick troubleshooting session what I found is the same mechanisms used for health state data apply to discovery data. Precisely every time a new discovery flows in, it gets validated by the dbo.p_DiscoverySourceUpsert stored procedure. The validation is based on the TimeGeneratedOfLastSnapshot if the data is older than the recorder snapshot is updated otherwise it gets discarded. And this was the case, during the w32time incident some data has been discovered by the agents and from then on all the newly discovered data has been discarded, not easy ton detect.

As usual the solution has been an unsupported database mod. First to see if you have any postated data you should use the following query againt the OpsMgr db:

select * from   [dbo].[DiscoverySource] d

inner join BaseManagedEntity B  on d.BoundManagedEntityId = B.BaseManagedEntityId

where d.IsDeleted = 0 and B.IsDeleted = 0 and TimeGeneratedOfLastSnapshot > GETUTCDATE()

The you can get rid of the issue updating the same table resetting the TimeGeneratedOfLastSnapshot to "now" so that all newly generated discovery will have a chance to be older than the one in the db hence being recorded:

update [dbo].[DiscoverySource]  set TimeGeneratedOfLastSnapshot = GETUTCDATE() from [dbo].[DiscoverySource] d inner join BaseManagedEntity B  on d.BoundManagedEntityId = B.BaseManagedEntityId

where d.IsDeleted = 0 and B.IsDeleted = 0 and TimeGeneratedOfLastSnapshot > GETUTCDATE()

 

– Daniele

This posting is provided "AS IS" with no warranties, and confers no rights.

About these ads
  1. #1 by Daniele Muscetta on February 13, 2010 - 12:48 pm

    A lot of software bugs (most of them, I’d say, but I don’t have *real* figures to back my claim here – it’s more of a feeling)… either causing odd behaviours, or crashes, or even security vulnerabilities, boil down to missing or incorrect input validation :(

  1. Post dated data in your OpsMgr database « Quae Nocent Docent

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 266 other followers

%d bloggers like this: