xref: /freebsd/usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.8 (revision a90b9d0159070121c221b966469c3e36d912bf82)
1.\" Copyright (c) 2016 Nuxi, https://nuxi.nl/
2.\"
3.\" Redistribution and use in source and binary forms, with or without
4.\" modification, are permitted provided that the following conditions
5.\" are met:
6.\" 1. Redistributions of source code must retain the above copyright
7.\"    notice, this list of conditions and the following disclaimer.
8.\" 2. Redistributions in binary form must reproduce the above copyright
9.\"    notice, this list of conditions and the following disclaimer in the
10.\"    documentation and/or other materials provided with the distribution.
11.\"
12.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22.\" SUCH DAMAGE.
23.Dd October 7, 2021
24.Dt PROMETHEUS_SYSCTL_EXPORTER 8
25.Os
26.Sh NAME
27.Nm prometheus_sysctl_exporter
28.Nd print kernel state as Prometheus metrics
29.Sh SYNOPSIS
30.Nm prometheus_sysctl_exporter
31.Op Fl dgh
32.Op Fl e Ar pattern
33.Op Fl i Ar pattern
34.Op Ar prefix ...
35.Sh DESCRIPTION
36Prometheus is a monitoring system that gathers metrics from its targets
37by fetching them through HTTP GET requests.
38Metrics are identified by a name and an optional set of labels.
39Sample values are required to be numerical.
40.Pp
41The
42.Nm
43utility prints the values of sysctl nodes to standard output,
44formatted such that they can be scraped by Prometheus directly.
45By default,
46it prints metrics for all numerically representable nodes in the sysctl
47namespace.
48It is also possible to limit output to a smaller number of metrics by
49specifying one or more prefixes as arguments.
50.Pp
51Metrics printed by this utility are named
52.Ql sysctl_ ,
53followed by the name of the sysctl node having its
54.Ql .\&
55separators replaced by
56.Ql _ .
57Components on which it is desirable to aggregate (e.g.,
58names of devices) are omitted from the metric's name,
59but are appended as labels instead.
60.Pp
61There are two different methods for exporting the output of
62.Nm
63to Prometheus.
64The first method is to periodically invoke this utility through
65.Xr cron 8
66and store its output in a textfile.
67The metrics in this textfile can then be served over HTTP using the
68Prometheus node exporter's textfile collector.
69The second method is to run this utility through
70.Xr inetd 8 .
71TCP port 9124 has been allocated for this purpose.
72.Pp
73The following options are available:
74.Bl -tag -width indent
75.It Fl d
76Print descriptions of metrics when available.
77.It Fl e Ar pattern
78Same as
79.Fl i ,
80except exclude metrics that match
81.Ar pattern .
82.It Fl g
83Gzip compresses the HTTP response body.
84.It Fl h
85Precede the output with a HTTP response header.
86This flag is required when running this utility through
87.Xr inetd 8 .
88.It Fl i Ar pattern
89If specified, include metrics that match
90.Ar pattern .
91The format of
92.Ar pattern
93is to be a regular expression as described in
94.Xr re_format 7 .
95The provided regular expression is tested against the Prometheus
96metric name.
97.El
98.Sh SEE ALSO
99.Xr cron 8 ,
100.Xr inetd 8 ,
101.Xr sysctl 8 ,
102.Xr SYSCTL_ADD_NODE_WITH_LABEL 9
103.Pp
104Prometheus project:
105.Pa https://prometheus.io/ .
106.Pp
107Prometheus exposition formats:
108.Pa https://prometheus.io/docs/instrumenting/exposition_formats/ .
109.Pp
110Prometheus node exporter:
111.Pa https://github.com/prometheus/node_exporter .
112.Pp
113Prometheus default port allocations:
114.Pa https://github.com/prometheus/prometheus/wiki/Default-port-allocations .
115.Sh HISTORY
116.Nm
117first appeared in
118.Fx 12.0 .
119.Sh AUTHORS
120.An Nuxi : Pa https://nuxi.nl/ .
121