[Xymon] Windows Xymon PS Client 1.98

Gavin Stone-Tolcher g.stone-tolcher at its.uq.edu.au
Wed Feb 25 01:30:23 CET 2015


> I've just committed version 1.98 to the project repository

Great work Zak! Good to see all this improvement so soon.

I see you are still using something like:

[uint32]$diskusedKB = ([uint32]($d.TotalBytes/1KB)) - ([uint32]($d.FreeBytes/1KB))    # PS ver 1 doesnt support subtraction uint64's
However, there was a report, see attached, about an integer overflow on large filesystems using this, seemingly fixed by removing the [uint32] casts on those lines.

As only PS 1 appears to have that issue, I handled this in my own local mod (reverted to 1.98 now), by simplistically checking the Powershell version before performing the calculation:

        if (($PSVersionTable.PSVersion.Major) -gt 1 ) {
          $diskusedKB = ($d.Capacity/1KB) - ($d.FreeSpace/1KB)
          $disksizeKB = ($d.Capacity/1KB)
        }
        else {
          [uint32]$diskusedKB = ([uint32]($d.Capacity/1KB)) - ([uint32]($d.FreeSpace/1KB))    # PS ver 1 doesnt support subtraction uint64's
          [uint32]$disksizeKB = [uint32]($d.Capacity/1KB)
        }

Maybe you could do something similar, or think of a better approach?


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
Sent: Tuesday, 24 February 2015 11:07 PM
To: xymon at xymon.com
Subject: [Xymon] Windows Xymon PS Client 1.98

Hi

I've just committed version 1.98 to the project repository - http://sourceforge.net/p/xymon/code/HEAD/tree/sandbox/WinPSClient/.

This update has a number of fixes and additions thanks to the suggestions and reaction to the previous patches, thanks to Gavin, Brandon and others for your feedback.

List of changes:


*         Mount points are now shown in the disk section, similar to BBWin. The drive label has been added and the column alignment adjusted to suit drives up to 999TB.

*         The eventlogswanted directive now supports wildcards in the list of event logs field. So you can now return all event logs like this:

eventlogswanted:*:250000


*         The eventlogswanted directive also supports an optional fourth field to specify which levels of event should be returned - critical, error, warning, information, verbose. By default, all are returned. Values in the field should be comma-delimited, e.g.:

eventlogswanted:*:250000:error,warning,critical


*         The dirsize directive now works for files as well as directories.

Thanks to everyone, I really appreciate your feedback.

Regards
Zak

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20150225/61cfe188/attachment.html>
-------------- next part --------------
An embedded message was scrubbed...
From: "Ribeiro, Glauber" <glauber.ribeiro at experian.com>
Subject: [Xymon] Bug Report - Powershell client - overflow with disk size for large disks
Date: Fri, 5 Sep 2014 16:30:37 +0000
Size: 6991
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20150225/61cfe188/attachment.mht>


More information about the Xymon mailing list