Check this out:

REM == netstat-stats-port80.vbs starts here

REM
REM netstat-stats-port80.vbs
REM version 1.1 09-05-08
REM version 1.2 10-11-26  added disclaimer
REM Noah Davids - [email protected]
REM
REM This script loops forever doing a "netstat -s" to collect the TCP/IP
REM statistics on the system. It delays for SleepTime seconds at the end
of
REM each loop. SleepTime is the only argument. The statistics are
collected in
REM a file named netstat-stats-port80.DATE.txt where DATE is the current
date.
REM
REM The current version of this script and documentation may be found at
REM http://noahdavids.org/self_published/netstat-stats-port80.vbs.html
REM
REM to run the script execute the command
REM           cscript netstat-stats-port80.vbs SleepTime
REM from a command window.
REM
REM feel free to contact me with any questions or comments
REM
REM This software is provided on an "AS IS" basis, WITHOUT ANY WARRANTY
OR ANY SUPPORT OF ANY KIND. 
REM The AUTHOR SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY
REM PARTICULAR PURPOSE.  This disclaimer applies, despite any verbal
representations of any kind provided
REM by the author or anyone else.
REM
option explicit
dim SleepTime
dim numtimes
dim exectimes
dim wshShell
dim WshNetwork
dim Today
dim TodaysDate
dim CurrentTime
dim Message
dim FillerLen
dim Header

Header = "=================================================="

if WScript.Arguments.Count <> 2 then
    WScript.Echo "Usage:" & _
    vbtab & "csript netstat-stats-port80.vbs SleepTime numtimes" & _
    vbNewLine & vbtab & "SleepTime is time in seconds between netstats"
& _
    vbNewLine & vbtab & "numtimes is number of times you want the
netstat command to run for"
else
    SleepTime = WScript.Arguments (0)
    SleepTime = SleepTime * 1000
    numtimes = WScript.Arguments (1)
    Set WshShell = WScript.CreateObject ("WScript.Shell")

    Set WshNetwork = WScript.CreateObject("WScript.Network")
    
    For exectimes = 1 to numtimes
        Today = Date
        TodaysDate = Year(Today) & "-" & Month (Today) & "-" & Day
(Today) 
        CurrentTime = time
        Message = TodaysDate & " " & time & " - " _
            & WshNetwork.UserDomain & "\" & WshNetwork.ComputerName
        FillerLen = (78 - Len (Message)) / 2
        Message = Mid (Header, 1, FillerLen) & " " & Message & Mid
(Header, 1, FillerLen)
        WshShell.Run "Cmd.exe /c echo " & Message & " >>
netstat-stats-port80." & _
            TodaysDate & ".txt", 0, True
        WshShell.Run "Cmd.exe /c netstat -a -n | find " & """:80""" & "
>> netstat-stats-port80." & TodaysDate & _  
            ".txt", 0, True
        Wscript.Echo Message
        WScript.Sleep SleepTime
    Next

        WScript.Echo "Exiting Script"
        Wscript.Quit

end if
REM
REM == netstat-stats-port80.vbs ends here



Regards,
 
Andrew Goodall
Software Engineer 2 | Development Services |  jcpenney . www.jcp.com

-----Original Message-----
From: Action Request System discussion list(ARSList)
[mailto:[email protected]] On Behalf Of Pierson, Shawn
Sent: Wednesday, May 18, 2011 1:05 PM
To: [email protected]
Subject: Re: MidTier Current Connection

This is getting more into the network troubleshooting side of things,
but it is possible to run netstat on the server to specifically see what
IP addresses or DNS names are connected to the server and on what port.
You didn't mention what OS so it varies between Windows and various Unix
OSes.  

Of course, this also requires that you know which specific IP or PC name
this user is using, at which point you could see if that PC is making a
connection or not.

There are caveats, however, as specific network devices that use
technology like NAT or load balancers can alter what IP address hits
your server instead of the actual PC's name or IP address.

However, just to give an example, I am running Windows Server for my Mid
Tier, so if I RDP onto the server and open up a cmd prompt and type
"netstat" and hit enter, it returns something like this (I am only
including the top row but it should be a long list):

Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    12.34.56.789:80        shawnPC:1104         ESTABLISHED

The area that says, "Local Address" should be your server's publicly
available IP address, and you can ignore anything that doesn't have :80
at the end of it or whichever port your web server runs on.  In my case,
my PC's DNS name is translated, and if it's something like what I put
here I can see that my PC is connecting to the web server (port 80).
However, this list may be hundreds of lines or more long, depending on
how many other entities connect to your Mid Tier server.  If you are on
Unix you can use grep to help you find just the specific IP address or
PC name that you are looking for.  In both cases, you can append ">
netstatlogfilewhatever.txt" (using your own file name) and it will write
it to a text file that you can view in Notepad, vi, or whatever.

I know you are looking for a more Remedy-based solution, but hopefully
this helps.

Thanks,

Shawn Pierson 
Remedy Developer | Southern Union


-----Original Message-----
From: Action Request System discussion list(ARSList)
[mailto:[email protected]] On Behalf Of Andre Hughes
Sent: Wednesday, May 18, 2011 11:41 AM
To: [email protected]
Subject: MidTier Current Connection

Hello,

We have two separate Mid Tiers (7.5). Is there any way to find out if a
user
is currently connected to a specific Mid Tier? Other than asking them of
course!

We are using the standard Tomcat from BMC's 7.5 patch 7 install.

Mid Tier Version 7.5.00 Patch 007 201009161400

Thanks,

Andre

________________________________________________________________________
_______
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug11 www.wwrug.com ARSList: "Where the Answers Are"

Private and confidential as detailed here:
http://www.sug.com/disclaimers/default.htm#Mail . If you cannot access
the link, please e-mail sender.

________________________________________________________________________
_______
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug11 www.wwrug.com ARSList: "Where the Answers Are"
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged 
material.  If the reader of this message is not the intended recipient,
you are hereby notified that your access is unauthorized, and any review,
dissemination, distribution or copying of this message including any 
attachments is strictly prohibited.  If you are not the intended
recipient, please contact the sender and delete the material from any
computer.

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug11 www.wwrug.com ARSList: "Where the Answers Are"

Reply via email to