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