パフォーマンス カウンターにアクセスした際のエラー


解説

デフォルトでは、SitecoreのHealthMonitor エージェントは、パフォーマンス カウンターの値をSitecoreのログ ファイルに定期的に記録します。ログに記録される対象のパフォーマンス カウンターは、web.config ファイルで構成されます。ただし、HealthMonitor エージェントは、一部のカウンターにアクセスできない場合、さまざまな例外をスローする可能性があります。

これらの例外は、さまざまな状況によって引き起こされる可能性があります。場合によってはSitecoreが原因である可能性があり、その他の場合には環境設定または.NET Frameworkが原因である可能性があります。

Sitecoreにパフォーマンス カウンターの値を記録させたくない場合、それらのエラー メッセージを安全に無視できます。それ以外の場合は、以下の解決策を試してください。

解決策1

エラー メッセージ:

WARN Counter category 'Sitecore.XXX' does not exist on this server. Using temporary internal counter for 'YYY'
考えられる解決策:

一部のSitecore 固有のパフォーマンス カウンターがサーバーにインストールされていません。

次の記事の解決策のセクションに従って、カウンターをインストールしてください:
http://sdn.sitecore.net/faq/administration/sitecore log filling up with warnings.aspx

更新済み:使用されていないカウンターがインストールされなくなるようzipファイルを更新しました。

Sitecore 7.5以降の場合:
添付の「xml counters[Sitecore7.5].zip」ファイルをsitecorecountersツールで使用してください。

解決策2

エラー メッセージ:

例1

WARN Counter category '.net CLR Memory' does not exist on this server. Using temporary internal counter for 'XXX'.
ERROR Instance Name is not available
 
Exception: System.InvalidOperationException
Message: Category does not exist.
Source: System
at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String machine, String category)
at System.Diagnostics.PerformanceCounterCategory.GetCounterInstances(String categoryName, String machineName)
at Sitecore.Diagnostics.PerformanceCounters.PerformanceCounter.GetInstanceName(String categoryName, String counterName)
at Sitecore.Diagnostics.PerformanceCounters.PerformanceCounter.get_InstanceName()

例2

WARN Cannot resolve Instance name for the counter. Category: .net CLR Memory, Counter name: XXX
ERROR Exception in alarm clock event subscriber.
 
Exception: Sitecore.Diagnostics.PerformanceCounters.InstanceNameIsNotAvailableException
Message: Exception of type 'Sitecore.Diagnostics.PerformanceCounters.InstanceNameIsNotAvailableException' was thrown.
Source: Sitecore.Kernel
at Sitecore.Diagnostics.PerformanceCounters.PerformanceCounter.get_InstanceName()
at Sitecore.Pipelines.HealthMonitor.HealthMonitor.LogCounterStatus(PipelineArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Services.AlarmClock.Heartbeat_Beat(Object sender, EventArgs e)

例3

WARN  Cannot resolve Instance name for the counter. Category: .net CLR Memory, Counter name: XXX
ERROR Instance Name is not available
 
Exception: Sitecore.Diagnostics.PerformanceCounters.InstanceNameIsNotAvailableException
Message: Exception of type 'Sitecore.Diagnostics.PerformanceCounters.InstanceNameIsNotAvailableException' was thrown.
Source: Sitecore.Kernel at Sitecore.Diagnostics.PerformanceCounters.PerformanceCounter.get_InstanceName()

例4(Sitecore 6.6.0 Update-5 以降の場合):

WARN  Counter 'XXX' does not exist on this server.

または

WARN  Counter category 'YYY' does not exist on this server.

 

考えられる解決策:

.NET パフォーマンス カウンターが正しくロードされていない可能性があるため、リロードをお試しください:

  1. 管理者コマンド プロンプトを開始します。
  2. unlodctr .NETFrameworkを実行します。
  3. lodctr %WINDIR%\Microsoft.NET\Framework\<Framework_ver>\CORPerfMonSymbols.ini を実行します。<Framework_ver>は、CORPerfMonSymbols.ini ファイルを含む .NET Framework バージョンのディレクトリです。4.0がインストールされていない場合は、v4.0.xxxまたはv2.0.xxxのいずれかであるはずです。
  4. IISを再起動します。

解決策3

エラー メッセージ:

例1

Exception: System.UnauthorizedAccessException 
Message: Access to the registry key 'Global' is denied. 
Source: mscorlib 
at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str) 
at Microsoft.Win32.RegistryKey.InternalGetValue(String name, Object defaultValue, Boolean doNotExpand, Boolean checkSecurity)
at Microsoft.Win32.RegistryKey.GetValue(String name) 
at System.Diagnostics.PerformanceMonitor.GetData(String item) 
at System.Diagnostics.PerformanceCounterLib.GetPerformanceData(String item) 
at System.Diagnostics.PerformanceCounterLib.get_CategoryTable() 
at System.Diagnostics.PerformanceCounterLib.CategoryExists(String machine, String category)
at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName, String machineName)

例2:(Sitecore 6.6.0 Update-5 以降の場合):

WARN Sitecore has no necessary permissions for reading/creating counters

 

考えられる解決策:

Sitecore アプリケーション プール ユーザーは、パフォーマンス カウンターにアクセスするために、システムの「パフォーマンス モニター ユーザー」グループのメンバーである必要があります。

このグループにユーザーを追加してIISを再起動すると、問題が解決するはずです。