X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcollectd.conf.pod;h=18e7f53c78e1136d2903dac26abe61df9d23f989;hb=f8287addd23543a970453e473829bd3d6c28bcdd;hp=15b6f680e04dfb6b4d018b89592185d1cb8d96fd;hpb=6d85a198dd90fb5af963ad847d9dbff7b8025c46;p=collectd.git diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index 15b6f680..18e7f53c 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -7,11 +7,15 @@ collectd.conf - Configuration for the system statistics collection daemon B + Interval 3600 + + LoadPlugin ping - Host "example.org" Host "provider.net" @@ -73,6 +77,7 @@ options are allowed inside a B block: Globals true + Interval 10 =over 4 @@ -427,7 +432,7 @@ mode will be used, i.e. delivery is guaranteed. If set to B (the default), the I delivery mode will be used, i.e. messages may be lost due to high load, overflowing queues or similar issues. -=item B B|B (Publish only) +=item B B|B|B (Publish only) Selects the format in which messages are sent to the broker. If set to B (the default), values are sent as C commands which are @@ -3627,6 +3632,13 @@ which are available in a PostgreSQL database or use future or special statistics provided by PostgreSQL without the need to upgrade your collectd installation. +Starting with version 5.2, the C plugin supports writing data to +PostgreSQL databases as well. This has been implemented in a generic way. You +need to specify an SQL statement which will then be executed by collectd in +order to write the data (see below for details). The benefit of that approach +is that there is no fixed database layout. Rather, the layout may be optimized +for the current setup. + The B manual can be found at L. @@ -3656,6 +3668,11 @@ L. + + Statement "SELECT collectd_insert($1, $2, $3, $4, $5, $6, $7, $8, $9);" + StoreRates true + + Host "hostname" Port "5432" @@ -3672,6 +3689,12 @@ L. Query backend # predefined Query rt36_tickets + + + # ... + Writer sqlstore + CommitInterval 10 + The B block defines one database query which may later be used by a @@ -3838,6 +3861,101 @@ This query collects the on-disk size of the database in bytes. =back +In addition, the following detailed queries are available by default. Please +note that each of those queries collects information B, thus, +potentially producing B of data. For details see the description of the +non-by_table queries above. + +=over 4 + +=item B + +=item B + +=item B + +=item B + +=back + +The B block defines a PostgreSQL writer backend. It accepts a single +mandatory argument specifying the name of the writer. This will then be used +in the B specification in order to activate the writer instance. The +names of all writers have to be unique. The following options may be +specified: + +=over 4 + +=item B I + +This mandatory option specifies the SQL statement that will be executed for +each submitted value. A single SQL statement is allowed only. Anything after +the first semicolon will be ignored. + +Nine parameters will be passed to the statement and should be specified as +tokens B<$1>, B<$2>, through B<$9> in the statement string. The following +values are made available through those parameters: + +=over 4 + +=item B<$1> + +The timestamp of the queried value as a floating point number. + +=item B<$2> + +The hostname of the queried value. + +=item B<$3> + +The plugin name of the queried value. + +=item B<$4> + +The plugin instance of the queried value. This value may be B if there +is no plugin instance. + +=item B<$5> + +The type of the queried value (cf. L). + +=item B<$6> + +The type instance of the queried value. This value may be B if there is +no type instance. + +=item B<$7> + +An array of names for the submitted values (i.Ee., the name of the data +sources of the submitted value-list). + +=item B<$8> + +An array of types for the submitted values (i.Ee., the type of the data +sources of the submitted value-list; C, C, ...). Note, that if +B is enabled (which is the default, see below), all types will be +C. + +=item B<$9> + +An array of the submitted values. The dimensions of the value name and value +arrays match. + +=back + +In general, it is advisable to create and call a custom function in the +PostgreSQL database for this purpose. Any procedural language supported by +PostgreSQL will do (see chapter "Server Programming" in the PostgreSQL manual +for details). + +=item B B|B + +If set to B (the default), convert counter values to rates. If set to +B counter values are stored as is, i.Ee. as an increasing integer +number. + +=back + The B block defines one PostgreSQL database for which to collect statistics. It accepts a single mandatory argument which specifies the database name. None of the other options are required. PostgreSQL will use @@ -3853,6 +3971,17 @@ for details. Specify the interval with which the database should be queried. The default is to use the global B setting. +=item B I + +This option may be used for database connections which have "writers" assigned +(see above). If specified, it causes a writer to put several updates into a +single transaction. This transaction will last for the specified amount of +time. By default, each update will be executed in a separate transaction. Each +transaction generates a fair amount of overhead which can, thus, be reduced by +activating this option. The draw-back is, that data covering the specified +amount of time will be lost, for example, if a single statement within the +transaction fails or if the database server crashes. + =item B I Specify the hostname or IP of the PostgreSQL server to connect to. If the @@ -3925,11 +4054,36 @@ B for details. =item B I -Specify a I which should be executed for the database connection. This -may be any of the predefined or user-defined queries. If no such option is -given, it defaults to "backends", "transactions", "queries", "query_plans", -"table_states", "disk_io" and "disk_usage". Else, the specified queries are -used only. +Specifies a I which should be executed in the context of the database +connection. This may be any of the predefined or user-defined queries. If no +such option is given, it defaults to "backends", "transactions", "queries", +"query_plans", "table_states", "disk_io" and "disk_usage" (unless a B +has been specified). Else, the specified queries are used only. + +=item B I + +Assigns the specified I backend to the database connection. This +causes all collected data to be send to the database using the settings +defined in the writer configuration (see the section "FILTER CONFIGURATION" +below for details on how to selectively send data to certain plugins). + +Each writer will register a flush callback which may be used when having long +transactions enabled (see the B option above). When issuing +the B command (see L for details) the current +transaction will be committed right away. Two different kinds of flush +callbacks are available with the C plugin: + +=over 4 + +=item B + +Flush all writer backends. + +=item BI + +Flush all writers of the specified I only. + +=back =back