tags:

views:

10

answers:

1

The output of onstat -g ses displays both hostname and tty columns. However, both of these are truncated to the first 8 chars.

Is it possible to obtain the hostname or tty in full from any other variant of onstat? (For network connections - and my purposes - they are interchangeable)

Background: we have a script executing onstat -g ses very frequently, which forms part of a load-balancing algorithm. The servers from whence these connections come now* have 9-character hostnames, and Murphy's Law dictates that the truncated digit is the one that identifies one from another. (ie they have names like ABC1DEFG1, ABC1DEFG2 and so on.)


.* Personally, I'm a great believer in the adage that "a standard that sucks is better than a constantly changing one". But this one has changed, and I must change with it...

A: 

Check what information is in the SMI syssessions table (in the sysmaster database). According to my reckoning, the value there for the hostname is in a CHAR(256) field, which should be able to hold your diddly little 9-character names without overflowing.

Jonathan Leffler
Thanks Jonathan. I was aware that the info was in syssessions, and have in fact modified this script to use DBI - code I know you to be very familiar with! - rather than open(ONSTAT, "onstat -g ses |"). I had been reluctant to do so, which proved to be premature optimisation, so shame on me.However, there are a bunch of other scripts parsing onstat output for various purposes, and they're all going to need the same mods, which is unfortunate.
RET