diff options
| author | Ian Eure <ian@retrospec.tv> | 2026-01-11 08:44:38 -0800 |
|---|---|---|
| committer | Ian Eure <ian@retrospec.tv> | 2026-03-29 08:59:52 -0700 |
| commit | 0218c4136a63387f122301d9dfb5b71c310d0807 (patch) | |
| tree | c2fc84c2360928e8da1e4893e8f6116651d5bca5 /doc | |
| parent | d768c5c27345d335e9d29932d8219ab31a9ae8b4 (diff) | |
gnu: Add collectd-service-type.
* gnu/services/monitoring.scm: (collectd-plugin-generic,
collectd-plugin-generic?, collectd-plugin-generic-load-plugin?,
collectd-plugin-generic-name, collectd-plugin-generic-options,
collectd-plugin-python, collectd-plugin-python?,
collectd-plugin-python-load-plugin?, collectd-plugin-python-type-databases,
collectd-plugin-python-type-packages, collectd-plugin-python-module-paths,
collectd-plugin-python-log-traces?, collectd-plugin-python-log-interactive?,
collectd-plugin-python-import, collectd-plugin-python-module,
collectd-plugin?, %collectd-default-type-database, %collectd-pid-file,
collectd-configuration, collectd-configuration?,
collectd-configuration-collectd, collectd-configuration-base-directory,
collectd-configuration-auto-load-plugin?,
collectd-configuration-collect-internal-stats?,
collectd-configuration-type-databases, collectd-configuration-interval,
collectd-configuration-max-read-interval, collectd-configuration-timeout,
collectd-configuration-read-threads, collectd-configuration-write-threads,
collectd-configuration-write-queue-limit-high,
collectd-configuration-write-queue-limit-low,
collectd-configuration-host-name,
collectd-configuration-fully-qualified-domain-name-lookup?,
collectd-configuration-plugins, collectd-service-type): New variable.
* doc/guix.texi (Monitoring Services): Document it.
Change-Id: I18d581292979e85603e679b9441be3eeb1856949
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/guix.texi | 294 |
1 files changed, 294 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 266012a7e82..41ddce9792f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -34106,6 +34106,300 @@ Zabbix server port. | |||
| 34106 | 34106 | ||
| 34107 | @c %end of fragment | 34107 | @c %end of fragment |
| 34108 | 34108 | ||
| 34109 | @subsubheading collectd Service | ||
| 34110 | @cindex collectd | ||
| 34111 | collectd is a daemon which collects, stores, transports, and visualizes | ||
| 34112 | system and application performance metrics in a variety of ways. | ||
| 34113 | |||
| 34114 | @defvar collectd-service-type | ||
| 34115 | This is the service type for the @uref{https://collectd.org/, collectd} | ||
| 34116 | service. Its value must be a @code{collectd-configuration} record: | ||
| 34117 | |||
| 34118 | @lisp | ||
| 34119 | (service collectd-service-type | ||
| 34120 | (collectd-configuration | ||
| 34121 | (plugins | ||
| 34122 | (list | ||
| 34123 | (collectd-plugin-generic | ||
| 34124 | (name "cpu") | ||
| 34125 | (options '((ReportByCpu . #t) | ||
| 34126 | (ReportByState . #t) | ||
| 34127 | (ValuesPercentage . #t)))))))) | ||
| 34128 | @end lisp | ||
| 34129 | |||
| 34130 | The service may be extended to add new plugins: | ||
| 34131 | |||
| 34132 | @lisp | ||
| 34133 | (simple-service 'collectd-memory | ||
| 34134 | collectd-service-type | ||
| 34135 | (list | ||
| 34136 | (collectd-plugin-generic | ||
| 34137 | (name "memory") | ||
| 34138 | (options '((ValuesAbsolute . #t) | ||
| 34139 | (ValusPercentage . #t)))))) | ||
| 34140 | @end lisp | ||
| 34141 | @end defvar | ||
| 34142 | |||
| 34143 | |||
| 34144 | @c %start of fragment | ||
| 34145 | |||
| 34146 | @deftp {Data Type} collectd-configuration | ||
| 34147 | Available @code{collectd-configuration} fields are: | ||
| 34148 | |||
| 34149 | @table @asis | ||
| 34150 | @item @code{collectd} (default: @code{collectd}) (type: package) | ||
| 34151 | The collectd package to use. | ||
| 34152 | |||
| 34153 | @item @code{base-directory} (default: @code{"/var/lib/collectd"}) (type: string) | ||
| 34154 | Sets the base directory. This is the directory beneath which all | ||
| 34155 | @acronym{RRD,round-robin database} files are created. Possibly more | ||
| 34156 | subdirectories are created. This is also the working directory for | ||
| 34157 | collectd. | ||
| 34158 | |||
| 34159 | @item @code{auto-load-plugins?} (default: @code{#f}) (type: boolean) | ||
| 34160 | When set to @code{#f}, plugins must be loaded explicitly, by setting the | ||
| 34161 | @code{load-plugin?} field of each plugin configuration to @code{#t}. If | ||
| 34162 | a @code{<Plugin ...>} block is encountered and no configuration handling | ||
| 34163 | callback for this plugin has been registered, a warning is logged and | ||
| 34164 | the block is ignored. | ||
| 34165 | |||
| 34166 | When set to @code{#t}, each @code{<Plugin ...>} block acts as if it was | ||
| 34167 | immediately preceded by a @code{LoadPlugin} statement. @code{LoadPlugin} | ||
| 34168 | statements are still required for plugins that don't provide any | ||
| 34169 | configuration, e.g. the @code{Load} plugin. | ||
| 34170 | |||
| 34171 | @item @code{collect-internal-stats?} (default: @code{#f}) (type: boolean) | ||
| 34172 | When @code{#t}, various statistics about the collectd daemon will be | ||
| 34173 | collected, with "collectd" as the plugin name. | ||
| 34174 | |||
| 34175 | @item @code{type-databases} (type: list-of-file-likes) | ||
| 34176 | One or more files that contain the data-set descriptions. See | ||
| 34177 | @code{types.db(5)} for a description of the format of these files. | ||
| 34178 | |||
| 34179 | @item @code{interval} (default: @code{60}) (type: maybe-seconds) | ||
| 34180 | Configures the interval in which to query the read plugins. Smaller | ||
| 34181 | values lead to a higher system load produced by collectd, while higher | ||
| 34182 | values lead to more coarse statistics. Warning: You should set this | ||
| 34183 | once and then never touch it again. If you do, you will have to delete | ||
| 34184 | all your RRD files or know some serious RRDtool magic! (Assuming you're | ||
| 34185 | using the RRDtool or RRDCacheD plugin.) | ||
| 34186 | |||
| 34187 | @item @code{max-read-interval} (default: @code{86400}) (type: seconds) | ||
| 34188 | A read plugin doubles the interval between queries after each failed | ||
| 34189 | attempt to get data. This options limits the maximum value of the | ||
| 34190 | interval. | ||
| 34191 | |||
| 34192 | @item @code{timeout} (type: maybe-integer) | ||
| 34193 | Consider a value list "missing" when no update has been read or received | ||
| 34194 | for @code{Iterations} iterations. By default, collectd considers a | ||
| 34195 | value list missing when no update has been received for twice the update | ||
| 34196 | interval. Since this setting uses iterations, the maximum allowed time | ||
| 34197 | without update depends on the @code{Interval} information contained in | ||
| 34198 | each value list. This is used in the @code{Threshold} configuration to | ||
| 34199 | dispatch notifications about missing values, see | ||
| 34200 | @code{collectd-threshold(5)} for details. | ||
| 34201 | |||
| 34202 | @item @code{read-threads} (default: @code{5}) (type: integer) | ||
| 34203 | Number of threads to start for reading plugins. You may want to | ||
| 34204 | increase this if you have more than five plugins that take a long time | ||
| 34205 | to read. Mostly those are plugins that do network-IO. Setting this to | ||
| 34206 | a value higher than the number of registered read callbacks is not | ||
| 34207 | recommended. | ||
| 34208 | |||
| 34209 | @item @code{write-threads} (default: @code{5}) (type: integer) | ||
| 34210 | Number of threads to start for dispatching value lists to write plugins. | ||
| 34211 | You may want to increase this if you have more than five plugins that | ||
| 34212 | may take relatively long to write to. | ||
| 34213 | |||
| 34214 | @item @code{write-queue-limit-high} (type: maybe-integer) | ||
| 34215 | Metrics are read by the read threads and then put into a queue to be | ||
| 34216 | handled by the write threads. If one of the write plugins is slow (e.g. | ||
| 34217 | network timeouts, I/O saturation of the disk) this queue will grow. In | ||
| 34218 | order to avoid running into memory issues in such a case, you can limit | ||
| 34219 | the size of this queue. If there are @code{write-queue-limit-high} | ||
| 34220 | metrics in the queue, any new metrics will be dropped. If the number of | ||
| 34221 | metrics currently in the queue is between @code{write-queue-limit-low} | ||
| 34222 | and @code{write-queue-limit-high}, the metric is dropped with a | ||
| 34223 | probability that is proportional to the number of metrics in the queue | ||
| 34224 | (i.e. it increases linearly until it reaches 100%). | ||
| 34225 | |||
| 34226 | @item @code{write-queue-limit-low} (type: maybe-integer) | ||
| 34227 | If there are less than @code{write-queue-limit-low} metrics in the | ||
| 34228 | queue, all new metrics will be enqueued. If | ||
| 34229 | @code{write-queue-limit-high} is set to non-zero and | ||
| 34230 | @code{write-queue-limit-low} is unset, the latter will default to half | ||
| 34231 | of @code{write-queue-limit-high}. | ||
| 34232 | |||
| 34233 | @item @code{host-name} (type: maybe-string) | ||
| 34234 | Sets the hostname that identifies a host. If you omit this setting, the | ||
| 34235 | hostname will be determined using the @code{gethostname(2)} system call. | ||
| 34236 | |||
| 34237 | @item @code{fully-qualified-domain-name-lookup?} (default: @code{#t}) (type: boolean) | ||
| 34238 | If @code{host-name} is determined automatically, this setting controls | ||
| 34239 | whether or not the daemon should try to figure out the | ||
| 34240 | @acronym{FQDN,fully qualified domain name}. This is done using a lookup | ||
| 34241 | of the name returned by @code{gethostname(2)}. | ||
| 34242 | |||
| 34243 | @item @code{plugins} (default: @code{()}) (type: list-of-collectd-plugins) | ||
| 34244 | Configurations for collectd plugins. | ||
| 34245 | |||
| 34246 | @end table | ||
| 34247 | |||
| 34248 | @end deftp | ||
| 34249 | |||
| 34250 | |||
| 34251 | @c %end of fragment | ||
| 34252 | |||
| 34253 | @c %start of fragment | ||
| 34254 | |||
| 34255 | @deftp {Data Type} collectd-plugin-generic | ||
| 34256 | |||
| 34257 | The @code{collectd-plugin-generic} record can represent most collectd | ||
| 34258 | plugins. | ||
| 34259 | |||
| 34260 | This example configuration will enable the CPU usage reporting plugin. | ||
| 34261 | See the @code{collectd.conf(5)} man page for a list of plugins and their | ||
| 34262 | options. | ||
| 34263 | |||
| 34264 | @lisp | ||
| 34265 | (collectd-plugin-generic | ||
| 34266 | (name "cpu") | ||
| 34267 | (options '((ReportByCpu . #t) | ||
| 34268 | (ReportByState . #t) | ||
| 34269 | (ValuesPercentage . #t)))) | ||
| 34270 | @end lisp | ||
| 34271 | |||
| 34272 | Available @code{collectd-plugin-generic} fields are: | ||
| 34273 | |||
| 34274 | @table @asis | ||
| 34275 | @item @code{load-plugin?} (default: @code{#t}) (type: boolean) | ||
| 34276 | When @code{#t}, include a @code{LoadPlugin} directive in the | ||
| 34277 | configuration. This interacts with @code{auto-load-plugins?} in | ||
| 34278 | @code{collectd-configuration}; if @code{auto-load-plugins?} is | ||
| 34279 | @code{#f}, all plugins should set this to @code{#t}. | ||
| 34280 | |||
| 34281 | @item @code{name} (type: string) | ||
| 34282 | The name of the plugin to configure. | ||
| 34283 | |||
| 34284 | @item @code{options} (default: @code{()}) (type: plugin-options) | ||
| 34285 | Configuration options for the plugin, as an alist. See | ||
| 34286 | @code{collect.conf(5)} for the available plugin options. | ||
| 34287 | |||
| 34288 | @end table | ||
| 34289 | |||
| 34290 | @end deftp | ||
| 34291 | |||
| 34292 | |||
| 34293 | @c %end of fragment | ||
| 34294 | |||
| 34295 | |||
| 34296 | |||
| 34297 | @c %start of fragment | ||
| 34298 | |||
| 34299 | @deftp {Data Type} collectd-plugin-python | ||
| 34300 | |||
| 34301 | The @code{collectd-plugin-python} configuration record holds | ||
| 34302 | configuration for collectd plugins written in Python. See the | ||
| 34303 | @code{collectd-python(5)} man page for more information on Python | ||
| 34304 | support in collectd. | ||
| 34305 | |||
| 34306 | Guix packages listed in the @code{packages} field will be added to the | ||
| 34307 | profile used to run collectd. This example configuration will load a | ||
| 34308 | Python plugin named @code{myplugin}, whose code is in the | ||
| 34309 | @code{python-myplugin} Guix package. | ||
| 34310 | |||
| 34311 | @lisp | ||
| 34312 | (collectd-plugin-python | ||
| 34313 | (packages (list python-myplugin)) | ||
| 34314 | (module "myplugin") | ||
| 34315 | (module-options '((SomeOption . "hi") | ||
| 34316 | (AnotherOption . 123)))) | ||
| 34317 | @end lisp | ||
| 34318 | |||
| 34319 | The @code{module-paths} field will emit verbatim @code{ModulePath} | ||
| 34320 | lines, for plugins not packaged for Guix. This example configuration | ||
| 34321 | loads the @code{gpio} plugin from | ||
| 34322 | @code{/home/user/projects/collectd-gpio/gpio}. | ||
| 34323 | |||
| 34324 | @lisp | ||
| 34325 | (collectd-plugin-python | ||
| 34326 | (module-paths | ||
| 34327 | (list | ||
| 34328 | "/home/user/projects/collectd-gpio/gpio")) | ||
| 34329 | (module "gpio") | ||
| 34330 | (module-options '((MonitorGPIOs 1 2 3 4)))) | ||
| 34331 | @end lisp | ||
| 34332 | |||
| 34333 | The two mechanisms may be combined: a Guix-packaged Python library may | ||
| 34334 | be used by unpackaged plugin code. This example loads a | ||
| 34335 | @code{mongometrics} plugin from | ||
| 34336 | @code{/opt/collectd-mongodb/mongometrics}, and also makes the | ||
| 34337 | @code{python-pymongo} Python package available for it to use. | ||
| 34338 | |||
| 34339 | @lisp | ||
| 34340 | (collectd-plugin-python | ||
| 34341 | (packages (list python-pymongo)) | ||
| 34342 | (module-paths | ||
| 34343 | (list | ||
| 34344 | "/opt/collectd-mongodb/mongometrics")) | ||
| 34345 | (module "mongometrics") | ||
| 34346 | (module-options '((Host . "localhost")))) | ||
| 34347 | @end lisp | ||
| 34348 | |||
| 34349 | Available @code{collectd-plugin-python} fields are: | ||
| 34350 | |||
| 34351 | @table @asis | ||
| 34352 | @item @code{load-plugin?} (default: @code{#t}) (type: boolean) | ||
| 34353 | When @code{#t}, include a @code{LoadPlugin} directive in the | ||
| 34354 | configuration. This interacts with @code{auto-load-plugins?} in | ||
| 34355 | @code{collectd-configuration}; if @code{collectd-configuration}'s | ||
| 34356 | @code{auto-load-plugins?} is @code{#f}, all plugins should set this to | ||
| 34357 | @code{#t}. | ||
| 34358 | |||
| 34359 | @item @code{type-databases} (default: @code{()}) (type: list-of-file-likes) | ||
| 34360 | One or more files that contain the data-set descriptions. See | ||
| 34361 | @code{types.db(5)} for a description of the format of these files. | ||
| 34362 | |||
| 34363 | @item @code{packages} (default: @code{()}) (type: list-of-packages) | ||
| 34364 | Packages to make available to the Python plugin. These can be | ||
| 34365 | dependencies of the plugin code, or may contain the plugin. | ||
| 34366 | |||
| 34367 | @item @code{module-paths} (default: @code{()}) (type: list-of-string) | ||
| 34368 | Entries to prepend to @code{sys.path}. | ||
| 34369 | |||
| 34370 | @item @code{log-traces?} (default: @code{#f}) (type: boolean) | ||
| 34371 | If a Python script throws an exception it will be logged by collectd | ||
| 34372 | with the name of the exception and the message. If you set this option | ||
| 34373 | to true it will also log the full stacktrace just like the default | ||
| 34374 | output of an interactive Python interpreter. This does not apply to the | ||
| 34375 | @code{CollectError} exception, which will never log a stacktrace. This | ||
| 34376 | should probably be set to false most of the time but is very useful for | ||
| 34377 | development and debugging of new modules. | ||
| 34378 | |||
| 34379 | @item @code{interactive?} (default: @code{#f}) (type: boolean) | ||
| 34380 | This option will cause the module to launch an interactive Python | ||
| 34381 | interpreter that reads from and writes to the terminal. Note that | ||
| 34382 | collectd will terminate right after starting up if you try to run it as | ||
| 34383 | a daemon while this option is enabled so make sure to start collectd | ||
| 34384 | with the @code{-f} option. See the @code{collectd-python(5)} man page | ||
| 34385 | for more information on this option. | ||
| 34386 | |||
| 34387 | @item @code{module} (type: string) | ||
| 34388 | The name of the Python module to import into the collectd Python | ||
| 34389 | process. The module must be available in @code{packages} or | ||
| 34390 | @code{module-paths}, and register a MPD callback. | ||
| 34391 | |||
| 34392 | @item @code{module-options} (default: @code{()}) (type: alist) | ||
| 34393 | Configuration options for the module. | ||
| 34394 | |||
| 34395 | @end table | ||
| 34396 | |||
| 34397 | @end deftp | ||
| 34398 | |||
| 34399 | |||
| 34400 | @c %end of fragment | ||
| 34401 | |||
| 34402 | |||
| 34109 | @node Kerberos Services | 34403 | @node Kerberos Services |
| 34110 | @subsection Kerberos Services | 34404 | @subsection Kerberos Services |
| 34111 | @cindex Kerberos | 34405 | @cindex Kerberos |
