[Xymon] Windows PS client svcs data missing

Storer, Raymond storerr at nibco.com
Fri May 13 17:39:48 CEST 2011


Scot and David, if you’d prefer to implement a .net pure call for services you can try the following:

# your path to the file may very
[ReflectionAssembly]::LoadFile(‘C:\WINDOWS\Microsoft.Net\Framework\v2.0.50727\System.ServiceProcess.dll’)
#get all the services installed on the local machine
$serviceController = [System.ServiceProcess.ServiceController]::GetServices()
foreach ($svc in $serviceController) {
                # should indicate: Stopped, Running, or Paused … others???
                write-host $svc.Status
                # the service name
                write-host $svc.Name
                # the service display name
                write-host $svc.DisplayName
}

Ray

From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On Behalf Of David Baldwin
Sent: Wednesday, May 11, 2011 7:41 PM
To: Scot Kreienkamp
Cc: xymon at xymon.com
Subject: Re: [Xymon] Windows PS client svcs data missing

Scot,
David,

I was able to catch a system this afternoon that wasn't reporting services.  I get this back when running the get-wmiobject command:

PS C:\> Get-WmiObject -Class Win32_Service
Get-WmiObject :
At line:1 char:14
+ Get-WmiObject <<<<  -Class Win32_Service
    + CategoryInfo          : InvalidOperation: (:) [Get-WmiObject], COMException
    + FullyQualifiedErrorId : GetWMICOMException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

Looks like it's a problem with your system.

One other thing… I noticed that whenever the PS client runs it takes the CPU up to 100% for 5-15 seconds or so on many of the systems it's installed on.  I'm already getting push back from other systems admins because of that.  I imagine many people will be complaining about it sooner or later, that's kind of a bad thing.  ☺

Off to Google that…

I don't have a lot of experience with WMI, but it seems like it can be a pretty heavyweight way to get fairly trivial information. There may be some tuning or checks that can be done to make sure it's running as best it can, but a google search or others be able to give better advice than I.

It would also pay to watch the memory footprint of the client long-term. I've tried to do as much preemptive garbage collection as I can, but I'm not convinced there aren't leaks, especially interfacing with COM objects, which given the error above makes WMI a big candidate. I wouldn't be surprised if some of the WMI data could be gained by alternative means such as poking about in the registry, but I don't have time to investigate at present.

David.

Scot Kreienkamp
Senior Systems Engineer
skreien at la-z-boy.com<mailto:skreien at la-z-boy.com>

From: David Baldwin [mailto:david.baldwin at ausport.gov.au]
Sent: Monday, May 09, 2011 9:31 PM
To: Scot Kreienkamp; xymon at xymon.com<mailto:xymon at xymon.com>
Subject: Re: [Xymon] Windows PS client svcs data missing

On 10/05/11 2:09 AM, Scot Kreienkamp wrote:
Hi everyone,

I've run into a problem with the Windows Powershell client intermittently omitting service data on Win2008.  Here's the relevant parts of the client data file:

Microsoft Windows Server 2008 R2 Standard   (build 7600)
---snip---
Persistent Routes:
  None
[ifstat]
fe80::619f:8c8:bf22:6ca5%11 2254617444 2999570366
10.100.1.211 2254617444 2999570366
::1 0 0
127.0.0.1 0 0
[svcs]
Name                                    StartupType  Status         DisplayName
[uptime]
sec: 8168297
94 days 12 hours 58 minutes 17 seconds
Bootup: 20110203213923.713291-360
[who]
SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE
---snip---

As you can see, the svcs portion is empty.  I already updated the client to the latest PS client files available and it still is happening. I'm not a programmer so I'm not sure how I can help troubleshoot this, but I'm willing to help in any way I can.
services information is gathered from WMI. The builtin powershell "get-services" doesn't return sufficient information.

Try the following:

open a powershell window (powershell.exe lives in C:\WINDOWS\system32\windowspowershell\v1.0)

Get-WmiObject -Class Win32_Service

Try running it a few times. Is it slow, or does it sometimes not return any information?

Also, if you look at the Client data report (link at the bottom of various pages - cpu, disk, procs, svcs), do you see sections for [WMI:Win32...] towards the bottom of the report. There should be:

WMI:Win32_OperatingSystem

WMI:Win32_ComputerSystem

WMI:Win32_BIOS

WMI:Win32_Processor

WMI:Win32_PhysicalMemory

WMI:Win32_LogicalDisk

WMI:Win32_QuickFixEngineering

WMI:Win32_Product


If these are missing there may be a problem with the WMI service. Try restarting it in the first instance.

David.



Thanks!

Scot Kreienkamp
skreien at la-z-boy.com<mailto:skreien at la-z-boy.com>




This message is intended only for the individual or entity to which it is addressed.  It may contain privileged, confidential information which is exempt from disclosure under applicable laws.  If you are not the intended recipient, please note that you are strictly prohibited from disseminating or distributing this information (other than to the intended recipient) or copying this information.  If you have received this communication in error, please notify us immediately by e-mail or by telephone at the above number. Thank you.





--

David Baldwin - IT Unit

Australian Sports Commission          www.ausport.gov.au<http://www.ausport.gov.au>

Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616

david.baldwin at ausport.gov.au<mailto:david.baldwin at ausport.gov.au>          Leverrier Street Bruce ACT 2617

________________________________
Keep up to date with what's happening in Australian sport visit www.ausport.gov.au<http://www.ausport.gov.au>

This message is intended for the addressee named and may contain confidential and privileged information. If you are not the intended recipient please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you receive this message in error, please delete it and notify the sender.
________________________________



This message is intended only for the individual or entity to which it is addressed.  It may contain privileged, confidential information which is exempt from disclosure under applicable laws.  If you are not the intended recipient, please note that you are strictly prohibited from disseminating or distributing this information (other than to the intended recipient) or copying this information.  If you have received this communication in error, please notify us immediately by e-mail or by telephone at the above number. Thank you.




--

David Baldwin - IT Unit

Australian Sports Commission          www.ausport.gov.au<http://www.ausport.gov.au>

Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616

david.baldwin at ausport.gov.au<mailto:david.baldwin at ausport.gov.au>          Leverrier Street Bruce ACT 2617

________________________________
CONFIDENTIALITY NOTICE: This email and any attachments are for the
exclusive and confidential use of the intended recipient. If you are not
the intended recipient, please do not read, distribute or take action in
reliance upon this message. If you have received this in error, please
notify us immediately by return email and promptly delete this message
and its attachments from your computer system. We do not waive
attorney-client or work product privilege by the transmission of this
message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20110513/c1abfedc/attachment.html>


More information about the Xymon mailing list