Maintenance Mode Dash Board

Has anybody ever created a dashboard to show what is in maintenance mode. I was thinking that might be a good one to set up so people can know what is being worked on. Any tips on how to do this.

1 Like

Hi rtbywalski, I also found that having a Maintenance mode dashboard to be of value. Here is what I did. Best of luck. Matthew

I created a Dashboard named ‘Maintenance Mode History’ with two sections “Objects in Maintenance Mode” and “Maintenance Mode History”. The first section is a Status Tile (Icons) scoped to Class ‘Windows Computer’ with Critera “InMaintenanceMode=1 OR HealthState=0”. The second section is a SQL Tile (grid). Connection string “Data Source=[your data source];Initial Catalog=OperationsManager;Integrated Security=True”. Here is my SQL query:

Use [OperationsManager] SELECT FullName as [object in maintenance], CONCAT(CONVERT(VARCHAR(24),StartTime, 113), ' UTC') As 'start time', CONCAT(CONVERT(VARCHAR(24),ScheduledEndTime, 113), ' UTC') As 'scheduled end time', dbo.MaintenanceMode.[User] as [user], Case ReasonCode When 0 then 'Other (Planned)' When 1 then 'Other (Unplanned)' When 2 then 'Hardware: Maintenance (Planned)' When 3 then 'Hardware: Maintenance (Unplanned)' When 4 then 'Hardware: Installation (Planned)' When 5 then 'Hardware: Installation (Unplanned)' When 6 then 'Operating System: Reconfiguration (Planned)' When 7 then 'Operating System: Reconfiguration (Unplanned)' When 8 then 'Application: Maintenance (Planned)' When 9 then 'Application: Maintenance (Unplanned)' When 10 then 'Application: Installation (Planned)' When 11 then 'Application: Unresponsive' When 12 then 'Application: Unstable' When 13 then 'Security issue' When 14 then 'Loss of network connectivity (Unplanned)' End as [reason for maintenance], Comments FROM BaseManagedEntity INNER JOIN MaintenanceMode ON BaseManagedEntity.BaseManagedEntityId = MaintenanceMode.BaseManagedEntityId WHERE IsInMaintenanceMode = 1 AND FullName like 'Microsoft.Windows.Computer:%'

1 Like

Thanks I was getting stumped on the criteria I wish I could find a document out there that would show me what my options are there.

1 Like

We have an icon tile that is configured like this.

1 Like

Nice work! I’m borrowing this query :wink:

Hello.

This dashboard is exactly what I was looking for, but unfortunately I cannot get it to work. Whenever I try to execute the SQL query against my DB, I get a bunch of errors. I have also tried to execute it directly in the SQL Management Studio, this doesn’t work either. I haven’t done any modifications to the SQL query at all. I’m on SCOM 2016.
I am getting the errors stated below - can anybody tell me what I am doing wrong?

Msg 102, Level 15, State 1, Line 3
Incorrect syntax near ‘‘’.
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near ‘time’.
Msg 132, Level 15, State 1, Line 10
The label ‘Hardware’ has already been declared. Label names must be unique within a query batch or stored procedure.
Msg 132, Level 15, State 1, Line 11
The label ‘Hardware’ has already been declared. Label names must be unique within a query batch or stored procedure.
Msg 132, Level 15, State 1, Line 12
The label ‘Hardware’ has already been declared. Label names must be unique within a query batch or stored procedure.
Msg 132, Level 15, State 1, Line 14
The label ‘System’ has already been declared. Label names must be unique within a query batch or stored procedure.
Msg 132, Level 15, State 1, Line 16
The label ‘Application’ has already been declared. Label names must be unique within a query batch or stored procedure.
Msg 132, Level 15, State 1, Line 17
The label ‘Application’ has already been declared. Label names must be unique within a query batch or stored procedure.
Msg 132, Level 15, State 1, Line 18
The label ‘Application’ has already been declared. Label names must be unique within a query batch or stored procedure.
Msg 132, Level 15, State 1, Line 19
The label ‘Application’ has already been declared. Label names must be unique within a query batch or stored procedure.

We use this method also, works great.

Kenni, you will need to copy this into a notepad and change all of the ’ marks. It seems copy pasting from this website modifies the quotes into another character that SQL doesn’t understand :slight_smile: