<?xml version="1.0" encoding="iso-8859-1"?><!-- generator="b2evolution/1.10.2" -->
<rss version="0.92">
	<channel>
		<title>Ozzy Citrix Noobs</title>
					  <link>http://www.ozctx.com/index.php?blog=1</link>
			  <description>This site is devoted to learning process of configuring and administering Citrix Suite.</description>
			  <language>en-AU</language>
			  <docs>http://backend.userland.com/rss092</docs>
			  			  <item>
			    <title>Monitor Citrix Web Interface IIS Application Pool</title>
			    <description>&lt;p&gt;Once a while, I am getting users calling &amp;#8220;Service Unavaible&amp;#8221; after logon to Access Gateway. By checking, found that one of the Application Pools in IIS was down. I have set seperate application pool for each Citrix Web Interface site, so if one application pool is down, only one site is affected. But how do I monitor this? By googling, I found the following from &lt;a href=&quot;http://forums.webhostautomation.com/showthread.php?t=11141&quot;&gt;http://forums.webhostautomation.com/showthread.php?t=11141&lt;/a&gt;, and I am only showing this here to thank the author for his wonderful idea. I have created a scheduled task to run this vbscript on the two Web Interface servers every 30 minutes for 24 hours, so I will be notified by email fairly quickly once there is a problem. In the script, I am using my own SendEmail to use SMTP server, as there is no Outlook client installed on that IIS server.&lt;/p&gt;

&lt;p&gt;===Code Starts==========================================================&lt;br /&gt;
&amp;#8216; Variables that need to be defined for the script to work&lt;br /&gt;
&amp;#8216;http://forums.webhostautomation.com/showthread.php?t=11141&lt;br /&gt;
Const LogDir = &amp;#8220;C:\Source\AppPoolLog&amp;#8221;&lt;br /&gt;
ToAddress = &amp;#8220;user@it.com&amp;#8221;&lt;br /&gt;
FromAddress = &amp;#8220;user@it.com&amp;#8221;&lt;/p&gt;

&lt;p&gt;showAppPools	&amp;#8216;Runs showAppPools Sub&lt;/p&gt;

&lt;p&gt;&amp;#8216; This will get the list of all app pools on the server&lt;br /&gt;
Sub showAppPools&lt;br /&gt;
Dim obj,apool&lt;br /&gt;
set obj = GetObject(&quot;IIS://localhost/W3SVC/apppools&quot;)&lt;br /&gt;
for each apool in obj&lt;br /&gt;
	apppoolStatus apool.name&lt;br /&gt;
Next&lt;br /&gt;
set obj = nothing&lt;br /&gt;
End Sub&lt;/p&gt;

&lt;p&gt;&amp;#8216; This will get the status of the app pool&lt;br /&gt;
Sub apppoolStatus(apppool)&lt;br /&gt;
Dim obj&lt;br /&gt;
set obj = GetObject(&quot;IIS://localhost/W3SVC/apppools/&amp;#8221; &amp;amp; apppool)&lt;br /&gt;
	Select Case obj.apppoolstate&lt;br /&gt;
		Case 0&lt;br /&gt;
			writetoLog apppool,&quot;0&amp;Prime;	&amp;#8216;Do not know what this status is&lt;br /&gt;
		Case 1&lt;br /&gt;
			writetoLog apppool,&quot;1&amp;Prime;	&amp;#8216;Do not know what this status is&lt;br /&gt;
		Case 2&lt;br /&gt;
			writetoLog apppool,&quot;Up&amp;#8221;&lt;br /&gt;
		Case 3&lt;br /&gt;
			writetoLog apppool,&quot;3&amp;Prime;	&amp;#8216;Do not know what this status is&lt;br /&gt;
		Case 4&lt;br /&gt;
			writetoLog apppool,&quot;DOWN&amp;#8221;&lt;br /&gt;
			startapppool apppool&lt;br /&gt;
			SendEmail GetComputerName,apppool&lt;br /&gt;
			writetoLog apppool,&quot;Restarted&amp;#8221;&lt;br /&gt;
	End Select&lt;br /&gt;
set obj = nothing&lt;br /&gt;
End Sub&lt;/p&gt;

&lt;p&gt;&amp;#8216; This will write information to a log file&lt;br /&gt;
Sub writetoLog(apppool,response)&lt;br /&gt;
Dim fso&lt;br /&gt;
lday = datepart(&quot;d&quot;,date)&lt;br /&gt;
lmonth = datepart(&quot;m&quot;,date)&lt;br /&gt;
lyear = datepart(&quot;yyyy&quot;,date)&lt;br /&gt;
logdate = lyear &amp;amp; lmonth &amp;amp; lday&lt;br /&gt;
set fso = CreateObject (&quot;Scripting.FileSystemObject&quot;)&lt;br /&gt;
Set objFSOwriteline = FSO.OpenTextFile(LogDir &amp;amp; &amp;#8220;\&amp;#8221; &amp;amp; logdate &amp;amp; &amp;#8220;.log&quot;, 8,True)&lt;br /&gt;
	objFSOwriteline.WriteLine(response &amp;amp; &amp;#8220;,&amp;#8221; &amp;amp; apppool &amp;amp; &amp;#8220;,&amp;#8221; &amp;amp; now())&lt;br /&gt;
	objFSOwriteline.close&lt;br /&gt;
Set objFSOwriteline = nothing&lt;br /&gt;
set fso = nothing&lt;br /&gt;
End Sub&lt;/p&gt;

&lt;p&gt;&amp;#8216; This starts the down app pool&lt;br /&gt;
Sub startapppool(apppool)&lt;br /&gt;
Dim obj&lt;br /&gt;
set obj = GetObject(&quot;IIS://localhost/W3SVC/apppools/&amp;#8221; &amp;amp; apppool)&lt;br /&gt;
	obj.start&lt;br /&gt;
set obj = nothing&lt;br /&gt;
End Sub&lt;/p&gt;

&lt;p&gt;&amp;#8216; This send a email regarding the down/restarted app pool&lt;br /&gt;
Sub emailSendCDOSYS(apppool)&lt;br /&gt;
Dim Mailer&lt;br /&gt;
Set Mailer=CreateObject(&quot;CDO.Message&quot;)&lt;br /&gt;
Message = &amp;#8220;===============================================&amp;#8221; &amp;amp; VbCrLf&lt;br /&gt;
Message = Message &amp;amp; &amp;#8220;Application Pool: &amp;#8221; &amp;amp; apppool &amp;amp; &amp;#8221; has been restarted&amp;#8221; &amp;amp; VbCrLf&lt;br /&gt;
Message = Message &amp;amp; &amp;#8220;Date/Time: &amp;#8220;&amp;amp; now() &amp;amp;&quot;&amp;#8221; &amp;amp; VbCrLf&lt;br /&gt;
Message = Message &amp;amp; &amp;#8220;===============================================&amp;#8221; &amp;amp; VbCrLf&lt;br /&gt;
Subject = &amp;#8220;Application Pool: &amp;#8221; &amp;amp; apppool &amp;amp; &amp;#8221; has been restarted&amp;#8221;&lt;br /&gt;
Mailer.TextBody = Message&lt;br /&gt;
Mailer.Subject = Subject&lt;br /&gt;
Mailer.To = ToAddress&lt;br /&gt;
Mailer.From = FromAddress&lt;br /&gt;
Mailer.Send&lt;br /&gt;
set Mailer = Nothing&lt;br /&gt;
End Sub&lt;/p&gt;

&lt;p&gt;sub SendEmail(ServerName, apppool)&lt;/p&gt;

&lt;p&gt;Set objEmail = CreateObject(&quot;CDO.Message&quot;)&lt;br /&gt;
objEmail.From = &amp;#8220;user@it.com&amp;#8221;&lt;br /&gt;
objEmail.To = &amp;#8220;user@it.com&amp;#8221;&lt;br /&gt;
objEmail.Subject = &amp;#8220;Application pool: &amp;#8221; &amp;amp; apppool &amp;amp; &amp;#8221; is restarted on &amp;#8221; &amp;amp; ServerName&lt;br /&gt;
objEmail.Textbody = &amp;#8220;Application Pool error.&amp;#8221;&lt;br /&gt;
objEmail.Configuration.Fields.Item _&lt;br /&gt;
    (&quot;http://schemas.microsoft.com/cdo/configuration/sendusing&quot;) = 2&lt;br /&gt;
objEmail.Configuration.Fields.Item _&lt;br /&gt;
    (&quot;http://schemas.microsoft.com/cdo/configuration/smtpserver&quot;) = _&lt;br /&gt;
        &amp;#8220;smtp.it.com&amp;#8221; &lt;br /&gt;
objEmail.Configuration.Fields.Item _&lt;br /&gt;
    (&quot;http://schemas.microsoft.com/cdo/configuration/smtpserverport&quot;) = 25&lt;br /&gt;
objEmail.Configuration.Fields.Update&lt;br /&gt;
objEmail.Send&lt;/p&gt;

&lt;p&gt;End Sub&lt;/p&gt;

&lt;p&gt;Function GetComputerName&lt;br /&gt;
Set objWMISvc = GetObject( &amp;#8220;winmgmts:\\.\root\cimv2&amp;Prime; )&lt;br /&gt;
Set colItems = objWMISvc.ExecQuery( &amp;#8220;Select * from Win32_ComputerSystem&quot;, , 48 )&lt;br /&gt;
For Each objItem in colItems&lt;br /&gt;
    strComputerName = objItem.Name&lt;br /&gt;
Next&lt;br /&gt;
GetComputerName = strComputerName&lt;br /&gt;
End Function&lt;br /&gt;
===Code ends============================================&lt;/p&gt;</description>
			    <link>http://www.ozctx.com/index.php?blog=1&amp;title=monitor_citrix_web_interface_iis_applica&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1</link>
			  </item>
			  			  <item>
			    <title>Publishing Explorer.exe on Xenapp 4.0</title>
			    <description>&lt;p&gt;Hello All, &lt;/p&gt;

&lt;p&gt;Its been a while since I blogged my daily chanllenges within Xenapp. I have been quiet busy with work and *cough* WOW .. haha &lt;/p&gt;

&lt;p&gt;Anyways, I thought I would ease into it with a little problem encountered this week with a published version of explorer. Previous the published application was set to load %systemroot%\explorer.exe of a Windows 2003 R2 SP2 server with Xenapp 4.0 R04. Now all of a sudden two weeks ago, user started to complain about explorer taking them to &amp;#8220;My Documents&amp;#8221; when they launch the published application. (Now I am new to this role and ALWAYS thought, since Windows XP SP2 that Explorer.exe defaults to MY Documents)&amp;#8230;. regardless this caused all sorts of issues for users. &lt;/p&gt;

&lt;p&gt;After much running around and emails, everyone finally agreed that they wanted a two pane Explorer with the left Pane should &amp;#8220;My Computer&amp;#8221; expanded in tree view and the right pane, showing all &amp;#8220;Drives&amp;#8221; in icon view. As shown below. &lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.ozctx.com/htsrv/viewfile.php?root=collection_1&amp;amp;path=Images/my_computer.jpg&amp;amp;viewtype=image&quot; alt=&quot;My Computer&quot; title=&quot;My Computer - Win2k3 SP2&quot; /&gt;&lt;/p&gt;

&lt;p&gt;After much googling I published the following &amp;#8230;. &lt;/p&gt;

&lt;p&gt;&lt;b&gt;%systemroot%\explorer.exe /n, /e, /root,/select,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Someone who is familiar with this will ask why the /select, option is there? as it will work without that&amp;#8230; If you don&amp;#8217;t add that select, you will not be able to use the &amp;#8220;Search&amp;#8221; file and folders under explorer if its published via Citrix.. (I have no idea why).&lt;/p&gt;</description>
			    <link>http://www.ozctx.com/index.php?blog=1&amp;title=publishing_explorer_exe_on_xenapp_4_0&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1</link>
			  </item>
			  			  <item>
			    <title>AGEE "SSL Error 38" and Citrix XTE Service</title>
			    <description>&lt;p&gt;&lt;b&gt;What is happening?&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;When monitoring Citrix by SolarWinds, we are getting one &amp;#8220;Reliability Server&amp;#8221; error every 5 minutes when SolarWinds scans port 2598 on the Citrix server. By searching Citrix KB, found the following article: &lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://support.citrix.com/article/CTX114680&quot;&gt;http://support.citrix.com/article/CTX114680&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://support.citrix.com/article/CTX120297&quot;&gt;http://support.citrix.com/article/CTX120297&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Adding the two lines to the end of httpd.conf, restart XTE service without seeing a problem. But after Citrix server restart, XTE service could not start. By checking the httpd.conf, found the two lines have been moved to the top of the file, and is added to the first line without a space between the line &amp;#8220;#Citrix Beginning&quot;.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Solution:&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Add the two lines to the end of the httpd.conf and add one extra line break after the two lines. Now restarting the Citrix server will not change the httpd.conf. XTE service is running fine.&lt;/p&gt;</description>
			    <link>http://www.ozctx.com/index.php?blog=1&amp;title=agee_ssl_error_38_and_citrix_xte_service&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1</link>
			  </item>
			  			  <item>
			    <title>Remove dead Citrix Servers from the farm</title>
			    <description>&lt;p&gt;Once our farm is all Presentation Server 4.5, I found it hard to remove dead servers from the farm via AMC.&lt;/p&gt;

&lt;p&gt;Occassionally we build VM Citrix servers for testing, and some VMs may be deleted before Citrix Presentation Server is uninstalled. Once this happens, for half of servers we are not able to remove it from AMC.&lt;/p&gt;

&lt;p&gt;I tried the following without success:&lt;/p&gt;

&lt;p&gt;1. Modify hosts file on the server running AMC. This resulted in a error event ID 4 kerberos duplicate server logged on the server.&lt;br /&gt;
2. Run dscheck before removing it from AMC. This did not help.&lt;/p&gt;

&lt;p&gt;Eventually, I have to create a new vm with the same server name, install Presentation Server 4.5 and remove it right away to remove it from the farm.&lt;/p&gt;

&lt;p&gt;After this I have checked with another 4 dead servers. I was able to delete two of them but not the other two. &lt;/p&gt;</description>
			    <link>http://www.ozctx.com/index.php?blog=1&amp;title=remove_dead_citrix_servers_from_the_farm&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1</link>
			  </item>
			  			  <item>
			    <title>Practical SolarWinds APM and Citrix</title>
			    <description>&lt;p&gt;We start to play with APM on SolarWinds. APM stands for Application Performance Monitoring, it can poke into Windows services, WMI, scripting etc. It also incorporate the convenience of monitoring protocols and ports. &lt;/p&gt;

&lt;p&gt;The following is a brief introduction on how to set up alert in SolarWinds to monitor Citrix XML Service on XML Broker.&lt;/p&gt;

&lt;p&gt;1.	In Solarwinds homepage, click &amp;#8220;Application Performance Monitor&amp;#8221; on the Modules row. We are now on the &amp;#8220;APM Application Summary&amp;#8221; page.&lt;/p&gt;

&lt;p&gt;2.	Click &amp;#8220;APM Settings&amp;#8221; to create new Application. Click &amp;#8220;AppBuilder&amp;#8221; to start the wizard.&lt;/p&gt;

&lt;p&gt;3.	Take &amp;#8220;Citrix XML Broker&amp;#8221; as example. &lt;br /&gt;
      a.	Select &amp;#8220;Windows Service Monitor&amp;#8221; as the first componet, click &amp;#8220;Next&amp;#8221;;&lt;/p&gt;

&lt;p&gt;      b.	Select &amp;#8220;Create a new component monitor&amp;#8221; at next step, and click &amp;#8220;Next&amp;#8221;;&lt;/p&gt;

&lt;p&gt;      c.	Type &amp;#8220;ServerName&amp;#8221; in the server list (or click browse to choose from the list), and &amp;#8220;Citrix Service Account&amp;#8221; in the Choose Credential drop down list. Click &amp;#8220;Next&amp;#8221;;&lt;br /&gt;
      d.	Now we will see all Windows Services for this server listed, including  Running and Stopped Windows Service. Select CtxHttp Citrix XML Service, then click &amp;#8220;Next&amp;#8221;;&lt;br /&gt;
      e.	Now type &amp;#8220;Citrix XML Service&amp;#8221; as the Monitor Name, accept all default settings, and click &amp;#8220;Next&amp;#8221;;&lt;br /&gt;
      f.	In &amp;#8220;New Application Monitor Template&amp;#8221;, type &amp;#8220;Citrix XML Broker&amp;#8221; and click &amp;#8220;Next&amp;#8221;;&lt;br /&gt;
      g.	Now select from the tree view list the desired nodes (computers) to be monitored, and click &amp;#8220;Next&amp;#8221;;&lt;br /&gt;
      h.	Then click &amp;#8220;OK, CREATE&amp;#8221; button to finish the APM.&lt;/p&gt;

&lt;p&gt;4.	After setting up the APM, we can jump to the Solarwinds console to set up the alerting:&lt;br /&gt;
      a.	Log on to Solarwinds Console, in All Programs, click &amp;#8220;SolarWinds Orion&amp;#8221;, Alerting, Reporting, and Mapping, then click Advanced Alert Manager;&lt;br /&gt;
      b.	Click Configure Alerts, the click &amp;#8220;New&amp;#8221; to create new alert;&lt;br /&gt;
      c.	Type &amp;#8220;Citrix XML Broker&amp;#8221; in the Name field;&lt;br /&gt;
      d.	Select &amp;#8220;Trigger Condition&amp;#8221; tab, and add the following simple conditions:&lt;br /&gt;
              i.	Application Name is equal to Citrix XML Broker&lt;br /&gt;
              ii.	Appliation Status is not equal to Up&lt;br /&gt;
              iii.	Node Status is not equal to Down&lt;br /&gt;
      e.	Select &amp;#8220;Trigger Actions&amp;#8221; tab, click &amp;#8220;Add New Action&amp;#8221;, choose the &amp;#8220;Send an E-mail/Page&amp;#8221;, and click &amp;#8220;OK&amp;#8221;;&lt;br /&gt;
      f.	In the action details fields, type the recipient&amp;#8217;s email address in &amp;#8220;To&amp;#8221; field, change From E-Mail Account details if you need. In the message area, type in the subject and Message content. You can use variables. The SMTP fields are prefilled. In Alert Escalation tab, select appropriate options regarding to alert acknowledgement and alert repeating.&lt;br /&gt;
      g.	Once these finished, you can test the Alert to check the alert format.&lt;/p&gt;
</description>
			    <link>http://www.ozctx.com/index.php?blog=1&amp;title=practical_solarwinds_apm_and_citrix&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1</link>
			  </item>
			  	</channel>
</rss>
