New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


Powershell: NotSpecified: (:) [Get-XAFarm], FaultException

Votes:

0

Your Vote:

Up

Down

I have the following powershell script:

Add-PSSnapin Citrix*
$ComputerName = [string]$Args[0]
if ($ComputerName -eq "")
{
 "<prtg><error>1</error><text>No Computername set in the parameters of the script</text></prtg>"
}
else
{
 $Sessions = Get-XAFarm -ComputerName "$ComputerName"
 $SessionCount = $Sessions.SessionCount
 "<prtg>"
 "<result>"
 "<channel>Current Session Count</channel>"
 "<value>" + $SessionCount + "</value>"
 "</result>"
 "</prtg>"
}

This script gives me the below stated error:

Get-XAFarm : De server kan de aanvraag niet verwerken als gevolg van een intern
e fout. Voor meer informatie over de fout kunt u IncludeExceptionDetailInFaults
 inschakelen (vanuit ServiceBehaviorAttribute of vanuit het configuratiegedrag 
<serviceDebug>) voor de server zodat de uitzonderingsgegevens naar de client wo
rden teruggestuurd, of u kunt tracering inschakelen. Raadpleeg hiertoe de docum
entatie van Microsoft .NET Framework 3.0 SDK en controleer de traceringslogboek
en voor de server.
At C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\GetCurrent
XASessionCount.ps1:9 char:14
+  $Sessions = Get-XAFarm -ComputerName "$ComputerName"
+              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-XAFarm], FaultException
    + FullyQualifiedErrorId : System.ServiceModel.FaultException,Citrix.XenApp 
   .Commands.GetFarmCmdlet
 
<prtg>
<result>
<channel>Current Session Count</channel>
<value></value>
</result>
</prtg>

If i execute the script manually, it works. so what's wrong with my script...

custom-script-exe powershell prtg14

Created on Nov 18, 2015 3:48:20 PM by  eagle00789 (0) 1

Last change on Nov 18, 2015 3:52:35 PM by  Torsten Lindner [Paessler Support]



1 Reply

Votes:

0

Your Vote:

Up

Down

Hi Eagle,

Please try to start the script within another security context by marking Use Windows credentials of parent device in the settings of the sensor. Please ensure that you enter a user who has got sufficient rights to execute scripts on the probe system.

Best regards, Felix

Created on Nov 20, 2015 12:28:39 PM by  Felix Saure [Paessler Support]



Please log in or register to enter your reply.


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.