[Xymon] [External] Xymon WinPSclient uptime bug

Beck, Zak zak.beck at accenture.com
Mon Feb 4 11:01:50 CET 2019


Hi Seb

Uptime is calculated between these two log lines:

XymonCollectInfo: Date processing (uses WMI data)
XymonCollectInfo: Adding CPU usage etc to main process data

Uptime message is sent in the main data packet, not any of the extra ones like procruntime / dirtime etc.  That packet is sent after the “Sending to Server” log message.

As far as I know the server only uses the content of the [uptime] section to generate the alert.

the uptime message (which has a timestamp of 16:26:38)

Are you referring to the Bootup: line? If so, that comes directly from WMI, you can test it in a Powershell prompt:

(Get-WmiObject -Class Win32_OperatingSystem).LastBootUpTime

…and if that is not working correctly then it’s more of a WMI/Windows problem.

Zak

From: SebA <spah at syntec.co.uk>
Sent: Friday, 1 February 2019 17:06
To: Beck, Zak <zak.beck at accenture.com>
Cc: Xymon Mailing List <xymon at xymon.com>
Subject: Re: [External] [Xymon] Xymon WinPSclient uptime bug

Hi Zak,

I can reproduce this in v.2.28 and the latest v2.34 on this server, and judging by the time on the Xymon server the uptime message (which has a timestamp of 16:26:38) is sent during the following message:

2019-02-01 16:26:38  Sending output for procruntime
2019-02-01 16:26:38  Using ASCII encoding
2019-02-01 16:26:38  Connecting to host x.x.x.x
2019-02-01 16:26:39  Sent 96 bytes to server
2019-02-01 16:26:39  Received 0 bytes from server

The uptime in c:\xymon-lastcollect.txt is correct when I follow the procedure you described, but I think that may be calculated later:

2019-02-01 16:26:39  Sending to server
2019-02-01 16:26:39  Using ASCII encoding
2019-02-01 16:26:40  Connecting to host x.x.x.x
2019-02-01 16:26:40  Sent 912722 bytes to server
2019-02-01 16:26:40  Received 578 bytes from server

From the above xymon-lastcollect.txt:

[date]
Fri 01 Feb 16:26:39 2019

-------------

That log was from v.2.28.  I think tried with v2.34 and it had the same behaviour but the time on the Xymon server for the uptime report was 25 seconds before I manually ran the xymonclient.ps1 script.  However, there was no other way it could have been reported to the server and time of the servers are in sync.  So, I don't know how that happened unless it is using the time from a file that it is sending using externaldatalocation - except those files don't have seconds in the time.  They are sent earlier than the main report though.

Kind regards,

SebA


On Thu, 31 Jan 2019 at 09:42, Beck, Zak <zak.beck at accenture.com<mailto:zak.beck at accenture.com>> wrote:
Hi Seb

I can’t replicate this one.

What do you have in analysis.cfg for UP?


UP bootlimit toolonglimit [color]

The cpu status goes yellow/red if the system has been up for less than "bootlimit" time, or longer than "toolonglimit". The time is in minutes, or you can add h/d/w for hours/days/weeks - eg. "2h" for two hours, or "4w" for 4 weeks.

Defaults: bootlimit=1h, toolonglimit=-1 (infinite), color=yellow.

Secondly, on a server where this happens, can you open an administrator powershell prompt and try this:

Stop-Service xymonpsclient
cd "c:\program files\xymon"
.\xymonclient.ps1

And press ctrl-c when you see this line:

2019-01-31 09:24:19  Delaying until next run: 30 seconds

Then open c:\xymon-lastcollect.txt and tell me what you get under [uptime] – here’s an example:

[uptime]
sec: 408029
4 days 17 hours 20 minutes 29 seconds
Bootup: 20190126160344.494100+000


You can then go back to powershell and

Start-Service xymonpsclient

Paths above subject to where you have installed the client.

Thanks

Zak

From: Xymon <xymon-bounces at xymon.com<mailto:xymon-bounces at xymon.com>> On Behalf Of SebA
Sent: Wednesday, 30 January 2019 18:19
To: Xymon Mailing List <xymon at xymon.com<mailto:xymon at xymon.com>>
Subject: [External] [Xymon] Xymon WinPSclient uptime bug

I've noticed a minor bug in the Xymon WinPSclient uptime report - after stopping and starting the service it says "

Machine recently rebooted
" in the uptime column on the Xymon server display.  I don't mind it going yellow - arguably a warning might be in order here, but if so, it should say 'Xymon client recently started'.  Once the client has been running for a bit, it reports the correct uptime.

Kind regards,

SebA

________________________________

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. Your privacy is important to us. Accenture uses your personal data only in compliance with data protection laws. For further information on how Accenture processes your personal data, please see our privacy statement at https://www.accenture.com/us-en/privacy-policy.
______________________________________________________________________________________

www.accenture.com<http://www.accenture.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20190204/67090653/attachment.html>


More information about the Xymon mailing list