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.
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:%'
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.
Nice work! Iâm borrowing this query
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