Xymon Mailing List Archive search

help with xymonpsclient

10 messages in this thread

list Chris Pretorius · Wed, 22 Apr 2020 11:01:06 +0000 ·
Good day

I have a windows server 2016 that I use winpsclient to collect the server matrix and send to xymon

Problem is the server has 24 cpu's allocated and on xymon it reports only 12 cores if you open the cpu page for the monitored host

Looks like this is the part in the xymonclient.ps1 script that collects the cpu count:

    WriteLog "XymonCollectInfo: CPU info (WMI)"
    $script:cpuinfo = @(Get-WmiObject -Class Win32_Processor)
    #$script:totalload = 0
    $script:numcpus  = $cpuinfo.Count
    $script:numcores = 0
    $script:numvcpus = 0
    foreach ($cpu in $cpuinfo) {
        #$script:totalload += $cpu.LoadPercentage
        $script:numcores += $cpu.NumberOfCores
        $script:numvcpus += $cpu.NumberOfLogicalProcessors
    }
    #$script:totalload /= $numcpus

    WriteLog "Found $($script:numcpus) CPUs, total of $($script:numcores) cores"

How do I modify the script to count the correct number of processors?

Kind regards

[cid:image001.png at 01D618A6.14853400]

Chris Pretorius
Senior Linux Administrator

[Lightstone]
user-3fef1df92e88@xymon.invalid<mailto:user-3fef1df92e88@xymon.invalid>
www.lightstone.co.za<https://www.lightstone.co.za/>;
0108228687
Centurion Square, 3rd Floor, cnr Heuwel and Gordon Hood rd, Centurion
[cid:image003.png at 01D618A6.14853400]<https://www.linkedin.com/company/lightstone-pty-ltd/>;  [cid:image004.png at 01D618A6.14853400] <https://twitter.com/lightstonetweet>;   [cid:image005.png at 01D618A6.14853400] <https://www.facebook.com/lightstone.sa>;
This communication is subject to Lightstone's email disclaimer<http://www.lightstone.co.za/portal/content/email-disclaimer.aspx>;
Attachments (1)
list Timothy Williams · Wed, 22 Apr 2020 10:54:07 -0400 ·
Chris,

You are using an outdated script. I could not find the WMI process in any
recent versions. I did go back and find it in a 2.19
Version 2.42 now contains:

WriteLog "XymonCollectInfo: CPU info"
    $script:cpuinfo = [ProcessorInformation]::GetSystemInfo()
    $script:numcores  = $cpuinfo.NumberOfProcessors
    WriteLog "Found $($script:numcores) cores"

Latest version properly shows all 24 cores on my Dell R540.

*Timothy L. Williams*

*Operating Systems Analyst*

Virginia Commonwealth University Computer Center


On Wed, Apr 22, 2020 at 10:20 AM Chris Pretorius <
quoted from Chris Pretorius
user-832aac18b2a8@xymon.invalid> wrote:
Good day


I have a windows server 2016 that I use winpsclient to collect the server
matrix and send to xymon


Problem is the server has 24 cpu?s allocated and on xymon it reports only
12 cores if you open the cpu page for the monitored host


Looks like this is the part in the xymonclient.ps1 script that collects
the cpu count:


    WriteLog "XymonCollectInfo: CPU info (WMI)"

    $script:cpuinfo = @(Get-WmiObject -Class Win32_Processor)

    #$script:totalload = 0

    $script:numcpus  = $cpuinfo.Count

    $script:numcores = 0

    $script:numvcpus = 0

    foreach ($cpu in $cpuinfo) {

        #$script:totalload += $cpu.LoadPercentage

        $script:numcores += $cpu.NumberOfCores

        $script:numvcpus += $cpu.NumberOfLogicalProcessors

    }

    #$script:totalload /= $numcpus


    WriteLog "Found $($script:numcpus) CPUs, total of $($script:numcores)
cores"


How do I modify the script to count the correct number of processors?


Kind regards


*Chris Pretorius *Senior Linux Administrator

[image: Lightstone]

user-3fef1df92e88@xymon.invalid

www.lightstone.co.za
quoted from Chris Pretorius

0108228687

Centurion Square, 3rd Floor, cnr Heuwel and Gordon Hood rd, Centurion

<https://www.linkedin.com/company/lightstone-pty-ltd/>;
<https://twitter.com/lightstonetweet>;
<https://www.facebook.com/lightstone.sa>;

This communication is subject to Lightstone's email disclaimer
<http://www.lightstone.co.za/portal/content/email-disclaimer.aspx>;

list Chris Pretorius · Wed, 22 Apr 2020 16:15:31 +0000 ·
Hi Timothy

The installation of the latest xymonclient.ps1 failed with the errors below.

The server is Window2016 server

IE version 11

Had to set the execution policy to Bypass, Setting it to remoteexecution failed


PS C:\Program Files\xymon> .\xymonclient.ps1 install
At C:\Program Files\xymon\xymonclient.ps1:28 char:19
+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
+                   ~
Missing file specification after redirection operator.
At C:\Program Files\xymon\xymonclient.ps1:28 char:20
+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
+                    ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:28 char:55
+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
+                                                       ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:29 char:16
+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
+                ~
Missing file specification after redirection operator.
At C:\Program Files\xymon\xymonclient.ps1:29 char:20
+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
+                    ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:29 char:55
+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
+                                                       ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:30 char:16
+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
+                ~
Missing file specification after redirection operator.
At C:\Program Files\xymon\xymonclient.ps1:30 char:20
+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
+                    ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:30 char:55
+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
+                                                       ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:31 char:16
+ <!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
+                ~
Missing file specification after redirection operator.
Not all parse errors were reported.  Correct the reported errors and try again.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : MissingFileSpecification

Kind regards
quoted from Timothy Williams

From: Timothy Williams <user-1a5482fb085e@xymon.invalid>
Sent: Wednesday, 22 April 2020 16:54
To: Chris Pretorius <user-832aac18b2a8@xymon.invalid>
Cc: xymon at xymon.com
Subject: Re: [Xymon] help with xymonpsclient

Chris,

You are using an outdated script. I could not find the WMI process in any recent versions. I did go back and find it in a 2.19
Version 2.42 now contains:

WriteLog "XymonCollectInfo: CPU info"
    $script:cpuinfo = [ProcessorInformation]::GetSystemInfo()
    $script:numcores  = $cpuinfo.NumberOfProcessors
    WriteLog "Found $($script:numcores) cores"

Latest version properly shows all 24 cores on my Dell R540.

Timothy L. Williams

Operating Systems Analyst

Virginia Commonwealth University Computer Center


On Wed, Apr 22, 2020 at 10:20 AM Chris Pretorius <user-832aac18b2a8@xymon.invalid<mailto:user-832aac18b2a8@xymon.invalid>> wrote:
Good day

I have a windows server 2016 that I use winpsclient to collect the server matrix and send to xymon

Problem is the server has 24 cpu?s allocated and on xymon it reports only 12 cores if you open the cpu page for the monitored host

Looks like this is the part in the xymonclient.ps1 script that collects the cpu count:

    WriteLog "XymonCollectInfo: CPU info (WMI)"
    $script:cpuinfo = @(Get-WmiObject -Class Win32_Processor)
    #$script:totalload = 0
    $script:numcpus  = $cpuinfo.Count
    $script:numcores = 0
    $script:numvcpus = 0
    foreach ($cpu in $cpuinfo) {
        #$script:totalload += $cpu.LoadPercentage
        $script:numcores += $cpu.NumberOfCores
        $script:numvcpus += $cpu.NumberOfLogicalProcessors
    }
    #$script:totalload /= $numcpus

    WriteLog "Found $($script:numcpus) CPUs, total of $($script:numcores) cores"

How do I modify the script to count the correct number of processors?

Kind regards

[cid:image001.png at 01D618D0.C6E13340]
quoted from Chris Pretorius

Chris Pretorius
Senior Linux Administrator

[Lightstone]
user-3fef1df92e88@xymon.invalid<mailto:user-3fef1df92e88@xymon.invalid>
www.lightstone.co.za<https://www.lightstone.co.za/>;
0108228687
Centurion Square, 3rd Floor, cnr Heuwel and Gordon Hood rd, Centurion

[cid:image003.png at 01D618D0.C6E13340]<https://www.linkedin.com/company/lightstone-pty-ltd/>;  [cid:image004.png at 01D618D0.C6E13340] <https://twitter.com/lightstonetweet>;   [cid:image005.png at 01D618D0.C6E13340] <https://www.facebook.com/lightstone.sa>;
This communication is subject to Lightstone's email disclaimer<http://www.lightstone.co.za/portal/content/email-disclaimer.aspx>;
list Chris Pretorius · Wed, 22 Apr 2020 18:11:38 +0000 ·
Hi Timothy

Please ignore my previous post

I managed to get past the error and the client installed successfully.

When I run the start command I get the following error:

PS C:\Program Files\xymon> .\xymonclient.ps1 install
Service "XymonPSClient" installed successfully!
PS C:\Program Files\xymon> .\xymonclient.ps1 start
start-service : Failed to start service 'XymonPSClient (XymonPSClient)'.
At C:\Program Files\xymon\xymonclient.ps1:4139 char:60
+ ...  $xymonsvcname).Status -ne "Running") { start-service $xymonsvcname }
+                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service],
   ServiceCommandException
    + FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand

Kind regards
quoted from Chris Pretorius

From: Chris Pretorius
Sent: Wednesday, 22 April 2020 18:16
To: Timothy Williams <user-1a5482fb085e@xymon.invalid>
Cc: xymon at xymon.com
Subject: RE: [Xymon] help with xymonpsclient

Hi Timothy

The installation of the latest xymonclient.ps1 failed with the errors below.

The server is Window2016 server

IE version 11

Had to set the execution policy to Bypass, Setting it to remoteexecution failed


PS C:\Program Files\xymon> .\xymonclient.ps1 install
At C:\Program Files\xymon\xymonclient.ps1:28 char:19
+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
+                   ~
Missing file specification after redirection operator.
At C:\Program Files\xymon\xymonclient.ps1:28 char:20
+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
+                    ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:28 char:55
+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
+                                                       ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:29 char:16
+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
+                ~
Missing file specification after redirection operator.
At C:\Program Files\xymon\xymonclient.ps1:29 char:20
+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
+                    ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:29 char:55
+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
+                                                       ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:30 char:16
+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
+                ~
Missing file specification after redirection operator.
At C:\Program Files\xymon\xymonclient.ps1:30 char:20
+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
+                    ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:30 char:55
+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
+                                                       ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:31 char:16
+ <!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
+                ~
Missing file specification after redirection operator.
Not all parse errors were reported.  Correct the reported errors and try again.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : MissingFileSpecification

Kind regards

From: Timothy Williams <user-1a5482fb085e@xymon.invalid<mailto:user-1a5482fb085e@xymon.invalid>>
Sent: Wednesday, 22 April 2020 16:54
To: Chris Pretorius <user-832aac18b2a8@xymon.invalid<mailto:user-832aac18b2a8@xymon.invalid>>
Cc: xymon at xymon.com<mailto:xymon at xymon.com>
Subject: Re: [Xymon] help with xymonpsclient

Chris,

You are using an outdated script. I could not find the WMI process in any recent versions. I did go back and find it in a 2.19
Version 2.42 now contains:

WriteLog "XymonCollectInfo: CPU info"
    $script:cpuinfo = [ProcessorInformation]::GetSystemInfo()
    $script:numcores  = $cpuinfo.NumberOfProcessors
    WriteLog "Found $($script:numcores) cores"

Latest version properly shows all 24 cores on my Dell R540.

Timothy L. Williams

Operating Systems Analyst

Virginia Commonwealth University Computer Center


On Wed, Apr 22, 2020 at 10:20 AM Chris Pretorius <user-832aac18b2a8@xymon.invalid<mailto:user-832aac18b2a8@xymon.invalid>> wrote:
Good day

I have a windows server 2016 that I use winpsclient to collect the server matrix and send to xymon

Problem is the server has 24 cpu?s allocated and on xymon it reports only 12 cores if you open the cpu page for the monitored host

Looks like this is the part in the xymonclient.ps1 script that collects the cpu count:

    WriteLog "XymonCollectInfo: CPU info (WMI)"
    $script:cpuinfo = @(Get-WmiObject -Class Win32_Processor)
    #$script:totalload = 0
    $script:numcpus  = $cpuinfo.Count
    $script:numcores = 0
    $script:numvcpus = 0
    foreach ($cpu in $cpuinfo) {
        #$script:totalload += $cpu.LoadPercentage
        $script:numcores += $cpu.NumberOfCores
        $script:numvcpus += $cpu.NumberOfLogicalProcessors
    }
    #$script:totalload /= $numcpus

    WriteLog "Found $($script:numcpus) CPUs, total of $($script:numcores) cores"

How do I modify the script to count the correct number of processors?

Kind regards

[cid:image001.png at 01D618E1.B74D4110]
quoted from Chris Pretorius

Chris Pretorius
Senior Linux Administrator

[Lightstone]
user-3fef1df92e88@xymon.invalid<mailto:user-3fef1df92e88@xymon.invalid>
www.lightstone.co.za<https://www.lightstone.co.za/>;
0108228687
Centurion Square, 3rd Floor, cnr Heuwel and Gordon Hood rd, Centurion

[cid:image003.png at 01D618E1.B74D4110]<https://www.linkedin.com/company/lightstone-pty-ltd/>;  [cid:image004.png at 01D618E1.B74D4110] <https://twitter.com/lightstonetweet>;   [cid:image005.png at 01D618E1.B74D4110] <https://www.facebook.com/lightstone.sa>;
This communication is subject to Lightstone's email disclaimer<http://www.lightstone.co.za/portal/content/email-disclaimer.aspx>;
list Timothy Williams · Wed, 22 Apr 2020 14:23:37 -0400 ·
Is that the same location as the older client was? Myself I use a C:\Utils
folder to avoid permission issues in Program files. Xymon XML config files
tell it where to create logs, etc. Make sure service has permission to
create files there.

here is an excerpt of my xymonclient_config.xml:

<XymonSettings>
  <servers>xymon.xxxx.xxx</servers>
  <clientlogfile>c:\Logs\xymonclient.log</clientlogfile>
  <clientconfigfile>c:\Utils\clientconfig.cfg</clientconfigfile>
  <clientlogretain>3</clientlogretain>
  <clientfqdn>0</clientfqdn>
  <clientlower>0</clientlower>
  <clientremotecfgexec>1</clientremotecfgexec>
</XymonSettings>

*Timothy L. Williams*


On Wed, Apr 22, 2020 at 2:11 PM Chris Pretorius <user-832aac18b2a8@xymon.invalid>
quoted from Chris Pretorius
wrote:
Hi Timothy


Please ignore my previous post


I managed to get past the error and the client installed successfully.


When I run the start command I get the following error:


PS C:\Program Files\xymon> .\xymonclient.ps1 install

Service "XymonPSClient" installed successfully!

PS C:\Program Files\xymon> .\xymonclient.ps1 start

start-service : Failed to start service 'XymonPSClient (XymonPSClient)'.

At C:\Program Files\xymon\xymonclient.ps1:4139 char:60

+ ...  $xymonsvcname).Status -ne "Running") { start-service $xymonsvcname }

+                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : OpenError:
(System.ServiceProcess.ServiceController:ServiceController) [Start-Service],

   ServiceCommandException

    + FullyQualifiedErrorId :
StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand


Kind regards


*From:* Chris Pretorius
*Sent:* Wednesday, 22 April 2020 18:16
*To:* Timothy Williams <user-1a5482fb085e@xymon.invalid>
*Cc:* xymon at xymon.com
*Subject:* RE: [Xymon] help with xymonpsclient


Hi Timothy


The installation of the latest xymonclient.ps1 failed with the errors
below.


The server is Window2016 server


IE version 11


Had to set the execution policy to Bypass, Setting it to remoteexecution
failed


PS C:\Program Files\xymon> .\xymonclient.ps1 install

At C:\Program Files\xymon\xymonclient.ps1:28 char:19

+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->

+                   ~

Missing file specification after redirection operator.

At C:\Program Files\xymon\xymonclient.ps1:28 char:20

+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->

+                    ~

The '<' operator is reserved for future use.

At C:\Program Files\xymon\xymonclient.ps1:28 char:55

+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->

+                                                       ~

The '<' operator is reserved for future use.

At C:\Program Files\xymon\xymonclient.ps1:29 char:16

+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->

+                ~

Missing file specification after redirection operator.

At C:\Program Files\xymon\xymonclient.ps1:29 char:20

+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->

+                    ~

The '<' operator is reserved for future use.

At C:\Program Files\xymon\xymonclient.ps1:29 char:55

+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->

+                                                       ~

The '<' operator is reserved for future use.

At C:\Program Files\xymon\xymonclient.ps1:30 char:16

+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->

+                ~

Missing file specification after redirection operator.

At C:\Program Files\xymon\xymonclient.ps1:30 char:20

+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->

+                    ~

The '<' operator is reserved for future use.

At C:\Program Files\xymon\xymonclient.ps1:30 char:55

+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->

+                                                       ~

The '<' operator is reserved for future use.

At C:\Program Files\xymon\xymonclient.ps1:31 char:16

+ <!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->

+                ~

Missing file specification after redirection operator.

Not all parse errors were reported.  Correct the reported errors and try
again.

    + CategoryInfo          : ParserError: (:) [], ParseException

    + FullyQualifiedErrorId : MissingFileSpecification


Kind regards


*From:* Timothy Williams <user-1a5482fb085e@xymon.invalid>
*Sent:* Wednesday, 22 April 2020 16:54
*To:* Chris Pretorius <user-832aac18b2a8@xymon.invalid>
*Cc:* xymon at xymon.com
*Subject:* Re: [Xymon] help with xymonpsclient


Chris,


You are using an outdated script. I could not find the WMI process in any
recent versions. I did go back and find it in a 2.19

Version 2.42 now contains:


WriteLog "XymonCollectInfo: CPU info"
    $script:cpuinfo = [ProcessorInformation]::GetSystemInfo()
    $script:numcores  = $cpuinfo.NumberOfProcessors
    WriteLog "Found $($script:numcores) cores"


Latest version properly shows all 24 cores on my Dell R540.

*Timothy L. Williams*

*Operating Systems Analyst*

Virginia Commonwealth University Computer Center


On Wed, Apr 22, 2020 at 10:20 AM Chris Pretorius <
user-832aac18b2a8@xymon.invalid> wrote:

Good day


I have a windows server 2016 that I use winpsclient to collect the server
matrix and send to xymon


Problem is the server has 24 cpu?s allocated and on xymon it reports only
12 cores if you open the cpu page for the monitored host


Looks like this is the part in the xymonclient.ps1 script that collects
the cpu count:


    WriteLog "XymonCollectInfo: CPU info (WMI)"

    $script:cpuinfo = @(Get-WmiObject -Class Win32_Processor)

    #$script:totalload = 0

    $script:numcpus  = $cpuinfo.Count

    $script:numcores = 0

    $script:numvcpus = 0

    foreach ($cpu in $cpuinfo) {

        #$script:totalload += $cpu.LoadPercentage

        $script:numcores += $cpu.NumberOfCores

        $script:numvcpus += $cpu.NumberOfLogicalProcessors

    }

    #$script:totalload /= $numcpus


    WriteLog "Found $($script:numcpus) CPUs, total of $($script:numcores)
cores"


How do I modify the script to count the correct number of processors?


Kind regards


*Chris Pretorius *Senior Linux Administrator

[image: Lightstone]

user-3fef1df92e88@xymon.invalid

www.lightstone.co.za

0108228687

Centurion Square, 3rd Floor, cnr Heuwel and Gordon Hood rd, Centurion

<https://www.linkedin.com/company/lightstone-pty-ltd/>;
<https://twitter.com/lightstonetweet>;
<https://www.facebook.com/lightstone.sa>;

This communication is subject to Lightstone's email disclaimer
<http://www.lightstone.co.za/portal/content/email-disclaimer.aspx>;

list Chris Pretorius · Thu, 23 Apr 2020 05:29:16 +0000 ·
Hi Timothy

Yes, the same location. I backed up the older files, deployed the new files and started the install process.

Are there any logs I can look at that can reveal why the service fails to start?
The client logs didn?t change during the install and start process.
quoted from Timothy Williams

Regards

From: Timothy Williams <user-1a5482fb085e@xymon.invalid>
Sent: Wednesday, 22 April 2020 20:24
To: Chris Pretorius <user-832aac18b2a8@xymon.invalid>
Cc: xymon at xymon.com
Subject: Re: [Xymon] help with xymonpsclient

Is that the same location as the older client was? Myself I use a C:\Utils folder to avoid permission issues in Program files. Xymon XML config files tell it where to create logs, etc. Make sure service has permission to create files there.

here is an excerpt of my xymonclient_config.xml:

<XymonSettings>
  <servers>xymon.xxxx.xxx</servers>
  <clientlogfile>c:\Logs\xymonclient.log</clientlogfile>
  <clientconfigfile>c:\Utils\clientconfig.cfg</clientconfigfile>
  <clientlogretain>3</clientlogretain>
  <clientfqdn>0</clientfqdn>
  <clientlower>0</clientlower>
  <clientremotecfgexec>1</clientremotecfgexec>
</XymonSettings>

Timothy L. Williams


On Wed, Apr 22, 2020 at 2:11 PM Chris Pretorius <user-832aac18b2a8@xymon.invalid<mailto:user-832aac18b2a8@xymon.invalid>> wrote:
Hi Timothy

Please ignore my previous post

I managed to get past the error and the client installed successfully.

When I run the start command I get the following error:

PS C:\Program Files\xymon> .\xymonclient.ps1 install
Service "XymonPSClient" installed successfully!
PS C:\Program Files\xymon> .\xymonclient.ps1 start
start-service : Failed to start service 'XymonPSClient (XymonPSClient)'.
At C:\Program Files\xymon\xymonclient.ps1:4139 char:60
+ ...  $xymonsvcname).Status -ne "Running") { start-service $xymonsvcname }
+                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service],
   ServiceCommandException
    + FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand

Kind regards

From: Chris Pretorius
Sent: Wednesday, 22 April 2020 18:16
To: Timothy Williams <user-1a5482fb085e@xymon.invalid<mailto:user-1a5482fb085e@xymon.invalid>>
Cc: xymon at xymon.com<mailto:xymon at xymon.com>
Subject: RE: [Xymon] help with xymonpsclient

Hi Timothy

The installation of the latest xymonclient.ps1 failed with the errors below.

The server is Window2016 server

IE version 11

Had to set the execution policy to Bypass, Setting it to remoteexecution failed


PS C:\Program Files\xymon> .\xymonclient.ps1 install
At C:\Program Files\xymon\xymonclient.ps1:28 char:19
+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
+                   ~
Missing file specification after redirection operator.
At C:\Program Files\xymon\xymonclient.ps1:28 char:20
+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
+                    ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:28 char:55
+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
+                                                       ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:29 char:16
+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
+                ~
Missing file specification after redirection operator.
At C:\Program Files\xymon\xymonclient.ps1:29 char:20
+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
+                    ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:29 char:55
+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
+                                                       ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:30 char:16
+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
+                ~
Missing file specification after redirection operator.
At C:\Program Files\xymon\xymonclient.ps1:30 char:20
+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
+                    ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:30 char:55
+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
+                                                       ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:31 char:16
+ <!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
+                ~
Missing file specification after redirection operator.
Not all parse errors were reported.  Correct the reported errors and try again.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : MissingFileSpecification

Kind regards

From: Timothy Williams <user-1a5482fb085e@xymon.invalid<mailto:user-1a5482fb085e@xymon.invalid>>
Sent: Wednesday, 22 April 2020 16:54
To: Chris Pretorius <user-832aac18b2a8@xymon.invalid<mailto:user-832aac18b2a8@xymon.invalid>>
Cc: xymon at xymon.com<mailto:xymon at xymon.com>
Subject: Re: [Xymon] help with xymonpsclient

Chris,

You are using an outdated script. I could not find the WMI process in any recent versions. I did go back and find it in a 2.19
Version 2.42 now contains:

WriteLog "XymonCollectInfo: CPU info"
    $script:cpuinfo = [ProcessorInformation]::GetSystemInfo()
    $script:numcores  = $cpuinfo.NumberOfProcessors
    WriteLog "Found $($script:numcores) cores"

Latest version properly shows all 24 cores on my Dell R540.

Timothy L. Williams

Operating Systems Analyst

Virginia Commonwealth University Computer Center


On Wed, Apr 22, 2020 at 10:20 AM Chris Pretorius <user-832aac18b2a8@xymon.invalid<mailto:user-832aac18b2a8@xymon.invalid>> wrote:
Good day

I have a windows server 2016 that I use winpsclient to collect the server matrix and send to xymon

Problem is the server has 24 cpu?s allocated and on xymon it reports only 12 cores if you open the cpu page for the monitored host

Looks like this is the part in the xymonclient.ps1 script that collects the cpu count:

    WriteLog "XymonCollectInfo: CPU info (WMI)"
    $script:cpuinfo = @(Get-WmiObject -Class Win32_Processor)
    #$script:totalload = 0
    $script:numcpus  = $cpuinfo.Count
    $script:numcores = 0
    $script:numvcpus = 0
    foreach ($cpu in $cpuinfo) {
        #$script:totalload += $cpu.LoadPercentage
        $script:numcores += $cpu.NumberOfCores
        $script:numvcpus += $cpu.NumberOfLogicalProcessors
    }
    #$script:totalload /= $numcpus

    WriteLog "Found $($script:numcpus) CPUs, total of $($script:numcores) cores"

How do I modify the script to count the correct number of processors?

Kind regards

[cid:image001.png at 01D61940.E46F0250]
quoted from Chris Pretorius

Chris Pretorius
Senior Linux Administrator

[Lightstone]
user-3fef1df92e88@xymon.invalid<mailto:user-3fef1df92e88@xymon.invalid>
www.lightstone.co.za<https://www.lightstone.co.za/>;
0108228687
Centurion Square, 3rd Floor, cnr Heuwel and Gordon Hood rd, Centurion

[cid:image003.png at 01D61940.E46F0250]<https://www.linkedin.com/company/lightstone-pty-ltd/>;  [cid:image004.png at 01D61940.E46F0250] <https://twitter.com/lightstonetweet>;   [cid:image005.png at 01D61940.E46F0250] <https://www.facebook.com/lightstone.sa>;
This communication is subject to Lightstone's email disclaimer<http://www.lightstone.co.za/portal/content/email-disclaimer.aspx>;
list Zak Beck · Thu, 23 Apr 2020 12:58:22 +0000 ·
Hi

You did copy nssm.exe to the same location as the client script?

You could try running it without the service ? this is often helpful with startup issues.

You need to start a powershell prompt with Administrator permissions ? you can usually do this by using Run (Win+R) and type in powershell.exe.

Then use cd to change directory to the location where you installed the client ? e.g.

cd "\program files\xymon"

and then to run the client:

.\xymonclient.ps1

You?ll a load of logging, if there are any exception messages in red you have a problem.

Cheers

Zak

From: Xymon <xymon-bounces at xymon.com> On Behalf Of Chris Pretorius
Sent: 23 April 2020 06:29
To: Timothy Williams <user-1a5482fb085e@xymon.invalid>
Cc: xymon at xymon.com
Subject: [External] Re: [Xymon] help with xymonpsclient

This message is from an EXTERNAL SENDER - be CAUTIOUS, particularly with links and attachments.
quoted from Chris Pretorius

Hi Timothy

Yes, the same location. I backed up the older files, deployed the new files and started the install process.

Are there any logs I can look at that can reveal why the service fails to start?
The client logs didn?t change during the install and start process.

Regards

From: Timothy Williams <user-1a5482fb085e@xymon.invalid<mailto:user-1a5482fb085e@xymon.invalid>>
Sent: Wednesday, 22 April 2020 20:24
To: Chris Pretorius <user-832aac18b2a8@xymon.invalid<mailto:user-832aac18b2a8@xymon.invalid>>
Cc: xymon at xymon.com<mailto:xymon at xymon.com>
Subject: Re: [Xymon] help with xymonpsclient

Is that the same location as the older client was? Myself I use a C:\Utils folder to avoid permission issues in Program files. Xymon XML config files tell it where to create logs, etc. Make sure service has permission to create files there.

here is an excerpt of my xymonclient_config.xml:

<XymonSettings>
  <servers>xymon.xxxx.xxx</servers>
  <clientlogfile>c:\Logs\xymonclient.log</clientlogfile>
  <clientconfigfile>c:\Utils\clientconfig.cfg</clientconfigfile>
  <clientlogretain>3</clientlogretain>
  <clientfqdn>0</clientfqdn>
  <clientlower>0</clientlower>
  <clientremotecfgexec>1</clientremotecfgexec>
</XymonSettings>

Timothy L. Williams


On Wed, Apr 22, 2020 at 2:11 PM Chris Pretorius <user-832aac18b2a8@xymon.invalid<mailto:user-832aac18b2a8@xymon.invalid>> wrote:
Hi Timothy

Please ignore my previous post

I managed to get past the error and the client installed successfully.

When I run the start command I get the following error:

PS C:\Program Files\xymon> .\xymonclient.ps1 install
Service "XymonPSClient" installed successfully!
PS C:\Program Files\xymon> .\xymonclient.ps1 start
start-service : Failed to start service 'XymonPSClient (XymonPSClient)'.
At C:\Program Files\xymon\xymonclient.ps1:4139 char:60
+ ...  $xymonsvcname).Status -ne "Running") { start-service $xymonsvcname }
+                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service],
   ServiceCommandException
    + FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand

Kind regards

From: Chris Pretorius
Sent: Wednesday, 22 April 2020 18:16
To: Timothy Williams <user-1a5482fb085e@xymon.invalid<mailto:user-1a5482fb085e@xymon.invalid>>
Cc: xymon at xymon.com<mailto:xymon at xymon.com>
Subject: RE: [Xymon] help with xymonpsclient

Hi Timothy

The installation of the latest xymonclient.ps1 failed with the errors below.

The server is Window2016 server

IE version 11

Had to set the execution policy to Bypass, Setting it to remoteexecution failed


PS C:\Program Files\xymon> .\xymonclient.ps1 install
At C:\Program Files\xymon\xymonclient.ps1:28 char:19
+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
+                   ~
Missing file specification after redirection operator.
At C:\Program Files\xymon\xymonclient.ps1:28 char:20
+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
+                    ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:28 char:55
+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
+                                                       ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:29 char:16
+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
+                ~
Missing file specification after redirection operator.
At C:\Program Files\xymon\xymonclient.ps1:29 char:20
+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
+                    ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:29 char:55
+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
+                                                       ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:30 char:16
+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
+                ~
Missing file specification after redirection operator.
At C:\Program Files\xymon\xymonclient.ps1:30 char:20
+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
+                    ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:30 char:55
+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
+                                                       ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:31 char:16
+ <!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
+                ~
Missing file specification after redirection operator.
Not all parse errors were reported.  Correct the reported errors and try again.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : MissingFileSpecification

Kind regards

From: Timothy Williams <user-1a5482fb085e@xymon.invalid<mailto:user-1a5482fb085e@xymon.invalid>>
Sent: Wednesday, 22 April 2020 16:54
To: Chris Pretorius <user-832aac18b2a8@xymon.invalid<mailto:user-832aac18b2a8@xymon.invalid>>
Cc: xymon at xymon.com<mailto:xymon at xymon.com>
Subject: Re: [Xymon] help with xymonpsclient

Chris,

You are using an outdated script. I could not find the WMI process in any recent versions. I did go back and find it in a 2.19
Version 2.42 now contains:

WriteLog "XymonCollectInfo: CPU info"
    $script:cpuinfo = [ProcessorInformation]::GetSystemInfo()
    $script:numcores  = $cpuinfo.NumberOfProcessors
    WriteLog "Found $($script:numcores) cores"

Latest version properly shows all 24 cores on my Dell R540.

Timothy L. Williams

Operating Systems Analyst

Virginia Commonwealth University Computer Center


On Wed, Apr 22, 2020 at 10:20 AM Chris Pretorius <user-832aac18b2a8@xymon.invalid<mailto:user-832aac18b2a8@xymon.invalid>> wrote:
Good day

I have a windows server 2016 that I use winpsclient to collect the server matrix and send to xymon

Problem is the server has 24 cpu?s allocated and on xymon it reports only 12 cores if you open the cpu page for the monitored host

Looks like this is the part in the xymonclient.ps1 script that collects the cpu count:

    WriteLog "XymonCollectInfo: CPU info (WMI)"
    $script:cpuinfo = @(Get-WmiObject -Class Win32_Processor)
    #$script:totalload = 0
    $script:numcpus  = $cpuinfo.Count
    $script:numcores = 0
    $script:numvcpus = 0
    foreach ($cpu in $cpuinfo) {
        #$script:totalload += $cpu.LoadPercentage
        $script:numcores += $cpu.NumberOfCores
        $script:numvcpus += $cpu.NumberOfLogicalProcessors
    }
    #$script:totalload /= $numcpus

    WriteLog "Found $($script:numcpus) CPUs, total of $($script:numcores) cores"

How do I modify the script to count the correct number of processors?

Kind regards

[cid:image001.png at 01D61977.3B4BBBF0]

Chris Pretorius
Senior Linux Administrator

[Lightstone]
user-3fef1df92e88@xymon.invalid<mailto:user-3fef1df92e88@xymon.invalid>
www.lightstone.co.za<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.lightstone.co.za_&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=ugSuveOyL_drqnUAz0dZBUcSLSR90WCDryI9hbB4fEc&e=>;
quoted from Chris Pretorius
0108228687
Centurion Square, 3rd Floor, cnr Heuwel and Gordon Hood rd, Centurion

[cid:image003.png at 01D61977.3B4BBBF0]<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.linkedin.com_company_lightstone-2Dpty-2Dltd_&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=YubTgs_Xi2wMuxxq1c_INNOoxExugs09GnFz-nb3sbM&e=>;  [cid:image004.png at 01D61977.3B4BBBF0] <https://urldefense.proofpoint.com/v2/url?u=https-3A__twitter.com_lightstonetweet&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=2cn6gPi7X1JqOoYf8IeWLQnRn0JAVyyagskFNDpjV4s&e=>;   [cid:image005.png at 01D61977.3B4BBBF0] <https://urldefense.proofpoint.com/v2/url?u=https-3A__www.facebook.com_lightstone.sa&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=cm4mmU4mrGdXjx8bgVucTo8u5QZGppNX7FEnQxjsI8c&e=>;
This communication is subject to Lightstone's email disclaimer<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.lightstone.co.za_portal_content_email-2Ddisclaimer.aspx&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=-MiIxoykoD8r3ddiP1t9YmO5rOyXH65umVGSjxfQFBo&e=>;


Xymon at xymon.com<https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.xymon.com_mailman_listinfo_xymon&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=EnMRF32_s3dEFk_WLA0vdGIbC02vveAowPD59SXbbds&e=>;


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
list Timothy Williams · Thu, 23 Apr 2020 09:15:29 -0400 ·
I have to edit the file so that it starts/runs on some machines. Try
changing about line 2499 from
if ($serviceexclds -ne '') TO:  if ($serviceexclds -ne "")

*Timothy L. Williams*
quoted from Zak Beck

On Thu, Apr 23, 2020 at 8:58 AM Beck, Zak <user-aada0fa38bf8@xymon.invalid> wrote:
Hi


You did copy nssm.exe to the same location as the client script?


You could try running it without the service ? this is often helpful with
startup issues.


You need to start a powershell prompt with Administrator permissions ? you
can usually do this by using Run (Win+R) and type in powershell.exe.


Then use cd to change directory to the location where you installed the
client ? e.g.


cd "\program files\xymon"


and then to run the client:


.\xymonclient.ps1


You?ll a load of logging, if there are any exception messages in red you
have a problem.


Cheers


Zak


*From:* Xymon <xymon-bounces at xymon.com> *On Behalf Of *Chris Pretorius
*Sent:* 23 April 2020 06:29
*To:* Timothy Williams <user-1a5482fb085e@xymon.invalid>
*Cc:* xymon at xymon.com
*Subject:* [External] Re: [Xymon] help with xymonpsclient


This message is from an EXTERNAL SENDER - be CAUTIOUS, particularly with
links and attachments.


Hi Timothy


Yes, the same location. I backed up the older files, deployed the new
files and started the install process.


Are there any logs I can look at that can reveal why the service fails to
start?

The client logs didn?t change during the install and start process.


Regards


*From:* Timothy Williams <user-1a5482fb085e@xymon.invalid>
*Sent:* Wednesday, 22 April 2020 20:24
*To:* Chris Pretorius <user-832aac18b2a8@xymon.invalid>
*Cc:* xymon at xymon.com
*Subject:* Re: [Xymon] help with xymonpsclient


Is that the same location as the older client was? Myself I use a C:\Utils
folder to avoid permission issues in Program files. Xymon XML config files
tell it where to create logs, etc. Make sure service has permission to
create files there.


here is an excerpt of my xymonclient_config.xml:


<XymonSettings>
  <servers>xymon.xxxx.xxx</servers>
  <clientlogfile>c:\Logs\xymonclient.log</clientlogfile>
  <clientconfigfile>c:\Utils\clientconfig.cfg</clientconfigfile>
  <clientlogretain>3</clientlogretain>
  <clientfqdn>0</clientfqdn>
  <clientlower>0</clientlower>
  <clientremotecfgexec>1</clientremotecfgexec>
</XymonSettings>

*Timothy L. Williams*


On Wed, Apr 22, 2020 at 2:11 PM Chris Pretorius <
user-832aac18b2a8@xymon.invalid> wrote:

Hi Timothy


Please ignore my previous post


I managed to get past the error and the client installed successfully.


When I run the start command I get the following error:


PS C:\Program Files\xymon> .\xymonclient.ps1 install

Service "XymonPSClient" installed successfully!

PS C:\Program Files\xymon> .\xymonclient.ps1 start

start-service : Failed to start service 'XymonPSClient (XymonPSClient)'.

At C:\Program Files\xymon\xymonclient.ps1:4139 char:60

+ ...  $xymonsvcname).Status -ne "Running") { start-service $xymonsvcname }

+                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : OpenError:
(System.ServiceProcess.ServiceController:ServiceController) [Start-Service],

   ServiceCommandException

    + FullyQualifiedErrorId :
StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand


Kind regards


*From:* Chris Pretorius
*Sent:* Wednesday, 22 April 2020 18:16
*To:* Timothy Williams <user-1a5482fb085e@xymon.invalid>
*Cc:* xymon at xymon.com
*Subject:* RE: [Xymon] help with xymonpsclient


Hi Timothy


The installation of the latest xymonclient.ps1 failed with the errors
below.


The server is Window2016 server


IE version 11


Had to set the execution policy to Bypass, Setting it to remoteexecution
failed


PS C:\Program Files\xymon> .\xymonclient.ps1 install

At C:\Program Files\xymon\xymonclient.ps1:28 char:19

+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->

+                   ~

Missing file specification after redirection operator.

At C:\Program Files\xymon\xymonclient.ps1:28 char:20

+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->

+                    ~

The '<' operator is reserved for future use.

At C:\Program Files\xymon\xymonclient.ps1:28 char:55

+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->

+                                                       ~

The '<' operator is reserved for future use.

At C:\Program Files\xymon\xymonclient.ps1:29 char:16

+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->

+                ~

Missing file specification after redirection operator.

At C:\Program Files\xymon\xymonclient.ps1:29 char:20

+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->

+                    ~

The '<' operator is reserved for future use.

At C:\Program Files\xymon\xymonclient.ps1:29 char:55

+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->

+                                                       ~

The '<' operator is reserved for future use.

At C:\Program Files\xymon\xymonclient.ps1:30 char:16

+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->

+                ~

Missing file specification after redirection operator.

At C:\Program Files\xymon\xymonclient.ps1:30 char:20

+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->

+                    ~

The '<' operator is reserved for future use.

At C:\Program Files\xymon\xymonclient.ps1:30 char:55

+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->

+                                                       ~

The '<' operator is reserved for future use.

At C:\Program Files\xymon\xymonclient.ps1:31 char:16

+ <!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->

+                ~

Missing file specification after redirection operator.

Not all parse errors were reported.  Correct the reported errors and try
again.

    + CategoryInfo          : ParserError: (:) [], ParseException

    + FullyQualifiedErrorId : MissingFileSpecification


Kind regards


*From:* Timothy Williams <user-1a5482fb085e@xymon.invalid>
*Sent:* Wednesday, 22 April 2020 16:54
*To:* Chris Pretorius <user-832aac18b2a8@xymon.invalid>
*Cc:* xymon at xymon.com
*Subject:* Re: [Xymon] help with xymonpsclient


Chris,


You are using an outdated script. I could not find the WMI process in any
recent versions. I did go back and find it in a 2.19

Version 2.42 now contains:


WriteLog "XymonCollectInfo: CPU info"
    $script:cpuinfo = [ProcessorInformation]::GetSystemInfo()
    $script:numcores  = $cpuinfo.NumberOfProcessors
    WriteLog "Found $($script:numcores) cores"


Latest version properly shows all 24 cores on my Dell R540.

*Timothy L. Williams*

*Operating Systems Analyst*

Virginia Commonwealth University Computer Center


On Wed, Apr 22, 2020 at 10:20 AM Chris Pretorius <
user-832aac18b2a8@xymon.invalid> wrote:

Good day


I have a windows server 2016 that I use winpsclient to collect the server
matrix and send to xymon


Problem is the server has 24 cpu?s allocated and on xymon it reports only
12 cores if you open the cpu page for the monitored host


Looks like this is the part in the xymonclient.ps1 script that collects
the cpu count:


    WriteLog "XymonCollectInfo: CPU info (WMI)"

    $script:cpuinfo = @(Get-WmiObject -Class Win32_Processor)

    #$script:totalload = 0

    $script:numcpus  = $cpuinfo.Count

    $script:numcores = 0

    $script:numvcpus = 0

    foreach ($cpu in $cpuinfo) {

        #$script:totalload += $cpu.LoadPercentage

        $script:numcores += $cpu.NumberOfCores

        $script:numvcpus += $cpu.NumberOfLogicalProcessors

    }

    #$script:totalload /= $numcpus


    WriteLog "Found $($script:numcpus) CPUs, total of $($script:numcores)
cores"


How do I modify the script to count the correct number of processors?


Kind regards


*Chris Pretorius *Senior Linux Administrator

[image: Lightstone]

user-3fef1df92e88@xymon.invalid

www.lightstone.co.za

<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.lightstone.co.za_&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=ugSuveOyL_drqnUAz0dZBUcSLSR90WCDryI9hbB4fEc&e=>;
quoted from Zak Beck

0108228687

Centurion Square, 3rd Floor, cnr Heuwel and Gordon Hood rd, Centurion


<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.linkedin.com_company_lightstone-2Dpty-2Dltd_&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=YubTgs_Xi2wMuxxq1c_INNOoxExugs09GnFz-nb3sbM&e=>;

<https://urldefense.proofpoint.com/v2/url?u=https-3A__twitter.com_lightstonetweet&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=2cn6gPi7X1JqOoYf8IeWLQnRn0JAVyyagskFNDpjV4s&e=>;

<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.facebook.com_lightstone.sa&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=cm4mmU4mrGdXjx8bgVucTo8u5QZGppNX7FEnQxjsI8c&e=>;

This communication is subject to Lightstone's email disclaimer
<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.lightstone.co.za_portal_content_email-2Ddisclaimer.aspx&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=-MiIxoykoD8r3ddiP1t9YmO5rOyXH65umVGSjxfQFBo&e=>;


<https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.xymon.com_mailman_listinfo_xymon&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=EnMRF32_s3dEFk_WLA0vdGIbC02vveAowPD59SXbbds&e=>;
quoted from Zak Beck


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
list Zak Beck · Thu, 23 Apr 2020 13:20:36 +0000 ·
Hmm, you shouldn?t have to do that ? do you have any noservicecheck entries in client-local.cfg? Do those entries have single quotes in at all? If so, that would break that line, you could try changing them to double quotes (").

Cheers

Zak
quoted from Timothy Williams

From: Timothy Williams <user-1a5482fb085e@xymon.invalid>
Sent: 23 April 2020 14:15
To: Beck, Zak <user-aada0fa38bf8@xymon.invalid>
Cc: Chris Pretorius <user-832aac18b2a8@xymon.invalid>; xymon at xymon.com
Subject: [External] Re: [Xymon] help with xymonpsclient

I have to edit the file so that it starts/runs on some machines. Try changing about line 2499 from
if ($serviceexclds -ne '') TO:  if ($serviceexclds -ne "")


Timothy L. Williams

On Thu, Apr 23, 2020 at 8:58 AM Beck, Zak <user-aada0fa38bf8@xymon.invalid<mailto:user-aada0fa38bf8@xymon.invalid>> wrote:
Hi

You did copy nssm.exe to the same location as the client script?

You could try running it without the service ? this is often helpful with startup issues.

You need to start a powershell prompt with Administrator permissions ? you can usually do this by using Run (Win+R) and type in powershell.exe.

Then use cd to change directory to the location where you installed the client ? e.g.

cd "\program files\xymon"

and then to run the client:

.\xymonclient.ps1

You?ll a load of logging, if there are any exception messages in red you have a problem.

Cheers

Zak

From: Xymon <xymon-bounces at xymon.com<mailto:xymon-bounces at xymon.com>> On Behalf Of Chris Pretorius
Sent: 23 April 2020 06:29
To: Timothy Williams <user-1a5482fb085e@xymon.invalid<mailto:user-1a5482fb085e@xymon.invalid>>
Cc: xymon at xymon.com<mailto:xymon at xymon.com>
Subject: [External] Re: [Xymon] help with xymonpsclient

This message is from an EXTERNAL SENDER - be CAUTIOUS, particularly with links and attachments.

Hi Timothy

Yes, the same location. I backed up the older files, deployed the new files and started the install process.

Are there any logs I can look at that can reveal why the service fails to start?
The client logs didn?t change during the install and start process.

Regards

From: Timothy Williams <user-1a5482fb085e@xymon.invalid<mailto:user-1a5482fb085e@xymon.invalid>>
Sent: Wednesday, 22 April 2020 20:24
To: Chris Pretorius <user-832aac18b2a8@xymon.invalid<mailto:user-832aac18b2a8@xymon.invalid>>
Cc: xymon at xymon.com<mailto:xymon at xymon.com>
Subject: Re: [Xymon] help with xymonpsclient

Is that the same location as the older client was? Myself I use a C:\Utils folder to avoid permission issues in Program files. Xymon XML config files tell it where to create logs, etc. Make sure service has permission to create files there.

here is an excerpt of my xymonclient_config.xml:

<XymonSettings>
  <servers>xymon.xxxx.xxx</servers>
  <clientlogfile>c:\Logs\xymonclient.log</clientlogfile>
  <clientconfigfile>c:\Utils\clientconfig.cfg</clientconfigfile>
  <clientlogretain>3</clientlogretain>
  <clientfqdn>0</clientfqdn>
  <clientlower>0</clientlower>
  <clientremotecfgexec>1</clientremotecfgexec>
</XymonSettings>

Timothy L. Williams


On Wed, Apr 22, 2020 at 2:11 PM Chris Pretorius <user-832aac18b2a8@xymon.invalid<mailto:user-832aac18b2a8@xymon.invalid>> wrote:
Hi Timothy

Please ignore my previous post

I managed to get past the error and the client installed successfully.

When I run the start command I get the following error:

PS C:\Program Files\xymon> .\xymonclient.ps1 install
Service "XymonPSClient" installed successfully!
PS C:\Program Files\xymon> .\xymonclient.ps1 start
start-service : Failed to start service 'XymonPSClient (XymonPSClient)'.
At C:\Program Files\xymon\xymonclient.ps1:4139 char:60
+ ...  $xymonsvcname).Status -ne "Running") { start-service $xymonsvcname }
+                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service],
   ServiceCommandException
    + FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand

Kind regards

From: Chris Pretorius
Sent: Wednesday, 22 April 2020 18:16
To: Timothy Williams <user-1a5482fb085e@xymon.invalid<mailto:user-1a5482fb085e@xymon.invalid>>
Cc: xymon at xymon.com<mailto:xymon at xymon.com>
Subject: RE: [Xymon] help with xymonpsclient

Hi Timothy

The installation of the latest xymonclient.ps1 failed with the errors below.

The server is Window2016 server

IE version 11

Had to set the execution policy to Bypass, Setting it to remoteexecution failed


PS C:\Program Files\xymon> .\xymonclient.ps1 install
At C:\Program Files\xymon\xymonclient.ps1:28 char:19
+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
+                   ~
Missing file specification after redirection operator.
At C:\Program Files\xymon\xymonclient.ps1:28 char:20
+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
+                    ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:28 char:55
+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
+                                                       ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:29 char:16
+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
+                ~
Missing file specification after redirection operator.
At C:\Program Files\xymon\xymonclient.ps1:29 char:20
+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
+                    ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:29 char:55
+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
+                                                       ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:30 char:16
+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
+                ~
Missing file specification after redirection operator.
At C:\Program Files\xymon\xymonclient.ps1:30 char:20
+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
+                    ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:30 char:55
+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
+                                                       ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:31 char:16
+ <!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
+                ~
Missing file specification after redirection operator.
Not all parse errors were reported.  Correct the reported errors and try again.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : MissingFileSpecification

Kind regards

From: Timothy Williams <user-1a5482fb085e@xymon.invalid<mailto:user-1a5482fb085e@xymon.invalid>>
Sent: Wednesday, 22 April 2020 16:54
To: Chris Pretorius <user-832aac18b2a8@xymon.invalid<mailto:user-832aac18b2a8@xymon.invalid>>
Cc: xymon at xymon.com<mailto:xymon at xymon.com>
Subject: Re: [Xymon] help with xymonpsclient

Chris,

You are using an outdated script. I could not find the WMI process in any recent versions. I did go back and find it in a 2.19
Version 2.42 now contains:

WriteLog "XymonCollectInfo: CPU info"
    $script:cpuinfo = [ProcessorInformation]::GetSystemInfo()
    $script:numcores  = $cpuinfo.NumberOfProcessors
    WriteLog "Found $($script:numcores) cores"

Latest version properly shows all 24 cores on my Dell R540.

Timothy L. Williams

Operating Systems Analyst

Virginia Commonwealth University Computer Center


On Wed, Apr 22, 2020 at 10:20 AM Chris Pretorius <user-832aac18b2a8@xymon.invalid<mailto:user-832aac18b2a8@xymon.invalid>> wrote:
Good day

I have a windows server 2016 that I use winpsclient to collect the server matrix and send to xymon

Problem is the server has 24 cpu?s allocated and on xymon it reports only 12 cores if you open the cpu page for the monitored host

Looks like this is the part in the xymonclient.ps1 script that collects the cpu count:

    WriteLog "XymonCollectInfo: CPU info (WMI)"
    $script:cpuinfo = @(Get-WmiObject -Class Win32_Processor)
    #$script:totalload = 0
    $script:numcpus  = $cpuinfo.Count
    $script:numcores = 0
    $script:numvcpus = 0
    foreach ($cpu in $cpuinfo) {
        #$script:totalload += $cpu.LoadPercentage
        $script:numcores += $cpu.NumberOfCores
        $script:numvcpus += $cpu.NumberOfLogicalProcessors
    }
    #$script:totalload /= $numcpus

    WriteLog "Found $($script:numcpus) CPUs, total of $($script:numcores) cores"

How do I modify the script to count the correct number of processors?

Kind regards

[cid:image001.png at 01D6197A.57F2E910]
quoted from Zak Beck

Chris Pretorius
Senior Linux Administrator

[Lightstone]
user-3fef1df92e88@xymon.invalid<mailto:user-3fef1df92e88@xymon.invalid>
www.lightstone.co.za<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.lightstone.co.za_&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=ugSuveOyL_drqnUAz0dZBUcSLSR90WCDryI9hbB4fEc&e=>;
0108228687
Centurion Square, 3rd Floor, cnr Heuwel and Gordon Hood rd, Centurion

[cid:image003.png at 01D6197A.57F2E910]<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.linkedin.com_company_lightstone-2Dpty-2Dltd_&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=YubTgs_Xi2wMuxxq1c_INNOoxExugs09GnFz-nb3sbM&e=>;  [cid:image004.png at 01D6197A.57F2E910] <https://urldefense.proofpoint.com/v2/url?u=https-3A__twitter.com_lightstonetweet&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=2cn6gPi7X1JqOoYf8IeWLQnRn0JAVyyagskFNDpjV4s&e=>;   [cid:image005.png at 01D6197A.57F2E910] <https://urldefense.proofpoint.com/v2/url?u=https-3A__www.facebook.com_lightstone.sa&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=cm4mmU4mrGdXjx8bgVucTo8u5QZGppNX7FEnQxjsI8c&e=>;
quoted from Timothy Williams
This communication is subject to Lightstone's email disclaimer<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.lightstone.co.za_portal_content_email-2Ddisclaimer.aspx&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=-MiIxoykoD8r3ddiP1t9YmO5rOyXH65umVGSjxfQFBo&e=>;


Xymon at xymon.com<https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.xymon.com_mailman_listinfo_xymon&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=EnMRF32_s3dEFk_WLA0vdGIbC02vveAowPD59SXbbds&e=>;


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>;
list Chris Pretorius · Fri, 24 Apr 2020 05:52:41 +0000 ·
Thank you for your reply Zak

I will test your suggestion as soon as I can get a maintenance slot on the server.

In the mean time I (hacked) the script to manually update the cpu count under duress from management ?

I am not sure how this will influence the real reported cpu load for this server but the load reported on Xymon has halved basically.
I am also new to hyperv so not sure how the cpu scheduler allocates cpu resources to the VM.

Since I made the change to the script, the cpu load on the server has reduced from a windows perspective.
But that could be due to the work load on the server now dropping as there is less data to process due to the lock down we have here.

Kind regards
quoted from Zak Beck

From: Beck, Zak <user-aada0fa38bf8@xymon.invalid>
Sent: Thursday, 23 April 2020 14:58
To: Chris Pretorius <user-832aac18b2a8@xymon.invalid>; Timothy Williams <user-1a5482fb085e@xymon.invalid>
Cc: xymon at xymon.com
Subject: RE: [Xymon] help with xymonpsclient

Hi

You did copy nssm.exe to the same location as the client script?

You could try running it without the service ? this is often helpful with startup issues.

You need to start a powershell prompt with Administrator permissions ? you can usually do this by using Run (Win+R) and type in powershell.exe.

Then use cd to change directory to the location where you installed the client ? e.g.

cd "\program files\xymon"

and then to run the client:

.\xymonclient.ps1

You?ll a load of logging, if there are any exception messages in red you have a problem.

Cheers

Zak

From: Xymon <xymon-bounces at xymon.com<mailto:xymon-bounces at xymon.com>> On Behalf Of Chris Pretorius
Sent: 23 April 2020 06:29
To: Timothy Williams <user-1a5482fb085e@xymon.invalid<mailto:user-1a5482fb085e@xymon.invalid>>
Cc: xymon at xymon.com<mailto:xymon at xymon.com>
Subject: [External] Re: [Xymon] help with xymonpsclient

This message is from an EXTERNAL SENDER - be CAUTIOUS, particularly with links and attachments.

Hi Timothy

Yes, the same location. I backed up the older files, deployed the new files and started the install process.

Are there any logs I can look at that can reveal why the service fails to start?
The client logs didn?t change during the install and start process.

Regards

From: Timothy Williams <user-1a5482fb085e@xymon.invalid<mailto:user-1a5482fb085e@xymon.invalid>>
Sent: Wednesday, 22 April 2020 20:24
To: Chris Pretorius <user-832aac18b2a8@xymon.invalid<mailto:user-832aac18b2a8@xymon.invalid>>
Cc: xymon at xymon.com<mailto:xymon at xymon.com>
Subject: Re: [Xymon] help with xymonpsclient

Is that the same location as the older client was? Myself I use a C:\Utils folder to avoid permission issues in Program files. Xymon XML config files tell it where to create logs, etc. Make sure service has permission to create files there.

here is an excerpt of my xymonclient_config.xml:

<XymonSettings>
  <servers>xymon.xxxx.xxx</servers>
  <clientlogfile>c:\Logs\xymonclient.log</clientlogfile>
  <clientconfigfile>c:\Utils\clientconfig.cfg</clientconfigfile>
  <clientlogretain>3</clientlogretain>
  <clientfqdn>0</clientfqdn>
  <clientlower>0</clientlower>
  <clientremotecfgexec>1</clientremotecfgexec>
</XymonSettings>

Timothy L. Williams


On Wed, Apr 22, 2020 at 2:11 PM Chris Pretorius <user-832aac18b2a8@xymon.invalid<mailto:user-832aac18b2a8@xymon.invalid>> wrote:
Hi Timothy

Please ignore my previous post

I managed to get past the error and the client installed successfully.

When I run the start command I get the following error:

PS C:\Program Files\xymon> .\xymonclient.ps1 install
Service "XymonPSClient" installed successfully!
PS C:\Program Files\xymon> .\xymonclient.ps1 start
start-service : Failed to start service 'XymonPSClient (XymonPSClient)'.
At C:\Program Files\xymon\xymonclient.ps1:4139 char:60
+ ...  $xymonsvcname).Status -ne "Running") { start-service $xymonsvcname }
+                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service],
   ServiceCommandException
    + FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand

Kind regards

From: Chris Pretorius
Sent: Wednesday, 22 April 2020 18:16
To: Timothy Williams <user-1a5482fb085e@xymon.invalid<mailto:user-1a5482fb085e@xymon.invalid>>
Cc: xymon at xymon.com<mailto:xymon at xymon.com>
Subject: RE: [Xymon] help with xymonpsclient

Hi Timothy

The installation of the latest xymonclient.ps1 failed with the errors below.

The server is Window2016 server

IE version 11

Had to set the execution policy to Bypass, Setting it to remoteexecution failed


PS C:\Program Files\xymon> .\xymonclient.ps1 install
At C:\Program Files\xymon\xymonclient.ps1:28 char:19
+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
+                   ~
Missing file specification after redirection operator.
At C:\Program Files\xymon\xymonclient.ps1:28 char:20
+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
+                    ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:28 char:55
+ <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
+                                                       ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:29 char:16
+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
+                ~
Missing file specification after redirection operator.
At C:\Program Files\xymon\xymonclient.ps1:29 char:20
+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
+                    ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:29 char:55
+ <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
+                                                       ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:30 char:16
+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
+                ~
Missing file specification after redirection operator.
At C:\Program Files\xymon\xymonclient.ps1:30 char:20
+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
+                    ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:30 char:55
+ <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
+                                                       ~
The '<' operator is reserved for future use.
At C:\Program Files\xymon\xymonclient.ps1:31 char:16
+ <!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
+                ~
Missing file specification after redirection operator.
Not all parse errors were reported.  Correct the reported errors and try again.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : MissingFileSpecification

Kind regards

From: Timothy Williams <user-1a5482fb085e@xymon.invalid<mailto:user-1a5482fb085e@xymon.invalid>>
Sent: Wednesday, 22 April 2020 16:54
To: Chris Pretorius <user-832aac18b2a8@xymon.invalid<mailto:user-832aac18b2a8@xymon.invalid>>
Cc: xymon at xymon.com<mailto:xymon at xymon.com>
Subject: Re: [Xymon] help with xymonpsclient

Chris,

You are using an outdated script. I could not find the WMI process in any recent versions. I did go back and find it in a 2.19
Version 2.42 now contains:

WriteLog "XymonCollectInfo: CPU info"
    $script:cpuinfo = [ProcessorInformation]::GetSystemInfo()
    $script:numcores  = $cpuinfo.NumberOfProcessors
    WriteLog "Found $($script:numcores) cores"

Latest version properly shows all 24 cores on my Dell R540.

Timothy L. Williams

Operating Systems Analyst

Virginia Commonwealth University Computer Center


On Wed, Apr 22, 2020 at 10:20 AM Chris Pretorius <user-832aac18b2a8@xymon.invalid<mailto:user-832aac18b2a8@xymon.invalid>> wrote:
Good day

I have a windows server 2016 that I use winpsclient to collect the server matrix and send to xymon

Problem is the server has 24 cpu?s allocated and on xymon it reports only 12 cores if you open the cpu page for the monitored host

Looks like this is the part in the xymonclient.ps1 script that collects the cpu count:

    WriteLog "XymonCollectInfo: CPU info (WMI)"
    $script:cpuinfo = @(Get-WmiObject -Class Win32_Processor)
    #$script:totalload = 0
    $script:numcpus  = $cpuinfo.Count
    $script:numcores = 0
    $script:numvcpus = 0
    foreach ($cpu in $cpuinfo) {
        #$script:totalload += $cpu.LoadPercentage
        $script:numcores += $cpu.NumberOfCores
        $script:numvcpus += $cpu.NumberOfLogicalProcessors
    }
    #$script:totalload /= $numcpus

    WriteLog "Found $($script:numcpus) CPUs, total of $($script:numcores) cores"

How do I modify the script to count the correct number of processors?

Kind regards

[cid:user-c32c5aa7dc9c@xymon.invalid4E6A90]
quoted from Zak Beck

Chris Pretorius
Senior Linux Administrator

[Lightstone]
user-3fef1df92e88@xymon.invalid<mailto:user-3fef1df92e88@xymon.invalid>
www.lightstone.co.za<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.lightstone.co.za_&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=ugSuveOyL_drqnUAz0dZBUcSLSR90WCDryI9hbB4fEc&e=>;
0108228687
Centurion Square, 3rd Floor, cnr Heuwel and Gordon Hood rd, Centurion

[cid:user-4260ffb50c23@xymon.invalid4E6A90]<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.linkedin.com_company_lightstone-2Dpty-2Dltd_&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=YubTgs_Xi2wMuxxq1c_INNOoxExugs09GnFz-nb3sbM&e=>;  [cid:user-85d3baab0118@xymon.invalid4E6A90] <https://urldefense.proofpoint.com/v2/url?u=https-3A__twitter.com_lightstonetweet&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=2cn6gPi7X1JqOoYf8IeWLQnRn0JAVyyagskFNDpjV4s&e=>;   [cid:user-8a3e87c1dbb0@xymon.invalid4E6A90] <https://urldefense.proofpoint.com/v2/url?u=https-3A__www.facebook.com_lightstone.sa&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=cm4mmU4mrGdXjx8bgVucTo8u5QZGppNX7FEnQxjsI8c&e=>;
quoted from Zak Beck
This communication is subject to Lightstone's email disclaimer<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.lightstone.co.za_portal_content_email-2Ddisclaimer.aspx&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=-MiIxoykoD8r3ddiP1t9YmO5rOyXH65umVGSjxfQFBo&e=>;


Xymon at xymon.com<https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.xymon.com_mailman_listinfo_xymon&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=xSaUNdht4ayW-5Ku4Gpsyibh9bTwVmO4Fcm-ju-e40A&s=EnMRF32_s3dEFk_WLA0vdGIbC02vveAowPD59SXbbds&e=>;


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>;