ps-watcher/tests/paction.cnf

22 lines
554 B
Plaintext
Raw Permalink Normal View History

2013-11-06 08:53:33 +00:00
# $Id: paction.cnf,v 1.2 2008/12/25 16:42:49 rockyb Exp $
# Test perl-action, prolog and epilog
# Rather the name of the interpreter is listed (e.g. bash or perl)
# Here's how you can match against a script.
# Look for my processes: ps-watcher.
[$PROLOG]
perl-action = $my_count=0; $root_procs=0;
[.*]
perl-action = <<EOP
if ($uid == 0) {
$my_count++; $root_procs++;
}
EOP
occurs = every
[$EPILOG]
trigger = <<EOT
$my_count > 0 && $my_count < $count &&
$root_procs > 0 && $my_count >= $root_procs
EOT
action = echo "ok 1"