Query current host status via CLI
Hello All,
One of my Intel admins has asked if there is a way to determine the total number of citrix sessions in use using hobbit. We are currently using the citrix plug-in, but he would like the same information displayed as a total for the farm. I'm sure there are ways within windows to do this, but I am not a windows admin. I know that I could easily to this from the command line in many ways.
My three questions are:
Is anyone already doing this?Is there a way from the command line on the hobbit server todetermine the most current status for a hobbit client? My thought was to scrape the include file for the citrix servers in question, feed it to a for loop, and then query the status, and then just count up the logged in clients. I've looked in the files in ~/data, and do not see current status messages there.
Can anyone think of a better way than in question #2, assumingI can get the most current status message via CLI?
Thanks,
Al
This e-mail message and any attached files are confidential and are intended solely for the use of the addressee(s) named above. If you are not the intended recipient, any review, use, or distribution of this e-mail message and any attached files is strictly prohibited. This communication may contain material protected by Federal privacy regulations, attorney-client work product, or other privileges. If you have received this confidential communication in error, please notify the sender immediately by reply e-mail message and permanently delete the original message. To reply to our email administrator directly, send an email to: postmaster at orlandoregional.org . If this e-mail message concerns a contract matter, be advised that no employee or agent is authorized to conclude any binding agreement on behalf of Orlando Regional Healthcare by e-mail without express written confirmation by an officer of the corporation. Any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of Orlando Regional Healthcare.
On Wed, Sep 06, 2006 at 10:16:38AM -0400, Jeffcoat, Al wrote:
One of my Intel admins has asked if there is a way to determine the total number of citrix sessions in use using hobbit. We are currently using the citrix plug-in, but he would like the same information displayed as a total for the farm. I'm sure there are ways within windows to do this, but I am not a windows admin. I know that I could easily to this from the command line in many ways.
Is anyone already doing this?
Yes.
You can use the command bb 127.0.0.1 "hobbitdboard test=citrix fields=msg" then search each line of output for the string "NNN users active" and sum up the NNN values. I have some rather ugly C code to do it, but I'm sure it can easily be done in Perl if you know how.
determine the most current status for a hobbit client?Is there a way from the command line on the hobbit server to
"hobbitdboard" command as above if you want the status for many hosts, "hobbitdlog host=HOSTNAME test=TESTNAME" if you want just a single status.
Regards, Henrik
hi,
where can i download the citrix plugin to get the users sessions?
thanks enrico
There's a file in the contrib directory of the source distribution file called citrix.zip. We are using it with the bbwin client.
Al
-----Original Message----- From: Enrico Morigi [mailto:emorigi at auslrn.net] Sent: Monday, September 11, 2006 8:49 AM To: hobbit at hswn.dk Subject: Re: [hobbit] Query current host status via CLI
hi,
where can i download the citrix plugin to get the users sessions?
thanks enrico
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
This e-mail message and any attached files are confidential and are intended solely for the use of the addressee(s) named above. If you are not the intended recipient, any review, use, or distribution of this e-mail message and any attached files is strictly prohibited. This communication may contain material protected by Federal privacy regulations, attorney-client work product, or other privileges. If you have received this confidential communication in error, please notify the sender immediately by reply e-mail message and permanently delete the original message. To reply to our email administrator directly, send an email to: postmaster at orlandoregional.org . If this e-mail message concerns a contract matter, be advised that no employee or agent is authorized to conclude any binding agreement on behalf of Orlando Regional Healthcare by e-mail without express written confirmation by an officer of the corporation. Any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of Orlando Regional Healthcare.
This is what we are using. It runs on one of the Citrix servers. The others don't collect farm data. It's not real pretty, but it does what we need.
BEGIN '******************************************************************* '******************************************************************* '*******************************************************************
'***********************************************************************
' ' VBScript Source File ' ' NAME: CITRIXALL.VBS ' ' AUTHOR: John A. Milburn ' DATE : 02/04/05 ' ' '***********************************************************************
Option Explicit '***********************************************************************
Const ForReading = 1 Const ForWriting = 2
Public Const wbemFlagReturnImmediately = &h10 Public Const wbemFlagForwardOnly = &h20
'On Error Resume Next
Dim strComputer strComputer = "."
Dim strFileOut, blArgs Dim lngResult, lngUsersOnFarm lngResult = 0
strFileOut = "-ctxinfo"
Dim fso Set fso = CreateObject("Scripting.FileSystemObject") If fso.FileExists(strFileOut) Then fso.DeleteFile(strFileOut) End If Set fso = Nothing
lngUsersOnFarm = GetFarmUsers(strComputer) lngResult = GetCitrixInfo(strComputer)
WScript.Quit lngResult '***********************************************************************
'***********************************************************************
'***********************************************************************
'***********************************************************************
'***********************************************************************
' Function name: GetCitrixInfo ' Parameters: ' '***********************************************************************
Function GetCitrixInfo(strComputer) '***********************************************************************
' On Error Resume Next
Dim strFarmName, strIPAddress, strLoginsEnabled, strNumberOfActiveSessions Dim strNumberOfDisconnectedSessions, strNumberOfSessions, strServerName Dim strServerType, strZoneName, strZoneRanking
Dim objWMIService, colItems, objItem Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\Citrix") Set colItems = objWMIService.ExecQuery("SELECT * FROM MetaFrame_Server", "WQL", _ wbemFlagReturnImmediately + wbemFlagForwardOnly)
Dim strOut
strOut = "" For Each objItem In colItems strFarmName = objItem.FarmName strIPAddress = objItem.IPAddress strLoginsEnabled = objItem.LoginsEnabled strNumberOfActiveSessions = objItem.NumberOfActiveSessions strNumberOfDisconnectedSessions = objItem.NumberOfDisconnectedSessions strNumberOfSessions = objItem.NumberOfSessions strServerName = objItem.ServerName strServerType = objItem.ServerType strZoneName = objItem.ZoneName strZoneRanking = objItem.ZoneRanking Next Set objItem = Nothing Set colItems = Nothing Set objWMIService = Nothing
strZoneName = Right(strZoneName, Len(strZoneName) - (InStr(strZoneName, Chr(34)))) strZoneName = Left(strZoneName, (InStr(strZoneName, Chr(34)) - 1))
strOut = strOut & "Farm Name : " & strFarmName & vbLf strOut = strOut & "Farm users : " & CStr(lngUsersOnFarm) & vbLf strOut = strOut & "IP Address : " & strIPAddress & vbLf strOut = strOut & "Logins Enabled : " & strLoginsEnabled & vbLf strOut = strOut & "Sessions" & vbLf strOut = strOut & " Active : " & strNumberOfActiveSessions & vbLf strOut = strOut & " Disconnected : " & strNumberOfDisconnectedSessions & vbLf strOut = strOut & " Total : " & strNumberOfSessions & vbLf strOut = strOut & "Server Type : " & strServerType & vbLf strOut = strOut & "Zone Name : " & strZoneName & vbLf strOut = strOut & "Zone Ranking : " & strZoneRanking & vbLf strOut = strOut & vbLf strOut = strOut & strNumberOfActiveSessions & " users active" & vbLf strOut = strOut & vbLf ' WScript.Echo strOut
Dim fso, objFileOut
Set fso = CreateObject("Scripting.FileSystemObject")
Dim blRed, blYellow, blGreen
blRed = False
blYellow = False
blGreen = True
'Set warning and error If strNumberOfActiveSessions > 20 Then blYellow = True End If
If strNumberOfActiveSessions > 25 Then blRed = True End If
Set objFileOut = fso.OpenTextFile(strFileOut, ForWriting, True) If blRed Then objFileOut.WriteLine "red Citrix Server Information" Else If blyellow Then objFileOut.WriteLine "yellow Citrix Server Information" Else objFileOut.WriteLine "green Citrix Server Information" End If End If
objFileOut.WriteLine "" objFileOut.WriteLine strOut objFileOut.WriteLine "" objFileOut.Close
Set fso = Nothing GetCitrixInfo = -1 Exit Function
End Function '***********************************************************************
'***********************************************************************
Function GetFarmUsers(strComputer) 'Server: \\COSTERMSERV3\root\Citrix:Citrix_Server.ServerName="D8TERMSERV1" 'Zone: \\COSTERMSERV3\root\Citrix:Citrix_Zone.ZoneName="D8" '***********************************************************************
Dim lngUserCount, objWMIService, colItems, objItem Dim strThisServer, lngPtr, strThisComputer Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\Citrix") Set colItems = objWMIService.ExecQuery("SELECT * FROM Citrix_ServersInZone", "WQL", _ wbemFlagReturnImmediately + wbemFlagForwardOnly) For Each objItem In colItems strThisServer = objItem.Server lngPtr = InStr(strThisServer, "=") + 2 strThisComputer = Mid(strThisServer, lngPtr, (Len(strThisServer) - lngPtr)) lngUserCount = lngUserCount + GetUsersOnServer(strThisComputer) Next Set objItem = Nothing Set colItems = Nothing Set objWMIService = Nothing GetFarmUsers = lngUserCount End Function '***********************************************************************
'***********************************************************************
Function GetUsersOnServer(strThisComputer) '***********************************************************************
Dim objWMIService, colItems, objItem, lngNumberOfSessions Set objWMIService = GetObject("winmgmts:\\" & strThisComputer & "\root\Citrix") Set colItems = objWMIService.ExecQuery("SELECT * FROM MetaFrame_Server", "WQL", _ wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems ' lngNumberOfSessions = CLng(objItem.NumberOfSessions) lngNumberOfSessions = CLng(objItem.NumberOfActiveSessions) ' lngNumberOfSessions = CLng(objItem.NumberOfDisconnectedSessions) ' lngNumberOfSessions = CLng(objItem.NumberOfSessions) Next Set objItem = Nothing Set colItems = Nothing Set objWMIService = Nothing
GetUsersOnServer = lngNumberOfSessions
End Function '***********************************************************************
'******************************************************************* '******************************************************************* '******************************************************************* END
-----Original Message----- From: Jeffcoat, Al [mailto:Al.Jeffcoat at orhs.org] Sent: Monday, September 11, 2006 9:59 AM To: hobbit at hswn.dk Subject: RE: [hobbit] Query current host status via CLI
There's a file in the contrib directory of the source distribution file called citrix.zip. We are using it with the bbwin client.
Al
-----Original Message----- From: Enrico Morigi [mailto:emorigi at auslrn.net] Sent: Monday, September 11, 2006 8:49 AM To: hobbit at hswn.dk Subject: Re: [hobbit] Query current host status via CLI
hi,
where can i download the citrix plugin to get the users sessions?
thanks enrico
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
This e-mail message and any attached files are confidential and are intended solely for the use of the addressee(s) named above. If you are not the intended recipient, any review, use, or distribution of this e-mail message and any attached files is strictly prohibited. This communication may contain material protected by Federal privacy regulations, attorney-client work product, or other privileges. If you have received this confidential communication in error, please notify the sender immediately by reply e-mail message and permanently delete the original message. To reply to our email administrator directly, send an email to: postmaster at orlandoregional.org . If this e-mail message concerns a contract matter, be advised that no employee or agent is authorized to conclude any binding agreement on behalf of Orlando Regional Healthcare by e-mail without express written confirmation by an officer of the corporation. Any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of Orlando Regional Healthcare.
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
participants (4)
-
Al.Jeffcoat@orhs.org
-
emorigi@auslrn.net
-
henrik@hswn.dk
-
John.Milburn@illinois.gov