Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Roger Vilca found that after upgrading from 11.70FC8 to 12.10FC15, onstat -g ses always printed a Last 20 Sessions Terminated section. Kirit Rana said it was introduced in 12.10; onstat -z did nothing, so Roger wrapped onstat in a script using sed. David Williams said there is no option to disable it and raised feature request INFX-I-500.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Roger Vilca — source: IBM Community (ConnectedCommunity.org) Informix forum
Hi,
Recently I upgraded the informix server from 11.70FC8 to 12.10FC15 (due to compatibilty issues I don't upgrade to version 14.x)
Since then, the output of "onstat -g ses " always shows the Last 20 Sessions Terminated
Example:
...
5 informix - 0 - 0 20480 16832 off
4 informix - 0 - 0 20480 16832 off
3 informix - 0 - 0 20480 16832 off
2 informix - 0 - 0 20480 16832 off
Last 20 Sessions Terminated
...
Ses ID Username Hostname PID Time Reason
1493833 user1 server01 28016 10/23/2022.07:00 onmode z
1777441 user2 server02 8452 10/30/2022.07:00 onmode z
2054425 user3 server03 16380 11/06/2022.07:00 onmode z
...
I don't know why IBM changed the default behaviour of onstat -g ses
Is there a configuration parameter or another option in onstat to avoid this part of the output ?
Thanks in advance,
Roger
------------------------------
Roger Vilca
------------------------------
#Informix
↪ replying to Roger Vilca
Kirit Rana — source: IBM Community (ConnectedCommunity.org) Informix forum
Hey Roger
The
Last 20 Sessions Terminated
section of the output from the
onstat -g sescommand was introduced at
IDS 12.10
but I am not certain at which patch version ...
[ informix@informix-01 ] ~ > onstat -g ses
HCL Informix Dynamic Server Version 12.10.FC13XT -- On-Line (Prim) -- Up 85 days 02:51:07 -- 115646856 Kbytes
session #RSAM total used dynamic
id user tty pid hostname threads memory memory explain
8430398 informix - 0 - 0 16384 12416 off
8430397 informix - 64492 informix-01 1 1638400 1599720 off
:
4 informix - 0 - 0 16384 12416 off
3 informix - 0 - 0 16384 12416 off
Last 20 Sessions Terminated
Ses ID Username Hostname PID Time Reason
8429988 informix informix-01 61805 01/05/2023.03:50 onmode z
8430242 informix informix-01 63689 01/05/2023.03:52 onmode z
Total Terminated 2
As far as I know, there
isn't
a parameter that can be set to suppress this section of the output. Restarting the Instance will yield the desired result but that may not be feasible if your system is in Production. I haven't tested whether or not
onstat -zhas any effect but you may upset a few people if you wiped out the statistics gathered over the Instance uptime.
I prefer to use what follows; Employing
sed
, I search for the first occurrence of the string:
Last 20
and once pattern matched I delete from that line number to the end of the piped output resulting in...
[ informix@informix-01 ] ~ > onstat -g ses | sed '/^Last 20 /,$d'
HCL Informix Dynamic Server Version 12.10.FC13XT -- On-Line (Prim) -- Up 85 days 02:52:09 -- 115646856 Kbytes
session #RSAM total used dynamic
id user tty pid hostname threads memory memory explain
8430477 informix - 0 - 0 16384 12416 off
8430474 openbet - 21098 siteserver-02 1 73728 64344 off
:
5 informix - 0 - 0 16384 12416 off
4 informix - 0 - 0 16384 12416 off
3 informix - 0 - 0 16384 12416 off
------------------------------
Kirit Rana
------------------------------
↪ replying to Kirit Rana
Roger Vilca — source: IBM Community (ConnectedCommunity.org) Informix forum
Thanks for your response Kirit,
I verified that onstat -z doesn't have any effect.
Finally, I created a little script as a "wrapper" that use "sed" according your suggest.
#!/bin/sh
if [ $# -ne 1 ] ; then
echo "Ingrese sesion"
exit 1
fi
sid=$1
onstat -g ses $sid | sed '/^Last 20 /,$d'exit 0
Regards,
Roger
------------------------------
Roger Vilca
------------------------------
↪ replying to Roger Vilca
Kirit Rana — source: IBM Community (ConnectedCommunity.org) Informix forum
Looks good. Does it work? You may have to fully qualify the path to the onstat binary or export the PATH variable at the head of the script.
------------------------------
Kirit Rana
------------------------------
↪ replying to Kirit Rana
Roger Vilca — source: IBM Community (ConnectedCommunity.org) Informix forum
Hi,
Yes it works. Anyway I will proceed with your suggest.
Thanks,
Roger
------------------------------
Roger Vilca
------------------------------
↪ replying to Kirit Rana
David Williams — source: IBM Community (ConnectedCommunity.org) Informix forum
Hi,
There is no option to disable this change to existing functionallity..
Feature Reqest Raised, please vote it up -
https://ibm-data-and-ai.ideas.ibm.com/ideas/INFX-I-500
Regards,
David.
------------------------------
David Williams
------------------------------
↪ replying to David Williams
Manga Go — source: IBM Community (ConnectedCommunity.org) Informix forum
Thank you
David Williams
for this kind of help. I really appreciate your effort
.
------------------------------
Manga Go
------------------------------
↪ replying to Roger Vilca
chuan lu — source: IBM Community (ConnectedCommunity.org) Informix forum
I see those information in version 14.10.fc8 also, it's useless.
------------------------------
chuan lu
------------------------------
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.