Lars Åges tanker

Politikk og teknologi

Monitoring Citrix Presentation Server/XenApp load in Nagios

| 1 kommentar

I’m currently running two diffrent Citrix farms, one on Presentation Server 4, and one on XenApp 6.5. Since I’m currently in the process of moving from one farm to another, I have to have very good control over how many servers I have in each farm, to always have enough resources on both farms. I really love qfarm /load and use it all the time, but I needed to automate it with our monitoring solution Nagios/Icinga. To do this, I’ve created the following powershellscript to monitor my farms, and get to know whenever there are missing resources.



(Put in c:\program files\nsclient++\scripts\ )

# Copyright Lars Age Kamfjord 

# The latest version of this can be found on http://PLACEHOLDER.wpsho/2013/12/18/monitoring-citrix-presentation-serverxenapp-in-nagios/

$object = Get-WmiObject -Namespace "root\citrix" -Class MetaFrame_Server_LoadLevel | Select-Object LoadLevel
if($object.LoadLevel -ge 9000) {
 Write-Host "Error: Extremly high load: "$object.LoadLevel
 exit 2

ElseIf ($object.LoadLevel -gt 7500) {
 Write-Host "Warning: High load: "$object.LoadLevel
 exit 1

ElseIf($object.LoadLevel -lt 1) {
 Write-Host "Unknown: Server not in production?"$object.LoadLevel
 exit 3

else {
 Write-Host "OK: Load "$object.LoadLevel
 exit 0


(Add line in nsclient.ini under NRPE/external scripts)

check_citrix_load=cmd /c echo scripts\citrix_load.ps1; exit($lastexitcode) | powershell.exe -command -

nagios service-definition

define service {
use generic-service
hostgroups admnett-windows-terminal-servers
service_description Citrix Load
check_command check_nrpe!check_citrix_load
check_interval 5
max_check_attempts 3

Én kommentar

  1. Hello Lars,

    how i read you are working with citrix farms and customize your monitoring for Nagios.
    So i have a question… Do you monitor only the performance and capacity of your citrix farms?
    Currently i´m searching for a solution to monitor the availability of citrix applications by Nagios. There was a solutions with a perl-script named ‘’ but it´s out of date. Last years came new Xen versions, citrix recievers, etc… and so the ‘old’ script doesn´t work anymore.
    So i try to find people are working with citrix farms and their monitoring – especially Nagios. 🙂
    I think i´m not the only person in this universe who will monitor the applications of citrix farms 🙂

    best regards

    Marco M – Germany

    p.s. sorry for my bad english 😉

Legg igjen en kommentar

Påkrevde felter er merket *.