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 script for HpyerV replica

Votes:

0

I'm trying to setup this Powershell script for HyperV replica located here

I keep getting:

Response not wellformed: "(<prtg> </prtg> )" (code: PE132)

I have PRTG installed on server1 - I have two hyperv servers they are monitor using the remote sensor option (hyperv1 & 2)

I've got the powershell script in the custom scripts folder on Server1. I add the sensor for the powershell script. But all I get is the above message back.

Do I need to install the prtg remote probe on to the hyperv servers and then put the script in the custom scripts directory on the hyperv server and then add the sensor to get it to work?

hyperv2012 powershell prtg

Created on Sep 23, 2015 1:32:23 PM

Last change on Nov 27, 2015 6:44:31 AM by  Luciano Lingnau [Paessler]



7 Replies

Accepted Answer

Votes:

7

Managed to get the script to work eventually.

Had to set Powershell on the server that was running the script to unrestricted:
Set-ExecutionPolicy unrestricted (x64 & x32 powershell)

Also had to install HyperV tools for Powershell using the following:

  1. Import-Module ServerManager
  2. Add-WindowsFeature RSAT-Hyper-V-Tools –IncludeAllSubFeature

I added the script to the custom sensor folder in PRTG monitoring folder on the server.

Then on PRTG I added a custom sensor "EXE/Script Advanced" Selected the script from the dropdown list.

In the Parameters field in PRTG sensor I added in my servers in this format including quotes "server1,server2,server3"

With the servers being the actual HyperV host server.

It was as easy as that. First time I had to use a custom script so didn't no how it worked. So hopefully these extra steps help anyone else with the issue.

Created on Sep 24, 2015 9:05:46 AM

Last change on Sep 24, 2015 12:28:27 PM by  Luciano Lingnau [Paessler]



Votes:

0

Hi,

I was trying to use this script but I keep getting the following error:

No "result" or "error" in XML response.

The only editing I have done to the script is to:

$ServerList = $Hypervservers.Split("Server1,Server2")

Do I need to use the Hyper-V Server IP address or the fully qualified domain name (FQDN) of the server?

Also, in the Parameters field do I need to use an IP address or FQDN?

Created on Nov 26, 2015 12:42:12 PM



Votes:

0

You don't need to edit the script, as said in my post. you put the server names in to the parameters field. it can be ip or FQDN.

So in the parameters field in PRTg it should be "server1.domain.com,server2.domain.com,server3.domain.com"

Created on Nov 26, 2015 1:51:28 PM



Votes:

0

Thanks for getting back to me,

When I use the un-edited script I get the following error when I enter the servers as parameters

XML: The returned xml does not match the expected schema. (code: PE233) -- JSON: The returned json does not match the expected structure (Invalid JSON.). (code: PE231)

Do I need to add the sensor in a particular position?

Any suggestions are welcome.

Created on Nov 26, 2015 5:01:27 PM



Votes:

0

Hello keithdaly,
As for the described error:

XML: The returned xml does not match the expected schema. (code: PE233)

It will be displayed when the result of the sensor doesn't match the format expected by PRTG. This usually indicates that some error occurred within the script (Authentication, Permission, etc).

Within the sensor's settings in PRTG, it is possible to configure the EXE Result to Write EXE result to disk. That way an result debug log from the sensor will be generated on every scan in the following folder(default) of the PRTG Probe where the sensor was set-up:

C:\ProgramData\Paessler\PRTG Network Monitor\Logs (Sensors)\

This debug log may provide additional information to why the script is failing or why PRTG isn't properly picking up the result. The expected result format is documented within PRTG under Setup > PRTG API on the "Custom Sensors" tab.

Best Regards,

Created on Nov 27, 2015 6:46:13 AM by  Luciano Lingnau [Paessler]



Votes:

0

Do you add the Custom Sensor to the local probe or to a specific server?

Created on Jul 7, 2016 2:14:50 AM



Votes:

0

@briandodds: You can add the custom sensor to the server in question.
Best regards

Created on Jul 8, 2016 12:05:42 PM by  Konstantin Wolff [Paessler Support]




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.