如何获取建立 Informix 网络连接的完整主机名?
onstat -g ses
的输出显示主机名和 tty 列。但是,这两个字符都被截断为前 8 个字符。
是否可以从 onstat
的任何其他变体获取完整的主机名或 tty? (对于网络连接 - 以及我的目的 - 它们是可以互换的)
背景:我们有一个非常频繁地执行 onstat -g ses
的脚本,它构成了负载平衡算法的一部分。这些连接所来自的服务器现在*具有 9 个字符的主机名,并且墨菲定律规定,截断的数字是识别彼此的数字。 (即它们的名称如 ABC1DEFG1、ABC1DEFG2 等。)
。* 就我个人而言,我非常相信这句格言:“糟糕的标准比不断变化的标准更好”。但这已经改变了,我也必须随之改变……
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...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查 SMI syssessions 表(在 sysmaster 数据库中)中有哪些信息。根据我的计算,主机名的值位于 CHAR(256) 字段中,该字段应该能够保存您的 9 个字符的小名称而不会溢出。
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.