Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Interpretation of onstat -g ses, hostname column

128 views
Skip to first unread message

Mike Reetz

unread,
Nov 2, 2004, 10:03:06 AM11/2/04
to
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

TBP

unread,
Nov 2, 2004, 10:36:52 AM11/2/04
to

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

Claus Samuelsen

unread,
Nov 2, 2004, 10:42:20 AM11/2/04
to
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

Doug Lawry

unread,
Nov 2, 2004, 10:59:08 AM11/2/04
to
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" <mre...@gmail.com> wrote in message
news:6fb5b27c.0411...@posting.google.com...

DL Redden

unread,
Nov 2, 2004, 11:48:23 AM11/2/04
to

the hex number can be converted to the IP. Here is an
example

a010a1e(a.01.0a.1e) = 10.1.10.30

a = 10
01 = 1
0a = 10
1e = 30


--- Mike Reetz <mre...@gmail.com> 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
>


__________________________________
Do you Yahoo!?
Check out the new Yahoo! Front Page.
www.yahoo.com

sending to informix-list

Colin Bull

unread,
Nov 2, 2004, 11:51:32 AM11/2/04
to

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?

You should convert the onstat output to dotted hex pairs from the right,
so a010a1e becomes a.01.0a.1e.

Put 1e in Windows calculater in hex mode, and then click the dec button
and it gives 30.
If you want the rest a =10, 01=1, a-10. So altogether that is 10.1.10.30

Colin Bull

________________________________________________________________________
This email has been scanned for all known viruses by the MessageLabs Email
Security System.
________________________________________________________________________

sending to informix-list

malcolm weallans

unread,
Nov 2, 2004, 2:29:20 PM11/2/04
to

Colin,
You surprise me. I thought that us old wizened practitioners could
still remember our hex conversions. Immediately I saw the numbers in
hex I was converting them into decimal.

And Mike,
I thought you would have known better as well. It's all part of the
development plot to make it look a lot more complicated than it is.

BTW All,
If you follow the max number of extents calculation in the performance
guide you no longer have to do the hex conversion. Oncheck gives the
address in decial separated by a colon, but nobody has told the tech
writers of the change. And who else has spotted the other deliberate
error in that procedure?

Regards

Malcolm

Colin Bull

sending to informix-list

sending to informix-list

Mike Reetz

unread,
Nov 2, 2004, 4:50:33 PM11/2/04
to
Thanks all for the replies!

Mike

Claus Samuelsen <c...@eye-bee-em.com> wrote in message news:<4187aade$0$33741$1472...@news.sunsite.dk>...

Art S. Kagel

unread,
Nov 2, 2004, 5:25:31 PM11/2/04
to
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

DL Redden

unread,
Nov 2, 2004, 11:48:23 AM11/2/04
to

the hex number can be converted to the IP. Here is an
example

a010a1e(a.01.0a.1e) = 10.1.10.30

a = 10
01 = 1
0a = 10
1e = 30


--- Mike Reetz <mre...@gmail.com> 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
>


__________________________________
Do you Yahoo!?
Check out the new Yahoo! Front Page.
www.yahoo.com

Colin Bull

unread,
Nov 2, 2004, 11:51:32 AM11/2/04
to

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?

You should convert the onstat output to dotted hex pairs from the right,
so a010a1e becomes a.01.0a.1e.

Put 1e in Windows calculater in hex mode, and then click the dec button
and it gives 30.
If you want the rest a =10, 01=1, a-10. So altogether that is 10.1.10.30

Colin Bull

________________________________________________________________________
This email has been scanned for all known viruses by the MessageLabs Email
Security System.
________________________________________________________________________

sending to informix-list
sending to informix-list

malcolm weallans

unread,
Nov 2, 2004, 2:29:20 PM11/2/04
to

Colin,
You surprise me. I thought that us old wizened practitioners could
still remember our hex conversions. Immediately I saw the numbers in
hex I was converting them into decimal.

And Mike,
I thought you would have known better as well. It's all part of the
development plot to make it look a lot more complicated than it is.

BTW All,
If you follow the max number of extents calculation in the performance
guide you no longer have to do the hex conversion. Oncheck gives the
address in decial separated by a colon, but nobody has told the tech
writers of the change. And who else has spotted the other deliberate
error in that procedure?

Regards

Malcolm

-----Original Message-----
From: owner-inf...@iiug.org [mailto:owner-inf...@iiug.org]
On Behalf Of Colin Bull
Sent: 02 November 2004 16:52
To: inform...@iiug.org
Subject: RE: Interpretation of onstat -g ses, hostname column

Colin Bull

sending to informix-list

sending to informix-list
sending to informix-list

nobody

unread,
Nov 9, 2004, 8:32:16 AM11/9/04
to
Did you truncate the lead 0 or did Informix?

If its Informix, then its a product defect.

0 new messages