Unix Technical Forum

Interpretation of onstat -g ses, hostname column

This is a discussion on Interpretation of onstat -g ses, hostname column within the Informix forums, part of the Database Server Software category; --> Sometimes the hostname is the DNS entry (i.e. human readable). Other times, when the connecting computer does not have ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-20-2008, 07:59 AM
Mike Reetz
 
Posts: n/a
Default Interpretation of onstat -g ses, hostname column

Sometimes the hostname is the DNS entry (i.e. human readable). Other
times, when the connecting computer does not have a DNS entry, the
value is in hex (??). How can that be changed back to an IP address?

Example:

3 values for hostname from onstat -g ses:

a010a1e
a010d22
a0e0213

From netstat -a connections via sqlexec with only IP addresses:

10.1.13.34
10.1.10.30
10.14.2.19

How can I map from the onstat output to the one of the IPs in the
netstat list?

Thanks,
Mike
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-20-2008, 07:59 AM
TBP
 
Posts: n/a
Default Re: Interpretation of onstat -g ses, hostname column

Mike Reetz wrote:
> Sometimes the hostname is the DNS entry (i.e. human readable). Other
> times, when the connecting computer does not have a DNS entry, the
> value is in hex (??). How can that be changed back to an IP address?
>
> Example:
>
> 3 values for hostname from onstat -g ses:
>
> a010a1e
> a010d22
> a0e0213
>
> From netstat -a connections via sqlexec with only IP addresses:
>
> 10.1.13.34
> 10.1.10.30
> 10.14.2.19
>
> How can I map from the onstat output to the one of the IPs in the
> netstat list?
>
> Thanks,
> Mike


Hexadecimal Decimal

0a 01 0a 1e => 10.1.13.30
0a 01 0d 22 => 10.1.13.34
0a 0e 02 13 => 10.14.2.19
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-20-2008, 07:59 AM
Claus Samuelsen
 
Posts: n/a
Default Re: Interpretation of onstat -g ses, hostname column

a010a1e = (hex) a.01.0a.1e = (dec) 10.1.10.30
a010d22 = (hex) a.01.0d.22 = (dec) 10.1.13.34
a0e0213 = (hex) a.0e.02.13 = (dec) 10.14.2.19


Mike Reetz wrote:

> Sometimes the hostname is the DNS entry (i.e. human readable). Other
> times, when the connecting computer does not have a DNS entry, the
> value is in hex (??). How can that be changed back to an IP address?
>
> Example:
>
> 3 values for hostname from onstat -g ses:
>
> a010a1e
> a010d22
> a0e0213
>
> From netstat -a connections via sqlexec with only IP addresses:
>
> 10.1.13.34
> 10.1.10.30
> 10.14.2.19
>
> How can I map from the onstat output to the one of the IPs in the
> netstat list?
>
> Thanks,
> Mike

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-20-2008, 07:59 AM
Doug Lawry
 
Posts: n/a
Default Re: Interpretation of onstat -g ses, hostname column

Here's some C code to build a command line tool "unhexip":

/*
Convert hexadecimal IP addresses to standard format
Doug Lawry, comp.databases.informix, 02/11/2004
*/

main(int argc, char **argv)
{
int ip, i, n[4];
char c;

if (argc == 1)
{
printf("Usage: %s hex-ip-address [...]\n", *argv);
exit(1);
}

while (--argc)
if (sscanf(*++argv, "%x%c", &ip, &c) != 1)
printf("Invalid hex number %s\n", *argv);
else
{
for (i = 0; i < 4; i++)
{
n[i] = ip % 256;
ip = ip / 256;
}
printf("%d.%d.%d.%d\n", n[3], n[2], n[1], n[0]);
}
}

--
Regards,
Doug Lawry
www.douglawry.webhop.org


"Mike Reetz" <mreetz@gmail.com> wrote in message
news:6fb5b27c.0411020703.71aff71@posting.google.co m...
> Sometimes the hostname is the DNS entry (i.e. human readable). Other
> times, when the connecting computer does not have a DNS entry, the
> value is in hex (??). How can that be changed back to an IP address?
>
> Example:
>
> 3 values for hostname from onstat -g ses:
>
> a010a1e
> a010d22
> a0e0213
>
> From netstat -a connections via sqlexec with only IP addresses:
>
> 10.1.13.34
> 10.1.10.30
> 10.14.2.19
>
> How can I map from the onstat output to the one of the IPs in the
> netstat list?
>
> Thanks,
> Mike



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-20-2008, 08:00 AM
Mike Reetz
 
Posts: n/a
Default Re: Interpretation of onstat -g ses, hostname column

Thanks all for the replies!

Mike

Claus Samuelsen <csa@eye-bee-em.com> wrote in message news:<4187aade$0$33741$14726298@news.sunsite.dk>.. .
> a010a1e = (hex) a.01.0a.1e = (dec) 10.1.10.30
> a010d22 = (hex) a.01.0d.22 = (dec) 10.1.13.34
> a0e0213 = (hex) a.0e.02.13 = (dec) 10.14.2.19
>
>
> Mike Reetz wrote:
>
> > Sometimes the hostname is the DNS entry (i.e. human readable). Other
> > times, when the connecting computer does not have a DNS entry, the
> > value is in hex (??). How can that be changed back to an IP address?
> >
> > Example:
> >
> > 3 values for hostname from onstat -g ses:
> >
> > a010a1e
> > a010d22
> > a0e0213
> >
> > From netstat -a connections via sqlexec with only IP addresses:
> >
> > 10.1.13.34
> > 10.1.10.30
> > 10.14.2.19
> >
> > How can I map from the onstat output to the one of the IPs in the
> > netstat list?
> >
> > Thanks,
> > Mike

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-20-2008, 08:00 AM
Art S. Kagel
 
Posts: n/a
Default Re: Interpretation of onstat -g ses, hostname column

On Tue, 02 Nov 2004 10:03:06 -0500, Mike Reetz wrote:

> Sometimes the hostname is the DNS entry (i.e. human readable). Other
> times, when the connecting computer does not have a DNS entry, the value is
> in hex (??). How can that be changed back to an IP address?

<SNIP>
> How can I map from the onstat output to the one of the IPs in the netstat
> list?

Claus' translations look right to me, TBP's are off a bit.

Here's another C translator that's a bit simpler:

#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <strings.h>

int main( int argc, char **argv )
{
union {
int whole;
char parts[4];
} hexnum;
char buff[1024];

while (fgets( buff, 1024, stdin ) != (char *)NULL ) {
hexnum.whole = strtol( buff, (char **)NULL, 16 );
printf( "%08x = %d.%d.%d.%d\n", (int)hexnum.parts[0],
(int)hexnum.parts[1], (int)hexnum.parts[2],
(int)hexnum.parts[3] );
}
}

Art S. Kagel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-20-2008, 08:02 AM
nobody
 
Posts: n/a
Default Re: Interpretation of onstat -g ses, hostname column

Did you truncate the lead 0 or did Informix?

If its Informix, then its a product defect.

Mike Reetz wrote:
> Sometimes the hostname is the DNS entry (i.e. human readable). Other
> times, when the connecting computer does not have a DNS entry, the
> value is in hex (??). How can that be changed back to an IP address?
>
> Example:
>
> 3 values for hostname from onstat -g ses:
>
> a010a1e
> a010d22
> a0e0213
>
> From netstat -a connections via sqlexec with only IP addresses:
>
> 10.1.13.34
> 10.1.10.30
> 10.14.2.19
>
> How can I map from the onstat output to the one of the IPs in the
> netstat list?
>
> Thanks,
> Mike


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:35 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com