Skip to content

Commit f9cd07b

Browse files
committed
Fixed output and lookup issues
Will require changes to already-installed sensor channels to repair. Recommend removing and re-adding as simplest fix.
1 parent 0d2f883 commit f9cd07b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Lockstep - Citrix Licensing Monitor - withlookup.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,11 +332,14 @@ $Services = Get-Service $ServiceNames -ComputerName $ComputerName -ErrorAction S
332332
###############################################################################
333333
# output
334334

335+
# this widens the buffer to prevent "chopping" long lines caused by long product names.
336+
$Host.UI.RawUI.BufferSize = New-Object Management.Automation.Host.Size (500,25)
337+
335338
$XMLOutput = "<prtg>`n"
336339

337340
foreach ($Service in $Services) {
338-
if ($Service.Status -ne "Running") { $State = 1 } else { $State = 0 }
339-
$XmlOutput += Set-PrtgResult $("Service: " + $Service.DisplayName) $State state -me 0 -em "Service is not running" -ValueLookup "lockstep.sensor.citrix.licensing"
341+
if ($Service.Status -ne "Running") { $State = 2 } else { $State = 1 }
342+
$XmlOutput += Set-PrtgResult $("Service: " + $Service.DisplayName) $State state -me 1 -em "Service is not running" -ValueLookup "prtg.standardlookups.yesno.stateyesok"
340343
}
341344

342345
foreach ($License in $LicensingData) {

0 commit comments

Comments
 (0)