Ip for a network session
Posted in 2008
The poster wanted to find the source IP/host of all network-connected sessions and saw no obvious onstat option. One reply pointed to the "hostname" column of onstat -g ses (sometimes shown as a hex IP), but he found that output truncated the value. John Miller suggested querying sysmaster instead: select sid, trim(username)||'@'||trim(hostname), and connect time via DBINFO('utc_to_datetime',connected) from sysscblst where connected > 0 — noting hostname is wider in newer versions. The poster confirmed this solved his problem.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: General Discussion
Is there a reasonable way to get the source ip address for all network
connected session? I don't see an onstat option that looks obvious for
this.
--
--------------------------------------------
Chris Salch
Programmer/Analyst
LeTourneau University
the Hex IP address is in onstat -g ses output under hostname
> Is there a reasonable way to get the source ip address for all network
> connected session? I don't see an onstat option that looks obvious for
> this.
>
> --
> --------------------------------------------
> Chris Salch
> Programmer/Analyst
> LeTourneau University
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
> See you at the IIUG Informix 2008 Conference
> The Power Conference for Informix Professionals
> April 27 - 30, 2008 Marriott Overland Park (Kansas City), Kansas
> http://www.iiug.org/conf
> Registration Now Open!!
>
>
================================================================================
===========
> Please access the attached hyperlink for an important electronic
> communications disclaimer:
>
> http://www.oninit.com/home/disclaimer.php
>
>
================================================================================
===========
>
--
Paul Watson
Tel: +1 913-400-2620
Mob: +1 913-387-7529
Web: www.oninit.com
Failure is not as frightening as regret.
If you want to improve, be content to be thought foolish and stupid.
================================================================================
===========
Please access the attached hyperlink for an important electronic
communications disclaimer:
http://www.oninit.com/home/disclaimer.php
================================================================================
===========
how about getting the information from the sysmaster
database. The following select should do the trick. I believe
in newer version the hostname column has been expanded
to hold longer hostnames.
John
database sysmaster;SELECT sid SID , trim(username)||'@'||trim(hostname) USER ,
(CURRENT-DBINFO('utc_to_datetime',connected))::interval hour to sec=
ond
FROM sysscblst
WHERE connected > 0
=
"Chris Salch" =
<ChrisSalch@letu. =
edu> =
To
Sent by: ids@iiug.org =
ids-bounces@iiug. =
cc
org =
Subj=
ect
Ip for a network session [11364=
]
02/21/2008 08:20 =
AM =
=
=
Please respond to =
ids@iiug.org =
=
=
Is there a reasonable way to get the source ip address for all network
connected session? I don't see an onstat option that looks obvious for
this.
--
--------------------------------------------
Chris Salch
Programmer/Analyst
LeTourneau University
***********************************************************************=
********
Forum Note: Use "Reply" to post a response in the discussion forum.
See you at the IIUG Informix 2008 Conference
The Power Conference for Informix Professionals
April 27 - 30, 2008 Marriott Overland Park (Kansas City), Kansas
http://www.iiug.org/conf
Registration Now Open!!
=
On Thu, 2008-02-21 at 11:24 -0500, Paul Watson wrote:
> the Hex IP address is in onstat -g ses output under hostname
>
> > Is there a reasonable way to get the source ip address for all network
> > connected session? I don't see an onstat option that looks obvious for
> > this.
> >
> > --
> > --------------------------------------------
> > Chris Salch
> > Programmer/Analyst
> > LeTourneau University
> >
> >
> >
>
*******************************************************************************
> > Forum Note: Use "Reply" to post a response in the discussion forum.
> >
> > See you at the IIUG Informix 2008 Conference
> > The Power Conference for Informix Professionals
> > April 27 - 30, 2008 Marriott Overland Park (Kansas City), Kansas
> > http://www.iiug.org/conf
> > Registration Now Open!!
> >
> >
>
================================================================================
===========
> > Please access the attached hyperlink for an important electronic
> > communications disclaimer:
> >
> > http://www.oninit.com/home/disclaimer.php
> >
> >
>
================================================================================
===========
> >
>
No good on this one. It's not in hex for me and it appears to be
clipping the important part.
session #RSAM total used dynamic
id user tty pid hostname threads memory memory explain
2835926 informix - 0 - 0 12288 7968 off
2835925 informix - 0 - 0 12288 7968 off
2835924 barnesc - 17209 paul 1 77824 69928 off
2835923 informix - 0 - 0 12288 7968 off
2835912 rogersv t4 17142 paul 1 73728 64016 off
Assuming that formated properly. . .
--
--------------------------------------------
Chris Salch
Programmer/Analyst
LeTourneau University
903-233-3537
On Thu, 2008-02-21 at 11:31 -0500, John Miller iii wrote:
> how about getting the information from the sysmaster
> database. The following select should do the trick. I believe
> in newer version the hostname column has been expanded
> to hold longer hostnames.
>
> John
>
> database sysmaster;> SELECT sid SID , trim(username)||'@'||trim(hostname) USER ,
>
> (CURRENT-DBINFO('utc_to_datetime',connected))::interval hour to sec=
> ond
> FROM sysscblst
> WHERE connected > 0
>
> =
>
> "Chris Salch" =
>
> <ChrisSalch@letu. =
>
> edu> =
> To
>
> Sent by: ids@iiug.org =
>
> ids-bounces@iiug. =
> cc
>
> org =
>
> Subj=
> ect
>
> Ip for a network session [11364=
> ]
>
> 02/21/2008 08:20 =
>
> AM =
>
> =
>
> =
>
> Please respond to =
>
> ids@iiug.org =
>
> =
>
> =
>
> Is there a reasonable way to get the source ip address for all network
> connected session? I don't see an onstat option that looks obvious for
> this.
>
That did it thanks :)
--
--------------------------------------------
Chris Salch
Programmer/Analyst
LeTourneau University
onstat -g ses
look under "hostname"...