Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
check_number_of_citrix_sessions
1.0
2010-08-11
- Nagios 3.x
112687
File | Description |
---|---|
check_number_of_citrix_sessions.wsf | check_number_of_citrix_sessions.wsf |
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.
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 hostname application_name warning critical
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;
2. 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;
3. 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;
4. 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;
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 hostname application_name warning critical
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;
2. 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;
3. 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;
4. 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;
Reviews (2)
bygradecke, February 8, 2013
To get it to work with XenApp 6.0 replace all occurrences of "MetaFrame" with "XenApp"
also I commented out lines 102-113 as they were throwing errors that objects/methods didn't exist. it doesn't seem to limit the script functionality.
Script with all updates can be found here: http://pastie.org/6095017#24
also I commented out lines 102-113 as they were throwing errors that objects/methods didn't exist. it doesn't seem to limit the script functionality.
Script with all updates can be found here: http://pastie.org/6095017#24
I had a small problem. The NSClient run as SYSTEM account, which is not CitrixAdministrator. I removed the lines 110-113 and everything seems to work. I'm not sure if this is special to my environment.
Line 110: If theFarm.WinFarmObject.IsCitrixAdministrator = 0 then
I had a problem with NSClient 0.4.172 which doesn' t like the perf data, because the perf data is not divided by a space. I added a space after every ';'
outputMessage=intSessions& " sesions - "& intActive& " active, "_
& intDisconnected& " disconnected. Number of users: "_
& numberOfUniqueUsers& ". |sessions_total="& intSessions& "; sessions_active="_
& intActive& "; sessions_disconnected="& intDisconnected& "; users="& numberOfUniqueUsers
Line 110: If theFarm.WinFarmObject.IsCitrixAdministrator = 0 then
I had a problem with NSClient 0.4.172 which doesn' t like the perf data, because the perf data is not divided by a space. I added a space after every ';'
outputMessage=intSessions& " sesions - "& intActive& " active, "_
& intDisconnected& " disconnected. Number of users: "_
& numberOfUniqueUsers& ". |sessions_total="& intSessions& "; sessions_active="_
& intActive& "; sessions_disconnected="& intDisconnected& "; users="& numberOfUniqueUsers