In this example, we kill idle user sessions--inactive user logins.
The KillIdleUserSession script shown below does its work silently, and sends no alert messages. You could add rules to send alert messages, if you want to. (Also note that all kill commands are always logged.)
The script follows.
///////////////////////////////////////////////////////////////////////////////
//
// process_alarms.cfg
//
///////////////////////////////////////////////////////////////////////////////
[other alarms omitted...]
///////////////////////////////////////////////////////////////////////////////
KillIdleUserSession
init
status active
level critical
task "Terminate idle user sessions"
input proc "\=w | \=awk '/[1-9]days/ {gsub("/","\\\\/");
print $1 " " $2}'"
dat $user 1
dat $tty 2
rule
exec wait "\=kill -9 `\=ps -aux |
\=awk '/$user.+$tty/ {print \$2}'`"
///////////////////////////////////////////////////////////////////////////////
[other alarms omitted...]
///////////////////////////////////////////////////////////////////////////////
[For more examples, see Samples.]
Home |
FAQ |
News |
Intro |
Samples |
Tutorial |
Reference |
Software |
Authors |
Licensing |
SiteSearch
Links |
SiteIndex |
Pikt-Users |
Pikt-Workers |
Contribute |
ContactUs |
Top of Page
Page best viewed at 1024x768.
Page last updated 2005-06-22.
This site is
PIKT®
powered.
PIKT® is a registered trademark of the University of Chicago.
Copyright © 1998-2005 Robert Osterlund. All rights reserved.
|