File: TRIGGER_VARS

package info (click to toggle)
pmacct 1.7.6-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 11,548 kB
  • sloc: ansic: 106,538; sh: 4,876; cpp: 4,340; python: 3,631; makefile: 502
file content (105 lines) | stat: -rw-r--r-- 4,664 bytes parent folder | download | duplicates (2)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
INTRODUCTION
A feature to spawn external executables is part of all pmacct plugins
(ie. sql_trigger_exec, print_trigger_exec, etc). In case of SQL plugins,
executables may either be spawned each time a cache purging event occurs
or at arbitrary time intervals (specified via sql_trigger_time); in all
other plugins a trigger can be spawned only at a cache purging event.
For time-sensitive triggers it is recommended to use crontab instead.
Also, in case of SQL plugins some information is being passed to the
triggered executable in the form of environment variables. The list of
supported variables follows: 

VAR:		$SQL_DB
DESC:		RDBMS database name.

VAR:		$SQL_TABLE
DESC:		SQL table name.

VAR:		$EFFECTIVE_SQL_TABLE
DESC:		SQL table name. This is defined only if the 'sql_table' value
		contains variables. Variables are replaced here by their actual
		values. This value will be inaccurate if multiple SQL tables
		are written as part of the same purge, ie. as a result of: 1)
		nfacctd daemon but nfacctd_time_new set to false (default); 2)
		$peer_src_ip part of the SQL table name.

VAR:		$SQL_HOST
DESC:		SQL server hostname (if any)

VAR:		$SQL_USER
DESC:		Username when authenticating to the SQL server.

VAR:		$SQL_REFRESH_TIME
DESC:		Time interval at which data is currently purged from the cache
		to the database.

VAR:		$SAMPLING_RATE
DESC:		Packet sampling ratio (1 out of N). It is defined only if packet
		sampling is actually enabled via a 'sampling_rate' configuration
		directive (see CONFIG-KEYS for further details about the key). 

VAR:		$SQL_RECOVERY_BACKUP_HOST
DESC:		SQL server hostname contacted if the primary server fails. This
		is defined only if 'sql_recovery_backup_host' is activated (see
		CONFIG-KEYS for further details about the key).

VAR:		$TOTAL_ELEM_NUMBER
DESC:		Returns the total number of queued elements during the last
		purging event. Elements may be subsequently filtered out. It
		is defined only if 'sql_trigger_time' directive is NOT defined
		(this causes the trigger to be launched each time the purging
		event occurs).

VAR:		$EFFECTIVE_ELEM_NUMBER
DESC:		Returns the effective number of elements (that is, excluding
		those filtered out) on the queue being encapsulated in SQL
		queries during the last purging event. It is defined only if
		'sql_trigger_time' is NOT defined (this causes the trigger to
		be launched each time the purging event occurs).

VAR:		$INSERT_QUERIES_NUMBER
DESC:		Returns the number of elements being successfully incapsulated
		into INSERT queries during the last cache-to-DB purging event.
		It is defined only if 'sql_trigger_time' is NOT defined (this
		causes the trigger to be launched each time the purging event
		occurs).

VAR:		$UPDATE_QUERIES_NUMBER
DESC:           Returns the number of elements being successfully incapsulated
                into UPDATE queries during the last cache-to-DB purging event.
                It is defined only if 'sql_trigger_time' is NOT defined (this
                causes the trigger to be launched each time the purging event
                occurs).

VAR:		$ELAPSED_TIME
DESC:		Returns the number of seconds the last purging event took to
		complete. It is defined only if 'sql_trigger_time' directive is
		NOT defined (this causes the trigger to be launched each time
		the purging event occurs).

VAR:		$SQL_HISTORY_BASETIME
DESC:		Returns the basetime of the current timeslot, if 'sql_history'
		is defined (see CONFIG-KEYS for further details about the key).
		It is the same value being inserted into 'stamp_inserted' field
		and is expressed as unixtime (seconds since Epoch). This is
		defined only if 'sql_trigger_time' is NOT defined (this causes
		the trigger to be launched each time the purging event occurs).

VAR:		$SQL_HISTORY_TIMESLOT
DESC:		Returns the timeslot size (in seconds), if 'sql_history' (see
		CONFIG-KEYS for further details about the key) is defined. Note
		that this value may change (it's recomputed) if monthly timeslot
		are in use. This is defined only if 'sql_trigger_time' is NOT
		defined (this causes the trigger to be launched each time the
		purging event occurs).
 
VAR:		$SQL_MAX_WRITERS
DESC:		Returns the maximum number of concurrent SQL writer processes
		allowed (see CONFIG-KEYS for details about 'sql_max_writers').  

VAR:            $SQL_ACTIVE_WRITERS
DESC:           Returns the active number of concurrent writer processes in
		place (see CONFIG-KEYS for details about 'sql_max_writers'). If
		used in conjunction with $SQL_MAX_WRITERS, this can prevent
		hitting the upper limit of writers by, say, taking corrective
		actions or sending proper warning notifications.