Делите путем


How and When to Clear the Cache

In System Center Operations Manager, when troubleshooting an issue with the Operations console or with an agent, you may see recommendations to "clear the cache." For more information on troubleshooting an issue with an agent, see Not monitored and gray agents.

Operations Console

A possible reason to clear the Operations Console cache is to fix errors that occur when you access data in views, such as ObjectNotFoundExceptions. Another reason is to free up disk space when the cache file becomes too large.

Important

Before proceeding close any open consoles.

This may need to be executed from an Administrator PowerShell console, depending on organization policy.

# Option 1: This will read the console install directory from registry and then execute. Useful if installed in a non-default directory
Start-Process ((Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\System Center Operations Manager\12\Setup\Console").InstallDirectory + "Microsoft.EnterpriseManagement.Monitoring.Console.exe") -ArgumentList "/clearCache"

# Option 2: This will start the process in the default ProgramFiles directory
Start-Process "$Env:ProgramFiles\Microsoft System Center\Operations Manager\Console\Microsoft.EnterpriseManagement.Monitoring.Console.exe" -ArgumentList "/clearCache"

Management servers

One of the last steps in troubleshooting is to clear the cache. This will remove any unsaved data along with the current configuration and management packs. After clearing the cache, we will receive a new configuration from the database, which includes updated management packs, and reconnect with clients. This can help if a management server has faulty or missing management packs that cause workflow errors or is delayed in sending data to the database.

  1. In the Monitoring workspace, expand Operations Manager, and then expand Management Server.
  2. Select Management Server State.
  3. In the Management Server State column, select one or several servers.
  4. In the Tasks pane, select Flush Health Service State and Cache.
  5. In the prompt window, enter the credentials used for this task, or use default and hit Run

Note

Know that this task works differently than that of an agent as all the workflows that are running under the HealthService on the management server (which could be in the tens of thousands) needs to be stopped, and this can take time, to the point where the task may time out or throw an error. If this occurs, you may want to consider performing the cache clear manually.

Gateway servers

One of the last steps in troubleshooting is clearing the cache. Sometimes, the gateway may not communicate with the management server and appear greyed out in the System Center Operations Manager console. In such cases, we need to clear the cache for gateways. We also need to do this when the gateway has outdated or unusable management packs or data that cannot be inserted into the database.

  1. In the Monitoring workspace, expand Operations Manager, and then expand Management Server.
  2. Select Management Server State.
  3. In the Gateway Management Server State column, select one or several servers.
  4. In the Tasks pane, select Flush Health Service State and Cache.
  5. In the prompt window, enter the credentials used for this task, or use default and hit Run

Client servers

A possible way to fix problems with workflows or communication between the agent on a client server and the management group is to clear the cache and restart the agent. This is a last resort for troubleshooting, but it can resolve some issues effectively.

  1. In the Monitoring workspace, expand Operations Manager, and then expand Agent Details.
  2. Select Agent Health State.
  3. In the Agent State column, select one or several agents.
  4. In the Tasks pane, select Flush Health Service State and Cache.
  5. In the prompt window, enter the credentials used for this task, or use default and hit Run

Note

Because this action deletes the cached data in the health service store files, including the record of this task itself, no true task status is reported in the console upon completion of the task, it will always "Succeed" so long as the command was sent.

Next steps

  • To understand how it can help you review alerts that have been generated by rules and monitors that are still active, review Viewing Active Alerts and Details.

  • To understand how Operations Manager monitors the communication channel between an agent and its primary management server to ensure it's responsive and available, see How Heartbeats Work in Operations Manager.