|
1 |
| -# File: /etc/libzbxpgsql.d/query.conf |
| 1 | +# File: /etc/zabbix/libzbxpgsql.conf |
2 | 2 | #
|
3 |
| -# This file contains SQL to be executed by `pg_query.*` keys |
| 3 | +# This file contains configuration for all pg.* keys. |
4 | 4 | #
|
5 |
| -# The default directory for SQL config files is: |
6 |
| -# /etc/libzbxpgsql.d |
7 |
| -# This default can be changed by setting the PGQUERYPATH environment variable |
8 |
| -# for the agent before startup. |
| 5 | +# By default, this file is loaded from /etc/zabbix/libzbxpgsql.conf, unless |
| 6 | +# the PGCONFIGFILE environment variable is set to a different path. |
9 | 7 | #
|
10 |
| -# *ALL* files in the config directory that end in ".conf" will be read and |
11 |
| -# parsed. |
| 8 | +# The config file is only read at startup of Zabbix agent. If you modify the |
| 9 | +# config file, you will need to restart the Zabbix agent for it to take effect. |
| 10 | +# |
| 11 | +# Syntax errors in the config file will prevent Zabbix from starting. |
12 | 12 | #
|
13 | 13 | # The config files are parsed by the C libconfig module:
|
14 | 14 | # http://www.hyperrealm.com/main.php?s=libconfig
|
15 | 15 | #
|
16 |
| -# The format of the config file is: |
17 |
| -# SQLkey = "SQL statement"; |
18 |
| -# |
19 | 16 | # Comment lines begin with a hash '#'.
|
20 | 17 | #
|
| 18 | +# The format for defining named SQL queries is: |
| 19 | +# queries = { |
| 20 | +# SQLkey = "SQL statement"; |
| 21 | +# }; |
| 22 | +# |
21 | 23 | # Requirements:
|
22 | 24 | # - The SQL key must be alphanumeric and can contain dashes and underscores
|
23 | 25 | # (-DO NOT- use asterisks or spaces in the key name).
|
|
27 | 29 | # "SELECT \"UPPERCASECOLUMN\" from table;";
|
28 | 30 | # - A semicolon is required at the end of each config entry.
|
29 | 31 | #
|
30 |
| -# Syntax errors in any config file will cause the Zabbix agent to shut down. |
31 |
| -# |
32 |
| -# Config files are only read at startup of Zabbix agent. If you add, change, or |
33 |
| -# remove config files you will need to restart the Zabbix agent for it to |
34 |
| -# re-read the files. |
35 |
| -# |
36 | 32 | # Example Query Setup (with substitution variables):
|
37 |
| -# * SQL key used in Zabbix server: |
| 33 | +# * Zabbix agent key, including a named query: |
38 | 34 | # pg_query.integer[,,myquery,45,200]
|
39 | 35 | #
|
40 | 36 | # * Matching query from the config file:
|
|
51 | 47 | # AlsoGood = "select count(*) "
|
52 | 48 | # " from pg_stat_activity;";
|
53 | 49 | #
|
54 |
| -# |
55 |
| -# Test Queries |
56 | 50 |
|
| 51 | +# Example Queries |
57 | 52 | queries = {
|
58 | 53 | teststr = "SELECT $1::text || $2::text;";
|
59 | 54 | testint = "SELECT $1::int;";
|
|
0 commit comments