[Xymon] Xymon Powershell Windows client

Gavin Stone-Tolcher g.stone-tolcher at its.uq.edu.au
Wed Feb 18 04:54:16 CET 2015


> I am wondering if the "disk" code in the powershell client might need some tweaks to collect MountPoint info?

For reference to client data chunks for the different clients are:

Powershell v1.97:

[disk]
Filesystem      1K-blocks      Used     Avail  Capacity    Mounted Summary(Total\Avail GB)
C               104753148  42705800  62047348       41%   /FIXED/C 99.90\59.17

Bbwin v0.13

[disk]
Filesystem       1K-blocks     Used       Avail    Capacity   Total Size   Free Space   Type    Mount Point
C                104753148   42706904   62046244    40%         99.90 GB     59.17 GB   FIXED   N/A
MountPointTest   104753148   42706904   62046244    40%         99.90 GB     59.17 GB   FIXED   C:\MountPointTest\


Cheers,
Gavin Stone-Tolcher, IT Support Officer, Network Operations and Incident Response
Information Technology Services
The University of Queensland
Level 4, Prentice Building, St Lucia 4072
T: +61 7 334 66645, M: +61 401 140 838
E: g.stone-tolcher at its.uq.edu.au<mailto:g.stone-tolcher at its.uq.edu.au> W: www.its.uq.edu.au<http://www.its.uq.edu.au>

ITS: Service. Team. Accountability. Results.

IMPORTANT: This email and any attachments are intended solely for the addressee(s), contain copyright material and are confidential. We do not waive any legal privilege or rights in respect of copyright or confidentiality. Except as intended addressees are otherwise permitted, you do not have permission to use, disclose, reproduce or communicate any part of this email or its attachments. Statements, opinions and information not related to the official business of The University of Queensland are neither given nor endorsed by us. By using this email (including accessing any attachments or links) you agree we are not liable for any loss or damage of any kind arising in connection with any electronic defect, virus or other malicious code we did not intentionally include.

Please consider the environment before printing this email.

CRICOS Code 00025B

From: Xymon [mailto:xymon-bounces at xymon.com] On Behalf Of Gavin Stone-Tolcher
Sent: Wednesday, 18 February 2015 11:19 AM
To: 'zak.beck at accenture.com'; xymon-developer at lists.sourceforge.net; xymon at xymon.com
Subject: Re: [Xymon] Xymon Powershell Windows client

Many many thanks for the quick fix for multiple servers. V1.97 is working OK now for me in this respect!

I still am not seeing a windows MountPoint on my test Win 7 32bit client in the "disk" output with v1.97 and "wanteddisks" set to "3 4".

Quickly looking at the client's code, it appears that "Get-WmiObject -Class Win32_LogicalDisk" is used to collect disk info?
Several google clicks later, various sites seem to suggest windows MountPoint info is not really available using that class?
e.g.
http://learn-powershell.net/2012/08/10/locating-mount-points-using-powershell/

Another good site with code examples suggests using the "Win32_Volume" class to collect the info
http://blogs.lessthandot.com/index.php/sysadmins/os/windows/getting-remote-mount-point-information/

While yet another site seems to be using the "Win32_MountPoint" class in his code to get MountPoint info from what I can see:
http://www.powershelladmin.com/wiki/PowerShell_Get-MountPointData_Cmdlet#Showing_Used.2FFree_Space_On_Mount_Points

I tried looking at the C++ code of winbb client but I'm afraid I can't make much sense of it.

I am wondering if the "disk" code in the powershell client might need some tweaks to collect MountPoint info?


Cheers,
Gavin Stone-Tolcher, IT Support Officer, Network Operations and Incident Response
Information Technology Services
The University of Queensland
Level 4, Prentice Building, St Lucia 4072
T: +61 7 334 66645, M: +61 401 140 838
E: g.stone-tolcher at its.uq.edu.au<mailto:g.stone-tolcher at its.uq.edu.au> W: www.its.uq.edu.au<http://www.its.uq.edu.au>

ITS: Service. Team. Accountability. Results.

IMPORTANT: This email and any attachments are intended solely for the addressee(s), contain copyright material and are confidential. We do not waive any legal privilege or rights in respect of copyright or confidentiality. Except as intended addressees are otherwise permitted, you do not have permission to use, disclose, reproduce or communicate any part of this email or its attachments. Statements, opinions and information not related to the official business of The University of Queensland are neither given nor endorsed by us. By using this email (including accessing any attachments or links) you agree we are not liable for any loss or damage of any kind arising in connection with any electronic defect, virus or other malicious code we did not intentionally include.

Please consider the environment before printing this email.

CRICOS Code 00025B

From: zak.beck at accenture.com [mailto:zak.beck at accenture.com]
Sent: Tuesday, 17 February 2015 9:00 PM
To: Gavin Stone-Tolcher; xymon-developer at lists.sourceforge.net; xymon at xymon.com
Subject: RE: Xymon Powershell Windows client

Hi

Thanks for the bug report - I've committed a patch which should fix the multiple servers issue, please try it.

There should be a single <servers> element in your config, containing the list of servers, space delimited:

<servers>server1.domain.com server2.domain.com</servers>

Re: mountpoints, if you add this to your XML config, you will get mountpoints.

  <wanteddisks>3 4</wanteddisks>

By default, wanteddisks = 3 - possible settings below, and you can combine settings with spaces:

2=USB
3=Local disks
4=Network shares
5=CD

But you will need the latest patch with the config fix for this to work properly.

Regards,
Zak

From: Gavin Stone-Tolcher [mailto:g.stone-tolcher at its.uq.edu.au]
Sent: 17 February 2015 00:09
To: Beck, Zak; xymon-developer at lists.sourceforge.net; xymon at xymon.com
Subject: RE: Xymon Powershell Windows client

Just a quick FYI:

I was just trying a test install on a 32bit windows 7 client and got this:

Cannot set "servers" because only strings can be used as values to set XmlNode p
At C:\Program Files\xymon\xymonclient.ps1:644 char:26
+             $script:XymonSettings. <<<< servers = $script:XymonSettings.server
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyAssignmentException

I had multiple IP in the <servers> etry in the config.
Changing the <servers> entry in xymonclient_config.xml to have a single entry rather than multiple whitespace entries allows the client to install with no error.

After installation adding a second IP to <servers> entry also does not seem to work with it just reporting to the first entry?

Also just another quick one, I have a mountpoint defined on this system that does not seem to be collected. Are mountpoints supported?
I re-ran the bbwin client on the same system and the mountpoint is detected and displayed.


Cheers,
Gavin Stone-Tolcher, IT Support Officer, Network Operations and Incident Response
Information Technology Services
The University of Queensland
Level 4, Prentice Building, St Lucia 4072
T: +61 7 334 66645, M: +61 401 140 838
E: g.stone-tolcher at its.uq.edu.au<mailto:g.stone-tolcher at its.uq.edu.au> W: www.its.uq.edu.au<http://www.its.uq.edu.au>

ITS: Service. Team. Accountability. Results.

IMPORTANT: This email and any attachments are intended solely for the addressee(s), contain copyright material and are confidential. We do not waive any legal privilege or rights in respect of copyright or confidentiality. Except as intended addressees are otherwise permitted, you do not have permission to use, disclose, reproduce or communicate any part of this email or its attachments. Statements, opinions and information not related to the official business of The University of Queensland are neither given nor endorsed by us. By using this email (including accessing any attachments or links) you agree we are not liable for any loss or damage of any kind arising in connection with any electronic defect, virus or other malicious code we did not intentionally include.

Please consider the environment before printing this email.

CRICOS Code 00025B

From: Xymon [mailto:xymon-bounces at xymon.com] On Behalf Of zak.beck at accenture.com<mailto:zak.beck at accenture.com>
Sent: Friday, 13 February 2015 7:53 PM
To: xymon-developer at lists.sourceforge.net<mailto:xymon-developer at lists.sourceforge.net>; xymon at xymon.com<mailto:xymon at xymon.com>
Subject: [Xymon] Xymon Powershell Windows client

Hi all,

Today I have uploaded a new version of the Xymon Powershell client to SVN (in sandbox/WinPSClient). We (Accenture) are very pleased to be contributing these changes to the open source community. I've been working on this now for around 8 months on and off and hopefully the changes made will be of benefit to everyone!

Whilst making changes, we have focussed mainly on making it work, improving reliability and most importantly improving performance.

In most cases, on our 64 bit OS virtual machines, a data collection now takes around 5 seconds. On heavily loaded (CPU load or event log load) servers, the script is now considerably faster than originally. Key to this has been reducing the amount of WMI usage as this was a major culprit.

We have also implemented some new features, largely based on our in-house requirements but hopefully useful to others:

*         Showing the process owner and command line in [procs]. This has been implemented using c# code, compiled at runtime.
*         Adding Active Directory replication test, Terminal Services sessions test
*         Ability to restart any stopped Windows service
*         Client self-update
*         Dirsize and dirtime checks (which were originally external scripts)

Some things have changed slightly; for example, the local configuration which was registry-based is now XML-based (you can still use registry settings if you prefer).  In the SVN repository I have also uploaded a Word document which describes how to install and the configuration options.

I have uploaded all the revisions we have made to SVN so there is a history of development. Whilst we will endeavour to continue contributing changes and improvements in coming months, this is an open source project and as such we are not offering any formal support. If anyone wishes to bugfix, branch or whatever, please do so!
Zak Beck
Accenture
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20150218/a308c10a/attachment.html>


More information about the Xymon mailing list