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

Error reading response: Invalid XML (missing /prtg)

Votes:

0

I try to run following script:

https://kb.paessler.com/en/topic/60478-how-can-i-monitor-licenses-in-my-network

but I cant, cuz the log tells me sth. I dont unterstand.

Die Datei "C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\li csense_status.ps1" kann nicht geladen werden, da die Ausführung von Skripts auf diesem System deaktiviert ist. Weitere Informationen erhalten Sie mit "get-hel p about_signing". Bei Zeile:1 Zeichen:2 + & <<<< 'C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\lic sense_status.ps1' ExpirationDate='18.11.2014'; exit $LASTEXITCODE + CategoryInfo : NotSpecified: (:) [], PSSecurityException + FullyQualifiedErrorId : RuntimeException

After I read this msg once, I did using the "set-executionpolicy remotesigned" (I even tried "AllSigned" just sayn). But I still get the same error. Do I have to restart the System or the probe?

Any suggestions? best regards

invalid-xml missing-prtg runscript

Created on May 28, 2014 12:05:26 PM



7 Replies

Accepted Answer

Votes:

1

Hi,
as the PRTG probe is a 32 bit process it is only able to spawn 32 bit child processes. Therefore when a Powershell script is executed the 32 bit version of Powershell is used.
Please try (for testing purposes) executing the following command in your 32 bit Powershell:

Set-ExecutionPolicy unrestricted

Afterwards, try adding the sensor again. If this works you can switch to a more restrictive execution policy.
Best regards

Created on May 28, 2014 6:44:53 PM by  Konstantin Wolff [Paessler Support]



Votes:

0

Hi,

thank your for your reply. I did the change on the execution policy as you said. Now I get a different error msg:

New-TimeSpan : Der Parameter "End" kann nicht gebunden werden. Der Wert "Expira tionDate=18.11.2014" kann nicht in den Typ "System.DateTime" konvertiert werden . Fehler: "Die Zeichenfolge wurde nicht als gültige DateTime erkannt. Ein unbek anntes Wort beginnt bei Index 0." Bei C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\licsense_ status.ps1:3 Zeichen:54 + $DateDifference = New-TimeSpan -Start (Get-Date) -End <<<< $ExpirationDate + CategoryInfo : InvalidArgument: (:) [New-TimeSpan], ParameterBi ndingException + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerSh ell.Commands.NewTimeSpanCommand

0:License expired for days!

sounds like a parameter does not fit as it should. But unfortunately I'm not that powershell pro and dont know what to do there. =/

regards

Created on Jun 3, 2014 9:48:20 AM



Votes:

0

Without the code it is pretty hard doing debugging but I assume you are passing the date as string to the script. If so, please try casting this string explicitly to datetime format, e.g. as outlined in this article.

Created on Jun 3, 2014 11:11:28 AM by  Konstantin Wolff [Paessler Support]



Votes:

0

I simply copied the script from the thread I mentioned in my 1st post:

Param([string]$ExpirationDate)

$DateDifference = New-TimeSpan -Start (Get-Date) -End $ExpirationDate $Days = $DateDifference.Days $DaysPassed = ($Days * -1) if($Days -gt 0){ Write-Host $Days":License expires in "$Days" day(s)." exit 0 } if($Days -eq 0){ Write-Host $Days":The license expires today!"; exit 1 } if($Days -lt 0){ Write-Host 0":License expired for "$DaysPassed" days!" exit 1 }

Created on Jun 3, 2014 11:49:33 AM



Votes:

0

Hi,
please try passing the expiration date in the following format:

YYYY-DD-MM

The complete call should then look somewhat like this:

yourscript.ps1 ExpirationDate="2015-30-10"

Created on Jun 5, 2014 1:50:02 PM by  Konstantin Wolff [Paessler Support]



Votes:

0

Hi,

I fixed it now. But its more like a workaround I came up with, not the real solution.

1st I tried to put the custom pwoershell script not in the

C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML

but rather into the

C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXE

...folder.

Then I the script runs through. But I still dont get any value.

So I edited the script like adding the parameter for the expiration date into it.

Param([string]$ExpirationDate)

$ExpirationDate="2014-11-18"

$DateDifference = New-TimeSpan -Start (Get-Date) -end $ExpirationDate
$Days = $DateDifference.Days
$DaysPassed = ($Days *
...

that solved it for me. Thanks.

Created on Jun 9, 2014 2:55:48 PM



Votes:

0

Me again!

I finally found the problem, as always it was situated in front of the monitor.

In the thread:

https://kb.paessler.com/en/topic/60478-how-can-i-monitor-licenses-in-my-network

Mr. Linke mentioned to set the Parameter of the sensor like:

ExpirationDate="2015-31-12"

But then the sensor runs in error state. But I just enter the date without the string before, it works. 2015-31-12 as parameter of the sensor and you win! :-)

PS maybe the post from Mr. Linke should edit his post?

best regards

Created on Jun 10, 2014 7:40:28 AM




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.