What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Powershell Sensor

Votes:

0

I have written a PowerShell sensor to get some information from some servers. It worked fine for one day and now I get: "No response (code: PE002)" every now and then I get the values back.

It looks like a timing problem. When I start the sensor manually it takes 2 seconds to finish.

Any Ideas where the problem is?

BR Thomas

custom powershell sensor

Created on Sep 17, 2018 11:42:05 AM



9 Replies

Votes:

1

Can you post some details about this? Did you try increasing the timeout? Probably it takes a while to load the modules for your PowerShell on the probe device and this is causing this - due to overload with other probing etc..

Some more details would be helpful.

Regards

Florian Rossmark

www.it-admins.com

Created on Sep 17, 2018 1:41:58 PM



Votes:

0

Hello

Yes I tried to increase timeout to 500, but no change.

The sensor uses wtsapi32.dll to count logged on terminal sessions.

In all articles I found PE002 related to DNS timeout.

BR

Thomas

Created on Sep 17, 2018 3:11:39 PM



Votes:

2

Can't you just use the default RDS session counter for this? I know the numbers are 2 sessions higher then it is true, but it still is a good sensor - this would avoid the issue after all..

The name of the sensor is WMI Terminal Services.

Would that be a possible solution?

Otherwise it sounds like you do a remote power shell script against the session host.

Regards

Florian Rossmark

www.it-admins.com

Created on Sep 17, 2018 8:08:21 PM



Votes:

0

I have tried this sensor but I get an error: Class(es) not found: "Win32_PerfRawData_LocalSessionManager_TerminalServices" (code: PE235)

We have around 40 Citrix workers and to fix this would be a big afford

Created on Sep 18, 2018 7:10:51 AM



Votes:

2

Hi Thomas,

Assuming you meant 40 Citrix servers - not workers, right? Just wanted to clarify this.

Let's say you have 40 servers, are you saying they all give you an error code PE235? Really wondering about this.

Did you try to use the WMI test utility and see if you actually can query WMI in regards to the sessions? You can find it here for free: https://www.paessler.com/tools/wmitester

If so - did only one server have an issue or really all 40 servers?

Further - did you open an administrative command shell on the server and do a WINMGMT /VERIFYREPOSITORY and if needed a WINMGMT /SALVAGEREPOSITORY in order to fix it? Assuming there is an issue the salvage might fix it - but depending on some details there might be other steps that have to be taken.

In case all 40 servers are affected - did you investigate the root cause? Are they cloned e.g.?

As for the reasons for all those questions - WMI and further the RDS sessions is a standard part of Windows. If it does not work, you might have other issues that would need to be investigated and addressed. I understand your idea of working around it by using PowerShell - but you see issues there as well that actually could be related, cause depending on what exactly you execute there, it might in the end relate to the same root cause.

Regards

Florian Rossmark

www.it-admins.com

Created on Sep 18, 2018 1:48:16 PM



Votes:

0

Hello there,

Thanks for your nice tips and answers Florian. We appreciate that :)

Thomas, please let us know if you are getting further here. We would like to make this work fine.


Kind regards,
Birk Guttmann, Tech Support Team

Created on Sep 19, 2018 12:29:40 PM by  Birk Guttmann [Paessler Support]



Votes:

0

Hello

I am talking about workers.

I have tried WMITest from probe to Worker :SELECT * FROM Win32_OperatingSystem Response is ok I have tried WMITest from probe to worker :SELECT TotalSessions FROM Win32_TerminalService I got a response I have tried WINMGMT /verifyrepository : no errors found

with the PRTG Sensor WMI Terminal Services (2008+) I get :Class(es) not found: "Win32_PerfRawData_LocalSessionManager_TerminalServices" (code: PE235)

Thomas

Created on Sep 19, 2018 3:02:07 PM



Votes:

1

Hi Tom,

You could use a custom WMI sensor and request the TotalSessions for sure via

SELECT TotalSessions FROM Win32_TerminalService

To help you a bit further and because I have a 2008 R2 RDS server around - I tested this as well successfully:

SELECT TotalSessions FROM Win32_PerfRawData_LocalSessionManager_TerminalServices

Both queries resulting in the same TotalSessions - I want to add that there are always 2x RDP ports open by default, Citrix might even add another one or two with the ICA protocol. This is not a real problem, it is just the way sessions are counted and you need to be aware of it.

Now - my basic understanding is that PRTG's default RDS sensor might go against the PerfRawData table in WMI. If you r RDS host is missing that performance counter for some reason, but you are able to get the same data via Win32_TerminalService then just implement this to bypass the issue. The root cause might not be eliminated but as long you don't have any other reason to investigate it further, you should be fine using a custom WMI sensor and requesting the data this way.

Putting a PowerShell script in between all of this just adds complexity and as you experience it already more complexity can lead to more issues.

Regards

Florian Rossmark

www.it-admins.com

Created on Sep 19, 2018 3:20:58 PM



Votes:

0

Hello

The WMI Sensor with with your select statement worked.

In addition I have created a PowerShell Sensor that uses the Rest Interface of the Citrix infrastructur server.

So we can close this task

Thank You

Thomas

Created on Sep 20, 2018 3:01:32 PM




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.