Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Perl Script Help for Citrix ICA Session Latency

 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
bballard



Joined: 19 Jan 2006
Posts: 35

PostPosted: Wed Mar 07, 2007 4:46 pm    Post subject: Perl Script Help for Citrix ICA Session Latency Reply with quote

I am trying to write a perl script to pull the ICA Session Latency for Citrix. So far this is the script:

Code:
use strict;
use Win32::OLE('in');

use constant wbemFlagReturnImmediately => 0x10;
use constant wbemFlagForwardOnly => 0x20;

my @computers = ($ARGV[0]);
foreach my $computer (@computers) {

   my $objWMIService = Win32::OLE->GetObject("winmgmts:\\\\$computer\\root\\CIMV2") or die "WMI connection failed.\n";
   my $colItems = $objWMIService->ExecQuery("SELECT * FROM Win32_PerfRawData_CitrixICA_ICASession", "WQL",
                  wbemFlagReturnImmediately | wbemFlagForwardOnly);

   foreach my $objItem (in $colItems) {
      print "LatencySessionAverage:$objItem->{LatencySessionAverage}";
      print "\n";

   }
}


The output looks like this:

Code:
LatencySessionAverage:42
LatencySessionAverage:78
LatencySessionAverage:49
LatencySessionAverage:69
LatencySessionAverage:86
LatencySessionAverage:229
LatencySessionAverage:175
LatencySessionAverage:56
LatencySessionAverage:37
LatencySessionAverage:7
LatencySessionAverage:1


Using perl, how do I get the Mean of all of the averages? Keep in mind, it may return a different amount of session each time.
Back to top
bballard



Joined: 19 Jan 2006
Posts: 35

PostPosted: Thu Mar 08, 2007 10:50 am    Post subject: Reply with quote

Okay found out how. See the post below.

http://forums.cacti.net/viewtopic.php?p=94048#94048
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group