At last, after years of waiting, there is finally a KB article on repairing the MSMQ Performance Counters:
936493 Performance objects or bridge channel data may not appear as expected in Message Queuing
There are already a number of KB articles that discuss fixing counter problems but they are usually service-specific. Not having one dedicated to MSMQ may have put people off trying the steps which is a shame as all the techniques can be applied to any broken counter.
There are basically two scenarios where you don't see the counters you expect:
The first is easy enough - MSMQ only generates performance data for active queues. That is, those queues that contain at least one message or are held open by a currently running application. There is no point creating memory structures for queues that exist but are never used.
The second has three causes:
First place to check for problems is the event log where you can expect to see the following event if the counters are broken:
Event Type: ErrorEvent Source: PerflibEvent Category: NoneEvent ID: 1008Date: 1/14/2007Time: 1:06:01 PMUser: N/AComputer: MSMQSERVERDescription:The Open Procedure for service "MSMQ" in DLL "C:\WINNT\system32\MQPERF.DLL" failed. Performance data for this service will not be available. Status code returned is data DWORD 0. Data:0000: 00000002
You can find documentation for this event here: 226494 Events for Performance Monitor extensions
Then you need to follow the methods in the KB.
"Method 1" discusses checking the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSMQ\Performance registry key for the required values. The values are very important as they position the MSMQ counters in the long list of counters and help texts that PerfLib maintains - if the number sequence is broken or invalid then counters stop working.
"Method 2" talks about using the LODCTR and UNLODCTR command-line utilities to reload the broken counters. There is more documentation here for this approach: 226512 HOW TO: Reinstall IIS 4.0 Performance Monitor Counters.
"Method 3" sort of combines the 2 above. Give this KB article a read: 300956 How to manually rebuild performance counter library values
There is another utility which the article doesn't cover - the Extensible Performance Counter List tool which comes with the Windows 2000 Resource Kit and can be downloaded from here. This can be used to disable and re-enable counters (which may help).
Reference Material
152513 Troubleshooting Performance Monitor Counter Problems179456 Extensible Counters in Performance Monitor226494 Events for Performance Monitor extensions 226512 HOW TO: Reinstall IIS 4.0 Performance Monitor Counters248993 PRB: Performance Object Is Not Displayed in Performance Monitor249138 Controlling the disabling of Performance Monitor extensions300956 How to manually rebuild performance counter library values