Avoid to see the Last 20 Sessions Terminated in onstat
Posted in 2023
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.
Topics: Installation, Setup & Upgrades, Server Administration, Versions, Editions & End-of-Life
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
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
------------------------------
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
------------------------------
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
------------------------------
Hi, Yes it works. Anyway I will proceed with your suggest. Thanks, Roger ------------------------------ Roger Vilca ------------------------------
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 ------------------------------
Thank you David Williams for this kind of help. I really appreciate your effort . ------------------------------ Manga Go ------------------------------
I see those information in version 14.10.fc8 also, it's useless. ------------------------------ chuan lu ------------------------------
Related threads
- Posting from the Informix-list
- Migrating from IDS 9.40.UC6 to 11.50.UC3
- Ip for a network session
- questions onstat -g