check_number_of_citrix_sessions

check_number_of_citrix_sessions

Check number of specific (or all) Citrix sessions, on specific Citrix Presentation Server (or entire Citrix farm), depends on arguments. Also, total number of (unique) users is displayed.

This script uses MFCOM. MFCOM is COM-based management interface, programming interface for the administration of MetaFrame XP farms and servers. MFCOM runs on every Citrix Presentation Server by default. No installation/configuration  required. Just be sure that "Citrix MFCOM Service" is running on Citrix Presentation Server.

The main idea is to run this script using NRPE (Nagios Remote Plugin Executor) on one server (must be Citrix Presentation Server) and get information about sessions/users on every server in the farm (or entire farm). Hostname (name of Citrix Presentation Server) is specified as argument.

This script requires Citrix Administrator privileges and must be run from Citrix Presentation server. Practically, that means that NRPE service (on Citrix Presentation Server) must be run with Citrix Admin privileges.

 

Usage:

cscript check_number_of_citrix_sessions.wsf

 

Examples:

  1. Check number of Internet Explorer 8 sessions on presentation server "citrixps12":

    cscript check_number_of_citrix_sessions.wsf citrixps12 "Internet Explorer 8" 10 20

    output:    OK: 7 sesions - 7 active, 0 disconnected. Number of users: 7. |sessions_total=7;sessions_active=7;sessions_disconnected=0;users=7;

 

  1. Check number of Internet Explorer 8 sessions on entire Citrix farm:

    cscript check_number_of_citrix_sessions.wsf all "Internet Explorer 8" 100 200

    output:   Critical: 332 sesions - 329 active, 3 disconnected. Number of users:309. |sessions_total=332;sessions_active=329;                                       sessions_disconnected=3;users=309;

 

  1. Check number of all sessions on presentation server "citrixps12":

    cscript check_number_of_citrix_sessions.wsf citrixps12 all 50 70

    output:   OK: 18 sesions - 17 active, 1 disconnected. Number of users: 11. |sessions_total=18; sessions_active=17;sessions_disconnected=1;users=11;

 

  1. Check number of all sessions on entire Citrix farm:

    cscript check_number_of_citrix_sessions.wsf all all 500 1000

    output: Warning: 809 sesions - 797 active, 12 disconnected. Number of users: 347. |sessions_total=809;sessions_active=797;sessions_disconnected=12;users=347;