It has been mentioned by various people that one should not put OpsMgr’s management servers’ health service objects into maintenance mode: Manageability Team Blog Entry
Now this is difficult to explain to people using the OpsMgr console and I’ve infrequently found my RMS’ health services showing the wrench icon. In order to avoid this situation from stopping OpsMgr for too long, I put together a tiny SQL query. It ends maintenance mode if found active on an RMS’ health service and then attempts to restart the config service on the RMS.
This will reinitialize the RMS and it will begin updating other maintenance windows as required.
I configured an SQL agent job using the above query. It is scheduled to run every 15 minutes and does the job nicely. The SQL statements below do create the SQL Server agent job ‘End RM Maintenance Mode’ for you. Simply paste the text into a new query window:
Note that you’ll need to allow the xp_commandshell function on your SQL server. This can be activated using the SQL Server Surface Area Configuration tool. Furthermore the user you’re running the SQL server agent under must have administrative access to the RMS server. You’ll need to pay attention to this especially if your RMS and SQL servers are on dedicated machines.
Open OpsMgr’s Operations Console. Change to the Monitoring pane and choose ‘Discovered Inventory’. From the action pane use ‘Change Target Type’ and select ‘HealthService’.
You should now see a list of all health services your RMS manages.
Set some non-RMS health services into maintenance mode and wait until their state changes to ‘Not monitored’. Now do the same with the health service entity of your RMS.
After the SQL server agent job has been run the RMS’ health service’s maintenance mode should have ended and by checking the system log on your RMS you should see that OpsMgr’s Config Service has been restarted.
In case your the RMS’ Health Service’s Maintenance Mode is not ended properly (the wrench icon disappears but the health service remains in ‘Not Monitored state), check your SQL server agent’s log. Most likely you’ll see that the job didn’t have the permission to restart the Config Service or xp_commandshell was not enabled.