<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Edgesight Under the Hood</title>
	<atom:link href="http://edgesightunderthehood.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://edgesightunderthehood.com</link>
	<description></description>
	<lastBuildDate>Wed, 15 Feb 2012 13:18:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='edgesightunderthehood.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Edgesight Under the Hood</title>
		<link>http://edgesightunderthehood.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://edgesightunderthehood.com/osd.xml" title="Edgesight Under the Hood" />
	<atom:link rel='hub' href='http://edgesightunderthehood.com/?pushpress=hub'/>
		<item>
		<title>ESUTH Poll</title>
		<link>http://edgesightunderthehood.com/2012/02/15/esuth-poll/</link>
		<comments>http://edgesightunderthehood.com/2012/02/15/esuth-poll/#comments</comments>
		<pubDate>Wed, 15 Feb 2012 13:17:58 +0000</pubDate>
		<dc:creator>John M. Smith</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://edgesightunderthehood.com/?p=421</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edgesightunderthehood.com&amp;blog=11422519&amp;post=421&amp;subd=edgesightunderthehood&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<a name="pd_a_5945510"></a><div class="PDS_Poll" id="PDI_container5945510" style="display:inline-block;"></div><div id="PD_superContainer"></div><noscript><a href="http://polldaddy.com/poll/5945510">Take Our Poll</a></noscript>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edgesightunderthehood.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edgesightunderthehood.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edgesightunderthehood.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edgesightunderthehood.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/edgesightunderthehood.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/edgesightunderthehood.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/edgesightunderthehood.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/edgesightunderthehood.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edgesightunderthehood.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edgesightunderthehood.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edgesightunderthehood.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edgesightunderthehood.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edgesightunderthehood.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edgesightunderthehood.wordpress.com/421/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edgesightunderthehood.com&amp;blog=11422519&amp;post=421&amp;subd=edgesightunderthehood&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://edgesightunderthehood.com/2012/02/15/esuth-poll/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7d875a10f43641d8674e1bc7c1fc8b9d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">John M. Smith</media:title>
		</media:content>
	</item>
		<item>
		<title>ESUTH Briforum Session now online</title>
		<link>http://edgesightunderthehood.com/2012/01/15/esuth-briforum-session-now-online/</link>
		<comments>http://edgesightunderthehood.com/2012/01/15/esuth-briforum-session-now-online/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 18:20:32 +0000</pubDate>
		<dc:creator>John M. Smith</dc:creator>
				<category><![CDATA[Advanced Persistent Threat]]></category>
		<category><![CDATA[Citrix SQL Queries]]></category>
		<category><![CDATA[Edge Sight]]></category>
		<category><![CDATA[EdgeSight]]></category>
		<category><![CDATA[Edgesight Custom Queries]]></category>
		<category><![CDATA[Edgesight Custom Reports]]></category>

		<guid isPermaLink="false">http://edgesightunderthehood.com/?p=414</guid>
		<description><![CDATA[My Briforum Session is online for anyone who wants to go check it out.  After viewing the session it appears I said &#8220;UH..&#8221; about 637 times?  Anyway it was a great experience and an honor to speak in front of so many talented individuals.  If you are curious of what I do when I go &#8230; <a href="http://edgesightunderthehood.com/2012/01/15/esuth-briforum-session-now-online/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edgesightunderthehood.com&amp;blog=11422519&amp;post=414&amp;subd=edgesightunderthehood&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:Helvetica;font-size:small;">My Briforum Session is online for anyone who wants to go check it out.  After viewing the session it appears I said &#8220;UH..&#8221; about 637 times?  Anyway it was a great experience and an honor to speak in front of so many talented individuals.  If you are curious of what I do when I go in and run queries you can watch this session and basically see how it&#8217;s done.  The session also has some custom queries show integrating malware and geospatial data with your Edgesight data to check for infected systems that your antivirus may have missed. </span></p>
<p>My presentation was somewhat hampered by being told I could not use any of my customer data in the presentation.  One of the hard tasks in teaching Edgesight is that most companies do not want their data made public so doing the presentation in a public forum was a bit tough.  This would be much easier if it were done in a corporate classroom using the customer&#8217;s data. </p>
<p>Anyway, please have a look, if you have never run a SQL query you will see some of that here.</p>
<p>Take care and thanks for watching.  I cannot recommend enough, attending Briforum, it is a true geek-to-geek, vender nuetral conference and was, hands down, the most informative virtualization conference I have ever gone to. </p>
<p>Thanks guys</p>
<p>John</p>
<p><a href="http://www.brianmadden.com/blogs/videos/archive/2011/08/16/edgesight-under-the-hood_2C00_-a-video-from-BriForum-2011.aspx">http://www.brianmadden.com/blogs/videos/archive/2011/08/16/edgesight-under-the-hood_2C00_-a-video-from-BriForum-2011.aspx</a></p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edgesightunderthehood.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edgesightunderthehood.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edgesightunderthehood.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edgesightunderthehood.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/edgesightunderthehood.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/edgesightunderthehood.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/edgesightunderthehood.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/edgesightunderthehood.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edgesightunderthehood.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edgesightunderthehood.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edgesightunderthehood.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edgesightunderthehood.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edgesightunderthehood.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edgesightunderthehood.wordpress.com/414/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edgesightunderthehood.com&amp;blog=11422519&amp;post=414&amp;subd=edgesightunderthehood&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://edgesightunderthehood.com/2012/01/15/esuth-briforum-session-now-online/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7d875a10f43641d8674e1bc7c1fc8b9d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">John M. Smith</media:title>
		</media:content>
	</item>
		<item>
		<title>Average Session Count by Day and Hour: The Report</title>
		<link>http://edgesightunderthehood.com/2011/08/17/average-session-count-by-day-and-hour-the-report/</link>
		<comments>http://edgesightunderthehood.com/2011/08/17/average-session-count-by-day-and-hour-the-report/#comments</comments>
		<pubDate>Wed, 17 Aug 2011 15:00:14 +0000</pubDate>
		<dc:creator>David Rowe</dc:creator>
				<category><![CDATA[custom edgesight reports]]></category>
		<category><![CDATA[EdgeSight]]></category>
		<category><![CDATA[Edgesight Custom Queries]]></category>
		<category><![CDATA[Edgesight Custom Reports]]></category>
		<category><![CDATA[Active Sessions]]></category>
		<category><![CDATA[Citrix]]></category>
		<category><![CDATA[Citrix Edgesight Reports]]></category>
		<category><![CDATA[Citrix SQL Queries]]></category>
		<category><![CDATA[Citrix SQL Reporting]]></category>
		<category><![CDATA[Users on Citrix Farm]]></category>

		<guid isPermaLink="false">http://edgesightunderthehood.com/?p=338</guid>
		<description><![CDATA[In my previous article: Average Session Count by Day and Hour: The Query,  I dove into a query that shows the number of sessions on a farm at any given hour.  Next, we go onto the creation of the report. For this I use SQL Server Business Intelligence Development Studio (BIDS).  To begin, I created &#8230; <a href="http://edgesightunderthehood.com/2011/08/17/average-session-count-by-day-and-hour-the-report/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edgesightunderthehood.com&amp;blog=11422519&amp;post=338&amp;subd=edgesightunderthehood&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In my previous article: <a href="http://wp.me/pLVwb-5p">Average Session Count by Day and Hour: The Query</a>,  I dove into a query that shows the number of sessions on a farm at any given hour.  Next, we go onto the creation of the <a href="http://edgesightunderthehood.files.wordpress.com/2011/08/session-count-by-date-and-hour3.doc">report</a>. For this I use SQL Server Business Intelligence Development Studio (BIDS).  To begin, I created a new report to contain a matrix which runs the query that I created above.  For this report to run in BIDS and EdgeSight, the entirety of the following should be placed in the query window:</p>
<p><pre class="brush: css;">
DECLARE @UTCNow DATETIME
DECLARE @LocalStartDate SMALLDATETIME
DECLARE @LocalEndDate SMALLDATETIME
DECLARE @CompId INTEGER
DECLARE @Filter INTEGER

SET @CompID = 1
SET @Filter = 1

SET @UTCNow = GETUTCDATE()
SET @LocalStartDate = dbo.udf_core_get_offset_date(1, @Start, 1, 0, @UTCNow)
SET @LocalEndDate = dbo.udf_core_get_offset_date(1, @End, 0, 0, @UTCNow)

SELECT     SUM(vw_ctrx_archive_system_perf.active_sessions_peak + vw_ctrx_archive_system_perf.inactive_sessions_peak) AS TotalSessions,
                      CONVERT(varchar(10), DATEADD(mi, timezone.standard_bias, vw_ctrx_archive_system_perf.time_stamp), 111) AS Date, CONVERT(varchar(10),
                      DATEADD(mi, timezone.standard_bias, vw_ctrx_archive_system_perf.time_stamp), 108) AS Time
FROM         vw_ctrx_archive_system_perf INNER JOIN
                      company ON vw_ctrx_archive_system_perf.compid = company.compid INNER JOIN
                      timezone ON company.tzid = timezone.tzid
GROUP BY vw_ctrx_archive_system_perf.time_stamp, timezone.standard_bias
HAVING      (DATEADD(mi, timezone.standard_bias, vw_ctrx_archive_system_perf.time_stamp) &gt;= @LocalStartDate) AND (DATEADD(mi, timezone.standard_bias,
                      vw_ctrx_archive_system_perf.time_stamp) &lt; DATEADD(d, 1, @LocalEndDate))
ORDER BY Date, Time
</pre></p>
<p>In the “Design the Matrix Wizard” Add Time2 to the Columns, Date to the Rows, and Total Sessions to the Details value.  Click finish.<br />
<a href="http://edgesightunderthehood.files.wordpress.com/2011/08/matrix-wizard.jpg"><img class="aligncenter size-full wp-image-356" title="BIDS Design Matrix" src="http://edgesightunderthehood.files.wordpress.com/2011/08/matrix-wizard.jpg?w=750" alt="Edgesight Matrix wizard"   /></a></p>
<p>The first necessary items that need to be added to the report in order for this report to run successfully are parameters.  On the data or layout tab of your new report, open the Report Parameters window.  Two parameters need to be added to the report “Start” and “End”.  They both need to be string values.  EdgeSight reads these parameters on the reports and allows you to choose what dates you want to run the report for.  Go ahead and preview the new report.  If it doesn’t work, take a break, watch an episode of Dexter, and be glad you work on computers, where everyone gets a second shot.  Let’s continue down the steps to making this a report with a bit more useful data.</p>
<p>In the rows where the Date is, I needed to add the day of the week to display days like the following: 8/1/2011 – Monday.  To do this I changed the formula for the cell to:  <strong>=Fields!Date.Value &amp; &#8221; &#8211; &#8221; &amp; WeekdayName(Weekday(Fields!Date.Value))</strong></p>
<p style="text-align:left;" align="right">In the columns where time2 resides I needed to show the hours and not show the integer.  I’m not a big VB guy and am still working on growing my coding.  For that reason I have change the cell to the impeccableformula of: <strong>=Fields!Time2.Value &amp; &#8220;:00:00&#8243;</strong>. This shows the hours of the day in military format.</p>
<p style="text-align:left;" align="right">Good enough for me.</p>
<p>In BIDS, to show the average of rows and columns, a bit of code needs to be added to the report.  In the Report Layout window, you can add the subtotals to the rows and columns by simply right clicking on any row and column and selecting “Subtotal”.  BIDS will add a new row or column to your report that shows the subtotal of the row or column.  The problem is that BIDS 2005, I don’t know about any newer version, only subtotals are shown and not the average.  To show the average of the columns instead of the subtotals, open the “report properties” and go to the code tab.  Based on a how-to from <a href="http://blog.boxedbits.com/archives/84">All About Business Intelligence</a> add the following code:</p>
<p><pre class="brush: css;">
Public Function MatrixCellValue(ByVal sumValue As Object, ByVal avgValue As Object, ByVal InScope As Boolean, ByVal sumFormat As String, ByVal avgFormat As String) As Object
        If InScope Then
            Return sumValue
        Else
            If Not avgValue Is Nothing Then
                Return String.Format(avgFormat, CDbl(avgValue))
            Else
                Return Nothing
            End If
        End If
    End Function
</pre></p>
<p>Next you have to change the details cell to the following code:</p>
<p><pre class="brush: css;">

=Code.MatrixCellValue(
Sum(Fields!TotalSessions.Value),
Avg(Fields!TotalSessions.Value),
InScope(&quot;matrix1_Date&quot;) and InScope(&quot;matrix1_Time&quot;),
&quot;{0,6:N0}&quot;,
&quot;{0,6:N1}&quot;)
</pre></p>
<p>Go ahead and preview the new results of your report.</p>
<p>After a few aesthetic changes, you can find an example data output of my finished report here:<br />
<a href="http://edgesightunderthehood.files.wordpress.com/2011/08/session-count-by-date-and-hour3.doc">Download &#8211; Session Count by Date and Hour</a> &#8211; Please note that this file is set to a .doc and needs to be renamed to a .rdl in order to be uploaded into EdgeSight.</p>
<p>***Update 8/19/11 &#8211; I did some playing around with this report and query and have noticed that I only applied the timezone offset to the time and not the date structure.  If a user runs the report on GMT-5:00, then instead of Friday 7:00PM showing up as the time, it will show Saturday 7:00PM.  I am correcting the query as soon as I can, and will update this post and the report once it is corrected.</p>
<p>****Update 8/20/11 &#8211; I fixed the query and the report.  The new version of the report converts time correctly.  You can <a href="http://edgesightunderthehood.files.wordpress.com/2011/08/session-count-by-date-and-hour3.doc">download it here</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edgesightunderthehood.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edgesightunderthehood.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edgesightunderthehood.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edgesightunderthehood.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/edgesightunderthehood.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/edgesightunderthehood.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/edgesightunderthehood.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/edgesightunderthehood.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edgesightunderthehood.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edgesightunderthehood.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edgesightunderthehood.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edgesightunderthehood.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edgesightunderthehood.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edgesightunderthehood.wordpress.com/338/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edgesightunderthehood.com&amp;blog=11422519&amp;post=338&amp;subd=edgesightunderthehood&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://edgesightunderthehood.com/2011/08/17/average-session-count-by-day-and-hour-the-report/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/80ec4287227acee0900b66b1014daa9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">davidprowe</media:title>
		</media:content>

		<media:content url="http://edgesightunderthehood.files.wordpress.com/2011/08/matrix-wizard.jpg" medium="image">
			<media:title type="html">BIDS Design Matrix</media:title>
		</media:content>
	</item>
		<item>
		<title>Average Session Count by Day and Hour: The Query</title>
		<link>http://edgesightunderthehood.com/2011/08/17/average-session-count-by-day-and-hour-the-query/</link>
		<comments>http://edgesightunderthehood.com/2011/08/17/average-session-count-by-day-and-hour-the-query/#comments</comments>
		<pubDate>Wed, 17 Aug 2011 13:00:02 +0000</pubDate>
		<dc:creator>David Rowe</dc:creator>
				<category><![CDATA[Citrix SQL Queries]]></category>
		<category><![CDATA[EdgeSight]]></category>
		<category><![CDATA[Edgesight Custom Queries]]></category>
		<category><![CDATA[Citrix]]></category>
		<category><![CDATA[Citrix Edgesight Reports]]></category>
		<category><![CDATA[Citrix SQL Reporting]]></category>
		<category><![CDATA[custom edgesight reports]]></category>
		<category><![CDATA[MS SQL]]></category>
		<category><![CDATA[Sessions on Farm]]></category>
		<category><![CDATA[Users on Farm]]></category>

		<guid isPermaLink="false">http://edgesightunderthehood.com/?p=335</guid>
		<description><![CDATA[A common support question that my clients have asked is, “On what days of the week do we have the greatest number of people in the system?”  Or &#8220;How many users do we have on the farm?&#8221; The User Logon Counts report in EdgeSight helps you see the total number of session for each day &#8230; <a href="http://edgesightunderthehood.com/2011/08/17/average-session-count-by-day-and-hour-the-query/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edgesightunderthehood.com&amp;blog=11422519&amp;post=335&amp;subd=edgesightunderthehood&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://edgesightunderthehood.files.wordpress.com/2011/08/session-count-by-hour1.jpg"><br />
</a>A common support question that my clients have asked is, “On what days of the week do we have the greatest number of people in the system?”  Or &#8220;How many users do we have on the farm?&#8221; The User Logon Counts report in EdgeSight helps you see the total number of session for each day or device, but this report doesn&#8217;t really have the answer I was looking for.  What I needed was a <a href="http://edgesightunderthehood.files.wordpress.com/2011/08/session-count-by-date-and-hour3.doc">report </a>that showed the number of sessions on my farm for each hour of the day. In order to do this, I needed not only a query but a report that could get me the requested information.</p>
<div>
<p>The first part of this solution was to create the query that will be used in the report.  This query I decided on was a combination of a standard view provided by Citrix in EdgeSight: vw_ctrx_archive_system_perf, and two tables; Company and Timezone.  You will find the query below (please note that if you run this query in SQL, you must input a start and end time for data to be returned):</p>
</div>
<p><pre class="brush: css;">
SELECT     SUM(vw_ctrx_archive_system_perf.active_sessions_peak + vw_ctrx_archive_system_perf.inactive_sessions_peak) AS TotalSessions, 
                      CONVERT(varchar(10), DATEADD(mi, timezone.standard_bias, vw_ctrx_archive_system_perf.time_stamp), 111) AS Date, CONVERT(varchar(10), 
                      DATEADD(mi, timezone.standard_bias, vw_ctrx_archive_system_perf.time_stamp), 108) AS Time
FROM         vw_ctrx_archive_system_perf INNER JOIN
                      company ON vw_ctrx_archive_system_perf.compid = company.compid INNER JOIN
                      timezone ON company.tzid = timezone.tzid
GROUP BY vw_ctrx_archive_system_perf.time_stamp, timezone.standard_bias
HAVING      (DATEADD(mi, timezone.standard_bias, vw_ctrx_archive_system_perf.time_stamp) &gt;= @LocalStartDate) AND (DATEADD(mi, timezone.standard_bias, 
                      vw_ctrx_archive_system_perf.time_stamp) &lt; DATEADD(d, 1, @LocalEndDate))
ORDER BY Date, Time
</pre></p>
<p>Lets talk about the output real fast:</p>
<p><a href="http://edgesightunderthehood.files.wordpress.com/2011/08/session-count-by-hour1.jpg"><img class="aligncenter" title="Session Count by Hour" src="http://edgesightunderthehood.files.wordpress.com/2011/08/session-count-by-hour1.jpg?w=541&#038;h=317" alt="" width="541" height="317" /></a></p>
<p>The first column of data is labeled &#8220;TotalSessions&#8221;.   This data combines the total number of inactive and active sessions for any given hour of the day.  Since we want the total number of Citrix sessions on the farm and not just the active sessions,  I needed to combine both the inactive and active sessions.</p>
<p>The second column of data is the Date:  The dataset’s date is split out of the vw_ctrx_archive_system_perf.time_stamp data field to supply you with only the YYYY/MM/DD value.  This is much easier to use in the report that we are going to be creating.</p>
<p>The third column of data Time:  This is the hour of the day in GMT that the data is recorded for.  If you are on east coast time (-5), and the Time column says 00:00:00, your local time is 7:00 PM.  Because we don’t want out times to show up in GMT, we have to connect the company and timezone tables to calculate the correct time of the day, which show up in the fourth column</p>
<p>The fourth column of data is Time2: This column shows the time of the day with integers.  This data is converted to your timezone (but does not adjust for DST.  I will try to spend some time to work on DST at a later date).</p>
<p>Before I go any further with this data and creating a report, we have to dive into the grooming policies in EdgeSight.  Because this query runs off vw_ctrx_archive_system_perf, the data is subject to the EdgeSight grooming policy.  By default, this view is groomed to only hold 30 days of data.  This is an out of the box nightmare.   As most of the general public knows, are at least one or two months in the year with more than 30 days in them.  For this reason we are going to update the grooming policy to groom every 45 days.  Why 45? So that you can run this report on last month’s data, and it can be ran up to 14 days into the current month and still pull last month’s data..</p>
<p>To update this grooming policy: In EdgeSight go to Configure: Server Configuration: Data Maintenance: Grooming.  The policy that you will need to adjust is the one on the very bottom called: XenApp System Performance: ctrx_system_perf:  vw_ctrx_archive_system_perf.</p>
<p><a href="http://edgesightunderthehood.files.wordpress.com/2011/08/vw_ctrx_archive_system_perf.jpg"><img class="aligncenter size-full wp-image-354" title="vw_ctrx_archive_system_perf" src="http://edgesightunderthehood.files.wordpress.com/2011/08/vw_ctrx_archive_system_perf.jpg?w=750&#038;h=65" alt="" width="750" height="65" /></a></p>
<p>As stated earlier, I put this figure on 45.  You can do more, but note that the view will hold more data in your EdgeSight Database.  Tune this as you see fit.</p>
<p>Please follow up with <a href="http://edgesightunderthehood.com/2011/08/16/average-session-count-by-day-and-hour-the-report">my next article</a> to the creation of the Average Session Count by Day and Time report.</p>
<p>Or&#8230; if you would rather just play with the report and don&#8217;t feel like reading any more, <a href="http://edgesightunderthehood.files.wordpress.com/2011/08/session-count-by-date-and-hour3.doc">Download the Report here</a>.  Simply rename the file to a .rdl and upload it to your custom reports on your EdgeSight web server!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edgesightunderthehood.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edgesightunderthehood.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edgesightunderthehood.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edgesightunderthehood.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/edgesightunderthehood.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/edgesightunderthehood.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/edgesightunderthehood.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/edgesightunderthehood.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edgesightunderthehood.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edgesightunderthehood.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edgesightunderthehood.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edgesightunderthehood.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edgesightunderthehood.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edgesightunderthehood.wordpress.com/335/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edgesightunderthehood.com&amp;blog=11422519&amp;post=335&amp;subd=edgesightunderthehood&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://edgesightunderthehood.com/2011/08/17/average-session-count-by-day-and-hour-the-query/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/80ec4287227acee0900b66b1014daa9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">davidprowe</media:title>
		</media:content>

		<media:content url="http://edgesightunderthehood.files.wordpress.com/2011/08/session-count-by-hour1.jpg" medium="image">
			<media:title type="html">Session Count by Hour</media:title>
		</media:content>

		<media:content url="http://edgesightunderthehood.files.wordpress.com/2011/08/vw_ctrx_archive_system_perf.jpg" medium="image">
			<media:title type="html">vw_ctrx_archive_system_perf</media:title>
		</media:content>
	</item>
		<item>
		<title>Finding Users On Your Network, Using PC&#8217;s, and Running a Certain Application</title>
		<link>http://edgesightunderthehood.com/2011/08/10/finding-users-on-your-network-using-pcs-and-running-a-certain-application/</link>
		<comments>http://edgesightunderthehood.com/2011/08/10/finding-users-on-your-network-using-pcs-and-running-a-certain-application/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 14:00:07 +0000</pubDate>
		<dc:creator>Alain</dc:creator>
				<category><![CDATA[Edge Sight]]></category>
		<category><![CDATA[EdgeSight]]></category>
		<category><![CDATA[Edgesight Custom Queries]]></category>

		<guid isPermaLink="false">https://edgesightunderthehood.wordpress.com/?p=330</guid>
		<description><![CDATA[Intro Recently I was asked to determine which users were using a certain application in our Citrix Farm.&#160; We are using a published desktop and while EdgeSight has reports to show published applications, few built-in reports to show what users are running in their session.&#160; In addition, I was only looking for users who were &#8230; <a href="http://edgesightunderthehood.com/2011/08/10/finding-users-on-your-network-using-pcs-and-running-a-certain-application/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edgesightunderthehood.com&amp;blog=11422519&amp;post=330&amp;subd=edgesightunderthehood&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Intro</strong></p>
<p>Recently I was asked to determine which users were using a certain application in our Citrix Farm.&nbsp; We are using a published desktop and while EdgeSight has reports to show published applications, few built-in reports to show what users are running in their session.&nbsp; In addition, I was only looking for users who were on our internal network and not using a thin client.&nbsp; Unless your network team has created a very segregated network, and you have set up user groups based on various subnets and devices, this sort of information is impossible to pull out of EdgeSight.&nbsp;&nbsp; In this post I will show you a query that gathers this information.</p>
<p><strong>The Query</strong></p>
<p><pre class="brush: sql;">
DECLARE @today datetime 
DECLARE @app varchar(20) 
SET @today = convert(varchar,getdate(),111) 
SET @app = 'notepad.exe' 
SELECT DISTINCT CONVERT(VARCHAR(10),DATEADD(hh,-4,apptbl.time_stamp), 111) AS 'Date', serv.machine_name AS 'Server', serv.[user] AS 'Username', serv.client_name, serv.client_address, serv.client_version, icatbl.client_directory, apptbl.app_description, apptbl.exe_name, apptbl.exe_version 
FROM vw_es_archive_application_usage apptbl, vw_ctrx_archive_server_start_perf serv, vw_es_usergroup_ica_users icatbl 
WHERE apptbl.exe_name like '%'+@app+'%' 
and apptbl.account_name &lt;&gt; 'UNKNOWN' 
and serv.client_address not like '192%' 
and icatbl.client_directory not like '\%' 
and convert(varchar(10),dateadd(hh,-4,apptbl.time_stamp), 111) &gt;= @today-30 
and apptbl.sessid = serv.sessid and icatbl.sessid = serv.sessid 
and CONVERT(VARCHAR(10),DATEADD(hh,-4,apptbl.time_stamp), 111) = CONVERT(VARCHAR(10),DATEADD(hh,-4,serv.time_stamp), 111) 
ORDER BY CONVERT(VARCHAR(10),DATEADD(hh,-4,apptbl.time_stamp), 111), 'username' 
</pre></p>
<p><strong>The Query Explained</strong></p>
<p>Let’s review the criteria we are looking for in this query:</p>
<ol>
<li>Users accessing a certain application</li>
<li>Users who are not using thin clients</li>
<li>Users who are on the internal LAN</li>
</ol>
<p>To gather this information, I’m using 3 different views in the EdgeSight database:</p>
<ol>
<li>vw_es_archive_application_usage &#8211; aliased as “apptbl”
<ul>
<li>This will give me Application Description, the EXE name, the EXE version</li>
</ul>
</li>
<li>vw_ctrx_archive_server_start_perf &#8211; aliased as “serv”
<ul>
<li>This will give me the XenApp server, the Username, the Client Name, IP Address, and ICA Version</li>
</ul>
</li>
<li>vw_es_usergroup_ica_users &#8211; aliased as “icatbl”
<ul>
<li>This will give me the ICA Client Directory</li>
</ul>
</li>
</ol>
<p>These 3 views will be linked by the SESSID (session id) column with is present in all the views.</p>
<p><pre class="brush: sql; light: true;">
and apptbl.sessid = serv.sessid and icatbl.sessid = serv.sessid
</pre></p>
<p>First we declare some variables and assign them values:</p>
<p><pre class="brush: sql; light: true;">
DECLARE @today datetime
DECLARE @app varchar(20)
SET @today = convert(varchar,getdate(),111)
SET @app = 'notepad.exe'
</pre></p>
<p>If you have the several requests with different criteria you can declare some variables to help you.&nbsp; In this case, I’ve created a variable called @app that I can set to any executable that I’m reporting on. To refer to this variable in the query, I use it in the WHERE clause using a LIKE operator and a regular expression.</p>
<p><pre class="brush: sql; light: true;">
WHERE apptbl.exe_name like '%'+@app+'%'
</pre></p>
<p>The rest of the WHERE clause helps us find the users we are looking for.</p>
<p><pre class="brush: sql; light: true;"> 
and apptbl.account_name &lt;&gt; 'UNKNOWN' 
and serv.client_address not like '192%' 
and icatbl.client_directory not like '\%' 
and convert(varchar(10),dateadd(hh,-4,apptbl.time_stamp), 111) &gt;= @today-30 
and apptbl.sessid = serv.sessid and icatbl.sessid = serv.sessid 
and CONVERT(VARCHAR(10),DATEADD(hh,-4,apptbl.time_stamp), 111) = CONVERT(VARCHAR(10),DATEADD(hh,-4,serv.time_stamp), 111) 
</pre></p>
<p>I have filtered out user IP addresses that start with “192” as this is typical of home-based routers.&nbsp; Obviously, you can modify this to reflect your own network.&nbsp; To filter out thin-clients, I’m not selecting any client directories that start with “\”.&nbsp; I’ve found that thin clients (in my case Wyse) have file systems that begin with a “\” and you can refer to my post that covered finding non-PC devices in EdgeSight <a href="http://edgesightunderthehood.com/2011/07/06/reporting-on-non-pc-devices/">here</a>. Finally, I’m only looking at entries for the past 30 days, where the sessid’s match, and where the time_stamps match.</p>
<p>I always welcome comments and questions.</p>
<p><em>Thanks,<br />
Alain</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edgesightunderthehood.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edgesightunderthehood.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edgesightunderthehood.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edgesightunderthehood.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/edgesightunderthehood.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/edgesightunderthehood.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/edgesightunderthehood.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/edgesightunderthehood.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edgesightunderthehood.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edgesightunderthehood.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edgesightunderthehood.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edgesightunderthehood.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edgesightunderthehood.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edgesightunderthehood.wordpress.com/330/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edgesightunderthehood.com&amp;blog=11422519&amp;post=330&amp;subd=edgesightunderthehood&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://edgesightunderthehood.com/2011/08/10/finding-users-on-your-network-using-pcs-and-running-a-certain-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c8719d9ad0f43dd188f6400b3d534b87?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Alain</media:title>
		</media:content>
	</item>
		<item>
		<title>EdgeSight: BRIFORUM Content</title>
		<link>http://edgesightunderthehood.com/2011/07/23/edgesight-briforum-content/</link>
		<comments>http://edgesightunderthehood.com/2011/07/23/edgesight-briforum-content/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 15:02:55 +0000</pubDate>
		<dc:creator>John M. Smith</dc:creator>
				<category><![CDATA[Edge Sight]]></category>
		<category><![CDATA[EdgeSight]]></category>
		<category><![CDATA[Edgesight Custom Queries]]></category>
		<category><![CDATA[Citrix]]></category>
		<category><![CDATA[MS SQL]]></category>
		<category><![CDATA[MSSQL]]></category>

		<guid isPermaLink="false">http://edgesightunderthehood.com/?p=279</guid>
		<description><![CDATA[Intro To everyone who attended my session at Briforum, thank you.  It was an honor to present and to meet so many Virtualization rock stars.  As promised, I am posting most of the content from my presentation at Briforum.  There were a few new queries that were not yet part of the site in addition &#8230; <a href="http://edgesightunderthehood.com/2011/07/23/edgesight-briforum-content/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edgesightunderthehood.com&amp;blog=11422519&amp;post=279&amp;subd=edgesightunderthehood&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><img class="alignright" src="http://www.brianmadden.com/Themes/bmtheme/images/briforum230.jpg" alt="" width="230" height="132" />Intro</strong><br />
To everyone who attended my session at Briforum, thank you.  It was an honor to present and to meet so many Virtualization rock stars.  As promised, I am posting most of the content from my presentation at Briforum.  There were a few new queries that were not yet part of the site in addition to a few that I did not have time to get to.  Also, I meant what I said about converting ESUTH to a forum so that we can have multiple authors.  If you have some good Edgesight Queries to share, let me know and I will make you an author on the site!</p>
<p><strong>Holistic Query<br />
</strong>This query is designed to give you your basic system performance including Memory and Disk Queue.  You can use this to query specific metrics of a system during a reporting period (by hour).  The only value you have to manually enter is the date in the format you see above.  You will take the &#8220;Machine Name&#8221; and &#8220;Time Stamp&#8221; column values and enter them into the query below to get more detail.</p>
<p>The Query:</p>
<p><pre class="brush: sql; gutter: false;">
select machine_name, dateadd(hh,-5,time_stamp), disk_time_sum/disk_time_cnt as &quot;Disk Time&quot;, total_processor_time_sum/total_processor_time_cnt as &quot;Processor Time&quot;,
(committed_Kbytes_sum/committed_kbytes_cnt)/1000.0 as &quot;Committed memory&quot;, Context_switches_sec_sum/Context_switches_sec_cnt as &quot;Context Switches&quot;,
current_disk_queue_length_sum/current_disk_queue_length_cnt as &quot;Disk Queue Length&quot;
from c3edgesight.citgop_edgesightxa.dbo.vw_es_archive_system_performance
where  machine_name like '%ComputerName%'
and CONVERT(varchar(10),dateadd(hh,-5,time_stamp),101) = '07/14/2011'
order by dateadd(hh,-5,time_stamp)
</pre></p>
<p>Gives us:</p>
<table width="697" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="121"><strong>machine_name</strong></td>
<td valign="top" width="119"><strong>Time</strong></td>
<td valign="top" width="79"><strong>Disk Time</strong></td>
<td valign="top" width="121"><strong>Processor Time</strong></td>
<td valign="top" width="92"><strong>Committed memory</strong></td>
<td valign="top" width="87"><strong>Context Switches</strong></td>
<td valign="top" width="79"><strong>Disk Queue Length</strong></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="121">SVR-DS81</td>
<td valign="bottom" nowrap="nowrap" width="119">7/14/11 13:00</td>
<td valign="bottom" nowrap="nowrap" width="79">0.2470124</td>
<td valign="bottom" nowrap="nowrap" width="121">6.543246415</td>
<td valign="bottom" nowrap="nowrap" width="92">4140.62</td>
<td valign="bottom" nowrap="nowrap" width="87">9686</td>
<td valign="bottom" nowrap="nowrap" width="79">0</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="121">SVR-DS66</td>
<td valign="bottom" nowrap="nowrap" width="119">7/14/11 13:00</td>
<td valign="bottom" nowrap="nowrap" width="79">0.1102058</td>
<td valign="bottom" nowrap="nowrap" width="121">26.54753931</td>
<td valign="bottom" nowrap="nowrap" width="92">2491.53</td>
<td valign="bottom" nowrap="nowrap" width="87">3814</td>
<td valign="bottom" nowrap="nowrap" width="79">0</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="121">SVR-DS68</td>
<td valign="bottom" nowrap="nowrap" width="119">7/14/11 13:00</td>
<td valign="bottom" nowrap="nowrap" width="79">0.2426049</td>
<td valign="bottom" nowrap="nowrap" width="121">5.727161964</td>
<td valign="bottom" nowrap="nowrap" width="92">3956.425</td>
<td valign="bottom" nowrap="nowrap" width="87">9090</td>
<td valign="bottom" nowrap="nowrap" width="79">0</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="121">SVR-DS69</td>
<td valign="bottom" nowrap="nowrap" width="119">7/14/11 13:00</td>
<td valign="bottom" nowrap="nowrap" width="79">0.140912</td>
<td valign="bottom" nowrap="nowrap" width="121">3.041551342</td>
<td valign="bottom" nowrap="nowrap" width="92">4347.409</td>
<td valign="bottom" nowrap="nowrap" width="87">8636</td>
<td valign="bottom" nowrap="nowrap" width="79">0</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="121">SVR-DS83</td>
<td valign="bottom" nowrap="nowrap" width="119">7/14/11 13:00</td>
<td valign="bottom" nowrap="nowrap" width="79">0.2029572</td>
<td valign="bottom" nowrap="nowrap" width="121">4.014888507</td>
<td valign="bottom" nowrap="nowrap" width="92">4259.335</td>
<td valign="bottom" nowrap="nowrap" width="87">7362</td>
<td valign="bottom" nowrap="nowrap" width="79">0</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="121">SVR-DS67</td>
<td valign="bottom" nowrap="nowrap" width="119">7/14/11 13:00</td>
<td valign="bottom" nowrap="nowrap" width="79">0.1474974</td>
<td valign="bottom" nowrap="nowrap" width="121">29.02722529</td>
<td valign="bottom" nowrap="nowrap" width="92">3434.519</td>
<td valign="bottom" nowrap="nowrap" width="87">6479</td>
<td valign="bottom" nowrap="nowrap" width="79">0</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="121">SVR-DS80</td>
<td valign="bottom" nowrap="nowrap" width="119">7/14/11 13:00</td>
<td valign="bottom" nowrap="nowrap" width="79">0.1451845</td>
<td valign="bottom" nowrap="nowrap" width="121">3.177582946</td>
<td valign="bottom" nowrap="nowrap" width="92">4403.747</td>
<td valign="bottom" nowrap="nowrap" width="87">8482</td>
<td valign="bottom" nowrap="nowrap" width="79">0</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="121">SVR-DS74</td>
<td valign="bottom" nowrap="nowrap" width="119">7/14/11 13:00</td>
<td valign="bottom" nowrap="nowrap" width="79">0.1923944</td>
<td valign="bottom" nowrap="nowrap" width="121">3.841824931</td>
<td valign="bottom" nowrap="nowrap" width="92">4391.01</td>
<td valign="bottom" nowrap="nowrap" width="87">7557</td>
<td valign="bottom" nowrap="nowrap" width="79">0</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="121">SVR-DS78</td>
<td valign="bottom" nowrap="nowrap" width="119">7/14/11 13:00</td>
<td valign="bottom" nowrap="nowrap" width="79">0.1418489</td>
<td valign="bottom" nowrap="nowrap" width="121">2.496465329</td>
<td valign="bottom" nowrap="nowrap" width="92">4249.419</td>
<td valign="bottom" nowrap="nowrap" width="87">6625</td>
<td valign="bottom" nowrap="nowrap" width="79">0</td>
</tr>
</tbody>
</table>
<p><strong><br />
Drilling Down:<br />
</strong>So, if looking at the results of the query above uncovers an issue of high CPU, RAM or Disk Que you can drill down with the following query.  In this example we will copy the Machine_name column and Time_Stamp column and paste them in between the single quotes to populate the variable.  So we will copy SVR-DS81 and 2011-07-14 13:00:00.000 which will give us a list of every processor owned by every user on the system during that reporting period.</p>
<p><pre class="brush: sql;">
declare @MachineName nvarchar (255)
declare @timestamp datetime
set @MachineName= 'SVR-DS81'
set @timestamp = '2011-07-14 13:00:00.000'
select account_name, exe_name, App_description, total_processor_time_sum/total_processor_time_cnt as &quot;Processor Time&quot;,(Private_kbytes_sum/private_kbytes_cnt)/1000 as &quot;Private Memory(megs)&quot;, pages_sec_sum/Pages_sec_cnt as &quot;Pages/Sec&quot;
from vw_es_archive_application_performance
where DATEADD(hh,-5,time_stamp) = @timestamp
and machine_name = @MachineName
order by &quot;pages/sec&quot; desc
</pre></p>
<table width="703" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="121"><strong>account_name</strong></td>
<td valign="top" width="119"><strong>exe_name</strong></td>
<td valign="top" width="193"><strong>App_description</strong></td>
<td valign="top" width="75"><strong>Processor Time</strong></td>
<td valign="top" width="108"><strong>Private Memory(megs)</strong></td>
<td valign="top" width="87"><strong>Pages/Sec</strong></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="121">JSmith</td>
<td valign="bottom" nowrap="nowrap" width="119">Excel.exe</td>
<td valign="bottom" nowrap="nowrap" width="193">Microsoft Office Excel</td>
<td valign="bottom" nowrap="nowrap" width="75">0.00021222</td>
<td valign="bottom" nowrap="nowrap" width="108">194</td>
<td valign="bottom" nowrap="nowrap" width="87">2</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="121">FJones</td>
<td valign="bottom" nowrap="nowrap" width="119">Outlook.exe</td>
<td valign="bottom" nowrap="nowrap" width="193">Microsoft Office Outlook</td>
<td valign="bottom" nowrap="nowrap" width="75">1.12339166</td>
<td valign="bottom" nowrap="nowrap" width="108">91</td>
<td valign="bottom" nowrap="nowrap" width="87">60</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="121">SStills</td>
<td valign="bottom" nowrap="nowrap" width="119">Cutefiller.exe</td>
<td valign="bottom" nowrap="nowrap" width="193">CutePDF Form Filler</td>
<td valign="bottom" nowrap="nowrap" width="75">1.66994562</td>
<td valign="bottom" nowrap="nowrap" width="108">87</td>
<td valign="bottom" nowrap="nowrap" width="87">127</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="121">NYoung</td>
<td valign="bottom" nowrap="nowrap" width="119">Wfica32.exe</td>
<td valign="bottom" nowrap="nowrap" width="193">Citrix</td>
<td valign="bottom" nowrap="nowrap" width="75">0.00010988</td>
<td valign="bottom" nowrap="nowrap" width="108">83</td>
<td valign="bottom" nowrap="nowrap" width="87">0</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="121">SPickens</td>
<td valign="bottom" nowrap="nowrap" width="119">Outlook.exe</td>
<td valign="bottom" nowrap="nowrap" width="193">Microsoft Office Outlook</td>
<td valign="bottom" nowrap="nowrap" width="75">0.05320751</td>
<td valign="bottom" nowrap="nowrap" width="108">79</td>
<td valign="bottom" nowrap="nowrap" width="87">14</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="121">CWebster</td>
<td valign="bottom" nowrap="nowrap" width="119">Wfica32.exe</td>
<td valign="bottom" nowrap="nowrap" width="193">Citrix</td>
<td valign="bottom" nowrap="nowrap" width="75">0.01940179</td>
<td valign="bottom" nowrap="nowrap" width="108">78</td>
<td valign="bottom" nowrap="nowrap" width="87">0</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="121">SBASS</td>
<td valign="bottom" nowrap="nowrap" width="119">Outlook.exe</td>
<td valign="bottom" nowrap="nowrap" width="193">Microsoft Office Outlook</td>
<td valign="bottom" nowrap="nowrap" width="75">2.86540794</td>
<td valign="bottom" nowrap="nowrap" width="108">65</td>
<td valign="bottom" nowrap="nowrap" width="87">99</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="121">SYSTEM</td>
<td valign="bottom" nowrap="nowrap" width="119">Pmagent.exe</td>
<td valign="bottom" nowrap="nowrap" width="193">Performance Manager Agent</td>
<td valign="bottom" nowrap="nowrap" width="75">0.13332299</td>
<td valign="bottom" nowrap="nowrap" width="108">47</td>
<td valign="bottom" nowrap="nowrap" width="87">44</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="121">Jsmith</td>
<td valign="bottom" nowrap="nowrap" width="119">Outlook.exe</td>
<td valign="bottom" nowrap="nowrap" width="193">Microsoft Office Outlook</td>
<td valign="bottom" nowrap="nowrap" width="75">0.00087658</td>
<td valign="bottom" nowrap="nowrap" width="108">45</td>
<td valign="bottom" nowrap="nowrap" width="87">0</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="121">SYSTEM</td>
<td valign="bottom" nowrap="nowrap" width="119">Icalm server.exe</td>
<td valign="bottom" nowrap="nowrap" width="193">iCALM Server</td>
<td valign="bottom" nowrap="nowrap" width="75">0.01223421</td>
<td valign="bottom" nowrap="nowrap" width="108">44</td>
<td valign="bottom" nowrap="nowrap" width="87">3</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="121">DFeller</td>
<td valign="bottom" nowrap="nowrap" width="119">Explorer.exe</td>
<td valign="bottom" nowrap="nowrap" width="193">Windows Explorer</td>
<td valign="bottom" nowrap="nowrap" width="75">0.12927156</td>
<td valign="bottom" nowrap="nowrap" width="108">43</td>
<td valign="bottom" nowrap="nowrap" width="87">27</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="121">JOlsen</td>
<td valign="bottom" nowrap="nowrap" width="119">Outlook.exe</td>
<td valign="bottom" nowrap="nowrap" width="193">Microsoft Office Outlook</td>
<td valign="bottom" nowrap="nowrap" width="75">0.51810852</td>
<td valign="bottom" nowrap="nowrap" width="108">43</td>
<td valign="bottom" nowrap="nowrap" width="87">142</td>
</tr>
</tbody>
</table>
<p><strong>How long did a user&#8217;s session last:<br />
</strong>So this is one of my cross-tab queries that you can copy and paste and just change the username for.  This will give you the date, sessoin ID, logon and logoff time as well as the length of the session for a specific user.  In this instance I am NOT pulling data from the views, rather I am pulling the data from two tables, the session table and the principal table.  This query can be handy when you are trying to audit the time a user is on the system.</p>
<p><strong>The Query:<br />
</strong></p>
<p><pre class="brush: sql;">
declare @today datetime
set @today = convert(varchar(10),getdate(),111)
select convert(varchar(10),dateadd(hh,-5,logon_time),111), inst_sessid, dateadd(hh,-5,logon_time),
dateadd(hh,-5,logoff_time),
convert(varchar,floor(datediff(mi,dateadd(hh,-5,logon_time) , dateadd(hh,-5,Logoff_time))/60))+ ':' +Right('0' + convert(varchar,datediff(mi,dateadd(hh,-5,logon_time) , dateadd(hh,-5,Logoff_time)) % 60), 2) as HrMinfrom session s, principal p
where convert(varchar(10),dateadd(hh,-5,logon_time),111) &gt; @today-30
and account_name = '%AccountName%'
and p.prid = s.prid
</pre></p>
<p><strong>Average Start/End Time:<br />
</strong>The idea for this Query came about after listening to Chris Nickerson (one of the top Social Engineers in the world) discuss how, as part of penetration testing, they can call a helpdesk and try to get them to change a passoword after finding a  user ID for a particular company.  I tend to think of this query as a social engineering counter measure.  What it gives me is the average logon and logoff time for a particular user.  How this can be valuable would be if you could set it up as part of the helpdesk solution so that when someone calls in, the helpdesk knows the average logon and logoff time for the person they are talking to.  If a person who normally works M-F 8AM to 5PM calls in at 2:15AM wanting to change their password, the helpdesk technician can maybe ask a few more questions or be more alerted to a possible social engineering attempt.  This query is still not entirely vetted but as I have changed employers, I may not get a chance to vet it further.  I have noticed it is accurate for standard users but for Admins who may have that &#8220;special&#8221; ICA Timeout, it my show some skewed results because lets face it, we are on the system pretty much 24&#215;7.  This query gives the average logon and logoff time for the last 7 days.</p>
<p><strong>The Query:<br />
</strong></p>
<p><pre class="brush: sql; gutter: false;">
select account_name, right(convert(varchar(20),(cast(AVG(cast(dateadd(hh,-5,logon_time)as float) - floor (cast(dateadd(hh,-5,logon_time) as float)))as datetime)),100),7),
right(convert(varchar(20),(cast(AVG(cast(dateadd(hh,-5,logoff_time)as float) - floor(cast(dateadd(hh,-5,logoff_time) as float)))as datetime)),100),7)
from session] s, principal p
where s.prid = p.prid
and account_name = '%UserName%'
and  dateadd(hh,-5,logon_time) &gt;= GETDATE()-7
group by account_name
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edgesightunderthehood.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edgesightunderthehood.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edgesightunderthehood.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edgesightunderthehood.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/edgesightunderthehood.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/edgesightunderthehood.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/edgesightunderthehood.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/edgesightunderthehood.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edgesightunderthehood.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edgesightunderthehood.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edgesightunderthehood.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edgesightunderthehood.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edgesightunderthehood.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edgesightunderthehood.wordpress.com/279/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edgesightunderthehood.com&amp;blog=11422519&amp;post=279&amp;subd=edgesightunderthehood&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://edgesightunderthehood.com/2011/07/23/edgesight-briforum-content/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7d875a10f43641d8674e1bc7c1fc8b9d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">John M. Smith</media:title>
		</media:content>

		<media:content url="http://www.brianmadden.com/Themes/bmtheme/images/briforum230.jpg" medium="image" />
	</item>
		<item>
		<title>Reporting On Non-PC Devices</title>
		<link>http://edgesightunderthehood.com/2011/07/06/reporting-on-non-pc-devices/</link>
		<comments>http://edgesightunderthehood.com/2011/07/06/reporting-on-non-pc-devices/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 14:00:00 +0000</pubDate>
		<dc:creator>Alain</dc:creator>
				<category><![CDATA[Citrix SQL Queries]]></category>
		<category><![CDATA[EdgeSight]]></category>
		<category><![CDATA[Edgesight Custom Queries]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Citrix SQL Reporting]]></category>
		<category><![CDATA[MS SQL]]></category>
		<category><![CDATA[MSSQL]]></category>

		<guid isPermaLink="false">https://edgesightunderthehood.wordpress.com/?p=260</guid>
		<description><![CDATA[Today’s workplace no longer follows a strict standard in terms of endpoint devices.  Despite the efforts of your infrastructure, network, and security teams users are connecting non-approved devices to your network and your Citrix farm.  A lot has been talked about the “Consumerization of IT” and it is a reality for any Citrix administrator/engineer.  In this blog post we will explore how to find these types of devices using EdgeSight. <a href="http://edgesightunderthehood.com/2011/07/06/reporting-on-non-pc-devices/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edgesightunderthehood.com&amp;blog=11422519&amp;post=260&amp;subd=edgesightunderthehood&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Intro</strong></p>
<p>Today’s workplace no longer follows a strict standard in terms of endpoint devices.  Despite the efforts of your infrastructure, network, and security teams users are connecting non-approved devices to your network and your Citrix farm.  A lot has been said about the “<a href="http://www.google.com/webhp?hl=en#q=%22consumerization%20of%20it%22&amp;nfpr=1&amp;ei=VqATTsziNOnl0QHA2LnPDQ&amp;sqi=2&amp;start=0&amp;bav=on.2,or.r_gc.r_pw.&amp;fp=1ec92a21f3882047&amp;biw=1600&amp;bih=809" target="_blank">Consumerization of IT</a>” and it is a reality for any Citrix administrator/engineer.  In this blog post we will explore how to find these types of devices using EdgeSight.</p>
<p><strong>The Query</strong></p>
<p>We will use the VW_ES_USERGROUP_ICA_USERS view for this query.  Here are the columns in this view:</p>
<p><a href="http://edgesightunderthehood.files.wordpress.com/2011/07/image.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="image" src="http://edgesightunderthehood.files.wordpress.com/2011/07/image_thumb.png?w=288&#038;h=484" alt="image" width="288" height="484" border="0" /></a></p>
<p>Here is a sample of data in this view (customer specific information hidden):</p>
<p><a href="http://edgesightunderthehood.files.wordpress.com/2011/07/image1.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;margin:5px 0;" title="image" src="http://edgesightunderthehood.files.wordpress.com/2011/07/image_thumb1.png?w=644&#038;h=104" alt="image" width="644" height="104" border="0" /></a></p>
<p><strong>Mobile Devices</strong></p>
<p>The following query will select mobile devices that connected to your farm in the last 30 days.</p>
<p><pre class="brush: sql;">
SELECT CONVERT(VARCHAR,dtlast,111) AS 'Date', account_name, client_buildnum, client_productid, client_disp_horiz, client_disp_vert
FROM vw_es_usergroup_ica_users
WHERE client_name = 'mobile'
and account_name &lt;&gt; 'UNKNOWN'
and CONVERT(VARCHAR,dtlast,111) &gt;= getdate() - 30
ORDER BY 'Date' DESC
</pre></p>
<p>Here’s a sample of the output:<br />
<a href="http://edgesightunderthehood.files.wordpress.com/2011/07/image2.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;margin:5px 0;" title="image" src="http://edgesightunderthehood.files.wordpress.com/2011/07/image_thumb2.png?w=644&#038;h=238" alt="image" width="644" height="238" border="0" /></a></p>
<p>The new Citrix Receiver sets the client name to ‘mobile’. On a PC this is typically the environment variable %COMPUTERNAME%.  To find the devices that are connecting, you can use the horizontal (client_disp_horiz) and vertical (client_disp_vert) resolutions and compare them to current resolutions of mobile devices.  I found a nice reference list <a href="http://cache8.groovypost.com/wp-content/uploads/2011/04/image230.png" target="_blank">here</a>.  This can get you half-way there.  The only other way that I’ve been able to distinguish the client that is connecting are the ‘client_buildnum’ and ‘client_productid’ fields.  Unfortunately, finding an updated list of ICA/Receiver build numbers is <a href="http://www.google.com/search?q=ica+client+build+number" target="_blank">not easy</a>.  <a href="http://www.archy.net/about/" target="_blank">Stephane Thirion</a> at <a href="http://www.archy.net/" target="_blank">Archy.net</a> provides a <a href="http://www.archy.net/2009/11/23/citrix-xenapp-ica-online-plug-in-client-version-numbers/" target="_blank">recently updated list</a>.</p>
<p><strong>Thin Clients</strong></p>
<p>We can also use VW_ES_USERGROUP_ICA_USERS to report on thin client devices.  It is unlikely that thin clients will be an unapproved device on your network, but we can get some useful data on them from this view.  The following query will select thin client devices that connected to your farm in the last 30 days.</p>
<p><pre class="brush: sql;">
SELECT  CONVERT(VARCHAR,dtlast,111) AS 'Date', account_name, client_directory, client_version, client_buildnum, client_productid, client_disp_horiz, client_disp_vert
FROM vw_es_usergroup_ica_users
WHERE client_directory like '\%'
and account_name &lt;&gt; 'UNKNOWN'
and CONVERT(VARCHAR,dtlast,111) &gt;= getdate() - 30
ORDER BY 'Date' DESC
</pre></p>
<p>Here’s a sample of the output:<br />
<a href="http://edgesightunderthehood.files.wordpress.com/2011/07/image3.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;margin:5px 0;" title="image" src="http://edgesightunderthehood.files.wordpress.com/2011/07/image_thumb3.png?w=644&#038;h=169" alt="image" width="644" height="169" border="0" /></a></p>
<p>If the thin client is windows-based, chances are the client_version field will give you the currently installed ICA client on the device.  You can use this information to pester the person in charge of thin client’s to update them or replace them (just kidding &#8211; but really you need to get them updated).  For this example, we examined the ‘client_directory’ column and determined that if it started with a  ‘\’, it was a thin client.  You may have to experiment with this field depending on which thin clients you have in your environment.</p>
<p>I hope this post has shown you how to track down non-pc devices connecting to your Citrix farm.  Once you have determined the ICA/Java client versions connecting to your farm (see the ICA Client Version report in EdgeSight!) you can modify these queries to find Java client users and Macintosh users.</p>
<p>As always, I welcome all comments and questions.</p>
<p><em>Thanks,<br />
Alain</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edgesightunderthehood.wordpress.com/260/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edgesightunderthehood.wordpress.com/260/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edgesightunderthehood.wordpress.com/260/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edgesightunderthehood.wordpress.com/260/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/edgesightunderthehood.wordpress.com/260/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/edgesightunderthehood.wordpress.com/260/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/edgesightunderthehood.wordpress.com/260/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/edgesightunderthehood.wordpress.com/260/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edgesightunderthehood.wordpress.com/260/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edgesightunderthehood.wordpress.com/260/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edgesightunderthehood.wordpress.com/260/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edgesightunderthehood.wordpress.com/260/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edgesightunderthehood.wordpress.com/260/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edgesightunderthehood.wordpress.com/260/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edgesightunderthehood.com&amp;blog=11422519&amp;post=260&amp;subd=edgesightunderthehood&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://edgesightunderthehood.com/2011/07/06/reporting-on-non-pc-devices/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c8719d9ad0f43dd188f6400b3d534b87?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Alain</media:title>
		</media:content>

		<media:content url="http://edgesightunderthehood.files.wordpress.com/2011/07/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://edgesightunderthehood.files.wordpress.com/2011/07/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://edgesightunderthehood.files.wordpress.com/2011/07/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://edgesightunderthehood.files.wordpress.com/2011/07/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Reporting on Alerts</title>
		<link>http://edgesightunderthehood.com/2011/06/16/reporting-on-alerts/</link>
		<comments>http://edgesightunderthehood.com/2011/06/16/reporting-on-alerts/#comments</comments>
		<pubDate>Thu, 16 Jun 2011 17:27:34 +0000</pubDate>
		<dc:creator>Alain</dc:creator>
				<category><![CDATA[EdgeSight]]></category>
		<category><![CDATA[Edgesight Custom Queries]]></category>
		<category><![CDATA[Citrix SQL Reporting]]></category>

		<guid isPermaLink="false">https://edgesightunderthehood.wordpress.com/?p=240</guid>
		<description><![CDATA[EdgeSight allows to you to create alerts that trigger on many criteria.  In this post, we will configure an alert and show how to query the database directly to get this information. <a href="http://edgesightunderthehood.com/2011/06/16/reporting-on-alerts/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edgesightunderthehood.com&amp;blog=11422519&amp;post=240&amp;subd=edgesightunderthehood&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Intro<img class="alignleft" src="http://community.citrix.com/download/attachments/75695064/es-logo.jpg" alt="" width="152" height="152" /></strong></p>
<p>EdgeSight allows to you to create alerts that trigger on many criteria.  In this post, we will configure an alert and show how to query the database directly to get this information.</p>
<p><strong>Creating an alert</strong></p>
<p>For the purposes of this post, I have created a Process Hung alert for outlook.exe.  This is a built-in Application Error alert that can trigger on the EXE file name, the application description, the process file version, and/or the process company name.  The actual alert will show up in the Farm Monitor and Alert List view under the Monitor Tab in the EdgeSight console.</p>
<p>Now you will get a near real-time alert in the console that looks like this:<br />
<a href="http://edgesightunderthehood.files.wordpress.com/2011/06/image.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="image" src="http://edgesightunderthehood.files.wordpress.com/2011/06/image_thumb.png?w=571&#038;h=63" alt="image" width="571" height="63" border="0" /></a></p>
<p>I found that this alert triggered quite often and while you can use the “Process Not Responding Alert” report, this blog is all about pulling back the veil.</p>
<p><strong>The Query</strong></p>
<p>We will use the VW_ES_ARCHIVE_ALERT view for this query.  Here is an example of all the columns in this view (customer specific information hidden):</p>
<p><a href="http://edgesightunderthehood.files.wordpress.com/2011/06/image1.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="image" src="http://edgesightunderthehood.files.wordpress.com/2011/06/image_thumb1.png?w=644&#038;h=60" alt="image" width="644" height="60" border="0" /></a></p>
<p>For our purposes, I want to get the date of the alert, the machine name, the username, the process name, the process description, and the actual text of the alert.</p>
<p><pre class="brush: sql;">
DECLARE @mydate DATETIME
Set @mydate = GETDATE()
SELECT DISTINCT CONVERT(VARCHAR,time_stamp,111) AS 'Date', machine_name, account_name, exe_name, alert_name,alert_text
FROM vw_es_archive_alert
WHERE alert_name = 'Process Hung'
and exe_name = 'Outlook.exe'
and CONVERT(VARCHAR,time_stamp,111) = CONVERT(VARCHAR,@mydate,111)
</pre></p>
<p>This gives me:<a href="http://edgesightunderthehood.files.wordpress.com/2011/06/image2.png"><br />
<img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="image" src="http://edgesightunderthehood.files.wordpress.com/2011/06/image_thumb2.png?w=554&#038;h=116" alt="image" width="554" height="116" border="0" /></a></p>
<p>If you look at the alert_text field, you will see some information that doesn’t look right.  You can see “Microsoft Office Outlook”, a weird character, and a series of numbers.  These numbers are in fact the actual process hang measured in milliseconds.  You can see this if you go back to the farm monitor and select the detail for an alert:</p>
<p><a href="http://edgesightunderthehood.files.wordpress.com/2011/06/image3.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="image" src="http://edgesightunderthehood.files.wordpress.com/2011/06/image_thumb3.png?w=313&#038;h=127" alt="image" width="313" height="127" border="0" /></a></p>
<p>You have the information you need to determine who is having a real long delay, but how can we sort or organize this delay information.  There is no built-in MSSQL function to break this column up into two useful fields.  A <a href="http://stackoverflow.com/questions/1007697/how-to-strip-all-non-alphabetic-characters-from-string-in-sql-server" target="_blank">Google search</a> pointed me to a user-written function that will strip non-alphanumeric from a column.</p>
<p><pre class="brush: sql;">
CREATE FUNCTION [dbo].[fn_StripCharacters]
(
@String NVARCHAR(MAX),
@MatchExpression VARCHAR(255)
)
RETURNS NVARCHAR(MAX)
AS
BEGIN
SET @MatchExpression =  '%['+@MatchExpression+']%'
WHILE PatIndex(@MatchExpression, @String) &gt; 0
SET @String = Stuff(@String, PatIndex(@MatchExpression, @String), 1, '')
RETURN @String
END
</pre></p>
<p>Once you execute this in the MSSQL Management Studio, you can reference the function in your query:</p>
<p><pre class="brush: sql;">
DECLARE @mydate DATETIME
Set @mydate = GETDATE()
SELECT DISTINCT CONVERT(VARCHAR,time_stamp,111) AS 'Date', machine_name, account_name, exe_name, alert_name, dbo.fn_StripCharacters(alert_text, '^a-z0-9')
FROM vw_es_archive_alert
WHERE alert_name = 'Process Hung'
and exe_name = 'Outlook.exe'
and CONVERT(VARCHAR,time_stamp,111) = CONVERT(VARCHAR,@mydate,111)
</pre></p>
<p>This now gives us:<br />
<a href="http://edgesightunderthehood.files.wordpress.com/2011/06/image4.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="image" src="http://edgesightunderthehood.files.wordpress.com/2011/06/image_thumb4.png?w=547&#038;h=155" alt="image" width="547" height="155" border="0" /></a></p>
<p>Now the special character is gone, but how can you split the process delay out of the column?  You can use a built-in MSSQL function call SUBSTRING.</p>
<p><pre class="brush: sql;">
DECLARE @mydate DATETIME
Set @mydate = GETDATE()
SELECT DISTINCT CONVERT(VARCHAR,time_stamp,111) AS 'Date', machine_name, account_name, exe_name, alert_name, SUBSTRING(dbo.fn_StripCharacters(alert_text, '^a-z0-9'),23,6) AS 'Delay'
FROM vw_es_archive_alert
WHERE alert_name = 'Process Hung'
and exe_name = 'Outlook.exe'
and CONVERT(VARCHAR,time_stamp,111) = CONVERT(VARCHAR,@mydate,111)
</pre></p>
<p>Now we get:</p>
<p><a href="http://edgesightunderthehood.files.wordpress.com/2011/06/image5.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="image" src="http://edgesightunderthehood.files.wordpress.com/2011/06/image_thumb5.png?w=441&#038;h=157" alt="image" width="441" height="157" border="0" /></a></p>
<p>To finish up, we’ll divide the Delay by 1000 to get the delay in seconds.</p>
<p><pre class="brush: sql;">
DECLARE @mydate DATETIME
Set @mydate = GETDATE()
SELECT DISTINCT CONVERT(VARCHAR,time_stamp,111) AS 'Date', machine_name, account_name, exe_name, alert_name, CONVERT(INTEGER,SUBSTRING(dbo.fn_StripCharacters(alert_text, '^a-z0-9'),23,6),10)/1000.0 AS 'Delay'
FROM vw_es_archive_alert
WHERE alert_name = 'Process Hung'
and exe_name = 'Outlook.exe'
and CONVERT(VARCHAR,time_stamp,111) = CONVERT(VARCHAR,@mydate,111)
ORDER BY 'Delay' desc
</pre></p>
<p>Our end result:</p>
<p><a href="http://edgesightunderthehood.files.wordpress.com/2011/06/image6.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="image" src="http://edgesightunderthehood.files.wordpress.com/2011/06/image_thumb6.png?w=460&#038;h=156" alt="image" width="460" height="156" border="0" /></a></p>
<p>With this information, you can do further manipulation including counting the number of alert instances for a user or tracking a single user over time.</p>
<p>As always I welcome all questions and comments.</p>
<p><em>Thanks,</em><br />
<em>Alain</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edgesightunderthehood.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edgesightunderthehood.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edgesightunderthehood.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edgesightunderthehood.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/edgesightunderthehood.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/edgesightunderthehood.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/edgesightunderthehood.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/edgesightunderthehood.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edgesightunderthehood.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edgesightunderthehood.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edgesightunderthehood.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edgesightunderthehood.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edgesightunderthehood.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edgesightunderthehood.wordpress.com/240/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edgesightunderthehood.com&amp;blog=11422519&amp;post=240&amp;subd=edgesightunderthehood&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://edgesightunderthehood.com/2011/06/16/reporting-on-alerts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c8719d9ad0f43dd188f6400b3d534b87?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Alain</media:title>
		</media:content>

		<media:content url="http://community.citrix.com/download/attachments/75695064/es-logo.jpg" medium="image" />

		<media:content url="http://edgesightunderthehood.files.wordpress.com/2011/06/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://edgesightunderthehood.files.wordpress.com/2011/06/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://edgesightunderthehood.files.wordpress.com/2011/06/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://edgesightunderthehood.files.wordpress.com/2011/06/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://edgesightunderthehood.files.wordpress.com/2011/06/image_thumb4.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://edgesightunderthehood.files.wordpress.com/2011/06/image_thumb5.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://edgesightunderthehood.files.wordpress.com/2011/06/image_thumb6.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>EdgeSight: Filtering a Query by IP Subnet</title>
		<link>http://edgesightunderthehood.com/2011/04/21/edgesight-filtering-a-query-by-ip-subnet/</link>
		<comments>http://edgesightunderthehood.com/2011/04/21/edgesight-filtering-a-query-by-ip-subnet/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 12:00:56 +0000</pubDate>
		<dc:creator>Alain</dc:creator>
				<category><![CDATA[Edge Sight]]></category>
		<category><![CDATA[EdgeSight]]></category>
		<category><![CDATA[Edgesight Custom Queries]]></category>
		<category><![CDATA[Citrix]]></category>
		<category><![CDATA[MS SQL]]></category>
		<category><![CDATA[MSSQL]]></category>

		<guid isPermaLink="false">https://edgesightunderthehood.wordpress.com/?p=184</guid>
		<description><![CDATA[Many of EdgeSight’s tables and views have a field for the client’s IP address, and this is stored as variable-length character string (varchar or nvarchar).  In order to sort or filter on this field you must use a complex regular expression or find a way to split the field into different octets.  In this blog post, we will do just that by presenting a problem that requires finding users based on their subnet… <a href="http://edgesightunderthehood.com/2011/04/21/edgesight-filtering-a-query-by-ip-subnet/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edgesightunderthehood.com&amp;blog=11422519&amp;post=184&amp;subd=edgesightunderthehood&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><a href="http://support.citrix.com/product/es/" target="_blank"><img style="border:0 none;" title="es_logo" src="https://www.citrix.com/site/resources/dynamic/softwareLogos/EdgeSight-Icon-120.gif" alt="es_logo" width="106" height="106" align="left" border="0" /></a>Prologue</strong><br />
Many of EdgeSight’s tables and views have a field for the client’s IP address, and this is stored as variable-length character string (varchar or nvarchar). In order to sort or filter on this field you must use a complex regular expression or find a way to split the field into different octets. In this blog post, we will do just that by presenting a problem that requires finding users based on their subnet…</p>
<p><strong>Intro</strong><br />
Thanks to the vibrant competition present in the virtualization space, many Engineers find themselves always transitioning to the next version of their virtualization solution. During such a transition, management (and hopefully the engineers) want to know who’s using the new system and if users are still accessing the old one. In many cases this can be a trivial exercise, but for this scenario we’ll make it more complex.</p>
<p><strong>Scenario</strong><br />
The networking team has intelligently organized its users&#8217; locations by subnet. In fact, due to number of users and available IP’s, each floor at the main location has it’s own subnet. Recently, Citrix users at the main location were transitioned to the new environment, except for a subset who had legacy applications that would not work in the new Citrix farm. Management wants to know many of the transitioned users are using the new system.</p>
<p><strong>Problem</strong><br />
Since we are using published desktops in both the old and new Citrix environments, EdgeSight (version 5.3) does not provide an easy way to query desktop launches (see <a href="http://edgesightunderthehood.com/2010/08/25/oye-vey-published-desktops-in-edgesight-5-3/" target="_blank">this post</a> on <a href="http://edgesightunderthehood.com/" target="_blank">EdgeSight Under the Hood</a> for how to get a query of published desktop launches). In this case, we have a different naming schema for the servers in the new farm, but since there are many different locations connecting back to our Citrix farms, we need to just select the users at the main location. This will require us to filter the users based on their IP subnet.</p>
<p><strong>PARSENAME</strong><br />
While researching this issue I found that dealing with IP addresses in <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Transact-SQL" target="_blank">Transact-SQL</a> is a common problem. Luckily there is a built-in function called <a href="http://msdn.microsoft.com/en-us/library/ms188006.aspx" target="_blank">PARSENAME</a> that parses object names like ‘<em>servername.databasename.schemaname.objectname’. </em>Since IPv4 addresses follow the same convention, you can reference each part of the octet in an IP address.</p>
<p>For example:</p>
<p><pre class="brush: sql; gutter: false;">
DECLARE @IP nvarchar(15)
SET @IP = '192.168.1.1'
SELECT PARSENAME(@IP,4) AS 'Octet 1',
PARSENAME(@IP,3)AS 'Octet 2',
PARSENAME(@IP,2)AS 'Octet 3',
PARSENAME(@IP,1)AS 'Octet 4'
</pre></p>
<p>Gives us:</p>
<p><pre class="brush: plain; light: true;">
Octet 1    Octet 2    Octet 3    Octet 4
---------- ---------- ---------- ----------
192        168        1          1

(1 row(s) affected)
</pre></p>
<p><strong><br />
The query</strong><br />
For this query we will use vw_ctrx_archive_server_start_perf which has become my goto view for client related information and just sort by one subnet: 192.168.1.0 – 192.168.1.101 and look at the last 3 days of data</p>
<p><pre class="brush: sql;">
DECLARE @today datetime
SET @today = CONVERT(varchar(10),getdate(),111)
--we are using DATEADD and offsetting by minus four hours due to Eastern Daylight Time
SELECT CONVERT(varchar(10),DATEADD(hh,-4,time_stamp), 111) as 'Date', ([user]) as 'User'
FROM vw_ctrx_archive_server_start_perf
WHERE CONVERT(varchar(10),DATEADD(hh,-4,time_stamp), 111) &gt;= @today-3 --past 3 days
and [user] &lt;&gt; 'UNKNOWN'
--Gets NEWSERVER01, NEWSERVER02, etc
and machine_name like 'NEWSERVER%
and PARSENAME(client_address,4) = '192'
and PARSENAME(client_address,3) = '168'  and (PARSENAME(client_address,2) = 1 and PARSENAME(client_address,1) between 0 and 101
GROUP BY CONVERT(varchar(10),DATEADD(hh,-4,time_stamp), 111), [user]
ORDER BY CONVERT(varchar(10),DATEADD(hh,-4,time_stamp), 111)
</pre></p>
<p>For our second example, we’ll sort with 11 sub-nets:<br />
192.168.1.0 – 192.168.1.101<br />
192.168.2.0 – 192.168.2.102<br />
192.168.3.0 – 192.168.3.103<br />
192.168.4.0 – 192.168.4.104<br />
192.168.5.0 – 192.168.5.105<br />
192.168.6.0 – 192.168.6.106<br />
192.168.7.0 – 192.168.7.107<br />
192.168.8.0 – 192.168.8.108<br />
192.168.9.0 – 192.168.9.109<br />
192.168.10.0 – 192.168.10.110<br />
192.168.11.0 – 192.168.11.121</p>
<p><pre class="brush: sql;">
DECLARE @today datetime
SET @today = convert(varchar(10),getdate(),111)
SELECT CONVERT(varchar(10),dateadd(hh,-4,time_stamp), 111) as 'Date', ([user]) as 'User'
FROM vw_ctrx_archive_server_start_perf
WHERE CONVERT(varchar(10),dateadd(hh,-4,time_stamp), 111) &gt;= @today-3
and [user] &lt;&gt; 'UNKNOWN'
and machine_name like 'NEWSERVER%'
and PARSENAME(client_address,4) = '192'
and PARSENAME(client_address,3) = '168'
and (PARSENAME(client_address,2) =1 and PARSENAME(client_address,1) between 0 and 101
or PARSENAME(client_address,2) =2 and PARSENAME(client_address,1) between 0 and 102
or PARSENAME(client_address,2) =3 and PARSENAME(client_address,1) between 0 and 103
or PARSENAME(client_address,2) =4 and PARSENAME(client_address,1) between 0 and 104
or PARSENAME(client_address,2) =5 and PARSENAME(client_address,1) between 0 and 105
or PARSENAME(client_address,2) =6 and PARSENAME(client_address,1) between 0 and 106
or PARSENAME(client_address,2) =7 and PARSENAME(client_address,1) between 0 and 107
or PARSENAME(client_address,2) =8 and PARSENAME(client_address,1) between 0 and 108
or PARSENAME(client_address,2) =9 and PARSENAME(client_address,1) between 0 and 109
or PARSENAME(client_address,2) =10 and PARSENAME(client_address,1) between 0 and 110
or PARSENAME(client_address,2) =11 and PARSENAME(client_address,1) between 0 and 121)
GROUP BY convert(varchar(10),dateadd(hh,-4,time_stamp), 111), [user]
ORDER BY convert(varchar(10),dateadd(hh,-4,time_stamp), 111)
</pre></p>
<p>Hopefully this will provide you with some more options when you need to present data from your EdgeSight database. As always I welcome any and all questions and comments.</p>
<p><em>Thanks,<br />
Alain</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edgesightunderthehood.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edgesightunderthehood.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edgesightunderthehood.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edgesightunderthehood.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/edgesightunderthehood.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/edgesightunderthehood.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/edgesightunderthehood.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/edgesightunderthehood.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edgesightunderthehood.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edgesightunderthehood.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edgesightunderthehood.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edgesightunderthehood.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edgesightunderthehood.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edgesightunderthehood.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edgesightunderthehood.com&amp;blog=11422519&amp;post=184&amp;subd=edgesightunderthehood&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://edgesightunderthehood.com/2011/04/21/edgesight-filtering-a-query-by-ip-subnet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c8719d9ad0f43dd188f6400b3d534b87?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Alain</media:title>
		</media:content>

		<media:content url="https://www.citrix.com/site/resources/dynamic/softwareLogos/EdgeSight-Icon-120.gif" medium="image">
			<media:title type="html">es_logo</media:title>
		</media:content>
	</item>
		<item>
		<title>OYE VEY!!!  Published Desktops in Edgesight 5.3</title>
		<link>http://edgesightunderthehood.com/2010/08/25/oye-vey-published-desktops-in-edgesight-5-3/</link>
		<comments>http://edgesightunderthehood.com/2010/08/25/oye-vey-published-desktops-in-edgesight-5-3/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 01:17:21 +0000</pubDate>
		<dc:creator>John M. Smith</dc:creator>
				<category><![CDATA[Citrix SQL Queries]]></category>
		<category><![CDATA[EdgeSight]]></category>
		<category><![CDATA[Edgesight Custom Queries]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Edgesight 5.3 Published Desktops]]></category>
		<category><![CDATA[Published Desktop Edgesight Report]]></category>

		<guid isPermaLink="false">http://edgesightunderthehood.wordpress.com/2010/08/25/oye-vey-published-desktops-in-edgesight-5-3/</guid>
		<description><![CDATA[Reporting on Published Desktops in Edgesight 5.3 We recently made the move to published XenAPP Desktops in our environment and after the initial rollout I thought I would consult edgesight and see what kind of metrics and performance numbers were in place and see how many users were using the new published desktop. What I found &#8230; <a href="http://edgesightunderthehood.com/2010/08/25/oye-vey-published-desktops-in-edgesight-5-3/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edgesightunderthehood.com&amp;blog=11422519&amp;post=170&amp;subd=edgesightunderthehood&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:Arial;font-size:10pt;">Reporting on Published Desktops in Edgesight 5.3<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">We recently made the move to published XenAPP Desktops in our environment and after the initial rollout I thought I would consult edgesight and see what kind of metrics and performance numbers were in place and see how many users were using the new published desktop. What I found was that published desktops do now show up in several of the views/tables in Edgesight and the data is basically missing for a number of canned reports.<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">After a call with Citrix and finding out that they will not have a fix for some time, I decided to see if I could find the data somewhere in the vast archives of Edgesight Data Model. What I found is that information about published Desktops does, in fact, appear to be there. It is in a table (not a view) called ctrx_session. Running the command<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;"><span style="color:blue;">select </span><span style="color:fuchsia;">* from </span>ctrx_session<span style="color:fuchsia;"> where app_name = &#8216;#%desktopName%&#8217;</span><span style="color:blue;"><br />
</span></span><span style="font-family:Arial;font-size:10pt;">This will give you a list of published applications, if you don&#8217;t know the name of your published desktop than use the &#8216;like&#8217; function to find it.<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Once you know your Desktop name you will need to cross reference the sessid with the view <em>vw_ctrx_archive_session_perf</em> and compare the <em>sessid</em> column type the following query to get counts on your published desktop. (<strong>Inner join folks can type it their way as well, note the alias of &#8220;s&#8221; and &#8220;p&#8221; for the tables)<span style="color:blue;"><br />
</span></strong></span></p>
<p><span style="font-family:Arial;font-size:10pt;"><span style="color:blue;">select </span><span style="color:fuchsia;">convert</span><span style="color:gray;">(</span><span style="color:blue;">varchar</span><span style="color:gray;">(</span>10<span style="color:gray;">),</span><span style="color:fuchsia;">dateadd</span><span style="color:gray;">(</span>hh<span style="color:gray;">,-</span>4<span style="color:gray;">,</span>s<span style="color:gray;">.</span>dtlast<span style="color:gray;">),</span>101<span style="color:gray;">), </span><span style="color:fuchsia;">count</span><span style="color:gray;">(</span><span style="color:blue;">distinct</span> [user]<span style="color:gray;">)<br />
</span></span><span style="font-family:Arial;font-size:10pt;"><span style="color:blue;">from</span> ctrx_session s , vw_ctrx_archive_session_perf p<br />
</span><span style="font-family:Arial;font-size:10pt;"><span style="color:blue;">where</span> p<span style="color:gray;">.</span>sessid <span style="color:gray;">=</span> s<span style="color:gray;">.</span>sessid<br />
</span><span style="font-family:Arial;font-size:10pt;"><span style="color:gray;">and</span> s<span style="color:gray;">.</span><span style="color:fuchsia;">app_name </span><span style="color:gray;">= </span><span style="color:red;">&#8216;#%virtual Desktop&#8217;<br />
</span></span><span style="font-family:Arial;font-size:10pt;"><span style="color:blue;">group </span><span style="color:blue;">by </span><span style="color:fuchsia;">convert</span><span style="color:gray;">(</span><span style="color:blue;">varchar</span><span style="color:gray;">(</span>10<span style="color:gray;">),</span><span style="color:fuchsia;">dateadd</span><span style="color:gray;">(</span>hh<span style="color:gray;">,-</span>4<span style="color:gray;">,</span>s<span style="color:gray;">.</span>dtlast<span style="color:gray;">),</span>101<span style="color:gray;">)<br />
</span></span><span style="font-family:Arial;font-size:10pt;"><span style="color:blue;">order </span><span style="color:blue;">by </span><span style="color:fuchsia;">convert</span><span style="color:gray;">(</span><span style="color:blue;">varchar</span><span style="color:gray;">(</span>10<span style="color:gray;">),</span><span style="color:fuchsia;">dateadd</span><span style="color:gray;">(</span>hh<span style="color:gray;">,-</span>4<span style="color:gray;">,</span>s<span style="color:gray;">.</span>dtlast<span style="color:gray;">),</span>101<span style="color:gray;">)<br />
</span></span></p>
<p><span style="font-family:Arial;font-size:10pt;">If you want to get the users who have accessed your virtual desktop you would type the following query<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">select </span><span style="color:blue;">distinct</span> [user]<br />
</span><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">from</span> ctrx_session s<span style="color:gray;">,</span> vw_ctrx_archive_session_perf p<br />
</span><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">where</span> p<span style="color:gray;">.</span>sessid <span style="color:gray;">=</span> s<span style="color:gray;">.</span>sessid<br />
</span><span style="font-size:10pt;"><span style="color:gray;font-family:Courier New;">and</span><span style="font-family:Courier New;"> s<span style="color:gray;">.</span><span style="color:fuchsia;">app_name </span><span style="color:gray;">like </span><span style="color:red;">&#8216;%virtual%&#8217;</span></span><span style="font-family:Arial;"><br />
</span></span></p>
<p>Comparing the <em>&#8220;sessid&#8221;</em> and specifying the <em>&#8220;#Virtual Desktop&#8221;</em> in your queries will also get you user names, system statistics such as CPU, Memory, etc but it does not get you any latency statistics which really sucks! I am hoping Citrix makes it a priority to get this fixed. Basically, you will not be able to tell a user who complains about their XenAPP Session that they had a latency of 500ms. One of the nice things about Edgesight was the ability to gather latency data, bummer!</p>
<p><strong>Conclusion:</strong><br />
I know this may not be much of a consolation prize but if you want to report usage, usernames, etc you at least can grab some of that information. If there is a specific metric (that does not have to do with latency) please let me know and I will try to send you a query that will work for you. I have been able to answer all but one question that has been sent to me.</p>
<p>Thanks for reading!</p>
<p>John</p>
<p><strong>ALSO NOTE: I am on eastern standard time so my query of the dtlast column has a &#8220;dateadd(hh,-4,dtlast). Adjust this according to your time zone. </strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edgesightunderthehood.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edgesightunderthehood.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edgesightunderthehood.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edgesightunderthehood.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/edgesightunderthehood.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/edgesightunderthehood.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/edgesightunderthehood.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/edgesightunderthehood.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edgesightunderthehood.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edgesightunderthehood.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edgesightunderthehood.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edgesightunderthehood.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edgesightunderthehood.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edgesightunderthehood.wordpress.com/170/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edgesightunderthehood.com&amp;blog=11422519&amp;post=170&amp;subd=edgesightunderthehood&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://edgesightunderthehood.com/2010/08/25/oye-vey-published-desktops-in-edgesight-5-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7d875a10f43641d8674e1bc7c1fc8b9d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">John M. Smith</media:title>
		</media:content>
	</item>
	</channel>
</rss>
