File: sample.ini

package info (click to toggle)
ps-watcher 1.08-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 772 kB
  • sloc: sh: 2,907; perl: 1,281; makefile: 104
file content (54 lines) | stat: -rw-r--r-- 1,799 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# $Id: sample.ini,v 1.8 2003/03/04 02:53:48 rockyb Exp $
# Comments start with # or ; and go to the end of the line.

# The format for each entry is in Microsoft .INI form:
# [process-pattern]
# trigger = perl-expression
# occurs  = (every|first|none)
# action  = program-and-arguments-to-run

# "trigger" and "occurs" are optional.

# Are there enough (at least 4) httpd processes running? 
[httpd$]
  trigger = $count < 4
  action  = echo "$trigger fired -- You have $count $command sessions."

# Show how many processes are running. Use builtin $count 
# variable
[.]
  action = echo "You have $count processes running"
# The below is implied
#occurs=first

# Which processes have been running for more than 1 day?
# Note this hack to specify a pattern ostensibly different from 
# the above pattern. This is an IniConf-imposed limitation.
# Also note use of builtin-function elapsed2secs
# and builtin constant DAYS.
# The variable $etime (elapsed time) does not exist on your OS.
# For on FreeBSD it doesn't, but that has a "cputime" reports a time
# entry.
[.?]
  trigger = elapsed2secs('$etime') > 1*DAYS
  action  = echo "$command has been running more than 1 day ($etime)"
  occurs  = every

[^]
  trigger = $vsz > 8000
  occurs  = every
  action  = echo "Large program $command (pid $pid) matches /$ps_pat/: $vsz KB"

# Scripts don't show as the script name as the command name on some
# operating systems. Rather the name of the interpreter is listed
# (e.g. bash or perl) Here's how you can match against a script. Note
# escaping $ in the trigger but not the action.

# Note: BSD/OS on the other hand give the script name rather than the
# interpreter name.

[/usr/bin/perl]
  trigger = \$args !~ /ps-watcher/
  occurs  = every
  action  = echo "***found perl program ${pid}:\n $args"