The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Citrix::SessionSet - Query UNIX Citrix Sessions from a Citrix Farm.

DESCRIPTION

Citrix::SessionSet Allows querying:

1) All sessions on farm (multiple, typically 2-8 hosts, by "farm context")
2) Sessions on a single host (by DNS hostname)
3) Sessions for an individual user (by username).

Parses output from Citrix command line tools to Perl objects. The module tries to do its best to deal with traditional problems of sub-shell execution (command piping) and remote shelling (rsh).

A UNIX Citrix "application" is usually a complete Desktop environment, but may also be single app like X-Terminal, Mail Client or Word processor.

CLASS VARIABLES

$Citrix::SessionSet::ctxcols

Column format string

@Citrix::SessionSet::ctxattr

Citrix Session set attributes (matching the letters in $ctxcols format string). These turn into hash keys in the sessionset collection.

$Citrix::SessionSet::debug

Class level "global" debugging level (Notice that also instance has a debug flag). Set to true to troubleshoot Citrix::SessionSet retrieval.

METHODS

my $ss = Citrix::SessionSet->new($farmctx);

Construct a new Citrix session collection. Indicate Farm context of query by $fc (See Citrix::Farm). Return empty session set (to be queried later)

$err = $ss->gethostsess('the-cx-host-67');

Get all sessions for a single host (passed as $host) and load the sessions (adding them) into session set instance. Return 1 for errors, 0 on success.

$err = $ss->getsession('the-cx-host-67:5234');

Get a session identified by $hostsess string (HOST:SESSID) from session set (Involves sequential search within session set as sessions are not indexed in current version). The composite key of form "HOST:SESSID" is required, because session set may contain sessions from multiple hosts (With single farm context though). Return the single identified session (as hash) or undef if no session by SESSID is found.

$err = $ss->mysess('joecitrix');

Load sessions for single user (by username) into session set. Usually loading takes place on an empty set to have truly the sessions for individual only. This can be used to create "My Sessions" views, but this is just "Sessions for User by ID". Return 1 (and up) for errors 0, for success.

my $cnt = $ss->count();

Accessor method to get the number of sessions stored in current session set. Return the (integer) count.