Commit Graph

1183 Commits

Author SHA1 Message Date
Shawn Craver b8b0195d6d OpenBSD rc.d script (#1306)
* OpenBSD rc.d script

Signed-off-by: Shawn Craver <craversp@gmail.com>
2019-04-04 13:06:31 +02:00
Théo Brigitte 4d88761c13 update github.com/godbus/dbus to latest master (#1305)
* update github.com/godbus/dbus to 271e53dc4968a0f8862f20841cc63bb5f43d6c57

Signed-off-by: Theo Brigitte <theo.brigitte@gmail.com>
2019-04-03 12:32:48 +02:00
Simon Pasquier dbe7badc7c Update Makefile.common (#1288)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-03-25 12:47:57 +01:00
Edgaras Giedrė 2f87b7cba6 Update smartmon.py to widen self_assessment_passed test (#1293)
Signed-off-by: EdgarasG <edgaras.giedre@hostinger.com>
2019-03-20 09:38:41 +01:00
Johannes 'fish' Ziemke d2136aace0
Update README: Add note about ts in textfile
This closes #1284
2019-03-19 11:23:17 +01:00
Slawomir Gonet 19e5bb6abd yum.sh: yum update monitor (#1273)
Signed-off-by: Slawomir Gonet <slawek@otwiera.cz>
2019-02-28 00:12:47 +01:00
Julian Kornberger 5110efc1cd Translate smartmon.py to Python (#1225)
* Add smartmon.py python port of the smartmon.sh bash script

Signed-off-by: Arthur Skowronek <ags@digineo.de>
2019-02-27 22:19:55 +01:00
Paul Gier 8ca1e5594b upgrade promu to v0.3.0 (#1272)
Signed-off-by: Paul Gier <pgier@redhat.com>
2019-02-27 20:30:09 +01:00
Saj Goonatilleke d546916c6b Add the inotify-instances text collector (#1186)
This is an alternative take on the embedded inotify collector:

https://github.com/prometheus/node_exporter/pull/988

The proposed embedded collector was not accepted for inclusion because
it was not possible for a single unprivileged node_exporter process to
detect inotify resource utilisation in other user domains.

This text collector works around the problem by giving the operator a
choice between the following:

  - Run only the text collector as root to gain visibility over all
    processes on the system.

  - Run one or more instances of the text collector as an unprivileged
    user to gain visibility over subsets of the system.

In either case, the data generated by this collector can be useful when
hunting down inotify instance leaks -- and when confirming the
resolution of such leaks.

Signed-off-by: Saj Goonatilleke <sg@redu.cx>
2019-02-27 01:03:25 +01:00
Cole White 83c9b11747 remove "-n" flag from /usr/bin/awk (#1269)
This flag causes no ipmi data to be emitted and an error log is generated on each invocation: "awk: not an option: -nf".

I was unable to locate a "-n" flag in the mawk or gawk man pages, so I tested it by manually changing the script on a running Debian buster system.  The issue was resolved and metrics were emitted.

Signed-off-by: Cole White <cwhite@wikimedia.org>
2019-02-23 18:37:06 +01:00
Nuno Tavares 0dc14762ef ADD Cachevault_Info.Temp, being a distinct phy component, I think it's worth monitoring (#1268)
Signed-off-by: Nuno Tavares <n.tavares@portavita.eu>
2019-02-21 14:12:45 +01:00
Paul Gier cc847f2f44 collector/cpu: split cpu freq metrics into separate collector (#1253)
The cpu frequency information is not always needed and/or available.
This change allows the cpu frequency metrics to be enabled/disabled
separately from the other cpu metrics, and also prevents a frequency
metric failure (such as a parse error) from failing the main cpu
collector.

Fixes #1241

Signed-off-by: Paul Gier <pgier@redhat.com>
2019-02-19 17:22:54 +01:00
Ben Kochie f028b81615
Update systemd blacklist (#1255)
Include additional unit types in the default systemd collector
blacklist.

Signed-off-by: Ben Kochie <superq@gmail.com>
2019-02-17 17:57:15 +01:00
Ben Kochie dc4c58671d
Update vendoring. (#1257)
* Update vendoring.

Update vendoring to latest upstream.

Signed-off-by: Ben Kochie <superq@gmail.com>
2019-02-13 14:12:12 +01:00
Paul Gier cb9e23c536 Systemd refactor (#1254)
This reduces the system metric collection time by using a wait group
and go routines to allow the systemd metric calls happen concurrently.

Also, makes the start time, restarts, tasks_max, and tasks_current metrics disabled by default
because these can be time consuming to gather.

Signed-off-by: Paul Gier <pgier@redhat.com>
2019-02-11 23:27:21 +01:00
mpursley 1ba436e194 add md_info_detail.sh (#1204)
Signed-off-by: Matt Pursley <mpursley@gmail.com>
2019-02-10 15:20:42 +01:00
Sachi King 18fc512fc4 Bond: Monitor bond mii_status not link operstate (#1124)
With a bond interface the state of the slave interface from the bond's
point of view is reflected in `mii_status` and is independent of the
link's `operstate`.

When a bond is monitored with `miimon`, `mii_status` will reflect the
state of the physical link as configured via the operator.

When a bond is monitored via `arp_interval` the `mii_status` will
reflect the results of the bond ARP checking.  This means the link can
be down from the bond's point of view, but up from a physical
connection point of view.

If a bond is not monitored via miimon or arp, the `mii_status` should
likely be always `up`, however I have observed a case where this is not
true and the `operstate` is `up` while `mii_status` is `down`.  Kernel
bond documentation stresses that a bond should not be configured without
one of `mii_mon` or `arp_interval` configured however.

This change results in the metric 'node_bonding_active' matching the
up/down state of the bond's point of view rather than operstate.

Signed-off-by: Sachi King <nakato@nakato.io>
2019-02-10 11:00:04 +01:00
Paul Gier e0d6d11859 netclass_linux: remove varying labels from the 'up' metric (#1243)
* netclass_linux: remove varying labels from the 'up' metric

This moves the variable label values such as 'operstate' out of
the 'network_up' metric and into a separate metric called '_info'.
This allows the 'up' metric to remain continous over state changes.
Fixes #1236

Signed-off-by: Paul Gier <pgier@redhat.com>
2019-02-07 15:59:32 +01:00
Johannes 'fish' Ziemke 6ea0aa73e4 Rename interface to device in netclass collector (#1224)
* Rename interface to device in netclass collector

This makes it consistent with other networking metrics like node_network_receive_bytes_total

This closes #1223 

Signed-off-by: Johannes 'fish' Ziemke <github@freigeist.org>
2019-02-06 20:02:48 +01:00
Ralf Horstmann 3867ad5ab0 Add diskstats collector for OpenBSD (#1250)
* Add diskstats collector for OpenBSD

Tested on i386 and amd64, OpenBSD 6.4 and -current.

* Refactor diskstats collectors

This moves common descriptors from Linux, Darwin, OpenBSD
diskstats collectors into diskstats_common.go

Signed-off-by: Ralf Horstmann <ralf+github@ackstorm.de>
2019-02-06 11:36:22 +01:00
David O'Rourke d442108d7a collector: Implement uname collector for FreeBSD (#1239)
* collector: Implement uname collector for FreeBSD

Signed-off-by: David O'Rourke <david.orourke@gmail.com>
2019-02-05 17:39:24 +01:00
Paul Gier 2b81bff518 collector: use path/filepath for handling file paths (#1245)
Similar to #1228.  Update the remaining collectors to use
'path/filepath' intead of 'path' for manipulating file paths.

Signed-off-by: Paul Gier <pgier@redhat.com>
2019-02-05 16:37:27 +01:00
Ralf Horstmann dda51ad06a Fix staticcheck ST1003 warnings (#1249)
This fixes a few staticcheck ST1003 warnings in OpenBSD CPU
collector. No functional change.

Signed-off-by: Ralf Horstmann <ralf+github@ackstorm.de>
2019-02-05 07:46:50 +01:00
James Hartig 62e87ca00c Fixed capitalization of linux in Makefile (#1252)
Signed-off-by: James Hartig <james@getadmiral.com>
2019-02-04 20:10:26 +01:00
mknapphrt 7fbdd0ae93 Update procfs vendor (#1248)
Signed-off-by: Mark Knapp <mknapp@hudson-trading.com>
2019-02-04 16:54:41 +01:00
mpursley 7d150d5782 add physical disk "state" to megaraid_pd_info metric (#1226)
Signed-off-by: Matt Pursley <mpursley@gmail.com>
2019-01-31 12:40:37 +01:00
Paul Gier 40dce45d8d collector/systemd: add new label "type" for systemd_unit_state (#1229)
Adds a new label called "type" systemd_unit_state which contains the
Type field from the unit file.  This applies only to the .service and
.mount unit types.  The other unit types do not include the optional
type field.

Fixes #1210

Signed-off-by: Paul Gier <pgier@redhat.com>
2019-01-29 23:54:47 +01:00
Paul Gier 6a3b92ce57 cleanup makefile (#1232)
The recent updates to Makefile.common make some of the stuff in
Makefile unnecessary.

Signed-off-by: Paul Gier <pgier@redhat.com>
2019-01-23 21:44:12 +01:00
Matt Layher 3b5c2f6463 collector: use path/filepath for handling file paths (#1228)
Signed-off-by: Matt Layher <mdlayher@gmail.com>
2019-01-21 17:44:55 +01:00
Jon Davies e766485286 Add kstat-based Solaris metrics (#1197)
* collector/loadavg_solaris.go: Use libkstat to gather load averages.
* go.mod: Added go-kstat.
* boot_time_solaris.go: Added.
* cpu_solaris.go: Added.
* README.md: Updated entries for Solaris.
* collector/zfs_solaris.go: Added.
* CHANGELOG.md: Added note about kstat-based Solaris metrics.

Signed-off-by: Jonathan Davies <jpds@protonmail.com>
2019-01-12 13:33:56 +01:00
Mateusz Piotrowski a616953b9a Do not use .PHONY for $(PROMTOOL) (#1216)
Adding $(PROMTOOL) to .PHONY makes it impossible to provide an alternative path
to promtool.

Signed-off-by: Mateusz Piotrowski <0mp@FreeBSD.org>
2019-01-10 17:44:10 +01:00
Johannes 'fish' Ziemke 8a6a464b7e
Add staticcheck.conf to enable ST1003 (#1214)
> ST1003 – Poorly chosen identifier (non-default)
> Identifiers, such as variable and package names, follow certain rules.

Signed-off-by: Johannes 'fish' Ziemke <github@freigeist.org>
2019-01-04 16:36:49 +00:00
Ben Kochie 070e4b2e17 Update Makefile.common (#1220)
* Update Makefile.common

Update to new staticcheck method[0].

[0]: https://github.com/prometheus/prometheus/pull/5057

Signed-off-by: Ben Kochie <superq@gmail.com>

* Fix staticcheck errors.

Signed-off-by: Ben Kochie <superq@gmail.com>
2019-01-04 15:58:53 +00:00
Dai Dang Van 085d872aaf Add S.M.A.R.T metrics (#1209)
Update metrics following SMART attributes in [1][2]
- Seek_Error_Rate - ID: 7
- Reallocated_Event_Count - ID: 196

[1] https://en.wikipedia.org/wiki/S.M.A.R.T.#Known_ATA_S.M.A.R.T._attributes
[2] https://en.wikibooks.org/wiki/Minimizing_Hard_Disk_Drive_Failure_and_Data_Loss/Self-Monitoring,_Analysis,_and_Reporting_Technology

Signed-off-by: Dai, Dang Van <daikk115@gmail.com>
2019-01-03 18:12:28 +01:00
Anton Tolchanov cf8b29d1fb Add a sample btrfs stats collector script (#1200)
Signed-off-by: Anton Tolchanov <commits@knyar.net>
2018-12-21 14:10:03 +01:00
Simon Pasquier 97dab59e18 Fix go.sum after Go1.11.4 bump (#1202)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-12-19 11:41:27 +00:00
dhewg 7c960fd683 smartmon.sh: add metric for active/low-power mode (#1192)
Add this new metric (where sda is active and sdb is in standby mode):
smartmon_device_active{disk="/dev/sda",type="sat"} 1
smartmon_device_active{disk="/dev/sdb",type="sat"} 0

Also skip further metrics if the drive is in a low-power mode. This
prevents spinning up disks just to get the metrics (which matches e.g.
debian's default behavior for smartd).

Signed-off-by: Andre Heider <a.heider@gmail.com>
2018-12-13 16:11:23 +01:00
Paul Gier 03bb276deb Makefile.common: fix promu download path for arm32 (#1196)
Signed-off-by: Paul Gier <pgier@redhat.com>
2018-12-13 16:07:22 +01:00
Paul Gier 614b815e00 Makefile.common: fix format rule (#1195)
Signed-off-by: Paul Gier <pgier@redhat.com>
2018-12-11 17:47:09 +01:00
Ben Kochie 73ddf5f1f7 netstat: Add TCP In/Out Segs (#1185)
* netstat: Add TCP In/Out Segs

In order to get a better idea of TCP packet loss, we need to know how
many `node_netstat_Tcp_OutSegs` there are so we can compare this to
`node_netstat_Tcp_RetransSegs`.

Signed-off-by: Ben Kochie <superq@gmail.com>

* Update fixtures

Signed-off-by: Ben Kochie <superq@gmail.com>
2018-12-08 12:16:02 +01:00
Tariq Ibrahim 6bd51269b7 update to host_statistics64 for Darwin meminfo (#1183)
Signed-off-by: tariqibrahim <tariq181290@gmail.com>
2018-12-06 16:47:20 +01:00
Ben Kochie f9dd8e9b8c
Release v0.17.0 (#1168)
* Update CHANGELOG
* Update VERSION

Signed-off-by: Ben Kochie <superq@gmail.com>
2018-11-30 15:18:48 +01:00
Ben Kochie 4abc6fba7d
Add fallback for missing /proc/1/mounts (#1172)
* Add fallback for missing /proc/1/mounts

On some systems, `/proc/1/mounts` is hidden from non-root users due to
the `hidepid` procfs feature. Attempt to fallback to `/proc/mounts` if
`/proc/1/mounts` is not found.

Signed-off-by: Ben Kochie <superq@gmail.com>

* Add tests.

Signed-off-by: Ben Kochie <superq@gmail.com>

* Add CHANGELOG entry.

Signed-off-by: Ben Kochie <superq@gmail.com>
2018-11-30 14:01:55 +01:00
Jerome Froelich 0cb0c4d911 Remove unused variable readOnly from filesystem_linux.go. (#1173)
The pull request #1002 changed the logic used on Linux servers to determine if a filesystem is
read-only. As a result of this change, the variable `readOnly` is now unused and can be removed.

Signed-off-by: Jerome Froelich <jeromefroelich@hotmail.com>
2018-11-30 14:01:39 +01:00
Ben Kochie becca1275c
Convert to Go modules (#1178)
* Convert to Go modules

* Update promu config.
* Convert to Go modules.
* Update vendoring.
* Update Makefile.common.
* Update circleci config.
* Use Prometheus release tar for promtool.
* Fixup unpack

* Use temp dir for unpacking tools.
* Use BSD compatible tar command.
* OpenBSD mkdir doesn't support `-v`.

Signed-off-by: Ben Kochie <superq@gmail.com>
2018-11-30 14:01:20 +01:00
Ben Kochie 1732478361
circleci: switch to 2.1 config
Signed-off-by: Ben Kochie <superq@gmail.com>
2018-11-29 12:06:34 +01:00
Andreas Wirooks 9c9e17aba7 Handle 'Unknown' as measurement value. (#1113)
We use the output-compatible perccli and storcli.py does not handle 'Unknown' as a result:
```
sg="Error parsing \"/var/lib/node_exporter/perccli.prom\": text format parsing error in line 222: expected float as value, got \"Unknown\"" source="textfile.go:212"
```
I know, the perccli should not return 'Unknown' but this error breaks all other useful measurements because the prom file is not parsable. My if condition fixes this.

Signed-off-by: Andreas Wirooks <andreas.wirooks@1und1.de>
2018-11-23 16:29:56 +01:00
ioriveur ea8e1373f7 Change Dfly's CPU counting frequency (#1140)
* Change Dfly's CPU counting frequency, see: https://github.com/prometheus/node_exporter/issues/1129

* Convert Dfly's CPU unit into second

Signed-off-by: iori-yja <fivo.11235813@gmail.com>
2018-11-21 13:45:22 +01:00
Ben Kochie ffefc8e74d Add a limit to the number of in-flight requests (#1166)
In order to avoid stuck collectors using up all system resources, add a
limit to the number of parallel in-flight scrape requests. This will
return a 503 error.

Default to 40 requests, this seems like a reasonable number based on:
* Two Prometheus servers scraping every 15 seconds.
* Failing scrapes after 5 minutes of stuckness.

Signed-off-by: Ben Kochie <superq@gmail.com>
2018-11-20 18:11:40 +01:00
Johannes 'fish' Ziemke bcec99e0aa Add link to prometheus-dcgm (#1164)
Signed-off-by: Johannes 'fish' Ziemke <github@freigeist.org>
2018-11-19 19:35:01 +01:00