How can I show the time (or time since) last state change ?

Is there a way to show time for latest state change on a “status” object (ie a DA).

We come into office in the morning and the dashboard are all green - BUT…
we don’t know if everything has been all fine or services has been down all night, but has just gone green.

So, I want to show a time for last state change on status dashboard.

Anyone with a good idea ?

You could run a powershell query to get the result:

Get-SCOMMonitoringObject “name of monitored object” | select statelast*

StateLastModified
—————–
2017-08-30 18:20:05

 

This SQL query could also be useful to get the last time an object triggered an alert.

SELECT TOP (1)

alt.RaisedDateTime,

vManagedEntity.DisplayName,

vManagedEntity.Path

FROM Alert.vAlertResolutionState AS ars INNER JOIN Alert.vAlertDetail AS adt ON ars.AlertGuid = adt.AlertGuid INNER JOIN

Alert.vAlert AS alt ON ars.AlertGuid=alt.AlertGuid INNER JOIN

vManagedEntity ON alt.ManagedEntityRowId=vManagedEntity.ManagedEntityRowId

WHERE vManagedEntity.Path = ‘monitored object name’ order by alt.RaisedDateTime desc

2 Likes

I'm looking for a way to show the state of an object (ie. an DA) and next to it, the time or duration since its last state change.

Somewhat like this (this is a capture from our old dashboard solution)

state.jpg

The new 3.3 version will include this feature

2 Likes

v3.3 will have this functionality easily accessible via the label option. Other functionality shown below:

Failing that, use a custom label on a status tile and use the StateLastModified property. The only thing I will say is that it comes in a somewhat unreadable number value, so would require some tinkering to make it understandable.

1 Like

Hey Bill, it may be worth putting in a feature request on this via [email protected]

I don’t believe you’ll be able to add this to a Visio as the text and image is static. The only thing that changes is the health state. Drop support a line and see if there’s anything you can do, but I believe Jannep is correct with the PS or SQL query route.

I doesn’t have to be in visio - the image was just to show what I meant.
I have created a feature request at support.

You could use Squaredups powershell management pack and run the command I listed above to get the data. And then set status from the values you get back.