Once a while, I am getting users calling “Service Unavaible” 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 http://forums.webhostautomation.com/showthread.php?t=11141, 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.
===Code Starts==========================================================
‘ Variables that need to be defined for the script to work
‘http://forums.webhostautomation.com/showthread.php?t=11141
Const LogDir = “C:\Source\AppPoolLog”
ToAddress = “user@it.com”
FromAddress = “user@it.com”
showAppPools ‘Runs showAppPools Sub
‘ This will get the list of all app pools on the server
Sub showAppPools
Dim obj,apool
set obj = GetObject("IIS://localhost/W3SVC/apppools")
for each apool in obj
apppoolStatus apool.name
Next
set obj = nothing
End Sub
‘ This will get the status of the app pool
Sub apppoolStatus(apppool)
Dim obj
set obj = GetObject("IIS://localhost/W3SVC/apppools/” & apppool)
Select Case obj.apppoolstate
Case 0
writetoLog apppool,"0″ ‘Do not know what this status is
Case 1
writetoLog apppool,"1″ ‘Do not know what this status is
Case 2
writetoLog apppool,"Up”
Case 3
writetoLog apppool,"3″ ‘Do not know what this status is
Case 4
writetoLog apppool,"DOWN”
startapppool apppool
SendEmail GetComputerName,apppool
writetoLog apppool,"Restarted”
End Select
set obj = nothing
End Sub
‘ This will write information to a log file
Sub writetoLog(apppool,response)
Dim fso
lday = datepart("d",date)
lmonth = datepart("m",date)
lyear = datepart("yyyy",date)
logdate = lyear & lmonth & lday
set fso = CreateObject ("Scripting.FileSystemObject")
Set objFSOwriteline = FSO.OpenTextFile(LogDir & “\” & logdate & “.log", 8,True)
objFSOwriteline.WriteLine(response & “,” & apppool & “,” & now())
objFSOwriteline.close
Set objFSOwriteline = nothing
set fso = nothing
End Sub
‘ This starts the down app pool
Sub startapppool(apppool)
Dim obj
set obj = GetObject("IIS://localhost/W3SVC/apppools/” & apppool)
obj.start
set obj = nothing
End Sub
‘ This send a email regarding the down/restarted app pool
Sub emailSendCDOSYS(apppool)
Dim Mailer
Set Mailer=CreateObject("CDO.Message")
Message = “===============================================” & VbCrLf
Message = Message & “Application Pool: ” & apppool & ” has been restarted” & VbCrLf
Message = Message & “Date/Time: “& now() &"” & VbCrLf
Message = Message & “===============================================” & VbCrLf
Subject = “Application Pool: ” & apppool & ” has been restarted”
Mailer.TextBody = Message
Mailer.Subject = Subject
Mailer.To = ToAddress
Mailer.From = FromAddress
Mailer.Send
set Mailer = Nothing
End Sub
sub SendEmail(ServerName, apppool)
Set objEmail = CreateObject("CDO.Message")
objEmail.From = “user@it.com”
objEmail.To = “user@it.com”
objEmail.Subject = “Application pool: ” & apppool & ” is restarted on ” & ServerName
objEmail.Textbody = “Application Pool error.”
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
“smtp.it.com”
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
End Sub
Function GetComputerName
Set objWMISvc = GetObject( “winmgmts:\\.\root\cimv2″ )
Set colItems = objWMISvc.ExecQuery( “Select * from Win32_ComputerSystem", , 48 )
For Each objItem in colItems
strComputerName = objItem.Name
Next
GetComputerName = strComputerName
End Function
===Code ends============================================
Hello All,
Its been a while since I blogged my daily chanllenges within Xenapp. I have been quiet busy with work and *cough* WOW .. haha
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 “My Documents” 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)…. regardless this caused all sorts of issues for users.
After much running around and emails, everyone finally agreed that they wanted a two pane Explorer with the left Pane should “My Computer” expanded in tree view and the right pane, showing all “Drives” in icon view. As shown below.

After much googling I published the following ….
%systemroot%\explorer.exe /n, /e, /root,/select,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
Someone who is familiar with this will ask why the /select, option is there? as it will work without that… If you don’t add that select, you will not be able to use the “Search” file and folders under explorer if its published via Citrix.. (I have no idea why).
2 comments | Permalink
What is happening?
When monitoring Citrix by SolarWinds, we are getting one “Reliability Server” error every 5 minutes when SolarWinds scans port 2598 on the Citrix server. By searching Citrix KB, found the following article:
http://support.citrix.com/article/CTX114680
http://support.citrix.com/article/CTX120297
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 “#Citrix Beginning".
Solution:
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.
1 comment | Permalink
Once our farm is all Presentation Server 4.5, I found it hard to remove dead servers from the farm via AMC.
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.
I tried the following without success:
1. Modify hosts file on the server running AMC. This resulted in a error event ID 4 kerberos duplicate server logged on the server.
2. Run dscheck before removing it from AMC. This did not help.
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.
After this I have checked with another 4 dead servers. I was able to delete two of them but not the other two.
4 comments | Permalink
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.
The following is a brief introduction on how to set up alert in SolarWinds to monitor Citrix XML Service on XML Broker.
1. In Solarwinds homepage, click “Application Performance Monitor” on the Modules row. We are now on the “APM Application Summary” page.
2. Click “APM Settings” to create new Application. Click “AppBuilder” to start the wizard.
3. Take “Citrix XML Broker” as example.
a. Select “Windows Service Monitor” as the first componet, click “Next”;
b. Select “Create a new component monitor” at next step, and click “Next”;
c. Type “ServerName” in the server list (or click browse to choose from the list), and “Citrix Service Account” in the Choose Credential drop down list. Click “Next”;
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 “Next”;
e. Now type “Citrix XML Service” as the Monitor Name, accept all default settings, and click “Next”;
f. In “New Application Monitor Template”, type “Citrix XML Broker” and click “Next”;
g. Now select from the tree view list the desired nodes (computers) to be monitored, and click “Next”;
h. Then click “OK, CREATE” button to finish the APM.
4. After setting up the APM, we can jump to the Solarwinds console to set up the alerting:
a. Log on to Solarwinds Console, in All Programs, click “SolarWinds Orion”, Alerting, Reporting, and Mapping, then click Advanced Alert Manager;
b. Click Configure Alerts, the click “New” to create new alert;
c. Type “Citrix XML Broker” in the Name field;
d. Select “Trigger Condition” tab, and add the following simple conditions:
i. Application Name is equal to Citrix XML Broker
ii. Appliation Status is not equal to Up
iii. Node Status is not equal to Down
e. Select “Trigger Actions” tab, click “Add New Action”, choose the “Send an E-mail/Page”, and click “OK”;
f. In the action details fields, type the recipient’s email address in “To” 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.
g. Once these finished, you can test the Alert to check the alert format.
:: Next Page >>
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
| << < | > >> | |||||
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | |||