|
|
|
|
|
Can I idle timeout a connection (e.g. disconnect users when the interface is not being used)? With Firmware V3.5.2 and later you can specify from the management GUI the amount of time (in minutes) the console server waits before it terminates an idle ssh, pmshell or web connection .
This script can be put it into /etc/config/crontab.root to run as a cron job every minute. It is currently set up to kill idle sessions over two minutes, but that can be increased up to about 60 minutes. As the idle timer changes from minutes to hours you would have to make sure the cron job run times don’t allow the idle time to roll past minutes to hours or else it will fail to kill the process. # cat /etc/config/scripts/kill-idle-pmshell #!/bin/bash # max idle time in minutes MAXIDLE=2 OLDIFS=$IFS IFS=' ' # get idle times of pmshell for i in `w -h | grep pmshell | awk '{ print $2,$4 }' | sed 's/:.*$//' | sed -e '/^.*[0-9]s$/d'`; do idletime=`echo $i | awk '{ print $2 }'` # if idle time is greater or equal to maxidle, get PIDs of the ttys if [ $idletime -ge $MAXIDLE ]; then TTYTOKILL=`echo "$i" | awk '{print $1}' | sed 's/^.*\///'` PIDSTOKILL=`ps | grep $TTYTOKILL | awk '{print $1}' | sed '2d'` # kill PID’s for ps in $PIDSTOKILL; do kill -9 $ps done fi done IFS=$OLDIFS # |
|
Solutions Product Overview Solutions Overview How to Buy |
About Us Corporate In the Media Press Releases Contact Us |
Resources YouTube Videos Resource Library |
Support Technical Support Knowledge Base Cabling & Adapters Contact Us |
| © Opengear 2011 | Privacy Policy |