We are trying to monitor the RemoteQueueLength in WMI for IIS6 SMTP on Windows Server 2012R2. PRTG returns the following from running a batch file calling the 64bit version of Powershell. We did try just running it under the native 32bit Powershell that PRTG utilizes still.
C:\Windows\system32>C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -file "C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\checkSMTPQueue.ps1" Get-WmiObject : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESS DENIED)) At C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\checkSMTPQ ueue.ps1:3 char:28 + $SMTPObject = Get-WmiObject <<<< -Query "SELECT RemoteQueueLength,MessageSen dRetries,NDRsGenerated,OutboundConnectionsRefused,OutboundConnectionsTotal,Remo teRetryQueueLength,TotalMessagesSubmitted from Win32_PerfRawData_SMTPSVC_SMTPSe rver Where Name='_Total'" -ComputerName server01a + CategoryInfo : NotSpecified: (:) [Get-WmiObject], UnauthorizedA ccessException + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.Pow erShell.Commands.GetWmiObjectCommand <prtg> <result><channel>RemoteQueueLength</channel><value></value></result> </prtg>
From the 64bit powershell command line, it works:
PS> Get-WmiObject -Query "SELECT RemoteQueueLength from Win32_PerfRawData_SMTPSVC_SMTPSe rver Where Name ='_Total'" -ComputerName server01a __GENUS : 2 __CLASS : Win32_PerfRawData_SMTPSVC_SMTPServer __SUPERCLASS : __DYNASTY : __RELPATH : __PROPERTY_COUNT : 1 __DERIVATION : {} __SERVER : __NAMESPACE : __PATH : RemoteQueueLength : 0
From the 32bit powershell command line, it fails:
PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> Get-WmiObject -Query "SELECT RemoteQueueLength from Win32_PerfRawData_SMTPSVC_SMTPServer Where Name ='_Total'" -ComputerName server01 Get-WmiObject : Invalid class At line:1 char:14 + Get-WmiObject <<<< -Query "SELECT RemoteQueueLength from Win32_PerfRawData_SMTPSVC_SMTPServer Where Name ='_Total'" -ComputerName v-smtp-02a + CategoryInfo : InvalidOperation: (:) [Get-WmiObject], ManagementException + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
Any thoughts on how to get PRTG to monitor queue info? Have we simply over thought it and there is a simpler solution?
Article Comments
Good morning,
We were already using WQL on the 2003 version of these servers running IIS 6.0 SMTP. The WQL scripts are essentially the same line suggested above.
I think the issue seems to stem from Perfmon not providing counters when run in 32bit mode. Starting PerfMon, mmc really, in 32bit mode does not show the SMTP counters. 64bit mode does.
Any suggestions?
-Scott
Jul, 2014 - Permalink
I'm afraid no, we do not have suggestions for it. Did you consult with Microsoft already? It's their performance counter(s) and their PerfMon.
Jul, 2014 - Permalink
Wasn't quite expecting that kind of response. We are aware that it is Microsoft performance counters, but it is your monitoring product we pay to monitor our service. I wasn't looking for an immediate fix, perhaps you can tell me when your product will be able to monitor Microsoft's 64bit counters?
-Scott
Jul, 2014 - Permalink
That not even the "normal" Pefmon can access the counters, is a sign that the issue is more on the counter side, than on the side accessing it. For PRTG currently there are no plans for a 64bit Probe in the near future. Sorry.
Jul, 2014 - Permalink
I just ran into this myself. Attempting to monitor the IIS 6.0 SMTP service in Windows 2012 R2 core. 64-bit queries work, but there is no class registered for 32-bit. I realize that Paessler has no plans to release a 64 bit version, but this significantly diminishes the usefulness of this particular sensor since most systems will be running 64bit these days. I have run into the 64/32 bit issue with other sensors as well and it seems like Paessler would want to provide some sort of advice or solution since this will affect an increasing number of devices and users.
Jun, 2016 - Permalink
Hello,
did you consider using the WMI Custom Sensor? Just supply the WQL Query
into an according wql-file, and then use this sensor?
best regards.
Jul, 2014 - Permalink