pax_global_header00006660000000000000000000000064132145023030014503gustar00rootroot0000000000000052 comment=4c770ff40006be2ea32dde7a29cfcc065201e042 prometheus-node-exporter-0.15.2+ds/000077500000000000000000000000001321450230300171565ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/.dockerignore000066400000000000000000000000501321450230300216250ustar00rootroot00000000000000.build/ .tarballs/ !.build/linux-amd64 prometheus-node-exporter-0.15.2+ds/.github/000077500000000000000000000000001321450230300205165ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/.github/ISSUE_TEMPLATE.md000066400000000000000000000022671321450230300232320ustar00rootroot00000000000000 ### Host operating system: output of `uname -a` ### node_exporter version: output of `node_exporter --version` ### node_exporter command line flags ### Are you running node_exporter in Docker? ### What did you do that produced an error? ### What did you expect to see? ### What did you see instead? prometheus-node-exporter-0.15.2+ds/.gitignore000066400000000000000000000006261321450230300211520ustar00rootroot00000000000000# Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a *.so # Folders _obj _test # Architecture specific extensions/prefixes *.[568vq] [568vq].out *.cgo1.go *.cgo2.c _cgo_defun.c _cgo_gotypes.go _cgo_export.* _testmain.go *.exe dependencies-stamp /node_exporter /.build /.deps /.release /.tarballs # Intellij /.idea *.iml # Test files extracted from ttar collector/fixtures/sys/ prometheus-node-exporter-0.15.2+ds/.promu.yml000066400000000000000000000020141321450230300211160ustar00rootroot00000000000000go: cgo: true repository: path: github.com/prometheus/node_exporter build: binaries: - name: node_exporter flags: -a -tags 'netgo static_build' ldflags: | -X {{repoPath}}/vendor/github.com/prometheus/common/version.Version={{.Version}} -X {{repoPath}}/vendor/github.com/prometheus/common/version.Revision={{.Revision}} -X {{repoPath}}/vendor/github.com/prometheus/common/version.Branch={{.Branch}} -X {{repoPath}}/vendor/github.com/prometheus/common/version.BuildUser={{user}}@{{host}} -X {{repoPath}}/vendor/github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}} tarball: files: - LICENSE - NOTICE crossbuild: platforms: - linux/amd64 - linux/386 - darwin/amd64 - darwin/386 - netbsd/amd64 - netbsd/386 - linux/arm - linux/arm64 # Temporarily deactivated as this does not currently build with promu. #- linux/mips64 #- linux/mips64le prometheus-node-exporter-0.15.2+ds/.travis.yml000066400000000000000000000001741321450230300212710ustar00rootroot00000000000000sudo: false language: go go: - 1.8.x - 1.9.x - master go_import_path: github.com/prometheus/node_exporter script: - make prometheus-node-exporter-0.15.2+ds/CHANGELOG.md000066400000000000000000000231051321450230300207700ustar00rootroot00000000000000## v0.15.2 / 2017-12-05 * [BUGFIX] cpu: Support processor-less (memory-only) NUMA nodes #734 ## v0.15.1 / 2017-11-07 * [BUGFIX] xfs: expose correct fields, fix metric names #708 * [BUGFIX] Correct buffer_bytes > INT_MAX on BSD/amd64. #712 * [BUGFIX] netstat: return nothing when /proc/net/snmp6 not found #718 * [BUGFIX] Fix off by one in Linux interrupts collector #721 * [BUGFIX] Add and use sysReadFile in hwmon collector #728 ## v0.15.0 / 2017-10-06 **Breaking changes** This release contains major breaking changes to flag handling. * The flag library has been changed, all flags now require double-dashs. (`-foo` becomes `--foo`). * The collector selection flag has been replaced by individual boolean flags. * The `-collector.procfs` and `-collector.sysfs` flags have been renamed to `--path.procfs` and `--path.sysfs` respectively. The `ntp` collector has been replaced with a new NTP-based check that is designed to expose the state of a localhost NTP server rather than provide the offset of the node to a remote NTP server. By default the `ntp` collector is now locked to localhost. This is to avoid accidental spamming of public internet NTP pools. Windows support is now removed, the [wmi_exporter](https://github.com/martinlindhe/wmi_exporter) is recommended as a replacement. * [CHANGE] `node_cpu` metrics moved from `stats` to `cpu` collector on linux (enabled by default). #548 * [CHANGE] Blacklist systemd scope units #534 * [CHANGE] Remove netbsd/arm #551 * [CHANGE] Remove Windows support #549 * [CHANGE] Enable IPVS collector by default #623 * [CHANGE] Switch to kingpin flags #639 * [CHANGE] Replace --collectors.enabled with per-collector flags #640 * [FEATURE] Add ARP collector for Linux #540 * [FEATURE] Add XFS colector for Linux #568, #575 * [FEATURE] Add qdisc collector for Linux #580 * [FEATURE] Add cpufreq stats for Linux #548 * [FEATURE] Add diskstats for Darwin #593 * [FEATURE] Add bcache collector for Linux #597 * [FEATURE] Add parsing /proc/net/snmp6 file for Linux #615 * [FEATURE] Add timex collector for Linux #664 * [ENHANCEMENT] Include overal health status in smartmon.sh example script #546 * [ENHANCEMENT] Include `guest_nice` in CPU collector #554 * [ENHANCEMENT] Add exec_boot_time for freebsd, dragonfly #550 * [ENHANCEMENT] Get full resolution for node_time #555 * [ENHANCEMENT] infiniband: Multiply port data XMIT/RCV metrics by 4 #579 * [ENHANCEMENT] cpu: Metric 'package_throttles_total' is per package. #657 * [BUGFIX] Fix stale device error metrics #533 * [BUGFIX] edac: Fix typo in node_edac_csrow_uncorrectable_errors_total #564 * [BUGFIX] Use int64 throughout the ZFS collector #653 * [BUGFIX] Silently ignore nonexisting bonding_masters file #569 * [BUGFIX] Change raid0 status line regexp for mdadm collector (bug #618) #619 * [BUGFIX] Ignore wifi collector permission errors #646 * [BUGFIX] Always try to return smartmon_device_info metric #663 ## v0.14.0 / 2017-03-21 NOTE: We are deprecating several collectors in this release. * `gmond` - Out of scope. * `megacli` - Requires forking, to be moved to textfile collection. * `ntp` - Out of scope. Breaking changes: * Collector errors are now a separate metric, `node_scrape_collector_success`, not a label on `node_exporter_scrape_duration_seconds` (#516) * [CHANGE] Report collector success/failure as a bool metric, not a label. #516 * [FEATURE] Add loadavg collector for Solaris #311 * [FEATURE] Add StorCli text collector example script #320 * [FEATURE] Add collector for Linux EDAC #324 * [FEATURE] Add text file utility for SMART metrics #354 * [FEATURE] Add a collector for NFS client statistics. #360 * [FEATURE] Add mountstats collector for detailed NFS statistics #367 * [FEATURE] Add a collector for DRBD #365 * [FEATURE] Add cpu collector for darwin #391 * [FEATURE] Add netdev collector for darwin #393 * [FEATURE] Collect CPU temperatures on FreeBSD #397 * [FEATURE] Add ZFS collector #410 * [FEATURE] Add initial wifi collector #413 * [FEATURE] Add NFS event metrics to mountstats collector #415 * [FEATURE] Add an example rules file #422 * [FEATURE] infiniband: Add new collector for InfiniBand statistics #450 * [FEATURE] buddyinfo: Add support for /proc/buddyinfo for linux free memory fragmentation. #454 * [IMPROVEMENT] hwmon: Provide annotation metric to link chip sysfs paths to human-readable chip types #359 * [IMPROVEMENT] Add node_filesystem_device_errors_total metric #374 * [IMPROVEMENT] Add runit service dir flag #375 * [IMPROVEMENT] Improve Docker documentation #376 * [IMPROVEMENT] Ignore autofs filesystems on linux #384 * [IMPROVEMENT] Replace some FreeBSD collectors with pure Go versions #385 * [IMPROVEMENT] Use filename as label, move 'label' to own metric #411 (hwmon) * [BUGFIX] mips64 build fix #361 * [BUGFIX] Update vendoring #372 (to fix #242) * [BUGFIX] Convert remaining collectors to use ConstMetrics #389 * [BUGFIX] Check for errors in netdev scanner #398 * [BUGFIX] Don't leak or race in FreeBSD devstat collector #396 * [BUGFIX] Allow graceful failure in hwmon collector #427 * [BUGFIX] Fix the reporting of active+total disk metrics for inactive raids. #522 ## v0.13.0 / 2016-11-26 NOTE: We have disabled builds of linux/ppc64 and linux/ppc64le due to build bugs. * [FEATURE] Add flag to ignore certain filesystem types (Copy of #217) #241 * [FEATURE] Add NTP stratum to NTP collector. #247 * [FEATURE] Add ignored-units flag for systemd collector #286 * [FEATURE] Compile netdev on dragonfly #314 * [FEATURE] Compile meminfo for dfly #315 * [FEATURE] Add hwmon /sensors support #278 * [FEATURE] Add Linux NUMA "numastat" metrics #249 * [FEATURE] export DragonFlyBSD CPU time #310 * [FEATURE] Dragonfly devstat #323 * [IMPROVEMENT] Use the offset calculation that includes round trip time in the ntp collector #250 * [IMPROVEMENT] Enable `*bsd` collector on darwin #265 * [IMPROVEMENT] Use meminfo_freebsd on darwin as well #266 * [IMPROVEMENT] sockstat: add support for RHE4 #267 * [IMPROVEMENT] Compile fs stats for dfly #302 * [BUGFIX] Add support for raid0 devices in mdadm_linux collector. #253 * [BUGFIX] Close file handler in textfile #263 * [BUGFIX] Ignore partitions on NVME devices by default #268 * [BUGFIX] Fix mdstat tabs parsing #275 * [BUGFIX] Fix mdadm collector for resync=PENDING. #309 * [BUGFIX] mdstat: Fix parsing of RAID0 lines that contain additional attributes. #341 * [BUGFIX] Fix additional mdadm parsing cases #346 ## 0.12.0 / 2016-05-05 * [CHANGE] Remove lastlogin collector. * [CHANGE] Remove -debug.memprofile-file flag. * [CHANGE] Sync BSD filesystem collector labels with Linux. * [CHANGE] Remove HTTP Basic Auth support. * [FEATURE] Add -version flag. * [FEATURE] Add Linux logind collector. * [FEATURE] Add Linux ksmd collector. * [FEATURE] Add Linux memory NUMA collector. * [FEATURE] Add Linux entropy collector. * [FEATURE] Add Linux vmstat collector. * [FEATURE] Add Linux conntrack collector. * [FEATURE] Add systemd collector. * [FEATURE] Add OpenBSD support for filesystem, interrupt and netdev collectors. * [FEATURE] Add supervisord collector. * [FEATURE] Add Linux /proc/mdstat collector. * [FEATURE] Add Linux uname collector. * [FEATURE] Add Linux /proc/sys/fs/file-nr collector. * [FEATURE] Add Linux /proc/net/sockstat collector. * [IMPROVEMENT] Provide statically linked Linux binaries. * [IMPROVEMENT] Remove root requirement for FreeBSD CPU metrics. * [IMPROVEMENT] Add node_exporter build info metric. * [IMPROVEMENT] Add disk bytes read/written metrics on Linux. * [IMPROVEMENT] Add filesystem read-only metric. * [IMPROVEMENT] Use common Prometheus log formatting. * [IMPROVEMENT] Add option to specify NTP protocol version. * [IMPROVEMENT] Handle statfs errors gracefully for individual filesystems. * [IMPROVEMENT] Add load5 and load15 metrics to loadavg collector. * [IMPROVEMENT] Add end-to-end tests. * [IMPROVEMENT] Export FreeBSD CPU metrics to seconds. * [IMPROVEMENT] Add flag to configure sysfs mountpoint. * [IMPROVEMENT] Add flag to configure procfs mountpoint. * [IMPROVEMENT] Add metric for last service state change to runit collector. * [BUGFIX] Fix FreeBSD netdev metrics on 64 bit systems. * [BUGFIX] Fix mdstat for devices in delayed resync state. * [BUGFIX] Fix Linux stat metrics on parallel scrapes. * [BUGFIX] Remove unavailable collectors from defaults. * [BUGFIX] Fix build errors on FreeBSD, OpenBSD, Darwin and Windows. * [BUGFIX] Fix build errors on 386, arm, arm64, ppc64 and ppc64le architectures. * [BUGFIX] Fix export of stale metrics for removed filesystem and network devices. * [BUGFIX] textfile: Fix mtime reporting. * [BUGFIX] megacli: prevent crash when drive temperature is N/A ## 0.11.0 / 2015-07-27 * [FEATURE] Add stats from /proc/net/snmp. * [FEATURE] Add support for FreeBSD. * [FEATURE] Allow netdev devices to be ignored. * [MAINTENANCE] New Dockerfile for unified way to dockerize Prometheus exporters. * [FEATURE] Add device,fstype collection to the filesystem exporter. * [IMPROVEMENT] Make logging of collector executions less verbose. ## 0.10.0 / 2015-06-10 * [CHANGE] Change logging output format and flags. ## 0.9.0 / 2015-05-26 * [BUGFIX] Fix `/proc/net/dev` parsing. * [CLEANUP] Remove the `attributes` collector, use `textfile` instead. * [CLEANUP] Replace last uses of the configuration file with flags. * [IMPROVEMENT] Remove cgo dependency. * [IMPROVEMENT] Sort collector names when printing. * [FEATURE] IPVS stats collector. ## 0.8.1 / 2015-05-17 * [MAINTENANCE] Use the common Prometheus build infrastructure. * [MAINTENANCE] Update former Google Code imports. * [IMPROVEMENT] Log the version at startup. * [FEATURE] TCP stats collector ## 0.8.0 / 2015-03-09 * [CLEANUP] Introduced semantic versioning and changelog. From now on, changes will be reported in this file. prometheus-node-exporter-0.15.2+ds/CONTRIBUTING.md000066400000000000000000000037761321450230300214240ustar00rootroot00000000000000# Contributing Prometheus uses GitHub to manage reviews of pull requests. * If you have a trivial fix or improvement, go ahead and create a pull request, addressing (with `@...`) the maintainer of this repository (see [MAINTAINERS.md](MAINTAINERS.md)) in the description of the pull request. * If you plan to do something more involved, first discuss your ideas on our [mailing list](https://groups.google.com/forum/?fromgroups#!forum/prometheus-developers). This will avoid unnecessary work and surely give you and us a good deal of inspiration. * Relevant coding style guidelines are the [Go Code Review Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments) and the _Formatting and style_ section of Peter Bourgon's [Go: Best Practices for Production Environments](http://peter.bourgon.org/go-in-production/#formatting-and-style). ## Collector Implementation Guidelines The Node Exporter is not a general monitoring agent. Its sole purpose is to expose machine metrics, as oppose to service metrics, with the only exception being the textfile collector. The metrics should not get transformed in a way that is hardware specific and would require maintaining any form of vendor based mappings or conditions. If for example a proc file contains the magic number 42 as some identifier, the Node Exporter should expose it as it is and not keep a mapping in code to make this human readable. Instead, the textfile collector can be used to add a static metric which can be joined with the metrics exposed by the exporter to get human readable identifier. A Collector may only read `/proc` or `/sys` files, use system calls or local sockets to retrieve metrics. It may not require root privileges. Running external commands is not allowed for performance and reliability reasons. Use a dedicated exporter instead or gather the metrics via the textfile collector. The Node Exporter tries to support the most common machine metrics. For more exotic metrics, use the textfile collector or a dedicated Exporter. prometheus-node-exporter-0.15.2+ds/Dockerfile000066400000000000000000000003521321450230300211500ustar00rootroot00000000000000FROM quay.io/prometheus/busybox:glibc MAINTAINER The Prometheus Authors COPY node_exporter /bin/node_exporter EXPOSE 9100 USER nobody ENTRYPOINT [ "/bin/node_exporter" ] prometheus-node-exporter-0.15.2+ds/Dockerfile.ppc64le000066400000000000000000000002231321450230300224210ustar00rootroot00000000000000FROM ppc64le/busybox:glibc COPY node_exporter /bin/node_exporter EXPOSE 9100 USER nobody ENTRYPOINT [ "/bin/node_exporter" ] prometheus-node-exporter-0.15.2+ds/LICENSE000066400000000000000000000261351321450230300201720ustar00rootroot00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. prometheus-node-exporter-0.15.2+ds/MAINTAINERS.md000066400000000000000000000001201321450230300212430ustar00rootroot00000000000000* Ben Kochie * Johannes 'fish' Ziemke prometheus-node-exporter-0.15.2+ds/Makefile000066400000000000000000000101461321450230300206200ustar00rootroot00000000000000# Copyright 2015 The Prometheus Authors # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. GO ?= GO15VENDOREXPERIMENT=1 go GOPATH := $(firstword $(subst :, ,$(shell $(GO) env GOPATH))) GOARCH := $(shell $(GO) env GOARCH) GOHOSTARCH := $(shell $(GO) env GOHOSTARCH) PROMU ?= $(GOPATH)/bin/promu STATICCHECK ?= $(GOPATH)/bin/staticcheck pkgs = $(shell $(GO) list ./... | grep -v /vendor/) PREFIX ?= $(shell pwd) BIN_DIR ?= $(shell pwd) DOCKER_IMAGE_NAME ?= node-exporter DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD)) MACH ?= $(shell uname -m) DOCKERFILE ?= Dockerfile ifeq ($(GOHOSTARCH),amd64) # Only supported on amd64 test-flags := -race endif ifeq ($(OS),Windows_NT) OS_detected := Windows else OS_detected := $(shell uname -s) endif ifeq ($(OS_detected), Linux) test-e2e := test-e2e else test-e2e := skip-test-e2e endif # 64bit -> 32bit mapping for cross-checking. At least for amd64/386, the 64bit CPU can execute 32bit code but not the other way around, so we don't support cross-testing upwards. cross-test = skip-test-32bit define goarch_pair ifeq ($$(OS_detected),Linux) ifeq ($$(GOARCH),$1) GOARCH_CROSS = $2 cross-test = test-32bit endif endif endef # By default, "cross" test with ourselves to cover unknown pairings. $(eval $(call goarch_pair,amd64,386)) $(eval $(call goarch_pair,arm64,arm)) $(eval $(call goarch_pair,mips64,mips)) $(eval $(call goarch_pair,mips64el,mipsel)) all: format vet staticcheck build test $(cross-test) $(test-e2e) style: @echo ">> checking code style" @! gofmt -d $(shell find . -path ./vendor -prune -o -name '*.go' -print) | grep '^' test: collector/fixtures/sys/.unpacked @echo ">> running tests" $(GO) test -short $(test-flags) $(pkgs) test-32bit: collector/fixtures/sys/.unpacked @echo ">> running tests in 32-bit mode" @env GOARCH=$(GOARCH_CROSS) $(GO) test $(pkgs) skip-test-32bit: @echo ">> SKIP running tests in 32-bit mode: not supported on $(OS_detected)/$(GOARCH)" collector/fixtures/sys/.unpacked: collector/fixtures/sys.ttar ./ttar -C collector/fixtures -x -f collector/fixtures/sys.ttar touch $@ test-e2e: build collector/fixtures/sys/.unpacked @echo ">> running end-to-end tests" ./end-to-end-test.sh skip-test-e2e: @echo ">> SKIP running end-to-end tests on $(OS_detected)" format: @echo ">> formatting code" @$(GO) fmt $(pkgs) vet: @echo ">> vetting code" @$(GO) vet $(pkgs) staticcheck: $(STATICCHECK) @echo ">> running staticcheck" @$(STATICCHECK) $(pkgs) build: $(PROMU) @echo ">> building binaries" @$(PROMU) build --prefix $(PREFIX) tarball: $(PROMU) @echo ">> building release tarball" @$(PROMU) tarball --prefix $(PREFIX) $(BIN_DIR) docker: ifeq ($(MACH), ppc64le) $(eval DOCKERFILE=Dockerfile.ppc64le) endif @echo ">> building docker image from $(DOCKERFILE)" @docker build --file $(DOCKERFILE) -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" . test-docker: @echo ">> testing docker image" ./test_image.sh "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" 9100 $(GOPATH)/bin/promu promu: @GOOS= GOARCH= $(GO) get -u github.com/prometheus/promu $(GOPATH)/bin/staticcheck: @GOOS= GOARCH= $(GO) get -u honnef.co/go/tools/cmd/staticcheck .PHONY: all style format build test test-e2e vet tarball docker promu staticcheck # Declaring the binaries at their default locations as PHONY targets is a hack # to ensure the latest version is downloaded on every make execution. # If this is not desired, copy/symlink these binaries to a different path and # set the respective environment variables. .PHONY: $(GOPATH)/bin/promu $(GOPATH)/bin/staticcheck prometheus-node-exporter-0.15.2+ds/NOTICE000066400000000000000000000007171321450230300200670ustar00rootroot00000000000000Configurable modular Prometheus exporter for various node metrics. Copyright 2013-2015 The Prometheus Authors This product includes software developed at SoundCloud Ltd. (http://soundcloud.com/). The following components are included in this product: wifi https://github.com/mdlayher/wifi Copyright 2016-2017 Matt Layher Licensed under the MIT License netlink https://github.com/mdlayher/netlink Copyright 2016-2017 Matt Layher Licensed under the MIT License prometheus-node-exporter-0.15.2+ds/README.md000066400000000000000000000176571321450230300204550ustar00rootroot00000000000000# Node exporter [![Build Status](https://travis-ci.org/prometheus/node_exporter.svg)][travis] [![CircleCI](https://circleci.com/gh/prometheus/node_exporter/tree/master.svg?style=shield)][circleci] [![Buildkite status](https://badge.buildkite.com/94a0c1fb00b1f46883219c256efe9ce01d63b6505f3a942f9b.svg)](https://buildkite.com/prometheus/node-exporter) [![Docker Repository on Quay](https://quay.io/repository/prometheus/node-exporter/status)][quay] [![Docker Pulls](https://img.shields.io/docker/pulls/prom/node-exporter.svg?maxAge=604800)][hub] [![Go Report Card](https://goreportcard.com/badge/github.com/prometheus/node_exporter)][goreportcard] Prometheus exporter for hardware and OS metrics exposed by \*NIX kernels, written in Go with pluggable metric collectors. The [WMI exporter](https://github.com/martinlindhe/wmi_exporter) is recommended for Windows users. ## Collectors There is varying support for collectors on each operating system. The tables below list all existing collectors and the supported systems. Collectors are enabled by providing a `--collector.` flag. Collectors that are enabled by default can be disabled by providing a `--no-collector.` flag. ### Enabled by default Name | Description | OS ---------|-------------|---- arp | Exposes ARP statistics from `/proc/net/arp`. | Linux bcache | Exposes bcache statistics from `/sys/fs/bcache/`. | Linux conntrack | Shows conntrack statistics (does nothing if no `/proc/sys/net/netfilter/` present). | Linux cpu | Exposes CPU statistics | Darwin, Dragonfly, FreeBSD, Linux diskstats | Exposes disk I/O statistics. | Darwin, Linux edac | Exposes error detection and correction statistics. | Linux entropy | Exposes available entropy. | Linux exec | Exposes execution statistics. | Dragonfly, FreeBSD filefd | Exposes file descriptor statistics from `/proc/sys/fs/file-nr`. | Linux filesystem | Exposes filesystem statistics, such as disk space used. | Darwin, Dragonfly, FreeBSD, Linux, OpenBSD hwmon | Expose hardware monitoring and sensor data from `/sys/class/hwmon/`. | Linux infiniband | Exposes network statistics specific to InfiniBand and Intel OmniPath configurations. | Linux ipvs | Exposes IPVS status from `/proc/net/ip_vs` and stats from `/proc/net/ip_vs_stats`. | Linux loadavg | Exposes load average. | Darwin, Dragonfly, FreeBSD, Linux, NetBSD, OpenBSD, Solaris mdadm | Exposes statistics about devices in `/proc/mdstat` (does nothing if no `/proc/mdstat` present). | Linux meminfo | Exposes memory statistics. | Darwin, Dragonfly, FreeBSD, Linux netdev | Exposes network interface statistics such as bytes transferred. | Darwin, Dragonfly, FreeBSD, Linux, OpenBSD netstat | Exposes network statistics from `/proc/net/netstat`. This is the same information as `netstat -s`. | Linux sockstat | Exposes various statistics from `/proc/net/sockstat`. | Linux stat | Exposes various statistics from `/proc/stat`. This includes boot time, forks and interrupts. | Linux textfile | Exposes statistics read from local disk. The `--collector.textfile.directory` flag must be set. | _any_ time | Exposes the current system time. | _any_ timex | Exposes selected adjtimex(2) system call stats. | Linux uname | Exposes system information as provided by the uname system call. | Linux vmstat | Exposes statistics from `/proc/vmstat`. | Linux wifi | Exposes WiFi device and station statistics. | Linux xfs | Exposes XFS runtime statistics. | Linux (kernel 4.4+) zfs | Exposes [ZFS](http://open-zfs.org/) performance statistics. | [Linux](http://zfsonlinux.org/) ### Disabled by default Name | Description | OS ---------|-------------|---- bonding | Exposes the number of configured and active slaves of Linux bonding interfaces. | Linux buddyinfo | Exposes statistics of memory fragments as reported by /proc/buddyinfo. | Linux devstat | Exposes device statistics | Dragonfly, FreeBSD drbd | Exposes Distributed Replicated Block Device statistics (to version 8.4) | Linux interrupts | Exposes detailed interrupts statistics. | Linux, OpenBSD ksmd | Exposes kernel and system statistics from `/sys/kernel/mm/ksm`. | Linux logind | Exposes session counts from [logind](http://www.freedesktop.org/wiki/Software/systemd/logind/). | Linux meminfo\_numa | Exposes memory statistics from `/proc/meminfo_numa`. | Linux mountstats | Exposes filesystem statistics from `/proc/self/mountstats`. Exposes detailed NFS client statistics. | Linux nfs | Exposes NFS client statistics from `/proc/net/rpc/nfs`. This is the same information as `nfsstat -c`. | Linux ntp | Exposes local NTP daemon health to check [time](./docs/TIME.md) | _any_ qdisc | Exposes [queuing discipline](https://en.wikipedia.org/wiki/Network_scheduler#Linux_kernel) statistics | Linux runit | Exposes service status from [runit](http://smarden.org/runit/). | _any_ supervisord | Exposes service status from [supervisord](http://supervisord.org/). | _any_ systemd | Exposes service and system status from [systemd](http://www.freedesktop.org/wiki/Software/systemd/). | Linux tcpstat | Exposes TCP connection status information from `/proc/net/tcp` and `/proc/net/tcp6`. (Warning: the current version has potential performance issues in high load situations.) | Linux ### Deprecated *These collectors will be (re)moved in the future.* Name | Description | OS ---------|-------------|---- gmond | Exposes statistics from Ganglia. | _any_ megacli | Exposes RAID statistics from MegaCLI. | Linux ### Textfile Collector The textfile collector is similar to the [Pushgateway](https://github.com/prometheus/pushgateway), in that it allows exporting of statistics from batch jobs. It can also be used to export static metrics, such as what role a machine has. The Pushgateway should be used for service-level metrics. The textfile module is for metrics that are tied to a machine. To use it, set the `--collector.textfile.directory` flag on the Node exporter. The collector will parse all files in that directory matching the glob `*.prom` using the [text format](http://prometheus.io/docs/instrumenting/exposition_formats/). To atomically push completion time for a cron job: ``` echo my_batch_job_completion_time $(date +%s) > /path/to/directory/my_batch_job.prom.$$ mv /path/to/directory/my_batch_job.prom.$$ /path/to/directory/my_batch_job.prom ``` To statically set roles for a machine using labels: ``` echo 'role{role="application_server"} 1' > /path/to/directory/role.prom.$$ mv /path/to/directory/role.prom.$$ /path/to/directory/role.prom ``` ## Building and running go get github.com/prometheus/node_exporter cd ${GOPATH-$HOME/go}/src/github.com/prometheus/node_exporter make ./node_exporter To see all available configuration flags: ./node_exporter -h ## Running tests make test ## Using Docker The node\_exporter is designed to monitor the host system. It's not recommended to deploy it as Docker container because it requires access to the host system. If you need to run it on Docker, you can deploy this exporter using the [node-exporter Docker image](https://quay.io/repository/prometheus/node-exporter) with the following options and bind-mounts: ```bash docker run -d -p 9100:9100 \ -v "/proc:/host/proc:ro" \ -v "/sys:/host/sys:ro" \ -v "/:/rootfs:ro" \ --net="host" \ quay.io/prometheus/node-exporter \ --path.procfs /host/proc \ --path.sysfs /host/sys \ --collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($|/)" ``` Be aware though that the mountpoint label in various metrics will now have `/rootfs` as prefix. ## Using a third-party repository for RHEL/CentOS/Fedora There is a [community-supplied COPR repository](https://copr.fedorainfracloud.org/coprs/ibotty/prometheus-exporters/). It closely follows upstream releases. [travis]: https://travis-ci.org/prometheus/node_exporter [hub]: https://hub.docker.com/r/prom/node-exporter/ [circleci]: https://circleci.com/gh/prometheus/node_exporter [quay]: https://quay.io/repository/prometheus/node-exporter [goreportcard]: https://goreportcard.com/report/github.com/prometheus/node_exporter prometheus-node-exporter-0.15.2+ds/VERSION000066400000000000000000000000071321450230300202230ustar00rootroot000000000000000.15.2 prometheus-node-exporter-0.15.2+ds/circle.yml000066400000000000000000000046011321450230300211430ustar00rootroot00000000000000machine: environment: DOCKER_IMAGE_NAME: prom/node-exporter QUAY_IMAGE_NAME: quay.io/prometheus/node-exporter DOCKER_TEST_IMAGE_NAME: quay.io/prometheus/golang-builder:1.9-base REPO_PATH: github.com/prometheus/node_exporter pre: - sudo curl -L -o /usr/bin/docker 'https://s3-external-1.amazonaws.com/circle-downloads/docker-1.9.1-circleci' - sudo chmod 0755 /usr/bin/docker - sudo curl -L 'https://github.com/aktau/github-release/releases/download/v0.6.2/linux-amd64-github-release.tar.bz2' | tar xvjf - --strip-components 3 -C $HOME/bin services: - docker dependencies: pre: - make promu - docker info override: - promu crossbuild - ln -s .build/linux-amd64/node_exporter node_exporter - | if [ -n "$CIRCLE_TAG" ]; then make docker DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME DOCKER_IMAGE_TAG=$CIRCLE_TAG make docker DOCKER_IMAGE_NAME=$QUAY_IMAGE_NAME DOCKER_IMAGE_TAG=$CIRCLE_TAG else make docker DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME make docker DOCKER_IMAGE_NAME=$QUAY_IMAGE_NAME fi post: - mkdir $CIRCLE_ARTIFACTS/binaries/ && cp -a .build/* $CIRCLE_ARTIFACTS/binaries/ - docker images test: override: - docker run --rm -t -v "$(pwd):/app" "${DOCKER_TEST_IMAGE_NAME}" -i "${REPO_PATH}" -T - make test-docker DOCKER_IMAGE_TAG=$CIRCLE_TAG deployment: hub_branch: branch: master owner: prometheus commands: - docker login -e $DOCKER_EMAIL -u $DOCKER_LOGIN -p $DOCKER_PASSWORD - docker login -e $QUAY_EMAIL -u $QUAY_LOGIN -p $QUAY_PASSWORD quay.io - docker push $DOCKER_IMAGE_NAME - docker push $QUAY_IMAGE_NAME hub_tag: tag: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/ owner: prometheus commands: - promu crossbuild tarballs - promu checksum .tarballs - promu release .tarballs - mkdir $CIRCLE_ARTIFACTS/releases/ && cp -a .tarballs/* $CIRCLE_ARTIFACTS/releases/ - docker login -e $DOCKER_EMAIL -u $DOCKER_LOGIN -p $DOCKER_PASSWORD - docker login -e $QUAY_EMAIL -u $QUAY_LOGIN -p $QUAY_PASSWORD quay.io - | if [[ "$CIRCLE_TAG" =~ ^v[0-9]+(\.[0-9]+){2}$ ]]; then docker tag "$DOCKER_IMAGE_NAME:$CIRCLE_TAG" "$DOCKER_IMAGE_NAME:latest" docker tag "$QUAY_IMAGE_NAME:$CIRCLE_TAG" "$QUAY_IMAGE_NAME:latest" fi - docker push $DOCKER_IMAGE_NAME - docker push $QUAY_IMAGE_NAME prometheus-node-exporter-0.15.2+ds/collector/000077500000000000000000000000001321450230300211445ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/arp_linux.go000066400000000000000000000047511321450230300235030ustar00rootroot00000000000000// Copyright 2017 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !noarp package collector import ( "bufio" "fmt" "io" "os" "strings" "github.com/prometheus/client_golang/prometheus" ) type arpCollector struct { entries *prometheus.Desc } func init() { registerCollector("arp", defaultEnabled, NewARPCollector) } // NewARPCollector returns a new Collector exposing ARP stats. func NewARPCollector() (Collector, error) { return &arpCollector{ entries: prometheus.NewDesc( prometheus.BuildFQName(namespace, "arp", "entries"), "ARP entries by device", []string{"device"}, nil, ), }, nil } func getARPEntries() (map[string]uint32, error) { file, err := os.Open(procFilePath("net/arp")) if err != nil { return nil, err } defer file.Close() entries, err := parseARPEntries(file) if err != nil { return nil, err } return entries, nil } // TODO: This should get extracted to the github.com/prometheus/procfs package // to support more complete parsing of /proc/net/arp. Instead of adding // more fields to this function's return values it should get moved and // changed to support each field. func parseARPEntries(data io.Reader) (map[string]uint32, error) { scanner := bufio.NewScanner(data) entries := make(map[string]uint32) for scanner.Scan() { columns := strings.Fields(scanner.Text()) if len(columns) < 6 { return nil, fmt.Errorf("unexpected ARP table format") } if columns[0] != "IP" { deviceIndex := len(columns) - 1 entries[columns[deviceIndex]]++ } } if err := scanner.Err(); err != nil { return nil, fmt.Errorf("failed to parse ARP info: %s", err) } return entries, nil } func (c *arpCollector) Update(ch chan<- prometheus.Metric) error { entries, err := getARPEntries() if err != nil { return fmt.Errorf("could not get ARP entries: %s", err) } for device, entryCount := range entries { ch <- prometheus.MustNewConstMetric( c.entries, prometheus.GaugeValue, float64(entryCount), device) } return nil } prometheus-node-exporter-0.15.2+ds/collector/bcache_linux.go000066400000000000000000000224641321450230300241270ustar00rootroot00000000000000// Copyright 2017 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nobcache package collector import ( "fmt" // https://godoc.org/github.com/prometheus/client_golang/prometheus "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/procfs/bcache" "github.com/prometheus/procfs/sysfs" ) func init() { registerCollector("bcache", defaultEnabled, NewBcacheCollector) } // A bcacheCollector is a Collector which gathers metrics from Linux bcache. type bcacheCollector struct { fs sysfs.FS } // NewBcacheCollector returns a newly allocated bcacheCollector. // It exposes a number of Linux bcache statistics. func NewBcacheCollector() (Collector, error) { fs, err := sysfs.NewFS(*sysPath) if err != nil { return nil, fmt.Errorf("failed to open sysfs: %v", err) } return &bcacheCollector{ fs: fs, }, nil } // Update reads and exposes bcache stats. // It implements the Collector interface. func (c *bcacheCollector) Update(ch chan<- prometheus.Metric) error { stats, err := c.fs.BcacheStats() if err != nil { return fmt.Errorf("failed to retrieve bcache stats: %v", err) } for _, s := range stats { c.updateBcacheStats(ch, s) } return nil } type bcacheMetric struct { name string desc string value float64 metricType prometheus.ValueType extraLabel []string extraLabelValue string } func bcachePeriodStatsToMetric(ps *bcache.PeriodStats, labelValue string) []bcacheMetric { label := []string{"backing_device"} metrics := []bcacheMetric{ { name: "bypassed_bytes_total", desc: "Amount of IO (both reads and writes) that has bypassed the cache.", value: float64(ps.Bypassed), metricType: prometheus.CounterValue, extraLabel: label, extraLabelValue: labelValue, }, { name: "cache_hits_total", desc: "Hits counted per individual IO as bcache sees them.", value: float64(ps.CacheHits), metricType: prometheus.CounterValue, extraLabel: label, extraLabelValue: labelValue, }, { name: "cache_misses_total", desc: "Misses counted per individual IO as bcache sees them.", value: float64(ps.CacheMisses), metricType: prometheus.CounterValue, extraLabel: label, extraLabelValue: labelValue, }, { name: "cache_bypass_hits_total", desc: "Hits for IO intended to skip the cache.", value: float64(ps.CacheBypassHits), metricType: prometheus.CounterValue, extraLabel: label, extraLabelValue: labelValue, }, { name: "cache_bypass_misses_total", desc: "Misses for IO intended to skip the cache.", value: float64(ps.CacheBypassMisses), metricType: prometheus.CounterValue, extraLabel: label, extraLabelValue: labelValue, }, { name: "cache_miss_collisions_total", desc: "Instances where data insertion from cache miss raced with write (data already present).", value: float64(ps.CacheMissCollisions), metricType: prometheus.CounterValue, extraLabel: label, extraLabelValue: labelValue, }, { name: "cache_readaheads_total", desc: "Count of times readahead occurred.", value: float64(ps.CacheReadaheads), metricType: prometheus.CounterValue, extraLabel: label, extraLabelValue: labelValue, }, } return metrics } // UpdateBcacheStats collects statistics for one bcache ID. func (c *bcacheCollector) updateBcacheStats(ch chan<- prometheus.Metric, s *bcache.Stats) { const ( subsystem = "bcache" ) var ( devLabel = []string{"uuid"} allMetrics []bcacheMetric metrics []bcacheMetric ) allMetrics = []bcacheMetric{ // metrics in /sys/fs/bcache// { name: "average_key_size_sectors", desc: "Average data per key in the btree (sectors).", value: float64(s.Bcache.AverageKeySize), metricType: prometheus.GaugeValue, }, { name: "btree_cache_size_bytes", desc: "Amount of memory currently used by the btree cache.", value: float64(s.Bcache.BtreeCacheSize), metricType: prometheus.GaugeValue, }, { name: "cache_available_percent", desc: "Percentage of cache device without dirty data, useable for writeback (may contain clean cached data).", value: float64(s.Bcache.CacheAvailablePercent), metricType: prometheus.GaugeValue, }, { name: "congested", desc: "Congestion.", value: float64(s.Bcache.Congested), metricType: prometheus.GaugeValue, }, { name: "root_usage_percent", desc: "Percentage of the root btree node in use (tree depth increases if too high).", value: float64(s.Bcache.RootUsagePercent), metricType: prometheus.GaugeValue, }, { name: "tree_depth", desc: "Depth of the btree.", value: float64(s.Bcache.TreeDepth), metricType: prometheus.GaugeValue, }, // metrics in /sys/fs/bcache//internal/ { name: "active_journal_entries", desc: "Number of journal entries that are newer than the index.", value: float64(s.Bcache.Internal.ActiveJournalEntries), metricType: prometheus.GaugeValue, }, { name: "btree_nodes", desc: "Total nodes in the btree.", value: float64(s.Bcache.Internal.BtreeNodes), metricType: prometheus.GaugeValue, }, { name: "btree_read_average_duration_seconds", desc: "Average btree read duration.", value: float64(s.Bcache.Internal.BtreeReadAverageDurationNanoSeconds) * 1e-9, metricType: prometheus.GaugeValue, }, { name: "cache_read_races", desc: "Counts instances where while data was being read from the cache, the bucket was reused and invalidated - i.e. where the pointer was stale after the read completed.", value: float64(s.Bcache.Internal.CacheReadRaces), metricType: prometheus.CounterValue, }, } for _, bdev := range s.Bdevs { // metrics in /sys/fs/bcache/// metrics = []bcacheMetric{ { name: "dirty_data_bytes", desc: "Amount of dirty data for this backing device in the cache.", value: float64(bdev.DirtyData), metricType: prometheus.GaugeValue, extraLabel: []string{"backing_device"}, extraLabelValue: bdev.Name, }, } allMetrics = append(allMetrics, metrics...) // metrics in /sys/fs/bcache///stats_total metrics := bcachePeriodStatsToMetric(&bdev.Total, bdev.Name) allMetrics = append(allMetrics, metrics...) } for _, cache := range s.Caches { metrics = []bcacheMetric{ // metrics in /sys/fs/bcache/// { name: "io_errors", desc: "Number of errors that have occurred, decayed by io_error_halflife.", value: float64(cache.IOErrors), metricType: prometheus.GaugeValue, extraLabel: []string{"cache_device"}, extraLabelValue: cache.Name, }, { name: "metadata_written_bytes_total", desc: "Sum of all non data writes (btree writes and all other metadata).", value: float64(cache.MetadataWritten), metricType: prometheus.CounterValue, extraLabel: []string{"cache_device"}, extraLabelValue: cache.Name, }, { name: "written_bytes_total", desc: "Sum of all data that has been written to the cache.", value: float64(cache.Written), metricType: prometheus.CounterValue, extraLabel: []string{"cache_device"}, extraLabelValue: cache.Name, }, // metrics in /sys/fs/bcache///priority_stats { name: "priority_stats_unused_percent", desc: "The percentage of the cache that doesn't contain any data.", value: float64(cache.Priority.UnusedPercent), metricType: prometheus.GaugeValue, extraLabel: []string{"cache_device"}, extraLabelValue: cache.Name, }, { name: "priority_stats_metadata_percent", desc: "Bcache's metadata overhead.", value: float64(cache.Priority.MetadataPercent), metricType: prometheus.GaugeValue, extraLabel: []string{"cache_device"}, extraLabelValue: cache.Name, }, } allMetrics = append(allMetrics, metrics...) } for _, m := range allMetrics { labels := append(devLabel, m.extraLabel...) desc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, m.name), m.desc, labels, nil, ) labelValues := []string{s.Name} if m.extraLabelValue != "" { labelValues = append(labelValues, m.extraLabelValue) } ch <- prometheus.MustNewConstMetric( desc, m.metricType, m.value, labelValues..., ) } } prometheus-node-exporter-0.15.2+ds/collector/bonding_linux.go000066400000000000000000000060771321450230300243440ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nobonding package collector import ( "fmt" "io/ioutil" "os" "path" "strings" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" ) type bondingCollector struct { slaves, active typedDesc } func init() { registerCollector("bonding", defaultDisabled, NewBondingCollector) } // NewBondingCollector returns a newly allocated bondingCollector. // It exposes the number of configured and active slave of linux bonding interfaces. func NewBondingCollector() (Collector, error) { return &bondingCollector{ slaves: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, "bonding", "slaves"), "Number of configured slaves per bonding interface.", []string{"master"}, nil, ), prometheus.GaugeValue}, active: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, "bonding", "active"), "Number of active slaves per bonding interface.", []string{"master"}, nil, ), prometheus.GaugeValue}, }, nil } // Update reads and exposes bonding states, implements Collector interface. Caution: This works only on linux. func (c *bondingCollector) Update(ch chan<- prometheus.Metric) error { statusfile := sysFilePath("class/net") bondingStats, err := readBondingStats(statusfile) if err != nil { if os.IsNotExist(err) { log.Debugf("Not collecting bonding, file does not exist: %s", statusfile) return nil } return err } for master, status := range bondingStats { ch <- c.slaves.mustNewConstMetric(float64(status[0]), master) ch <- c.active.mustNewConstMetric(float64(status[1]), master) } return nil } func readBondingStats(root string) (status map[string][2]int, err error) { status = map[string][2]int{} masters, err := ioutil.ReadFile(path.Join(root, "bonding_masters")) if err != nil { return nil, err } for _, master := range strings.Fields(string(masters)) { slaves, err := ioutil.ReadFile(path.Join(root, master, "bonding", "slaves")) if err != nil { return nil, err } sstat := [2]int{0, 0} for _, slave := range strings.Fields(string(slaves)) { state, err := ioutil.ReadFile(path.Join(root, master, fmt.Sprintf("lower_%s", slave), "operstate")) if os.IsNotExist(err) { // some older? kernels use slave_ prefix state, err = ioutil.ReadFile(path.Join(root, master, fmt.Sprintf("slave_%s", slave), "operstate")) } if err != nil { return nil, err } sstat[0]++ if strings.TrimSpace(string(state)) == "up" { sstat[1]++ } } status[master] = sstat } return status, err } prometheus-node-exporter-0.15.2+ds/collector/bonding_linux_test.go000066400000000000000000000021051321450230300253670ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "testing" ) func TestBonding(t *testing.T) { bondingStats, err := readBondingStats("fixtures/sys/class/net") if err != nil { t.Fatal(err) } if bondingStats["bond0"][0] != 0 || bondingStats["bond0"][1] != 0 { t.Fatal("bond0 in unexpected state") } if bondingStats["int"][0] != 2 || bondingStats["int"][1] != 1 { t.Fatal("int in unexpected state") } if bondingStats["dmz"][0] != 2 || bondingStats["dmz"][1] != 2 { t.Fatal("dmz in unexpected state") } } prometheus-node-exporter-0.15.2+ds/collector/buddyinfo.go000066400000000000000000000037541321450230300234670ustar00rootroot00000000000000// Copyright 2017 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nobuddyinfo // +build !netbsd package collector import ( "fmt" "strconv" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" "github.com/prometheus/procfs" ) const ( buddyInfoSubsystem = "buddyinfo" ) type buddyinfoCollector struct { desc *prometheus.Desc } func init() { registerCollector("buddyinfo", defaultDisabled, NewBuddyinfoCollector) } // NewBuddyinfoCollector returns a new Collector exposing buddyinfo stats. func NewBuddyinfoCollector() (Collector, error) { desc := prometheus.NewDesc( prometheus.BuildFQName(namespace, buddyInfoSubsystem, "count"), "Count of free blocks according to size.", []string{"node", "zone", "size"}, nil, ) return &buddyinfoCollector{desc}, nil } // Update calls (*buddyinfoCollector).getBuddyInfo to get the platform specific // buddyinfo metrics. func (c *buddyinfoCollector) Update(ch chan<- prometheus.Metric) error { fs, err := procfs.NewFS(*procPath) if err != nil { return fmt.Errorf("failed to open procfs: %v", err) } buddyInfo, err := fs.NewBuddyInfo() if err != nil { return fmt.Errorf("couldn't get buddyinfo: %s", err) } log.Debugf("Set node_buddy: %#v", buddyInfo) for _, entry := range buddyInfo { for size, value := range entry.Sizes { ch <- prometheus.MustNewConstMetric( c.desc, prometheus.GaugeValue, value, entry.Node, entry.Zone, strconv.Itoa(size), ) } } return nil } prometheus-node-exporter-0.15.2+ds/collector/collector.go000066400000000000000000000102711321450230300234620ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package collector includes all individual collectors to gather and export system metrics. package collector import ( "fmt" "sync" "time" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" "gopkg.in/alecthomas/kingpin.v2" ) // Namespace defines the common namespace to be used by all metrics. const namespace = "node" var ( scrapeDurationDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, "scrape", "collector_duration_seconds"), "node_exporter: Duration of a collector scrape.", []string{"collector"}, nil, ) scrapeSuccessDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, "scrape", "collector_success"), "node_exporter: Whether a collector succeeded.", []string{"collector"}, nil, ) ) func warnDeprecated(collector string) { log.Warnf("The %s collector is deprecated and will be removed in the future!", collector) } const ( defaultEnabled = true defaultDisabled = false ) var ( factories = make(map[string]func() (Collector, error)) collectorState = make(map[string]*bool) ) func registerCollector(collector string, isDefaultEnabled bool, factory func() (Collector, error)) { var helpDefaultState string if isDefaultEnabled { helpDefaultState = "enabled" } else { helpDefaultState = "disabled" } flagName := fmt.Sprintf("collector.%s", collector) flagHelp := fmt.Sprintf("Enable the %s collector (default: %s).", collector, helpDefaultState) defaultValue := fmt.Sprintf("%v", isDefaultEnabled) flag := kingpin.Flag(flagName, flagHelp).Default(defaultValue).Bool() collectorState[collector] = flag factories[collector] = factory } // NodeCollector implements the prometheus.Collector interface. type nodeCollector struct { Collectors map[string]Collector } // NewNodeCollector creates a new NodeCollector func NewNodeCollector() (*nodeCollector, error) { collectors := make(map[string]Collector) for key, enabled := range collectorState { if *enabled { collector, err := factories[key]() if err != nil { return nil, err } collectors[key] = collector } } return &nodeCollector{Collectors: collectors}, nil } // Describe implements the prometheus.Collector interface. func (n nodeCollector) Describe(ch chan<- *prometheus.Desc) { ch <- scrapeDurationDesc ch <- scrapeSuccessDesc } // Collect implements the prometheus.Collector interface. func (n nodeCollector) Collect(ch chan<- prometheus.Metric) { wg := sync.WaitGroup{} wg.Add(len(n.Collectors)) for name, c := range n.Collectors { go func(name string, c Collector) { execute(name, c, ch) wg.Done() }(name, c) } wg.Wait() } func execute(name string, c Collector, ch chan<- prometheus.Metric) { begin := time.Now() err := c.Update(ch) duration := time.Since(begin) var success float64 if err != nil { log.Errorf("ERROR: %s collector failed after %fs: %s", name, duration.Seconds(), err) success = 0 } else { log.Debugf("OK: %s collector succeeded after %fs.", name, duration.Seconds()) success = 1 } ch <- prometheus.MustNewConstMetric(scrapeDurationDesc, prometheus.GaugeValue, duration.Seconds(), name) ch <- prometheus.MustNewConstMetric(scrapeSuccessDesc, prometheus.GaugeValue, success, name) } // Collector is the interface a collector has to implement. type Collector interface { // Get new metrics and expose them via prometheus registry. Update(ch chan<- prometheus.Metric) error } type typedDesc struct { desc *prometheus.Desc valueType prometheus.ValueType } func (d *typedDesc) mustNewConstMetric(value float64, labels ...string) prometheus.Metric { return prometheus.MustNewConstMetric(d.desc, d.valueType, value, labels...) } prometheus-node-exporter-0.15.2+ds/collector/conntrack_linux.go000066400000000000000000000036361321450230300247040ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !noconntrack package collector import ( "github.com/prometheus/client_golang/prometheus" ) type conntrackCollector struct { current *prometheus.Desc limit *prometheus.Desc } func init() { registerCollector("conntrack", defaultEnabled, NewConntrackCollector) } // NewConntrackCollector returns a new Collector exposing conntrack stats. func NewConntrackCollector() (Collector, error) { return &conntrackCollector{ current: prometheus.NewDesc( prometheus.BuildFQName(namespace, "", "nf_conntrack_entries"), "Number of currently allocated flow entries for connection tracking.", nil, nil, ), limit: prometheus.NewDesc( prometheus.BuildFQName(namespace, "", "nf_conntrack_entries_limit"), "Maximum size of connection tracking table.", nil, nil, ), }, nil } func (c *conntrackCollector) Update(ch chan<- prometheus.Metric) error { value, err := readUintFromFile(procFilePath("sys/net/netfilter/nf_conntrack_count")) if err != nil { // Conntrack probably not loaded into the kernel. return nil } ch <- prometheus.MustNewConstMetric( c.current, prometheus.GaugeValue, float64(value)) value, err = readUintFromFile(procFilePath("sys/net/netfilter/nf_conntrack_max")) if err != nil { return nil } ch <- prometheus.MustNewConstMetric( c.limit, prometheus.GaugeValue, float64(value)) return nil } prometheus-node-exporter-0.15.2+ds/collector/cpu_darwin.go000066400000000000000000000062101321450230300236250ustar00rootroot00000000000000// Copyright 2016 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Based on gopsutil/cpu/cpu_darwin_cgo.go @ ae251eb which is licensed under // BSD. See https://github.com/shirou/gopsutil/blob/master/LICENSE for details. // +build !nocpu package collector import ( "bytes" "encoding/binary" "fmt" "strconv" "unsafe" "github.com/prometheus/client_golang/prometheus" ) /* #cgo LDFLAGS: #include #include #include #include #include #include #if TARGET_OS_MAC #include #endif #include #include */ import "C" // ClocksPerSec default value. from time.h const ClocksPerSec = float64(128) type statCollector struct { cpu *prometheus.Desc } func init() { registerCollector("cpu", defaultEnabled, NewCPUCollector) } // NewCPUCollector returns a new Collector exposing CPU stats. func NewCPUCollector() (Collector, error) { return &statCollector{ cpu: prometheus.NewDesc( prometheus.BuildFQName(namespace, "", "cpu"), "Seconds the cpus spent in each mode.", []string{"cpu", "mode"}, nil, ), }, nil } func (c *statCollector) Update(ch chan<- prometheus.Metric) error { var ( count C.mach_msg_type_number_t cpuload *C.processor_cpu_load_info_data_t ncpu C.natural_t ) status := C.host_processor_info(C.host_t(C.mach_host_self()), C.PROCESSOR_CPU_LOAD_INFO, &ncpu, (*C.processor_info_array_t)(unsafe.Pointer(&cpuload)), &count) if status != C.KERN_SUCCESS { return fmt.Errorf("host_processor_info error=%d", status) } // jump through some cgo casting hoops and ensure we properly free // the memory that cpuload points to target := C.vm_map_t(C.mach_task_self_) address := C.vm_address_t(uintptr(unsafe.Pointer(cpuload))) defer C.vm_deallocate(target, address, C.vm_size_t(ncpu)) // the body of struct processor_cpu_load_info // aka processor_cpu_load_info_data_t var cpuTicks [C.CPU_STATE_MAX]uint32 // copy the cpuload array to a []byte buffer // where we can binary.Read the data size := int(ncpu) * binary.Size(cpuTicks) buf := (*[1 << 30]byte)(unsafe.Pointer(cpuload))[:size:size] bbuf := bytes.NewBuffer(buf) for i := 0; i < int(ncpu); i++ { err := binary.Read(bbuf, binary.LittleEndian, &cpuTicks) if err != nil { return err } for k, v := range map[string]int{ "user": C.CPU_STATE_USER, "system": C.CPU_STATE_SYSTEM, "nice": C.CPU_STATE_NICE, "idle": C.CPU_STATE_IDLE, } { ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, float64(cpuTicks[v])/ClocksPerSec, "cpu"+strconv.Itoa(i), k) } } return nil } prometheus-node-exporter-0.15.2+ds/collector/cpu_dragonfly.go000066400000000000000000000074511321450230300243360ustar00rootroot00000000000000// Copyright 2016 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nocpu package collector import ( "errors" "fmt" "unsafe" "github.com/prometheus/client_golang/prometheus" ) /* #cgo LDFLAGS: #include #include #include #include int getCPUTimes(uint64_t **cputime, size_t *cpu_times_len, long *freq) { size_t len; // Get number of cpu cores. int mib[2]; int ncpu; mib[0] = CTL_HW; mib[1] = HW_NCPU; len = sizeof(ncpu); if (sysctl(mib, 2, &ncpu, &len, NULL, 0)) { return -1; } // The bump on each statclock is // ((cur_systimer - prev_systimer) * systimer_freq) >> 32 // where // systimer_freq = sysctl kern.cputimer.freq len = sizeof(*freq); if (sysctlbyname("kern.cputimer.freq", freq, &len, NULL, 0)) { return -1; } // Get the cpu times. struct kinfo_cputime cp_t[ncpu]; bzero(cp_t, sizeof(struct kinfo_cputime)*ncpu); len = sizeof(cp_t[0])*ncpu; if (sysctlbyname("kern.cputime", &cp_t, &len, NULL, 0)) { return -1; } *cpu_times_len = ncpu*CPUSTATES; uint64_t user, nice, sys, intr, idle; user = nice = sys = intr = idle = 0; *cputime = (uint64_t *) malloc(sizeof(uint64_t)*(*cpu_times_len)); for (int i = 0; i < ncpu; ++i) { int offset = CPUSTATES * i; (*cputime)[offset] = cp_t[i].cp_user; (*cputime)[offset+1] = cp_t[i].cp_nice; (*cputime)[offset+2] = cp_t[i].cp_sys; (*cputime)[offset+3] = cp_t[i].cp_intr; (*cputime)[offset+4] = cp_t[i].cp_idle; } return 0; } */ import "C" const maxCPUTimesLen = C.MAXCPU * C.CPUSTATES type statCollector struct { cpu *prometheus.Desc } func init() { registerCollector("cpu", defaultEnabled, NewStatCollector) } // NewStatCollector returns a new Collector exposing CPU stats. func NewStatCollector() (Collector, error) { return &statCollector{ cpu: prometheus.NewDesc( prometheus.BuildFQName(namespace, "", "cpu"), "Seconds the cpus spent in each mode.", []string{"cpu", "mode"}, nil, ), }, nil } func getDragonFlyCPUTimes() ([]float64, error) { // We want time spent per-cpu per CPUSTATE. // CPUSTATES (number of CPUSTATES) is defined as 5U. // States: CP_USER | CP_NICE | CP_SYS | CP_IDLE | CP_INTR // // Each value is a counter incremented at frequency // kern.cputimer.freq // // Look into sys/kern/kern_clock.c for details. var ( cpuTimesC *C.uint64_t cpuTimerFreq C.long cpuTimesLength C.size_t ) if C.getCPUTimes(&cpuTimesC, &cpuTimesLength, &cpuTimerFreq) == -1 { return nil, errors.New("could not retrieve CPU times") } defer C.free(unsafe.Pointer(cpuTimesC)) cput := (*[maxCPUTimesLen]C.uint64_t)(unsafe.Pointer(cpuTimesC))[:cpuTimesLength:cpuTimesLength] cpuTimes := make([]float64, cpuTimesLength) for i, value := range cput { cpuTimes[i] = float64(value) / float64(cpuTimerFreq) } return cpuTimes, nil } // Expose CPU stats using sysctl. func (c *statCollector) Update(ch chan<- prometheus.Metric) error { var fieldsCount = 5 cpuTimes, err := getDragonFlyCPUTimes() if err != nil { return err } // Export order: user nice sys intr idle cpuFields := []string{"user", "nice", "sys", "interrupt", "idle"} for i, value := range cpuTimes { cpux := fmt.Sprintf("cpu%d", i/fieldsCount) ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, value, cpux, cpuFields[i%fieldsCount]) } return nil } prometheus-node-exporter-0.15.2+ds/collector/cpu_dragonfly_test.go000066400000000000000000000017731321450230300253760ustar00rootroot00000000000000// Copyright 2016 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nocpu package collector import ( "runtime" "testing" ) func TestCPU(t *testing.T) { var ( fieldsCount = 5 times, err = getDragonFlyCPUTimes() ) if err != nil { t.Fatalf("expected no error, got %v", err) } if len(times) == 0 { t.Fatalf("no cputimes found") } want := runtime.NumCPU() * fieldsCount if len(times) != want { t.Fatalf("should have %d cpuTimes: got %d", want, len(times)) } } prometheus-node-exporter-0.15.2+ds/collector/cpu_freebsd.go000066400000000000000000000077731321450230300237720ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nocpu package collector import ( "fmt" "math" "strconv" "unsafe" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" "golang.org/x/sys/unix" ) type clockinfo struct { hz int32 // clock frequency tick int32 // micro-seconds per hz tick spare int32 stathz int32 // statistics clock frequency profhz int32 // profiling clock frequency } type cputime struct { user float64 nice float64 sys float64 intr float64 idle float64 } func getCPUTimes() ([]cputime, error) { const states = 5 clockb, err := unix.SysctlRaw("kern.clockrate") if err != nil { return nil, err } clock := *(*clockinfo)(unsafe.Pointer(&clockb[0])) cpb, err := unix.SysctlRaw("kern.cp_times") if err != nil { return nil, err } var cpufreq float64 if clock.stathz > 0 { cpufreq = float64(clock.stathz) } else { cpufreq = float64(clock.hz) } var times []float64 for len(cpb) >= int(unsafe.Sizeof(int(0))) { t := *(*int)(unsafe.Pointer(&cpb[0])) times = append(times, float64(t)/cpufreq) cpb = cpb[unsafe.Sizeof(int(0)):] } cpus := make([]cputime, len(times)/states) for i := 0; i < len(times); i += states { cpu := &cpus[i/states] cpu.user = times[i] cpu.nice = times[i+1] cpu.sys = times[i+2] cpu.intr = times[i+3] cpu.idle = times[i+4] } return cpus, nil } type statCollector struct { cpu typedDesc temp typedDesc } func init() { registerCollector("cpu", defaultEnabled, NewStatCollector) } // NewStatCollector returns a new Collector exposing CPU stats. func NewStatCollector() (Collector, error) { return &statCollector{ cpu: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, "cpu", "seconds_total"), "Seconds the CPU spent in each mode.", []string{"cpu", "mode"}, nil, ), prometheus.CounterValue}, temp: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, "cpu", "temperature_celsius"), "CPU temperature", []string{"cpu"}, nil, ), prometheus.GaugeValue}, }, nil } // Expose CPU stats using sysctl. func (c *statCollector) Update(ch chan<- prometheus.Metric) error { // We want time spent per-cpu per CPUSTATE. // CPUSTATES (number of CPUSTATES) is defined as 5U. // Order: CP_USER | CP_NICE | CP_SYS | CP_IDLE | CP_INTR // sysctl kern.cp_times provides hw.ncpu * CPUSTATES long integers: // hw.ncpu * (space-separated list of the above variables) // // Each value is a counter incremented at frequency // kern.clockrate.(stathz | hz) // // Look into sys/kern/kern_clock.c for details. cpuTimes, err := getCPUTimes() if err != nil { return err } for cpu, t := range cpuTimes { lcpu := strconv.Itoa(cpu) ch <- c.cpu.mustNewConstMetric(float64(t.user), lcpu, "user") ch <- c.cpu.mustNewConstMetric(float64(t.nice), lcpu, "nice") ch <- c.cpu.mustNewConstMetric(float64(t.sys), lcpu, "system") ch <- c.cpu.mustNewConstMetric(float64(t.intr), lcpu, "interrupt") ch <- c.cpu.mustNewConstMetric(float64(t.idle), lcpu, "idle") temp, err := unix.SysctlUint32(fmt.Sprintf("dev.cpu.%d.temperature", cpu)) if err != nil { if err == unix.ENOENT { // No temperature information for this CPU log.Debugf("no temperature information for CPU %d", cpu) } else { // Unexpected error ch <- c.temp.mustNewConstMetric(math.NaN(), lcpu) log.Errorf("failed to query CPU temperature for CPU %d: %s", cpu, err) } continue } ch <- c.temp.mustNewConstMetric(float64(temp-2732)/10, lcpu) } return err } prometheus-node-exporter-0.15.2+ds/collector/cpu_linux.go000066400000000000000000000167311321450230300235110ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nocpu package collector import ( "fmt" "io/ioutil" "os" "path/filepath" "regexp" "strings" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" "github.com/prometheus/procfs" ) const ( cpuCollectorSubsystem = "cpu" ) var ( digitRegexp = regexp.MustCompile("[0-9]+") ) type cpuCollector struct { cpu *prometheus.Desc cpuFreq *prometheus.Desc cpuFreqMin *prometheus.Desc cpuFreqMax *prometheus.Desc cpuCoreThrottle *prometheus.Desc cpuPackageThrottle *prometheus.Desc } func init() { registerCollector("cpu", defaultEnabled, NewCPUCollector) } // NewCPUCollector returns a new Collector exposing kernel/system statistics. func NewCPUCollector() (Collector, error) { return &cpuCollector{ cpu: prometheus.NewDesc( prometheus.BuildFQName(namespace, "", cpuCollectorSubsystem), "Seconds the cpus spent in each mode.", []string{"cpu", "mode"}, nil, ), cpuFreq: prometheus.NewDesc( prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "frequency_hertz"), "Current cpu thread frequency in hertz.", []string{"cpu"}, nil, ), cpuFreqMin: prometheus.NewDesc( prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "frequency_min_hertz"), "Minimum cpu thread frequency in hertz.", []string{"cpu"}, nil, ), cpuFreqMax: prometheus.NewDesc( prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "frequency_max_hertz"), "Maximum cpu thread frequency in hertz.", []string{"cpu"}, nil, ), // FIXME: This should be a per core metric, not per cpu! cpuCoreThrottle: prometheus.NewDesc( prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "core_throttles_total"), "Number of times this cpu core has been throttled.", []string{"cpu"}, nil, ), cpuPackageThrottle: prometheus.NewDesc( prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "package_throttles_total"), "Number of times this cpu package has been throttled.", []string{"node"}, nil, ), }, nil } // Update implements Collector and exposes cpu related metrics from /proc/stat and /sys/.../cpu/. func (c *cpuCollector) Update(ch chan<- prometheus.Metric) error { if err := c.updateStat(ch); err != nil { return err } if err := c.updateCPUfreq(ch); err != nil { return err } return nil } // updateCPUfreq reads /sys/bus/cpu/devices/cpu* and expose cpu frequency statistics. func (c *cpuCollector) updateCPUfreq(ch chan<- prometheus.Metric) error { cpus, err := filepath.Glob(sysFilePath("bus/cpu/devices/cpu[0-9]*")) if err != nil { return err } var value uint64 // cpu loop for _, cpu := range cpus { _, cpuname := filepath.Split(cpu) if _, err := os.Stat(filepath.Join(cpu, "cpufreq")); os.IsNotExist(err) { log.Debugf("CPU %v is missing cpufreq", cpu) } else { // sysfs cpufreq values are kHz, thus multiply by 1000 to export base units (hz). // See https://www.kernel.org/doc/Documentation/cpu-freq/user-guide.txt if value, err = readUintFromFile(filepath.Join(cpu, "cpufreq", "scaling_cur_freq")); err != nil { return err } ch <- prometheus.MustNewConstMetric(c.cpuFreq, prometheus.GaugeValue, float64(value)*1000.0, cpuname) if value, err = readUintFromFile(filepath.Join(cpu, "cpufreq", "scaling_min_freq")); err != nil { return err } ch <- prometheus.MustNewConstMetric(c.cpuFreqMin, prometheus.GaugeValue, float64(value)*1000.0, cpuname) if value, err = readUintFromFile(filepath.Join(cpu, "cpufreq", "scaling_max_freq")); err != nil { return err } ch <- prometheus.MustNewConstMetric(c.cpuFreqMax, prometheus.GaugeValue, float64(value)*1000.0, cpuname) } if _, err := os.Stat(filepath.Join(cpu, "thermal_throttle")); os.IsNotExist(err) { log.Debugf("CPU %v is missing thermal_throttle", cpu) continue } if value, err = readUintFromFile(filepath.Join(cpu, "thermal_throttle", "core_throttle_count")); err != nil { return err } ch <- prometheus.MustNewConstMetric(c.cpuCoreThrottle, prometheus.CounterValue, float64(value), cpuname) } nodes, err := filepath.Glob(sysFilePath("bus/node/devices/node[0-9]*")) if err != nil { return err } // package / NUMA node loop for _, node := range nodes { if _, err := os.Stat(filepath.Join(node, "cpulist")); os.IsNotExist(err) { log.Debugf("NUMA node %v is missing cpulist", node) continue } cpulist, err := ioutil.ReadFile(filepath.Join(node, "cpulist")) if err != nil { log.Debugf("could not read cpulist of NUMA node %v", node) return err } // cpulist example of one package/node with HT: "0-11,24-35" line := strings.Split(string(cpulist), "\n")[0] if line == "" { // Skip processor-less (memory-only) NUMA nodes. // E.g. RAM expansion with Intel Optane Drive(s) using // Intel Memory Drive Technology (IMDT). log.Debugf("skipping processor-less (memory-only) NUMA node %v", node) continue } firstCPU := strings.FieldsFunc(line, func(r rune) bool { return r == '-' || r == ',' })[0] if _, err := os.Stat(filepath.Join(node, "cpu"+firstCPU, "thermal_throttle", "package_throttle_count")); os.IsNotExist(err) { log.Debugf("Node %v CPU %v is missing package_throttle", node, firstCPU) continue } if value, err = readUintFromFile(filepath.Join(node, "cpu"+firstCPU, "thermal_throttle", "package_throttle_count")); err != nil { return err } nodeno := digitRegexp.FindAllString(node, 1)[0] ch <- prometheus.MustNewConstMetric(c.cpuPackageThrottle, prometheus.CounterValue, float64(value), nodeno) } return nil } // updateStat reads /proc/stat through procfs and exports cpu related metrics. func (c *cpuCollector) updateStat(ch chan<- prometheus.Metric) error { fs, err := procfs.NewFS(*procPath) if err != nil { return fmt.Errorf("failed to open procfs: %v", err) } stats, err := fs.NewStat() if err != nil { return err } for cpuID, cpuStat := range stats.CPU { cpuName := fmt.Sprintf("cpu%d", cpuID) ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.User, cpuName, "user") ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.Nice, cpuName, "nice") ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.System, cpuName, "system") ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.Idle, cpuName, "idle") ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.Iowait, cpuName, "iowait") ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.IRQ, cpuName, "irq") ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.SoftIRQ, cpuName, "softirq") ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.Steal, cpuName, "steal") ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.Guest, cpuName, "guest") ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.GuestNice, cpuName, "guest_nice") } return nil } prometheus-node-exporter-0.15.2+ds/collector/devstat_dragonfly.go000066400000000000000000000073161321450230300252210ustar00rootroot00000000000000// Copyright 2016 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nodevstat package collector import ( "errors" "fmt" "github.com/prometheus/client_golang/prometheus" ) /* #cgo LDFLAGS: -ldevstat #include #include #include typedef struct { char device[DEVSTAT_NAME_LEN]; int unit; uint64_t bytes; uint64_t transfers; uint64_t blocks; } Stats; int _get_ndevs() { struct statinfo current; int num_devices; current.dinfo = (struct devinfo *)calloc(1, sizeof(struct devinfo)); if (current.dinfo == NULL) return -2; checkversion(); if (getdevs(¤t) == -1) return -1; return current.dinfo->numdevs; } Stats _get_stats(int i) { struct statinfo current; int num_devices; current.dinfo = (struct devinfo *)calloc(1, sizeof(struct devinfo)); getdevs(¤t); num_devices = current.dinfo->numdevs; Stats stats; uint64_t total_bytes, total_transfers, total_blocks; long double kb_per_transfer, transfers_per_second, mb_per_second, blocks_per_second, ms_per_transaction; strcpy(stats.device, current.dinfo->devices[i].device_name); stats.unit = current.dinfo->devices[i].unit_number; compute_stats(¤t.dinfo->devices[i], NULL, 1.0, &total_bytes, &total_transfers, &total_blocks, &kb_per_transfer, &transfers_per_second, &mb_per_second, &blocks_per_second, &ms_per_transaction); stats.bytes = total_bytes; stats.transfers = total_transfers; stats.blocks = total_blocks; return stats; } */ import "C" const ( devstatSubsystem = "devstat" ) type devstatCollector struct { bytesDesc *prometheus.Desc transfersDesc *prometheus.Desc blocksDesc *prometheus.Desc } func init() { registerCollector("devstat", defaultDisabled, NewDevstatCollector) } // NewDevstatCollector returns a new Collector exposing Device stats. func NewDevstatCollector() (Collector, error) { return &devstatCollector{ bytesDesc: prometheus.NewDesc( prometheus.BuildFQName(namespace, devstatSubsystem, "bytes_total"), "The total number of bytes transferred for reads and writes on the device.", []string{"device"}, nil, ), transfersDesc: prometheus.NewDesc( prometheus.BuildFQName(namespace, devstatSubsystem, "transfers_total"), "The total number of transactions completed.", []string{"device"}, nil, ), blocksDesc: prometheus.NewDesc( prometheus.BuildFQName(namespace, devstatSubsystem, "blocks_total"), "The total number of bytes given in terms of the devices blocksize.", []string{"device"}, nil, ), }, nil } func (c *devstatCollector) Update(ch chan<- prometheus.Metric) error { count := C._get_ndevs() if count == -1 { return errors.New("getdevs() failed") } if count == -2 { return errors.New("calloc() failed") } for i := C.int(0); i < count; i++ { stats := C._get_stats(i) device := fmt.Sprintf("%s%d", C.GoString(&stats.device[0]), stats.unit) ch <- prometheus.MustNewConstMetric(c.bytesDesc, prometheus.CounterValue, float64(stats.bytes), device) ch <- prometheus.MustNewConstMetric(c.transfersDesc, prometheus.CounterValue, float64(stats.transfers), device) ch <- prometheus.MustNewConstMetric(c.blocksDesc, prometheus.CounterValue, float64(stats.blocks), device) } return nil } prometheus-node-exporter-0.15.2+ds/collector/devstat_freebsd.c000066400000000000000000000050621321450230300244570ustar00rootroot00000000000000// Copyright 2017 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nodevstat #include #include #include #include #include #include #include #include int _get_stats(struct devinfo *info, Stats **stats) { struct statinfo current; current.dinfo = info; if (devstat_getdevs(NULL, ¤t) == -1) { return -1; } Stats *p = (Stats*)calloc(current.dinfo->numdevs, sizeof(Stats)); for (int i = 0; i < current.dinfo->numdevs; i++) { uint64_t bytes_read, bytes_write, bytes_free; uint64_t transfers_other, transfers_read, transfers_write, transfers_free; long double duration_other, duration_read, duration_write, duration_free; long double busy_time; uint64_t blocks; strcpy(p[i].device, current.dinfo->devices[i].device_name); p[i].unit = current.dinfo->devices[i].unit_number; devstat_compute_statistics(¤t.dinfo->devices[i], NULL, 1.0, DSM_TOTAL_BYTES_READ, &bytes_read, DSM_TOTAL_BYTES_WRITE, &bytes_write, DSM_TOTAL_BYTES_FREE, &bytes_free, DSM_TOTAL_TRANSFERS_OTHER, &transfers_other, DSM_TOTAL_TRANSFERS_READ, &transfers_read, DSM_TOTAL_TRANSFERS_WRITE, &transfers_write, DSM_TOTAL_TRANSFERS_FREE, &transfers_free, DSM_TOTAL_DURATION_OTHER, &duration_other, DSM_TOTAL_DURATION_READ, &duration_read, DSM_TOTAL_DURATION_WRITE, &duration_write, DSM_TOTAL_DURATION_FREE, &duration_free, DSM_TOTAL_BUSY_TIME, &busy_time, DSM_TOTAL_BLOCKS, &blocks, DSM_NONE); p[i].bytes.read = bytes_read; p[i].bytes.write = bytes_write; p[i].bytes.free = bytes_free; p[i].transfers.other = transfers_other; p[i].transfers.read = transfers_read; p[i].transfers.write = transfers_write; p[i].transfers.free = transfers_free; p[i].duration.other = duration_other; p[i].duration.read = duration_read; p[i].duration.write = duration_write; p[i].duration.free = duration_free; p[i].busyTime = busy_time; p[i].blocks = blocks; } *stats = p; return current.dinfo->numdevs; } prometheus-node-exporter-0.15.2+ds/collector/devstat_freebsd.go000066400000000000000000000073661321450230300246530ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nodevstat package collector import ( "errors" "fmt" "sync" "unsafe" "github.com/prometheus/client_golang/prometheus" ) // #cgo LDFLAGS: -ldevstat -lkvm -lelf // #include "devstat_freebsd.h" import "C" const ( devstatSubsystem = "devstat" ) type devstatCollector struct { mu sync.Mutex devinfo *C.struct_devinfo bytes typedDesc transfers typedDesc duration typedDesc busyTime typedDesc blocks typedDesc } func init() { registerCollector("devstat", defaultDisabled, NewDevstatCollector) } // NewDevstatCollector returns a new Collector exposing Device stats. func NewDevstatCollector() (Collector, error) { return &devstatCollector{ devinfo: &C.struct_devinfo{}, bytes: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, devstatSubsystem, "bytes_total"), "The total number of bytes in transactions.", []string{"device", "type"}, nil, ), prometheus.CounterValue}, transfers: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, devstatSubsystem, "transfers_total"), "The total number of transactions.", []string{"device", "type"}, nil, ), prometheus.CounterValue}, duration: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, devstatSubsystem, "duration_seconds_total"), "The total duration of transactions in seconds.", []string{"device", "type"}, nil, ), prometheus.CounterValue}, busyTime: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, devstatSubsystem, "busy_time_seconds_total"), "Total time the device had one or more transactions outstanding in seconds.", []string{"device"}, nil, ), prometheus.CounterValue}, blocks: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, devstatSubsystem, "blocks_transferred_total"), "The total number of blocks transferred.", []string{"device"}, nil, ), prometheus.CounterValue}, }, nil } func (c *devstatCollector) Update(ch chan<- prometheus.Metric) error { c.mu.Lock() defer c.mu.Unlock() var stats *C.Stats n := C._get_stats(c.devinfo, &stats) if n == -1 { return errors.New("devstat_getdevs failed") } base := unsafe.Pointer(stats) for i := C.int(0); i < n; i++ { offset := i * C.int(C.sizeof_Stats) stat := (*C.Stats)(unsafe.Pointer(uintptr(base) + uintptr(offset))) device := fmt.Sprintf("%s%d", C.GoString(&stat.device[0]), stat.unit) ch <- c.bytes.mustNewConstMetric(float64(stat.bytes.read), device, "read") ch <- c.bytes.mustNewConstMetric(float64(stat.bytes.write), device, "write") ch <- c.transfers.mustNewConstMetric(float64(stat.transfers.other), device, "other") ch <- c.transfers.mustNewConstMetric(float64(stat.transfers.read), device, "read") ch <- c.transfers.mustNewConstMetric(float64(stat.transfers.write), device, "write") ch <- c.duration.mustNewConstMetric(float64(stat.duration.other), device, "other") ch <- c.duration.mustNewConstMetric(float64(stat.duration.read), device, "read") ch <- c.duration.mustNewConstMetric(float64(stat.duration.write), device, "write") ch <- c.busyTime.mustNewConstMetric(float64(stat.busyTime), device) ch <- c.blocks.mustNewConstMetric(float64(stat.blocks), device) } C.free(unsafe.Pointer(stats)) return nil } prometheus-node-exporter-0.15.2+ds/collector/devstat_freebsd.h000066400000000000000000000023231321450230300244610ustar00rootroot00000000000000// Copyright 2017 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include #include #include #include #include #include #include typedef struct { uint64_t read; uint64_t write; uint64_t free; } Bytes; typedef struct { uint64_t other; uint64_t read; uint64_t write; uint64_t free; } Transfers; typedef struct { double other; double read; double write; double free; } Duration; typedef struct { char device[DEVSTAT_NAME_LEN]; int unit; Bytes bytes; Transfers transfers; Duration duration; long busyTime; uint64_t blocks; } Stats; int _get_ndevs(); int _get_stats(struct devinfo *info, Stats **stats); prometheus-node-exporter-0.15.2+ds/collector/diskstats_darwin.go000066400000000000000000000112371321450230300250540ustar00rootroot00000000000000// Copyright 2017 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nodiskstats package collector import ( "fmt" "github.com/lufia/iostat" "github.com/prometheus/client_golang/prometheus" ) const ( diskSubsystem = "disk" ) type typedDescFunc struct { typedDesc value func(stat *iostat.DriveStats) float64 } type diskstatsCollector struct { descs []typedDescFunc } func init() { registerCollector("diskstats", defaultEnabled, NewDiskstatsCollector) } // NewDiskstatsCollector returns a new Collector exposing disk device stats. func NewDiskstatsCollector() (Collector, error) { var diskLabelNames = []string{"device"} return &diskstatsCollector{ descs: []typedDescFunc{ { typedDesc: typedDesc{ desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "reads_completed_total"), "The total number of reads completed successfully.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, value: func(stat *iostat.DriveStats) float64 { return float64(stat.NumRead) }, }, { typedDesc: typedDesc{ desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "read_sectors_total"), "The total number of sectors read successfully.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, value: func(stat *iostat.DriveStats) float64 { return float64(stat.NumRead) / float64(stat.BlockSize) }, }, { typedDesc: typedDesc{ desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "read_seconds_total"), "The total number of seconds spent by all reads.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, value: func(stat *iostat.DriveStats) float64 { return stat.TotalReadTime.Seconds() }, }, { typedDesc: typedDesc{ desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "writes_completed_total"), "The total number of writes completed successfully.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, value: func(stat *iostat.DriveStats) float64 { return float64(stat.NumWrite) }, }, { typedDesc: typedDesc{ desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "written_sectors_total"), "The total number of sectors written successfully.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, value: func(stat *iostat.DriveStats) float64 { return float64(stat.NumWrite) / float64(stat.BlockSize) }, }, { typedDesc: typedDesc{ desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "write_seconds_total"), "This is the total number of seconds spent by all writes.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, value: func(stat *iostat.DriveStats) float64 { return stat.TotalWriteTime.Seconds() }, }, { typedDesc: typedDesc{ desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "read_bytes_total"), "The total number of bytes read successfully.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, value: func(stat *iostat.DriveStats) float64 { return float64(stat.BytesRead) }, }, { typedDesc: typedDesc{ desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "written_bytes_total"), "The total number of bytes written successfully.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, value: func(stat *iostat.DriveStats) float64 { return float64(stat.BytesWritten) }, }, }, }, nil } func (c *diskstatsCollector) Update(ch chan<- prometheus.Metric) error { diskStats, err := iostat.ReadDriveStats() if err != nil { return fmt.Errorf("couldn't get diskstats: %s", err) } for _, stats := range diskStats { for _, desc := range c.descs { v := desc.value(stats) ch <- desc.mustNewConstMetric(v, stats.Name) } } return nil } prometheus-node-exporter-0.15.2+ds/collector/diskstats_linux.go000066400000000000000000000157031321450230300247310ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nodiskstats package collector import ( "bufio" "fmt" "io" "os" "regexp" "strconv" "strings" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" "gopkg.in/alecthomas/kingpin.v2" ) const ( diskSubsystem = "disk" diskSectorSize uint64 = 512 ) var ( ignoredDevices = kingpin.Flag("collector.diskstats.ignored-devices", "Regexp of devices to ignore for diskstats.").Default("^(ram|loop|fd|(h|s|v|xv)d[a-z]|nvme\\d+n\\d+p)\\d+$").String() ) type diskstatsCollector struct { ignoredDevicesPattern *regexp.Regexp descs []typedDesc } func init() { registerCollector("diskstats", defaultEnabled, NewDiskstatsCollector) } // NewDiskstatsCollector returns a new Collector exposing disk device stats. func NewDiskstatsCollector() (Collector, error) { var diskLabelNames = []string{"device"} return &diskstatsCollector{ ignoredDevicesPattern: regexp.MustCompile(*ignoredDevices), // Docs from https://www.kernel.org/doc/Documentation/iostats.txt descs: []typedDesc{ { desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "reads_completed"), "The total number of reads completed successfully.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, { desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "reads_merged"), "The total number of reads merged. See https://www.kernel.org/doc/Documentation/iostats.txt.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, { desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "sectors_read"), "The total number of sectors read successfully.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, { desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "read_time_ms"), "The total number of milliseconds spent by all reads.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, { desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "writes_completed"), "The total number of writes completed successfully.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, { desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "writes_merged"), "The number of writes merged. See https://www.kernel.org/doc/Documentation/iostats.txt.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, { desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "sectors_written"), "The total number of sectors written successfully.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, { desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "write_time_ms"), "This is the total number of milliseconds spent by all writes.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, { desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "io_now"), "The number of I/Os currently in progress.", diskLabelNames, nil, ), valueType: prometheus.GaugeValue, }, { desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "io_time_ms"), "Total Milliseconds spent doing I/Os.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, { desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "io_time_weighted"), "The weighted # of milliseconds spent doing I/Os. See https://www.kernel.org/doc/Documentation/iostats.txt.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, { desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "bytes_read"), "The total number of bytes read successfully.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, { desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "bytes_written"), "The total number of bytes written successfully.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, }, }, nil } func (c *diskstatsCollector) Update(ch chan<- prometheus.Metric) error { procDiskStats := procFilePath("diskstats") diskStats, err := getDiskStats() if err != nil { return fmt.Errorf("couldn't get diskstats: %s", err) } for dev, stats := range diskStats { if c.ignoredDevicesPattern.MatchString(dev) { log.Debugf("Ignoring device: %s", dev) continue } if len(stats) != len(c.descs) { return fmt.Errorf("invalid line for %s for %s", procDiskStats, dev) } for i, value := range stats { v, err := strconv.ParseFloat(value, 64) if err != nil { return fmt.Errorf("invalid value %s in diskstats: %s", value, err) } ch <- c.descs[i].mustNewConstMetric(v, dev) } } return nil } func getDiskStats() (map[string]map[int]string, error) { file, err := os.Open(procFilePath("diskstats")) if err != nil { return nil, err } defer file.Close() return parseDiskStats(file) } func convertDiskSectorsToBytes(sectorCount string) (string, error) { sectors, err := strconv.ParseUint(sectorCount, 10, 64) if err != nil { return "", err } return strconv.FormatUint(sectors*diskSectorSize, 10), nil } func parseDiskStats(r io.Reader) (map[string]map[int]string, error) { var ( diskStats = map[string]map[int]string{} scanner = bufio.NewScanner(r) ) for scanner.Scan() { parts := strings.Fields(scanner.Text()) if len(parts) < 4 { // we strip major, minor and dev return nil, fmt.Errorf("invalid line in %s: %s", procFilePath("diskstats"), scanner.Text()) } dev := parts[2] diskStats[dev] = map[int]string{} for i, v := range parts[3:] { diskStats[dev][i] = v } bytesRead, err := convertDiskSectorsToBytes(diskStats[dev][2]) if err != nil { return nil, fmt.Errorf("invalid value for sectors read in %s: %s", procFilePath("diskstats"), scanner.Text()) } diskStats[dev][11] = bytesRead bytesWritten, err := convertDiskSectorsToBytes(diskStats[dev][6]) if err != nil { return nil, fmt.Errorf("invalid value for sectors written in %s: %s", procFilePath("diskstats"), scanner.Text()) } diskStats[dev][12] = bytesWritten } return diskStats, scanner.Err() } prometheus-node-exporter-0.15.2+ds/collector/diskstats_linux_test.go000066400000000000000000000025601321450230300257650ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "os" "testing" ) func TestDiskStats(t *testing.T) { file, err := os.Open("fixtures/proc/diskstats") if err != nil { t.Fatal(err) } defer file.Close() diskStats, err := parseDiskStats(file) if err != nil { t.Fatal(err) } if want, got := "25353629", diskStats["sda4"][0]; want != got { t.Errorf("want diskstats sda4 %s, got %s", want, got) } if want, got := "68", diskStats["mmcblk0p2"][10]; want != got { t.Errorf("want diskstats mmcblk0p2 %s, got %s", want, got) } if want, got := "513713216512", diskStats["sda"][11]; want != got { t.Errorf("want diskstats sda read bytes %s, got %s", want, got) } if want, got := "258916880384", diskStats["sda"][12]; want != got { t.Errorf("want diskstats sda write bytes %s, got %s", want, got) } } prometheus-node-exporter-0.15.2+ds/collector/drbd_linux.go000066400000000000000000000140621321450230300236300ustar00rootroot00000000000000// Copyright 2016 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "bufio" "fmt" "os" "strconv" "strings" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" ) // Numerical metric provided by /proc/drbd. type drbdNumericalMetric struct { desc *prometheus.Desc valueType prometheus.ValueType multiplier float64 } func newDRBDNumericalMetric(name string, desc string, valueType prometheus.ValueType, multiplier float64) drbdNumericalMetric { return drbdNumericalMetric{ desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, "drbd", name), desc, []string{"device"}, nil), valueType: valueType, multiplier: multiplier, } } // String pair metric provided by /proc/drbd. type drbdStringPairMetric struct { desc *prometheus.Desc valueOkay string } func (metric *drbdStringPairMetric) isOkay(value string) float64 { if value == metric.valueOkay { return 1 } return 0 } func newDRBDStringPairMetric(name string, desc string, valueOkay string) drbdStringPairMetric { return drbdStringPairMetric{ desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, "drbd", name), desc, []string{"device", "node"}, nil), valueOkay: valueOkay, } } var ( drbdNumericalMetrics = map[string]drbdNumericalMetric{ "ns": newDRBDNumericalMetric( "network_sent_bytes_total", "Total number of bytes sent via the network.", prometheus.CounterValue, 1024), "nr": newDRBDNumericalMetric( "network_received_bytes_total", "Total number of bytes received via the network.", prometheus.CounterValue, 1), "dw": newDRBDNumericalMetric( "disk_written_bytes_total", "Net data written on local hard disk; in bytes.", prometheus.CounterValue, 1024), "dr": newDRBDNumericalMetric( "disk_read_bytes_total", "Net data read from local hard disk; in bytes.", prometheus.CounterValue, 1024), "al": newDRBDNumericalMetric( "activitylog_writes_total", "Number of updates of the activity log area of the meta data.", prometheus.CounterValue, 1), "bm": newDRBDNumericalMetric( "bitmap_writes_total", "Number of updates of the bitmap area of the meta data.", prometheus.CounterValue, 1), "lo": newDRBDNumericalMetric( "local_pending", "Number of open requests to the local I/O sub-system.", prometheus.GaugeValue, 1), "pe": newDRBDNumericalMetric( "remote_pending", "Number of requests sent to the peer, but that have not yet been answered by the latter.", prometheus.GaugeValue, 1), "ua": newDRBDNumericalMetric( "remote_unacknowledged", "Number of requests received by the peer via the network connection, but that have not yet been answered.", prometheus.GaugeValue, 1), "ap": newDRBDNumericalMetric( "application_pending", "Number of block I/O requests forwarded to DRBD, but not yet answered by DRBD.", prometheus.GaugeValue, 1), "ep": newDRBDNumericalMetric( "epochs", "Number of Epochs currently on the fly.", prometheus.GaugeValue, 1), "oos": newDRBDNumericalMetric( "out_of_sync_bytes", "Amount of data known to be out of sync; in bytes.", prometheus.GaugeValue, 1024), } drbdStringPairMetrics = map[string]drbdStringPairMetric{ "ro": newDRBDStringPairMetric( "node_role_is_primary", "Whether the role of the node is in the primary state.", "Primary"), "ds": newDRBDStringPairMetric( "disk_state_is_up_to_date", "Whether the disk of the node is up to date.", "UpToDate"), } drbdConnected = prometheus.NewDesc( prometheus.BuildFQName(namespace, "drbd", "connected"), "Whether DRBD is connected to the peer.", []string{"device"}, nil) ) type drbdCollector struct{} func init() { registerCollector("drbd", defaultDisabled, newDRBDCollector) } func newDRBDCollector() (Collector, error) { return &drbdCollector{}, nil } func (c *drbdCollector) Update(ch chan<- prometheus.Metric) error { statsFile := procFilePath("drbd") file, err := os.Open(statsFile) if err != nil { if os.IsNotExist(err) { log.Debugf("Not collecting DRBD statistics, as %s does not exist: %s", statsFile, err) return nil } return err } defer file.Close() scanner := bufio.NewScanner(file) scanner.Split(bufio.ScanWords) device := "unknown" for scanner.Scan() { field := scanner.Text() if kv := strings.Split(field, ":"); len(kv) == 2 { if id, err := strconv.ParseUint(kv[0], 10, 64); err == nil && kv[1] == "" { device = fmt.Sprintf("drbd%d", id) } else if metric, ok := drbdNumericalMetrics[kv[0]]; ok { // Numerical value. value, err := strconv.ParseFloat(kv[1], 64) if err != nil { return err } ch <- prometheus.MustNewConstMetric( metric.desc, metric.valueType, value*metric.multiplier, device) } else if metric, ok := drbdStringPairMetrics[kv[0]]; ok { // String pair value. values := strings.Split(kv[1], "/") ch <- prometheus.MustNewConstMetric( metric.desc, prometheus.GaugeValue, metric.isOkay(values[0]), device, "local") ch <- prometheus.MustNewConstMetric( metric.desc, prometheus.GaugeValue, metric.isOkay(values[1]), device, "remote") } else if kv[0] == "cs" { // Connection state. var connected float64 if kv[1] == "Connected" { connected = 1 } ch <- prometheus.MustNewConstMetric( drbdConnected, prometheus.GaugeValue, connected, device) } else { log.Debugf("Don't know how to process key-value pair [%s: %q]", kv[0], kv[1]) } } else { log.Debugf("Don't know how to process string %q", field) } } return scanner.Err() } prometheus-node-exporter-0.15.2+ds/collector/edac_linux.go000066400000000000000000000114641321450230300236140ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !noedac package collector import ( "fmt" "path" "path/filepath" "regexp" "github.com/prometheus/client_golang/prometheus" ) const ( edacSubsystem = "edac" ) var ( edacMemControllerRE = regexp.MustCompile(`.*devices/system/edac/mc/mc([0-9]*)`) edacMemCsrowRE = regexp.MustCompile(`.*devices/system/edac/mc/mc[0-9]*/csrow([0-9]*)`) ) type edacCollector struct { ceCount *prometheus.Desc ueCount *prometheus.Desc csRowCECount *prometheus.Desc csRowUECount *prometheus.Desc } func init() { registerCollector("edac", defaultEnabled, NewEdacCollector) } // NewEdacCollector returns a new Collector exposing edac stats. func NewEdacCollector() (Collector, error) { return &edacCollector{ ceCount: prometheus.NewDesc( prometheus.BuildFQName(namespace, edacSubsystem, "correctable_errors_total"), "Total correctable memory errors.", []string{"controller"}, nil, ), ueCount: prometheus.NewDesc( prometheus.BuildFQName(namespace, edacSubsystem, "uncorrectable_errors_total"), "Total uncorrectable memory errors.", []string{"controller"}, nil, ), csRowCECount: prometheus.NewDesc( prometheus.BuildFQName(namespace, edacSubsystem, "csrow_correctable_errors_total"), "Total correctable memory errors for this csrow.", []string{"controller", "csrow"}, nil, ), csRowUECount: prometheus.NewDesc( prometheus.BuildFQName(namespace, edacSubsystem, "csrow_uncorrectable_errors_total"), "Total uncorrectable memory errors for this csrow.", []string{"controller", "csrow"}, nil, ), }, nil } func (c *edacCollector) Update(ch chan<- prometheus.Metric) error { memControllers, err := filepath.Glob(sysFilePath("devices/system/edac/mc/mc[0-9]*")) if err != nil { return err } for _, controller := range memControllers { controllerMatch := edacMemControllerRE.FindStringSubmatch(controller) if controllerMatch == nil { return fmt.Errorf("controller string didn't match regexp: %s", controller) } controllerNumber := controllerMatch[1] value, err := readUintFromFile(path.Join(controller, "ce_count")) if err != nil { return fmt.Errorf("couldn't get ce_count for controller %s: %s", controllerNumber, err) } ch <- prometheus.MustNewConstMetric( c.ceCount, prometheus.CounterValue, float64(value), controllerNumber) value, err = readUintFromFile(path.Join(controller, "ce_noinfo_count")) if err != nil { return fmt.Errorf("couldn't get ce_noinfo_count for controller %s: %s", controllerNumber, err) } ch <- prometheus.MustNewConstMetric( c.csRowCECount, prometheus.CounterValue, float64(value), controllerNumber, "unknown") value, err = readUintFromFile(path.Join(controller, "ue_count")) if err != nil { return fmt.Errorf("couldn't get ue_count for controller %s: %s", controllerNumber, err) } ch <- prometheus.MustNewConstMetric( c.ueCount, prometheus.CounterValue, float64(value), controllerNumber) value, err = readUintFromFile(path.Join(controller, "ue_noinfo_count")) if err != nil { return fmt.Errorf("couldn't get ue_noinfo_count for controller %s: %s", controllerNumber, err) } ch <- prometheus.MustNewConstMetric( c.csRowUECount, prometheus.CounterValue, float64(value), controllerNumber, "unknown") // For each controller, walk the csrow directories. csrows, err := filepath.Glob(controller + "/csrow[0-9]*") if err != nil { return err } for _, csrow := range csrows { csrowMatch := edacMemCsrowRE.FindStringSubmatch(csrow) if csrowMatch == nil { return fmt.Errorf("csrow string didn't match regexp: %s", csrow) } csrowNumber := csrowMatch[1] value, err = readUintFromFile(path.Join(csrow, "ce_count")) if err != nil { return fmt.Errorf("couldn't get ce_count for controller/csrow %s/%s: %s", controllerNumber, csrowNumber, err) } ch <- prometheus.MustNewConstMetric( c.csRowCECount, prometheus.CounterValue, float64(value), controllerNumber, csrowNumber) value, err = readUintFromFile(path.Join(csrow, "ue_count")) if err != nil { return fmt.Errorf("couldn't get ue_count for controller/csrow %s/%s: %s", controllerNumber, csrowNumber, err) } ch <- prometheus.MustNewConstMetric( c.csRowUECount, prometheus.CounterValue, float64(value), controllerNumber, csrowNumber) } } return err } prometheus-node-exporter-0.15.2+ds/collector/entropy_linux.go000066400000000000000000000027421321450230300244170ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !noentropy package collector import ( "fmt" "github.com/prometheus/client_golang/prometheus" ) type entropyCollector struct { entropyAvail *prometheus.Desc } func init() { registerCollector("entropy", defaultEnabled, NewEntropyCollector) } // NewEntropyCollector returns a new Collector exposing entropy stats. func NewEntropyCollector() (Collector, error) { return &entropyCollector{ entropyAvail: prometheus.NewDesc( prometheus.BuildFQName(namespace, "", "entropy_available_bits"), "Bits of available entropy.", nil, nil, ), }, nil } func (c *entropyCollector) Update(ch chan<- prometheus.Metric) error { value, err := readUintFromFile(procFilePath("sys/kernel/random/entropy_avail")) if err != nil { return fmt.Errorf("couldn't get entropy_avail: %s", err) } ch <- prometheus.MustNewConstMetric( c.entropyAvail, prometheus.GaugeValue, float64(value)) return nil } prometheus-node-exporter-0.15.2+ds/collector/exec_bsd.go000066400000000000000000000061201321450230300232460ustar00rootroot00000000000000// Copyright 2017 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build freebsd dragonfly // +build !noexec package collector import ( "github.com/prometheus/client_golang/prometheus" ) type execCollector struct { sysctls []bsdSysctl } func init() { registerCollector("exec", defaultEnabled, NewExecCollector) } // NewExecCollector returns a new Collector exposing system execution statistics. func NewExecCollector() (Collector, error) { // From sys/vm/vm_meter.c: // All are of type CTLTYPE_UINT. // // vm.stats.sys.v_swtch: Context switches // vm.stats.sys.v_trap: Traps // vm.stats.sys.v_syscall: System calls // vm.stats.sys.v_intr: Device interrupts // vm.stats.sys.v_soft: Software interrupts // vm.stats.vm.v_forks: Number of fork() calls // // From sys/kern/kern_tc.c: // kern.boottime is an S,timeval return &execCollector{ sysctls: []bsdSysctl{ { name: "context_switches_total", description: "Context switches since system boot. Resets at architeture unsigned integer.", mib: "vm.stats.sys.v_swtch", }, { name: "traps_total", description: "Traps since system boot. Resets at architeture unsigned integer.", mib: "vm.stats.sys.v_trap", }, { name: "system_calls_total", description: "System calls since system boot. Resets at architeture unsigned integer.", mib: "vm.stats.sys.v_syscall", }, { name: "device_interrupts_total", description: "Device interrupts since system boot. Resets at architeture unsigned integer.", mib: "vm.stats.sys.v_intr", }, { name: "software_interrupts_total", description: "Software interrupts since system boot. Resets at architeture unsigned integer.", mib: "vm.stats.sys.v_soft", }, { name: "forks_total", description: "Number of fork() calls since system boot. Resets at architeture unsigned integer.", mib: "vm.stats.vm.v_forks", }, { name: "boot_timestamp_seconds", description: "Unix time of last boot, including microseconds.", mib: "kern.boottime", dataType: bsdSysctlTypeStructTimeval, }, }, }, nil } // Update pushes exec statistics onto ch func (c *execCollector) Update(ch chan<- prometheus.Metric) error { for _, m := range c.sysctls { v, err := m.Value() if err != nil { return err } ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, "exec", m.name), m.description, nil, nil, ), prometheus.CounterValue, v) } return nil } prometheus-node-exporter-0.15.2+ds/collector/filefd_linux.go000066400000000000000000000045411321450230300241470ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nofilefd package collector import ( "bytes" "fmt" "io/ioutil" "os" "strconv" "github.com/prometheus/client_golang/prometheus" ) const ( fileFDStatSubsystem = "filefd" ) type fileFDStatCollector struct{} func init() { registerCollector(fileFDStatSubsystem, defaultEnabled, NewFileFDStatCollector) } // NewFileFDStatCollector returns a new Collector exposing file-nr stats. func NewFileFDStatCollector() (Collector, error) { return &fileFDStatCollector{}, nil } func (c *fileFDStatCollector) Update(ch chan<- prometheus.Metric) error { fileFDStat, err := parseFileFDStats(procFilePath("sys/fs/file-nr")) if err != nil { return fmt.Errorf("couldn't get file-nr: %s", err) } for name, value := range fileFDStat { v, err := strconv.ParseFloat(value, 64) if err != nil { return fmt.Errorf("invalid value %s in file-nr: %s", value, err) } ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, fileFDStatSubsystem, name), fmt.Sprintf("File descriptor statistics: %s.", name), nil, nil, ), prometheus.GaugeValue, v, ) } return nil } func parseFileFDStats(filename string) (map[string]string, error) { file, err := os.Open(filename) if err != nil { return nil, err } defer file.Close() content, err := ioutil.ReadAll(file) if err != nil { return nil, err } parts := bytes.Split(bytes.TrimSpace(content), []byte("\u0009")) if len(parts) < 3 { return nil, fmt.Errorf("unexpected number of file stats in %q", filename) } var fileFDStat = map[string]string{} // The file-nr proc is only 1 line with 3 values. fileFDStat["allocated"] = string(parts[0]) // The second value is skipped as it will always be zero in linux 2.6. fileFDStat["maximum"] = string(parts[2]) return fileFDStat, nil } prometheus-node-exporter-0.15.2+ds/collector/filefd_linux_test.go000066400000000000000000000020031321450230300251750ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import "testing" func TestFileFDStats(t *testing.T) { fileFDStats, err := parseFileFDStats("fixtures/proc/sys/fs/file-nr") if err != nil { t.Fatal(err) } if want, got := "1024", fileFDStats["allocated"]; want != got { t.Errorf("want filefd allocated %q, got %q", want, got) } if want, got := "1631329", fileFDStats["maximum"]; want != got { t.Errorf("want filefd maximum %q, got %q", want, got) } } prometheus-node-exporter-0.15.2+ds/collector/filesystem_bsd.go000066400000000000000000000043731321450230300245160ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build openbsd darwin,amd64 dragonfly // +build !nofilesystem package collector import ( "errors" "unsafe" "github.com/prometheus/common/log" ) /* #include #include #include #include */ import "C" const ( defIgnoredMountPoints = "^/(dev)($|/)" defIgnoredFSTypes = "^devfs$" readOnly = 0x1 // MNT_RDONLY ) // Expose filesystem fullness. func (c *filesystemCollector) GetStats() (stats []filesystemStats, err error) { var mntbuf *C.struct_statfs count := C.getmntinfo(&mntbuf, C.MNT_NOWAIT) if count == 0 { return nil, errors.New("getmntinfo() failed") } mnt := (*[1 << 20]C.struct_statfs)(unsafe.Pointer(mntbuf)) stats = []filesystemStats{} for i := 0; i < int(count); i++ { mountpoint := C.GoString(&mnt[i].f_mntonname[0]) if c.ignoredMountPointsPattern.MatchString(mountpoint) { log.Debugf("Ignoring mount point: %s", mountpoint) continue } device := C.GoString(&mnt[i].f_mntfromname[0]) fstype := C.GoString(&mnt[i].f_fstypename[0]) if c.ignoredFSTypesPattern.MatchString(fstype) { log.Debugf("Ignoring fs type: %s", fstype) continue } var ro float64 if (mnt[i].f_flags & readOnly) != 0 { ro = 1 } stats = append(stats, filesystemStats{ labels: filesystemLabels{ device: device, mountPoint: mountpoint, fsType: fstype, }, size: float64(mnt[i].f_blocks) * float64(mnt[i].f_bsize), free: float64(mnt[i].f_bfree) * float64(mnt[i].f_bsize), avail: float64(mnt[i].f_bavail) * float64(mnt[i].f_bsize), files: float64(mnt[i].f_files), filesFree: float64(mnt[i].f_ffree), ro: ro, }) } return stats, nil } prometheus-node-exporter-0.15.2+ds/collector/filesystem_common.go000066400000000000000000000123401321450230300252270ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nofilesystem // +build linux freebsd openbsd darwin,amd64 dragonfly package collector import ( "regexp" "github.com/prometheus/client_golang/prometheus" "gopkg.in/alecthomas/kingpin.v2" ) // Arch-dependent implementation must define: // * defIgnoredMountPoints // * defIgnoredFSTypes // * filesystemLabelNames // * filesystemCollector.GetStats var ( ignoredMountPoints = kingpin.Flag( "collector.filesystem.ignored-mount-points", "Regexp of mount points to ignore for filesystem collector.", ).Default(defIgnoredMountPoints).String() ignoredFSTypes = kingpin.Flag( "collector.filesystem.ignored-fs-types", "Regexp of filesystem types to ignore for filesystem collector.", ).Default(defIgnoredFSTypes).String() filesystemLabelNames = []string{"device", "mountpoint", "fstype"} ) type filesystemCollector struct { ignoredMountPointsPattern *regexp.Regexp ignoredFSTypesPattern *regexp.Regexp sizeDesc, freeDesc, availDesc *prometheus.Desc filesDesc, filesFreeDesc *prometheus.Desc roDesc, deviceErrorDesc *prometheus.Desc } type filesystemLabels struct { device, mountPoint, fsType string } type filesystemStats struct { labels filesystemLabels size, free, avail float64 files, filesFree float64 ro, deviceError float64 } func init() { registerCollector("filesystem", defaultEnabled, NewFilesystemCollector) } // NewFilesystemCollector returns a new Collector exposing filesystems stats. func NewFilesystemCollector() (Collector, error) { subsystem := "filesystem" mountPointPattern := regexp.MustCompile(*ignoredMountPoints) filesystemsTypesPattern := regexp.MustCompile(*ignoredFSTypes) sizeDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "size"), "Filesystem size in bytes.", filesystemLabelNames, nil, ) freeDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "free"), "Filesystem free space in bytes.", filesystemLabelNames, nil, ) availDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "avail"), "Filesystem space available to non-root users in bytes.", filesystemLabelNames, nil, ) filesDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "files"), "Filesystem total file nodes.", filesystemLabelNames, nil, ) filesFreeDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "files_free"), "Filesystem total free file nodes.", filesystemLabelNames, nil, ) roDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "readonly"), "Filesystem read-only status.", filesystemLabelNames, nil, ) deviceErrorDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "device_error"), "Whether an error occurred while getting statistics for the given device.", filesystemLabelNames, nil, ) return &filesystemCollector{ ignoredMountPointsPattern: mountPointPattern, ignoredFSTypesPattern: filesystemsTypesPattern, sizeDesc: sizeDesc, freeDesc: freeDesc, availDesc: availDesc, filesDesc: filesDesc, filesFreeDesc: filesFreeDesc, roDesc: roDesc, deviceErrorDesc: deviceErrorDesc, }, nil } func (c *filesystemCollector) Update(ch chan<- prometheus.Metric) error { stats, err := c.GetStats() if err != nil { return err } // Make sure we expose a metric once, even if there are multiple mounts seen := map[filesystemLabels]bool{} for _, s := range stats { if seen[s.labels] { continue } seen[s.labels] = true ch <- prometheus.MustNewConstMetric( c.deviceErrorDesc, prometheus.GaugeValue, s.deviceError, s.labels.device, s.labels.mountPoint, s.labels.fsType, ) if s.deviceError > 0 { continue } ch <- prometheus.MustNewConstMetric( c.sizeDesc, prometheus.GaugeValue, s.size, s.labels.device, s.labels.mountPoint, s.labels.fsType, ) ch <- prometheus.MustNewConstMetric( c.freeDesc, prometheus.GaugeValue, s.free, s.labels.device, s.labels.mountPoint, s.labels.fsType, ) ch <- prometheus.MustNewConstMetric( c.availDesc, prometheus.GaugeValue, s.avail, s.labels.device, s.labels.mountPoint, s.labels.fsType, ) ch <- prometheus.MustNewConstMetric( c.filesDesc, prometheus.GaugeValue, s.files, s.labels.device, s.labels.mountPoint, s.labels.fsType, ) ch <- prometheus.MustNewConstMetric( c.filesFreeDesc, prometheus.GaugeValue, s.filesFree, s.labels.device, s.labels.mountPoint, s.labels.fsType, ) ch <- prometheus.MustNewConstMetric( c.roDesc, prometheus.GaugeValue, s.ro, s.labels.device, s.labels.mountPoint, s.labels.fsType, ) } return nil } prometheus-node-exporter-0.15.2+ds/collector/filesystem_freebsd.go000066400000000000000000000043641321450230300253600ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nofilesystem package collector import ( "bytes" "unsafe" "github.com/prometheus/common/log" "golang.org/x/sys/unix" ) const ( defIgnoredMountPoints = "^/(dev)($|/)" defIgnoredFSTypes = "^devfs$" readOnly = 0x1 // MNT_RDONLY noWait = 0x2 // MNT_NOWAIT ) func gostring(b []int8) string { bb := *(*[]byte)(unsafe.Pointer(&b)) idx := bytes.IndexByte(bb, 0) if idx < 0 { return "" } return string(bb[:idx]) } // Expose filesystem fullness. func (c *filesystemCollector) GetStats() ([]filesystemStats, error) { buf := make([]unix.Statfs_t, 16) for { n, err := unix.Getfsstat(buf, noWait) if err != nil { return nil, err } if n < len(buf) { buf = buf[:n] break } buf = make([]unix.Statfs_t, len(buf)*2) } stats := []filesystemStats{} for _, fs := range buf { mountpoint := gostring(fs.Mntonname[:]) if c.ignoredMountPointsPattern.MatchString(mountpoint) { log.Debugf("Ignoring mount point: %s", mountpoint) continue } device := gostring(fs.Mntfromname[:]) fstype := gostring(fs.Fstypename[:]) if c.ignoredFSTypesPattern.MatchString(fstype) { log.Debugf("Ignoring fs type: %s", fstype) continue } var ro float64 if (fs.Flags & readOnly) != 0 { ro = 1 } stats = append(stats, filesystemStats{ labels: filesystemLabels{ device: device, mountPoint: mountpoint, fsType: fstype, }, size: float64(fs.Blocks) * float64(fs.Bsize), free: float64(fs.Bfree) * float64(fs.Bsize), avail: float64(fs.Bavail) * float64(fs.Bsize), files: float64(fs.Files), filesFree: float64(fs.Ffree), ro: ro, }) } return stats, nil } prometheus-node-exporter-0.15.2+ds/collector/filesystem_linux.go000066400000000000000000000047721321450230300251100ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nofilesystem package collector import ( "bufio" "os" "strings" "syscall" "github.com/prometheus/common/log" ) const ( defIgnoredMountPoints = "^/(sys|proc|dev)($|/)" defIgnoredFSTypes = "^(sys|proc|auto)fs$" readOnly = 0x1 // ST_RDONLY ) // GetStats returns filesystem stats. func (c *filesystemCollector) GetStats() ([]filesystemStats, error) { mps, err := mountPointDetails() if err != nil { return nil, err } stats := []filesystemStats{} for _, labels := range mps { if c.ignoredMountPointsPattern.MatchString(labels.mountPoint) { log.Debugf("Ignoring mount point: %s", labels.mountPoint) continue } if c.ignoredFSTypesPattern.MatchString(labels.fsType) { log.Debugf("Ignoring fs type: %s", labels.fsType) continue } buf := new(syscall.Statfs_t) err := syscall.Statfs(labels.mountPoint, buf) if err != nil { stats = append(stats, filesystemStats{ labels: labels, deviceError: 1, }) log.Errorf("Error on statfs() system call for %q: %s", labels.mountPoint, err) continue } var ro float64 if (buf.Flags & readOnly) != 0 { ro = 1 } stats = append(stats, filesystemStats{ labels: labels, size: float64(buf.Blocks) * float64(buf.Bsize), free: float64(buf.Bfree) * float64(buf.Bsize), avail: float64(buf.Bavail) * float64(buf.Bsize), files: float64(buf.Files), filesFree: float64(buf.Ffree), ro: ro, }) } return stats, nil } func mountPointDetails() ([]filesystemLabels, error) { file, err := os.Open(procFilePath("mounts")) if err != nil { return nil, err } defer file.Close() filesystems := []filesystemLabels{} scanner := bufio.NewScanner(file) for scanner.Scan() { parts := strings.Fields(scanner.Text()) filesystems = append(filesystems, filesystemLabels{ device: parts[0], mountPoint: parts[1], fsType: parts[2], }) } return filesystems, scanner.Err() } prometheus-node-exporter-0.15.2+ds/collector/fixtures/000077500000000000000000000000001321450230300230155ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/e2e-output.txt000066400000000000000000005626471321450230300256130ustar00rootroot00000000000000# HELP go_gc_duration_seconds A summary of the GC invocation durations. # TYPE go_gc_duration_seconds summary # HELP go_goroutines Number of goroutines that currently exist. # TYPE go_goroutines gauge # HELP go_info Information about the Go environment. # TYPE go_info gauge # HELP go_memstats_alloc_bytes Number of bytes allocated and still in use. # TYPE go_memstats_alloc_bytes gauge # HELP go_memstats_alloc_bytes_total Total number of bytes allocated, even if freed. # TYPE go_memstats_alloc_bytes_total counter # HELP go_memstats_buck_hash_sys_bytes Number of bytes used by the profiling bucket hash table. # TYPE go_memstats_buck_hash_sys_bytes gauge # HELP go_memstats_frees_total Total number of frees. # TYPE go_memstats_frees_total counter # HELP go_memstats_gc_cpu_fraction The fraction of this program's available CPU time used by the GC since the program started. # TYPE go_memstats_gc_cpu_fraction gauge # HELP go_memstats_gc_sys_bytes Number of bytes used for garbage collection system metadata. # TYPE go_memstats_gc_sys_bytes gauge # HELP go_memstats_heap_alloc_bytes Number of heap bytes allocated and still in use. # TYPE go_memstats_heap_alloc_bytes gauge # HELP go_memstats_heap_idle_bytes Number of heap bytes waiting to be used. # TYPE go_memstats_heap_idle_bytes gauge # HELP go_memstats_heap_inuse_bytes Number of heap bytes that are in use. # TYPE go_memstats_heap_inuse_bytes gauge # HELP go_memstats_heap_objects Number of allocated objects. # TYPE go_memstats_heap_objects gauge # HELP go_memstats_heap_released_bytes Number of heap bytes released to OS. # TYPE go_memstats_heap_released_bytes gauge # HELP go_memstats_heap_sys_bytes Number of heap bytes obtained from system. # TYPE go_memstats_heap_sys_bytes gauge # HELP go_memstats_last_gc_time_seconds Number of seconds since 1970 of last garbage collection. # TYPE go_memstats_last_gc_time_seconds gauge # HELP go_memstats_lookups_total Total number of pointer lookups. # TYPE go_memstats_lookups_total counter # HELP go_memstats_mallocs_total Total number of mallocs. # TYPE go_memstats_mallocs_total counter # HELP go_memstats_mcache_inuse_bytes Number of bytes in use by mcache structures. # TYPE go_memstats_mcache_inuse_bytes gauge # HELP go_memstats_mcache_sys_bytes Number of bytes used for mcache structures obtained from system. # TYPE go_memstats_mcache_sys_bytes gauge # HELP go_memstats_mspan_inuse_bytes Number of bytes in use by mspan structures. # TYPE go_memstats_mspan_inuse_bytes gauge # HELP go_memstats_mspan_sys_bytes Number of bytes used for mspan structures obtained from system. # TYPE go_memstats_mspan_sys_bytes gauge # HELP go_memstats_next_gc_bytes Number of heap bytes when next garbage collection will take place. # TYPE go_memstats_next_gc_bytes gauge # HELP go_memstats_other_sys_bytes Number of bytes used for other system allocations. # TYPE go_memstats_other_sys_bytes gauge # HELP go_memstats_stack_inuse_bytes Number of bytes in use by the stack allocator. # TYPE go_memstats_stack_inuse_bytes gauge # HELP go_memstats_stack_sys_bytes Number of bytes obtained from system for stack allocator. # TYPE go_memstats_stack_sys_bytes gauge # HELP go_memstats_sys_bytes Number of bytes obtained from system. # TYPE go_memstats_sys_bytes gauge # HELP go_threads Number of OS threads created. # TYPE go_threads gauge # HELP http_request_duration_microseconds The HTTP request latencies in microseconds. # TYPE http_request_duration_microseconds summary http_request_duration_microseconds{handler="prometheus",quantile="0.5"} NaN http_request_duration_microseconds{handler="prometheus",quantile="0.9"} NaN http_request_duration_microseconds{handler="prometheus",quantile="0.99"} NaN http_request_duration_microseconds_sum{handler="prometheus"} 0 http_request_duration_microseconds_count{handler="prometheus"} 0 # HELP http_request_size_bytes The HTTP request sizes in bytes. # TYPE http_request_size_bytes summary http_request_size_bytes{handler="prometheus",quantile="0.5"} NaN http_request_size_bytes{handler="prometheus",quantile="0.9"} NaN http_request_size_bytes{handler="prometheus",quantile="0.99"} NaN http_request_size_bytes_sum{handler="prometheus"} 0 http_request_size_bytes_count{handler="prometheus"} 0 # HELP http_response_size_bytes The HTTP response sizes in bytes. # TYPE http_response_size_bytes summary http_response_size_bytes{handler="prometheus",quantile="0.5"} NaN http_response_size_bytes{handler="prometheus",quantile="0.9"} NaN http_response_size_bytes{handler="prometheus",quantile="0.99"} NaN http_response_size_bytes_sum{handler="prometheus"} 0 http_response_size_bytes_count{handler="prometheus"} 0 # HELP node_arp_entries ARP entries by device # TYPE node_arp_entries gauge node_arp_entries{device="eth0"} 3 node_arp_entries{device="eth1"} 3 # HELP node_bcache_active_journal_entries Number of journal entries that are newer than the index. # TYPE node_bcache_active_journal_entries gauge node_bcache_active_journal_entries{uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 1 # HELP node_bcache_average_key_size_sectors Average data per key in the btree (sectors). # TYPE node_bcache_average_key_size_sectors gauge node_bcache_average_key_size_sectors{uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 # HELP node_bcache_btree_cache_size_bytes Amount of memory currently used by the btree cache. # TYPE node_bcache_btree_cache_size_bytes gauge node_bcache_btree_cache_size_bytes{uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 # HELP node_bcache_btree_nodes Total nodes in the btree. # TYPE node_bcache_btree_nodes gauge node_bcache_btree_nodes{uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 # HELP node_bcache_btree_read_average_duration_seconds Average btree read duration. # TYPE node_bcache_btree_read_average_duration_seconds gauge node_bcache_btree_read_average_duration_seconds{uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 1.305e-06 # HELP node_bcache_bypassed_bytes_total Amount of IO (both reads and writes) that has bypassed the cache. # TYPE node_bcache_bypassed_bytes_total counter node_bcache_bypassed_bytes_total{backing_device="bdev0",uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 # HELP node_bcache_cache_available_percent Percentage of cache device without dirty data, useable for writeback (may contain clean cached data). # TYPE node_bcache_cache_available_percent gauge node_bcache_cache_available_percent{uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 100 # HELP node_bcache_cache_bypass_hits_total Hits for IO intended to skip the cache. # TYPE node_bcache_cache_bypass_hits_total counter node_bcache_cache_bypass_hits_total{backing_device="bdev0",uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 # HELP node_bcache_cache_bypass_misses_total Misses for IO intended to skip the cache. # TYPE node_bcache_cache_bypass_misses_total counter node_bcache_cache_bypass_misses_total{backing_device="bdev0",uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 # HELP node_bcache_cache_hits_total Hits counted per individual IO as bcache sees them. # TYPE node_bcache_cache_hits_total counter node_bcache_cache_hits_total{backing_device="bdev0",uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 546 # HELP node_bcache_cache_miss_collisions_total Instances where data insertion from cache miss raced with write (data already present). # TYPE node_bcache_cache_miss_collisions_total counter node_bcache_cache_miss_collisions_total{backing_device="bdev0",uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 # HELP node_bcache_cache_misses_total Misses counted per individual IO as bcache sees them. # TYPE node_bcache_cache_misses_total counter node_bcache_cache_misses_total{backing_device="bdev0",uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 # HELP node_bcache_cache_read_races Counts instances where while data was being read from the cache, the bucket was reused and invalidated - i.e. where the pointer was stale after the read completed. # TYPE node_bcache_cache_read_races counter node_bcache_cache_read_races{uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 # HELP node_bcache_cache_readaheads_total Count of times readahead occurred. # TYPE node_bcache_cache_readaheads_total counter node_bcache_cache_readaheads_total{backing_device="bdev0",uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 # HELP node_bcache_congested Congestion. # TYPE node_bcache_congested gauge node_bcache_congested{uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 # HELP node_bcache_dirty_data_bytes Amount of dirty data for this backing device in the cache. # TYPE node_bcache_dirty_data_bytes gauge node_bcache_dirty_data_bytes{backing_device="bdev0",uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 # HELP node_bcache_io_errors Number of errors that have occurred, decayed by io_error_halflife. # TYPE node_bcache_io_errors gauge node_bcache_io_errors{cache_device="cache0",uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 # HELP node_bcache_metadata_written_bytes_total Sum of all non data writes (btree writes and all other metadata). # TYPE node_bcache_metadata_written_bytes_total counter node_bcache_metadata_written_bytes_total{cache_device="cache0",uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 512 # HELP node_bcache_priority_stats_metadata_percent Bcache's metadata overhead. # TYPE node_bcache_priority_stats_metadata_percent gauge node_bcache_priority_stats_metadata_percent{cache_device="cache0",uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 # HELP node_bcache_priority_stats_unused_percent The percentage of the cache that doesn't contain any data. # TYPE node_bcache_priority_stats_unused_percent gauge node_bcache_priority_stats_unused_percent{cache_device="cache0",uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 99 # HELP node_bcache_root_usage_percent Percentage of the root btree node in use (tree depth increases if too high). # TYPE node_bcache_root_usage_percent gauge node_bcache_root_usage_percent{uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 # HELP node_bcache_tree_depth Depth of the btree. # TYPE node_bcache_tree_depth gauge node_bcache_tree_depth{uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 # HELP node_bcache_written_bytes_total Sum of all data that has been written to the cache. # TYPE node_bcache_written_bytes_total counter node_bcache_written_bytes_total{cache_device="cache0",uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 # HELP node_bonding_active Number of active slaves per bonding interface. # TYPE node_bonding_active gauge node_bonding_active{master="bond0"} 0 node_bonding_active{master="dmz"} 2 node_bonding_active{master="int"} 1 # HELP node_bonding_slaves Number of configured slaves per bonding interface. # TYPE node_bonding_slaves gauge node_bonding_slaves{master="bond0"} 0 node_bonding_slaves{master="dmz"} 2 node_bonding_slaves{master="int"} 2 # HELP node_boot_time Node boot time, in unixtime. # TYPE node_boot_time gauge node_boot_time 1.418183276e+09 # HELP node_buddyinfo_count Count of free blocks according to size. # TYPE node_buddyinfo_count gauge node_buddyinfo_count{node="0",size="0",zone="DMA"} 1 node_buddyinfo_count{node="0",size="0",zone="DMA32"} 759 node_buddyinfo_count{node="0",size="0",zone="Normal"} 4381 node_buddyinfo_count{node="0",size="1",zone="DMA"} 0 node_buddyinfo_count{node="0",size="1",zone="DMA32"} 572 node_buddyinfo_count{node="0",size="1",zone="Normal"} 1093 node_buddyinfo_count{node="0",size="10",zone="DMA"} 3 node_buddyinfo_count{node="0",size="10",zone="DMA32"} 0 node_buddyinfo_count{node="0",size="10",zone="Normal"} 0 node_buddyinfo_count{node="0",size="2",zone="DMA"} 1 node_buddyinfo_count{node="0",size="2",zone="DMA32"} 791 node_buddyinfo_count{node="0",size="2",zone="Normal"} 185 node_buddyinfo_count{node="0",size="3",zone="DMA"} 0 node_buddyinfo_count{node="0",size="3",zone="DMA32"} 475 node_buddyinfo_count{node="0",size="3",zone="Normal"} 1530 node_buddyinfo_count{node="0",size="4",zone="DMA"} 2 node_buddyinfo_count{node="0",size="4",zone="DMA32"} 194 node_buddyinfo_count{node="0",size="4",zone="Normal"} 567 node_buddyinfo_count{node="0",size="5",zone="DMA"} 1 node_buddyinfo_count{node="0",size="5",zone="DMA32"} 45 node_buddyinfo_count{node="0",size="5",zone="Normal"} 102 node_buddyinfo_count{node="0",size="6",zone="DMA"} 1 node_buddyinfo_count{node="0",size="6",zone="DMA32"} 12 node_buddyinfo_count{node="0",size="6",zone="Normal"} 4 node_buddyinfo_count{node="0",size="7",zone="DMA"} 0 node_buddyinfo_count{node="0",size="7",zone="DMA32"} 0 node_buddyinfo_count{node="0",size="7",zone="Normal"} 0 node_buddyinfo_count{node="0",size="8",zone="DMA"} 1 node_buddyinfo_count{node="0",size="8",zone="DMA32"} 0 node_buddyinfo_count{node="0",size="8",zone="Normal"} 0 node_buddyinfo_count{node="0",size="9",zone="DMA"} 1 node_buddyinfo_count{node="0",size="9",zone="DMA32"} 0 node_buddyinfo_count{node="0",size="9",zone="Normal"} 0 # HELP node_context_switches Total number of context switches. # TYPE node_context_switches counter node_context_switches 3.8014093e+07 # HELP node_cpu Seconds the cpus spent in each mode. # TYPE node_cpu counter node_cpu{cpu="cpu0",mode="guest"} 0 node_cpu{cpu="cpu0",mode="guest_nice"} 0 node_cpu{cpu="cpu0",mode="idle"} 10870.69 node_cpu{cpu="cpu0",mode="iowait"} 2.2 node_cpu{cpu="cpu0",mode="irq"} 0.01 node_cpu{cpu="cpu0",mode="nice"} 0.19 node_cpu{cpu="cpu0",mode="softirq"} 34.1 node_cpu{cpu="cpu0",mode="steal"} 0 node_cpu{cpu="cpu0",mode="system"} 210.45 node_cpu{cpu="cpu0",mode="user"} 444.9 node_cpu{cpu="cpu1",mode="guest"} 0 node_cpu{cpu="cpu1",mode="guest_nice"} 0 node_cpu{cpu="cpu1",mode="idle"} 11107.87 node_cpu{cpu="cpu1",mode="iowait"} 5.91 node_cpu{cpu="cpu1",mode="irq"} 0 node_cpu{cpu="cpu1",mode="nice"} 0.23 node_cpu{cpu="cpu1",mode="softirq"} 0.46 node_cpu{cpu="cpu1",mode="steal"} 0 node_cpu{cpu="cpu1",mode="system"} 164.74 node_cpu{cpu="cpu1",mode="user"} 478.69 node_cpu{cpu="cpu2",mode="guest"} 0 node_cpu{cpu="cpu2",mode="guest_nice"} 0 node_cpu{cpu="cpu2",mode="idle"} 11123.21 node_cpu{cpu="cpu2",mode="iowait"} 4.41 node_cpu{cpu="cpu2",mode="irq"} 0 node_cpu{cpu="cpu2",mode="nice"} 0.36 node_cpu{cpu="cpu2",mode="softirq"} 3.26 node_cpu{cpu="cpu2",mode="steal"} 0 node_cpu{cpu="cpu2",mode="system"} 159.16 node_cpu{cpu="cpu2",mode="user"} 465.04 node_cpu{cpu="cpu3",mode="guest"} 0 node_cpu{cpu="cpu3",mode="guest_nice"} 0 node_cpu{cpu="cpu3",mode="idle"} 11132.3 node_cpu{cpu="cpu3",mode="iowait"} 5.33 node_cpu{cpu="cpu3",mode="irq"} 0 node_cpu{cpu="cpu3",mode="nice"} 1.02 node_cpu{cpu="cpu3",mode="softirq"} 0.6 node_cpu{cpu="cpu3",mode="steal"} 0 node_cpu{cpu="cpu3",mode="system"} 156.83 node_cpu{cpu="cpu3",mode="user"} 470.54 node_cpu{cpu="cpu4",mode="guest"} 0 node_cpu{cpu="cpu4",mode="guest_nice"} 0 node_cpu{cpu="cpu4",mode="idle"} 11403.21 node_cpu{cpu="cpu4",mode="iowait"} 2.17 node_cpu{cpu="cpu4",mode="irq"} 0 node_cpu{cpu="cpu4",mode="nice"} 0.25 node_cpu{cpu="cpu4",mode="softirq"} 0.08 node_cpu{cpu="cpu4",mode="steal"} 0 node_cpu{cpu="cpu4",mode="system"} 107.76 node_cpu{cpu="cpu4",mode="user"} 284.13 node_cpu{cpu="cpu5",mode="guest"} 0 node_cpu{cpu="cpu5",mode="guest_nice"} 0 node_cpu{cpu="cpu5",mode="idle"} 11362.7 node_cpu{cpu="cpu5",mode="iowait"} 6.72 node_cpu{cpu="cpu5",mode="irq"} 0 node_cpu{cpu="cpu5",mode="nice"} 1.01 node_cpu{cpu="cpu5",mode="softirq"} 0.3 node_cpu{cpu="cpu5",mode="steal"} 0 node_cpu{cpu="cpu5",mode="system"} 115.86 node_cpu{cpu="cpu5",mode="user"} 292.71 node_cpu{cpu="cpu6",mode="guest"} 0 node_cpu{cpu="cpu6",mode="guest_nice"} 0 node_cpu{cpu="cpu6",mode="idle"} 11397.21 node_cpu{cpu="cpu6",mode="iowait"} 3.19 node_cpu{cpu="cpu6",mode="irq"} 0 node_cpu{cpu="cpu6",mode="nice"} 0.36 node_cpu{cpu="cpu6",mode="softirq"} 0.29 node_cpu{cpu="cpu6",mode="steal"} 0 node_cpu{cpu="cpu6",mode="system"} 102.76 node_cpu{cpu="cpu6",mode="user"} 291.52 node_cpu{cpu="cpu7",mode="guest"} 0 node_cpu{cpu="cpu7",mode="guest_nice"} 0 node_cpu{cpu="cpu7",mode="idle"} 11392.82 node_cpu{cpu="cpu7",mode="iowait"} 5.55 node_cpu{cpu="cpu7",mode="irq"} 0 node_cpu{cpu="cpu7",mode="nice"} 2.68 node_cpu{cpu="cpu7",mode="softirq"} 0.31 node_cpu{cpu="cpu7",mode="steal"} 0 node_cpu{cpu="cpu7",mode="system"} 101.64 node_cpu{cpu="cpu7",mode="user"} 290.98 # HELP node_cpu_core_throttles_total Number of times this cpu core has been throttled. # TYPE node_cpu_core_throttles_total counter node_cpu_core_throttles_total{cpu="cpu0"} 5 node_cpu_core_throttles_total{cpu="cpu1"} 0 node_cpu_core_throttles_total{cpu="cpu2"} 40 # HELP node_cpu_frequency_hertz Current cpu thread frequency in hertz. # TYPE node_cpu_frequency_hertz gauge node_cpu_frequency_hertz{cpu="cpu0"} 1.699981e+09 node_cpu_frequency_hertz{cpu="cpu1"} 1.699981e+09 node_cpu_frequency_hertz{cpu="cpu3"} 8e+06 # HELP node_cpu_frequency_max_hertz Maximum cpu thread frequency in hertz. # TYPE node_cpu_frequency_max_hertz gauge node_cpu_frequency_max_hertz{cpu="cpu0"} 3.7e+09 node_cpu_frequency_max_hertz{cpu="cpu1"} 3.7e+09 node_cpu_frequency_max_hertz{cpu="cpu3"} 4.2e+09 # HELP node_cpu_frequency_min_hertz Minimum cpu thread frequency in hertz. # TYPE node_cpu_frequency_min_hertz gauge node_cpu_frequency_min_hertz{cpu="cpu0"} 8e+08 node_cpu_frequency_min_hertz{cpu="cpu1"} 8e+08 node_cpu_frequency_min_hertz{cpu="cpu3"} 1e+06 # HELP node_cpu_package_throttles_total Number of times this cpu package has been throttled. # TYPE node_cpu_package_throttles_total counter node_cpu_package_throttles_total{node="0"} 30 # HELP node_disk_bytes_read The total number of bytes read successfully. # TYPE node_disk_bytes_read counter node_disk_bytes_read{device="dm-0"} 5.13708655616e+11 node_disk_bytes_read{device="dm-1"} 1.589248e+06 node_disk_bytes_read{device="dm-2"} 1.578752e+08 node_disk_bytes_read{device="dm-3"} 1.98144e+06 node_disk_bytes_read{device="dm-4"} 529408 node_disk_bytes_read{device="dm-5"} 4.3150848e+07 node_disk_bytes_read{device="mmcblk0"} 798720 node_disk_bytes_read{device="mmcblk0p1"} 81920 node_disk_bytes_read{device="mmcblk0p2"} 389120 node_disk_bytes_read{device="nvme0n1"} 2.377714176e+09 node_disk_bytes_read{device="sda"} 5.13713216512e+11 node_disk_bytes_read{device="sr0"} 0 node_disk_bytes_read{device="vda"} 1.6727491584e+10 # HELP node_disk_bytes_written The total number of bytes written successfully. # TYPE node_disk_bytes_written counter node_disk_bytes_written{device="dm-0"} 2.5891680256e+11 node_disk_bytes_written{device="dm-1"} 303104 node_disk_bytes_written{device="dm-2"} 2.607828992e+09 node_disk_bytes_written{device="dm-3"} 0 node_disk_bytes_written{device="dm-4"} 70144 node_disk_bytes_written{device="dm-5"} 5.89664256e+08 node_disk_bytes_written{device="mmcblk0"} 0 node_disk_bytes_written{device="mmcblk0p1"} 0 node_disk_bytes_written{device="mmcblk0p2"} 0 node_disk_bytes_written{device="nvme0n1"} 2.0199236096e+10 node_disk_bytes_written{device="sda"} 2.58916880384e+11 node_disk_bytes_written{device="sr0"} 0 node_disk_bytes_written{device="vda"} 1.0938236928e+11 # HELP node_disk_io_now The number of I/Os currently in progress. # TYPE node_disk_io_now gauge node_disk_io_now{device="dm-0"} 0 node_disk_io_now{device="dm-1"} 0 node_disk_io_now{device="dm-2"} 0 node_disk_io_now{device="dm-3"} 0 node_disk_io_now{device="dm-4"} 0 node_disk_io_now{device="dm-5"} 0 node_disk_io_now{device="mmcblk0"} 0 node_disk_io_now{device="mmcblk0p1"} 0 node_disk_io_now{device="mmcblk0p2"} 0 node_disk_io_now{device="nvme0n1"} 0 node_disk_io_now{device="sda"} 0 node_disk_io_now{device="sr0"} 0 node_disk_io_now{device="vda"} 0 # HELP node_disk_io_time_ms Total Milliseconds spent doing I/Os. # TYPE node_disk_io_time_ms counter node_disk_io_time_ms{device="dm-0"} 1.1325968e+07 node_disk_io_time_ms{device="dm-1"} 76 node_disk_io_time_ms{device="dm-2"} 65400 node_disk_io_time_ms{device="dm-3"} 16 node_disk_io_time_ms{device="dm-4"} 24 node_disk_io_time_ms{device="dm-5"} 58848 node_disk_io_time_ms{device="mmcblk0"} 136 node_disk_io_time_ms{device="mmcblk0p1"} 24 node_disk_io_time_ms{device="mmcblk0p2"} 68 node_disk_io_time_ms{device="nvme0n1"} 222766 node_disk_io_time_ms{device="sda"} 9.65388e+06 node_disk_io_time_ms{device="sr0"} 0 node_disk_io_time_ms{device="vda"} 4.1614592e+07 # HELP node_disk_io_time_weighted The weighted # of milliseconds spent doing I/Os. See https://www.kernel.org/doc/Documentation/iostats.txt. # TYPE node_disk_io_time_weighted counter node_disk_io_time_weighted{device="dm-0"} 1.206301256e+09 node_disk_io_time_weighted{device="dm-1"} 84 node_disk_io_time_weighted{device="dm-2"} 129416 node_disk_io_time_weighted{device="dm-3"} 104 node_disk_io_time_weighted{device="dm-4"} 44 node_disk_io_time_weighted{device="dm-5"} 105632 node_disk_io_time_weighted{device="mmcblk0"} 156 node_disk_io_time_weighted{device="mmcblk0p1"} 24 node_disk_io_time_weighted{device="mmcblk0p2"} 68 node_disk_io_time_weighted{device="nvme0n1"} 1.032546e+06 node_disk_io_time_weighted{device="sda"} 8.2621804e+07 node_disk_io_time_weighted{device="sr0"} 0 node_disk_io_time_weighted{device="vda"} 2.077872228e+09 # HELP node_disk_read_time_ms The total number of milliseconds spent by all reads. # TYPE node_disk_read_time_ms counter node_disk_read_time_ms{device="dm-0"} 4.6229572e+07 node_disk_read_time_ms{device="dm-1"} 84 node_disk_read_time_ms{device="dm-2"} 6536 node_disk_read_time_ms{device="dm-3"} 104 node_disk_read_time_ms{device="dm-4"} 28 node_disk_read_time_ms{device="dm-5"} 924 node_disk_read_time_ms{device="mmcblk0"} 156 node_disk_read_time_ms{device="mmcblk0p1"} 24 node_disk_read_time_ms{device="mmcblk0p2"} 68 node_disk_read_time_ms{device="nvme0n1"} 21650 node_disk_read_time_ms{device="sda"} 1.8492372e+07 node_disk_read_time_ms{device="sr0"} 0 node_disk_read_time_ms{device="vda"} 8.655768e+06 # HELP node_disk_reads_completed The total number of reads completed successfully. # TYPE node_disk_reads_completed counter node_disk_reads_completed{device="dm-0"} 5.9910002e+07 node_disk_reads_completed{device="dm-1"} 388 node_disk_reads_completed{device="dm-2"} 11571 node_disk_reads_completed{device="dm-3"} 3870 node_disk_reads_completed{device="dm-4"} 392 node_disk_reads_completed{device="dm-5"} 3729 node_disk_reads_completed{device="mmcblk0"} 192 node_disk_reads_completed{device="mmcblk0p1"} 17 node_disk_reads_completed{device="mmcblk0p2"} 95 node_disk_reads_completed{device="nvme0n1"} 47114 node_disk_reads_completed{device="sda"} 2.5354637e+07 node_disk_reads_completed{device="sr0"} 0 node_disk_reads_completed{device="vda"} 1.775784e+06 # HELP node_disk_reads_merged The total number of reads merged. See https://www.kernel.org/doc/Documentation/iostats.txt. # TYPE node_disk_reads_merged counter node_disk_reads_merged{device="dm-0"} 0 node_disk_reads_merged{device="dm-1"} 0 node_disk_reads_merged{device="dm-2"} 0 node_disk_reads_merged{device="dm-3"} 0 node_disk_reads_merged{device="dm-4"} 0 node_disk_reads_merged{device="dm-5"} 0 node_disk_reads_merged{device="mmcblk0"} 3 node_disk_reads_merged{device="mmcblk0p1"} 3 node_disk_reads_merged{device="mmcblk0p2"} 0 node_disk_reads_merged{device="nvme0n1"} 4 node_disk_reads_merged{device="sda"} 3.4367663e+07 node_disk_reads_merged{device="sr0"} 0 node_disk_reads_merged{device="vda"} 15386 # HELP node_disk_sectors_read The total number of sectors read successfully. # TYPE node_disk_sectors_read counter node_disk_sectors_read{device="dm-0"} 1.003337218e+09 node_disk_sectors_read{device="dm-1"} 3104 node_disk_sectors_read{device="dm-2"} 308350 node_disk_sectors_read{device="dm-3"} 3870 node_disk_sectors_read{device="dm-4"} 1034 node_disk_sectors_read{device="dm-5"} 84279 node_disk_sectors_read{device="mmcblk0"} 1560 node_disk_sectors_read{device="mmcblk0p1"} 160 node_disk_sectors_read{device="mmcblk0p2"} 760 node_disk_sectors_read{device="nvme0n1"} 4.643973e+06 node_disk_sectors_read{device="sda"} 1.003346126e+09 node_disk_sectors_read{device="sr0"} 0 node_disk_sectors_read{device="vda"} 3.2670882e+07 # HELP node_disk_sectors_written The total number of sectors written successfully. # TYPE node_disk_sectors_written counter node_disk_sectors_written{device="dm-0"} 5.0569688e+08 node_disk_sectors_written{device="dm-1"} 592 node_disk_sectors_written{device="dm-2"} 5.093416e+06 node_disk_sectors_written{device="dm-3"} 0 node_disk_sectors_written{device="dm-4"} 137 node_disk_sectors_written{device="dm-5"} 1.151688e+06 node_disk_sectors_written{device="mmcblk0"} 0 node_disk_sectors_written{device="mmcblk0p1"} 0 node_disk_sectors_written{device="mmcblk0p2"} 0 node_disk_sectors_written{device="nvme0n1"} 3.9451633e+07 node_disk_sectors_written{device="sda"} 5.05697032e+08 node_disk_sectors_written{device="sr0"} 0 node_disk_sectors_written{device="vda"} 2.1363744e+08 # HELP node_disk_write_time_ms This is the total number of milliseconds spent by all writes. # TYPE node_disk_write_time_ms counter node_disk_write_time_ms{device="dm-0"} 1.1585578e+09 node_disk_write_time_ms{device="dm-1"} 0 node_disk_write_time_ms{device="dm-2"} 122884 node_disk_write_time_ms{device="dm-3"} 0 node_disk_write_time_ms{device="dm-4"} 16 node_disk_write_time_ms{device="dm-5"} 104684 node_disk_write_time_ms{device="mmcblk0"} 0 node_disk_write_time_ms{device="mmcblk0p1"} 0 node_disk_write_time_ms{device="mmcblk0p2"} 0 node_disk_write_time_ms{device="nvme0n1"} 1.011053e+06 node_disk_write_time_ms{device="sda"} 6.387796e+07 node_disk_write_time_ms{device="sr0"} 0 node_disk_write_time_ms{device="vda"} 2.069221364e+09 # HELP node_disk_writes_completed The total number of writes completed successfully. # TYPE node_disk_writes_completed counter node_disk_writes_completed{device="dm-0"} 3.9231014e+07 node_disk_writes_completed{device="dm-1"} 74 node_disk_writes_completed{device="dm-2"} 153522 node_disk_writes_completed{device="dm-3"} 0 node_disk_writes_completed{device="dm-4"} 38 node_disk_writes_completed{device="dm-5"} 98918 node_disk_writes_completed{device="mmcblk0"} 0 node_disk_writes_completed{device="mmcblk0p1"} 0 node_disk_writes_completed{device="mmcblk0p2"} 0 node_disk_writes_completed{device="nvme0n1"} 1.07832e+06 node_disk_writes_completed{device="sda"} 2.8444756e+07 node_disk_writes_completed{device="sr0"} 0 node_disk_writes_completed{device="vda"} 6.038856e+06 # HELP node_disk_writes_merged The number of writes merged. See https://www.kernel.org/doc/Documentation/iostats.txt. # TYPE node_disk_writes_merged counter node_disk_writes_merged{device="dm-0"} 0 node_disk_writes_merged{device="dm-1"} 0 node_disk_writes_merged{device="dm-2"} 0 node_disk_writes_merged{device="dm-3"} 0 node_disk_writes_merged{device="dm-4"} 0 node_disk_writes_merged{device="dm-5"} 0 node_disk_writes_merged{device="mmcblk0"} 0 node_disk_writes_merged{device="mmcblk0p1"} 0 node_disk_writes_merged{device="mmcblk0p2"} 0 node_disk_writes_merged{device="nvme0n1"} 43950 node_disk_writes_merged{device="sda"} 1.1134226e+07 node_disk_writes_merged{device="sr0"} 0 node_disk_writes_merged{device="vda"} 2.0711856e+07 # HELP node_drbd_activitylog_writes_total Number of updates of the activity log area of the meta data. # TYPE node_drbd_activitylog_writes_total counter node_drbd_activitylog_writes_total{device="drbd1"} 1100 # HELP node_drbd_application_pending Number of block I/O requests forwarded to DRBD, but not yet answered by DRBD. # TYPE node_drbd_application_pending gauge node_drbd_application_pending{device="drbd1"} 12348 # HELP node_drbd_bitmap_writes_total Number of updates of the bitmap area of the meta data. # TYPE node_drbd_bitmap_writes_total counter node_drbd_bitmap_writes_total{device="drbd1"} 221 # HELP node_drbd_connected Whether DRBD is connected to the peer. # TYPE node_drbd_connected gauge node_drbd_connected{device="drbd1"} 1 # HELP node_drbd_disk_read_bytes_total Net data read from local hard disk; in bytes. # TYPE node_drbd_disk_read_bytes_total counter node_drbd_disk_read_bytes_total{device="drbd1"} 1.2154539008e+11 # HELP node_drbd_disk_state_is_up_to_date Whether the disk of the node is up to date. # TYPE node_drbd_disk_state_is_up_to_date gauge node_drbd_disk_state_is_up_to_date{device="drbd1",node="local"} 1 node_drbd_disk_state_is_up_to_date{device="drbd1",node="remote"} 1 # HELP node_drbd_disk_written_bytes_total Net data written on local hard disk; in bytes. # TYPE node_drbd_disk_written_bytes_total counter node_drbd_disk_written_bytes_total{device="drbd1"} 2.8941845504e+10 # HELP node_drbd_epochs Number of Epochs currently on the fly. # TYPE node_drbd_epochs gauge node_drbd_epochs{device="drbd1"} 1 # HELP node_drbd_local_pending Number of open requests to the local I/O sub-system. # TYPE node_drbd_local_pending gauge node_drbd_local_pending{device="drbd1"} 12345 # HELP node_drbd_network_received_bytes_total Total number of bytes received via the network. # TYPE node_drbd_network_received_bytes_total counter node_drbd_network_received_bytes_total{device="drbd1"} 1.0961011e+07 # HELP node_drbd_network_sent_bytes_total Total number of bytes sent via the network. # TYPE node_drbd_network_sent_bytes_total counter node_drbd_network_sent_bytes_total{device="drbd1"} 1.7740228608e+10 # HELP node_drbd_node_role_is_primary Whether the role of the node is in the primary state. # TYPE node_drbd_node_role_is_primary gauge node_drbd_node_role_is_primary{device="drbd1",node="local"} 1 node_drbd_node_role_is_primary{device="drbd1",node="remote"} 1 # HELP node_drbd_out_of_sync_bytes Amount of data known to be out of sync; in bytes. # TYPE node_drbd_out_of_sync_bytes gauge node_drbd_out_of_sync_bytes{device="drbd1"} 1.2645376e+07 # HELP node_drbd_remote_pending Number of requests sent to the peer, but that have not yet been answered by the latter. # TYPE node_drbd_remote_pending gauge node_drbd_remote_pending{device="drbd1"} 12346 # HELP node_drbd_remote_unacknowledged Number of requests received by the peer via the network connection, but that have not yet been answered. # TYPE node_drbd_remote_unacknowledged gauge node_drbd_remote_unacknowledged{device="drbd1"} 12347 # HELP node_edac_correctable_errors_total Total correctable memory errors. # TYPE node_edac_correctable_errors_total counter node_edac_correctable_errors_total{controller="0"} 1 # HELP node_edac_csrow_correctable_errors_total Total correctable memory errors for this csrow. # TYPE node_edac_csrow_correctable_errors_total counter node_edac_csrow_correctable_errors_total{controller="0",csrow="0"} 3 node_edac_csrow_correctable_errors_total{controller="0",csrow="unknown"} 2 # HELP node_edac_csrow_uncorrectable_errors_total Total uncorrectable memory errors for this csrow. # TYPE node_edac_csrow_uncorrectable_errors_total counter node_edac_csrow_uncorrectable_errors_total{controller="0",csrow="0"} 4 node_edac_csrow_uncorrectable_errors_total{controller="0",csrow="unknown"} 6 # HELP node_edac_uncorrectable_errors_total Total uncorrectable memory errors. # TYPE node_edac_uncorrectable_errors_total counter node_edac_uncorrectable_errors_total{controller="0"} 5 # HELP node_entropy_available_bits Bits of available entropy. # TYPE node_entropy_available_bits gauge node_entropy_available_bits 1337 # HELP node_exporter_build_info A metric with a constant '1' value labeled by version, revision, branch, and goversion from which node_exporter was built. # TYPE node_exporter_build_info gauge # HELP node_filefd_allocated File descriptor statistics: allocated. # TYPE node_filefd_allocated gauge node_filefd_allocated 1024 # HELP node_filefd_maximum File descriptor statistics: maximum. # TYPE node_filefd_maximum gauge node_filefd_maximum 1.631329e+06 # HELP node_forks Total number of forks. # TYPE node_forks counter node_forks 26442 # HELP node_hwmon_chip_names Annotation metric for human-readable chip names # TYPE node_hwmon_chip_names gauge node_hwmon_chip_names{chip="nct6779",chip_name="nct6779"} 1 node_hwmon_chip_names{chip="platform_coretemp_0",chip_name="coretemp"} 1 node_hwmon_chip_names{chip="platform_coretemp_1",chip_name="coretemp"} 1 # HELP node_hwmon_fan_alarm Hardware sensor alarm status (fan) # TYPE node_hwmon_fan_alarm gauge node_hwmon_fan_alarm{chip="nct6779",sensor="fan2"} 0 # HELP node_hwmon_fan_beep_enabled Hardware monitor sensor has beeping enabled # TYPE node_hwmon_fan_beep_enabled gauge node_hwmon_fan_beep_enabled{chip="nct6779",sensor="fan2"} 0 # HELP node_hwmon_fan_manual Hardware monitor fan element manual # TYPE node_hwmon_fan_manual gauge node_hwmon_fan_manual{chip="platform_applesmc_768",sensor="fan1"} 0 node_hwmon_fan_manual{chip="platform_applesmc_768",sensor="fan2"} 0 # HELP node_hwmon_fan_max_rpm Hardware monitor for fan revolutions per minute (max) # TYPE node_hwmon_fan_max_rpm gauge node_hwmon_fan_max_rpm{chip="platform_applesmc_768",sensor="fan1"} 6156 node_hwmon_fan_max_rpm{chip="platform_applesmc_768",sensor="fan2"} 5700 # HELP node_hwmon_fan_min_rpm Hardware monitor for fan revolutions per minute (min) # TYPE node_hwmon_fan_min_rpm gauge node_hwmon_fan_min_rpm{chip="nct6779",sensor="fan2"} 0 node_hwmon_fan_min_rpm{chip="platform_applesmc_768",sensor="fan1"} 2160 node_hwmon_fan_min_rpm{chip="platform_applesmc_768",sensor="fan2"} 2000 # HELP node_hwmon_fan_output Hardware monitor fan element output # TYPE node_hwmon_fan_output gauge node_hwmon_fan_output{chip="platform_applesmc_768",sensor="fan1"} 2160 node_hwmon_fan_output{chip="platform_applesmc_768",sensor="fan2"} 2000 # HELP node_hwmon_fan_pulses Hardware monitor fan element pulses # TYPE node_hwmon_fan_pulses gauge node_hwmon_fan_pulses{chip="nct6779",sensor="fan2"} 2 # HELP node_hwmon_fan_rpm Hardware monitor for fan revolutions per minute (input) # TYPE node_hwmon_fan_rpm gauge node_hwmon_fan_rpm{chip="nct6779",sensor="fan2"} 1098 node_hwmon_fan_rpm{chip="platform_applesmc_768",sensor="fan1"} 0 node_hwmon_fan_rpm{chip="platform_applesmc_768",sensor="fan2"} 1998 # HELP node_hwmon_fan_target_rpm Hardware monitor for fan revolutions per minute (target) # TYPE node_hwmon_fan_target_rpm gauge node_hwmon_fan_target_rpm{chip="nct6779",sensor="fan2"} 27000 # HELP node_hwmon_fan_tolerance Hardware monitor fan element tolerance # TYPE node_hwmon_fan_tolerance gauge node_hwmon_fan_tolerance{chip="nct6779",sensor="fan2"} 0 # HELP node_hwmon_in_alarm Hardware sensor alarm status (in) # TYPE node_hwmon_in_alarm gauge node_hwmon_in_alarm{chip="nct6779",sensor="in0"} 0 node_hwmon_in_alarm{chip="nct6779",sensor="in1"} 1 # HELP node_hwmon_in_beep_enabled Hardware monitor sensor has beeping enabled # TYPE node_hwmon_in_beep_enabled gauge node_hwmon_in_beep_enabled{chip="nct6779",sensor="in0"} 0 node_hwmon_in_beep_enabled{chip="nct6779",sensor="in1"} 0 # HELP node_hwmon_in_max_volts Hardware monitor for voltage (max) # TYPE node_hwmon_in_max_volts gauge node_hwmon_in_max_volts{chip="nct6779",sensor="in0"} 1.744 node_hwmon_in_max_volts{chip="nct6779",sensor="in1"} 0 # HELP node_hwmon_in_min_volts Hardware monitor for voltage (min) # TYPE node_hwmon_in_min_volts gauge node_hwmon_in_min_volts{chip="nct6779",sensor="in0"} 0 node_hwmon_in_min_volts{chip="nct6779",sensor="in1"} 0 # HELP node_hwmon_in_volts Hardware monitor for voltage (input) # TYPE node_hwmon_in_volts gauge node_hwmon_in_volts{chip="nct6779",sensor="in0"} 0.792 node_hwmon_in_volts{chip="nct6779",sensor="in1"} 1.024 # HELP node_hwmon_intrusion_alarm Hardware sensor alarm status (intrusion) # TYPE node_hwmon_intrusion_alarm gauge node_hwmon_intrusion_alarm{chip="nct6779",sensor="intrusion0"} 1 node_hwmon_intrusion_alarm{chip="nct6779",sensor="intrusion1"} 1 # HELP node_hwmon_intrusion_beep_enabled Hardware monitor sensor has beeping enabled # TYPE node_hwmon_intrusion_beep_enabled gauge node_hwmon_intrusion_beep_enabled{chip="nct6779",sensor="intrusion0"} 0 node_hwmon_intrusion_beep_enabled{chip="nct6779",sensor="intrusion1"} 0 # HELP node_hwmon_pwm_auto_point1_pwm Hardware monitor pwm element auto_point1_pwm # TYPE node_hwmon_pwm_auto_point1_pwm gauge node_hwmon_pwm_auto_point1_pwm{chip="nct6779",sensor="pwm1"} 153 # HELP node_hwmon_pwm_auto_point1_temp Hardware monitor pwm element auto_point1_temp # TYPE node_hwmon_pwm_auto_point1_temp gauge node_hwmon_pwm_auto_point1_temp{chip="nct6779",sensor="pwm1"} 30000 # HELP node_hwmon_pwm_auto_point2_pwm Hardware monitor pwm element auto_point2_pwm # TYPE node_hwmon_pwm_auto_point2_pwm gauge node_hwmon_pwm_auto_point2_pwm{chip="nct6779",sensor="pwm1"} 255 # HELP node_hwmon_pwm_auto_point2_temp Hardware monitor pwm element auto_point2_temp # TYPE node_hwmon_pwm_auto_point2_temp gauge node_hwmon_pwm_auto_point2_temp{chip="nct6779",sensor="pwm1"} 70000 # HELP node_hwmon_pwm_auto_point3_pwm Hardware monitor pwm element auto_point3_pwm # TYPE node_hwmon_pwm_auto_point3_pwm gauge node_hwmon_pwm_auto_point3_pwm{chip="nct6779",sensor="pwm1"} 255 # HELP node_hwmon_pwm_auto_point3_temp Hardware monitor pwm element auto_point3_temp # TYPE node_hwmon_pwm_auto_point3_temp gauge node_hwmon_pwm_auto_point3_temp{chip="nct6779",sensor="pwm1"} 70000 # HELP node_hwmon_pwm_auto_point4_pwm Hardware monitor pwm element auto_point4_pwm # TYPE node_hwmon_pwm_auto_point4_pwm gauge node_hwmon_pwm_auto_point4_pwm{chip="nct6779",sensor="pwm1"} 255 # HELP node_hwmon_pwm_auto_point4_temp Hardware monitor pwm element auto_point4_temp # TYPE node_hwmon_pwm_auto_point4_temp gauge node_hwmon_pwm_auto_point4_temp{chip="nct6779",sensor="pwm1"} 70000 # HELP node_hwmon_pwm_auto_point5_pwm Hardware monitor pwm element auto_point5_pwm # TYPE node_hwmon_pwm_auto_point5_pwm gauge node_hwmon_pwm_auto_point5_pwm{chip="nct6779",sensor="pwm1"} 255 # HELP node_hwmon_pwm_auto_point5_temp Hardware monitor pwm element auto_point5_temp # TYPE node_hwmon_pwm_auto_point5_temp gauge node_hwmon_pwm_auto_point5_temp{chip="nct6779",sensor="pwm1"} 75000 # HELP node_hwmon_pwm_crit_temp_tolerance Hardware monitor pwm element crit_temp_tolerance # TYPE node_hwmon_pwm_crit_temp_tolerance gauge node_hwmon_pwm_crit_temp_tolerance{chip="nct6779",sensor="pwm1"} 2000 # HELP node_hwmon_pwm_enable Hardware monitor pwm element enable # TYPE node_hwmon_pwm_enable gauge node_hwmon_pwm_enable{chip="nct6779",sensor="pwm1"} 5 # HELP node_hwmon_pwm_floor Hardware monitor pwm element floor # TYPE node_hwmon_pwm_floor gauge node_hwmon_pwm_floor{chip="nct6779",sensor="pwm1"} 1 # HELP node_hwmon_pwm_mode Hardware monitor pwm element mode # TYPE node_hwmon_pwm_mode gauge node_hwmon_pwm_mode{chip="nct6779",sensor="pwm1"} 1 # HELP node_hwmon_pwm_start Hardware monitor pwm element start # TYPE node_hwmon_pwm_start gauge node_hwmon_pwm_start{chip="nct6779",sensor="pwm1"} 1 # HELP node_hwmon_pwm_step_down_time Hardware monitor pwm element step_down_time # TYPE node_hwmon_pwm_step_down_time gauge node_hwmon_pwm_step_down_time{chip="nct6779",sensor="pwm1"} 100 # HELP node_hwmon_pwm_step_up_time Hardware monitor pwm element step_up_time # TYPE node_hwmon_pwm_step_up_time gauge node_hwmon_pwm_step_up_time{chip="nct6779",sensor="pwm1"} 100 # HELP node_hwmon_pwm_stop_time Hardware monitor pwm element stop_time # TYPE node_hwmon_pwm_stop_time gauge node_hwmon_pwm_stop_time{chip="nct6779",sensor="pwm1"} 6000 # HELP node_hwmon_pwm_target_temp Hardware monitor pwm element target_temp # TYPE node_hwmon_pwm_target_temp gauge node_hwmon_pwm_target_temp{chip="nct6779",sensor="pwm1"} 0 # HELP node_hwmon_pwm_temp_sel Hardware monitor pwm element temp_sel # TYPE node_hwmon_pwm_temp_sel gauge node_hwmon_pwm_temp_sel{chip="nct6779",sensor="pwm1"} 7 # HELP node_hwmon_pwm_temp_tolerance Hardware monitor pwm element temp_tolerance # TYPE node_hwmon_pwm_temp_tolerance gauge node_hwmon_pwm_temp_tolerance{chip="nct6779",sensor="pwm1"} 0 # HELP node_hwmon_pwm_weight_duty_base Hardware monitor pwm element weight_duty_base # TYPE node_hwmon_pwm_weight_duty_base gauge node_hwmon_pwm_weight_duty_base{chip="nct6779",sensor="pwm1"} 0 # HELP node_hwmon_pwm_weight_duty_step Hardware monitor pwm element weight_duty_step # TYPE node_hwmon_pwm_weight_duty_step gauge node_hwmon_pwm_weight_duty_step{chip="nct6779",sensor="pwm1"} 0 # HELP node_hwmon_pwm_weight_temp_sel Hardware monitor pwm element weight_temp_sel # TYPE node_hwmon_pwm_weight_temp_sel gauge node_hwmon_pwm_weight_temp_sel{chip="nct6779",sensor="pwm1"} 1 # HELP node_hwmon_pwm_weight_temp_step Hardware monitor pwm element weight_temp_step # TYPE node_hwmon_pwm_weight_temp_step gauge node_hwmon_pwm_weight_temp_step{chip="nct6779",sensor="pwm1"} 0 # HELP node_hwmon_pwm_weight_temp_step_base Hardware monitor pwm element weight_temp_step_base # TYPE node_hwmon_pwm_weight_temp_step_base gauge node_hwmon_pwm_weight_temp_step_base{chip="nct6779",sensor="pwm1"} 0 # HELP node_hwmon_pwm_weight_temp_step_tol Hardware monitor pwm element weight_temp_step_tol # TYPE node_hwmon_pwm_weight_temp_step_tol gauge node_hwmon_pwm_weight_temp_step_tol{chip="nct6779",sensor="pwm1"} 0 # HELP node_hwmon_sensor_label Label for given chip and sensor # TYPE node_hwmon_sensor_label gauge node_hwmon_sensor_label{chip="hwmon4",label="foosensor",sensor="temp1"} 1 node_hwmon_sensor_label{chip="hwmon4",label="foosensor",sensor="temp2"} 1 node_hwmon_sensor_label{chip="platform_applesmc_768",label="left_side",sensor="fan1"} 1 node_hwmon_sensor_label{chip="platform_applesmc_768",label="right_side",sensor="fan2"} 1 node_hwmon_sensor_label{chip="platform_coretemp_0",label="core_0",sensor="temp2"} 1 node_hwmon_sensor_label{chip="platform_coretemp_0",label="core_1",sensor="temp3"} 1 node_hwmon_sensor_label{chip="platform_coretemp_0",label="core_2",sensor="temp4"} 1 node_hwmon_sensor_label{chip="platform_coretemp_0",label="core_3",sensor="temp5"} 1 node_hwmon_sensor_label{chip="platform_coretemp_0",label="physical_id_0",sensor="temp1"} 1 node_hwmon_sensor_label{chip="platform_coretemp_1",label="core_0",sensor="temp2"} 1 node_hwmon_sensor_label{chip="platform_coretemp_1",label="core_1",sensor="temp3"} 1 node_hwmon_sensor_label{chip="platform_coretemp_1",label="core_2",sensor="temp4"} 1 node_hwmon_sensor_label{chip="platform_coretemp_1",label="core_3",sensor="temp5"} 1 node_hwmon_sensor_label{chip="platform_coretemp_1",label="physical_id_0",sensor="temp1"} 1 # HELP node_hwmon_temp_celsius Hardware monitor for temperature (input) # TYPE node_hwmon_temp_celsius gauge node_hwmon_temp_celsius{chip="hwmon4",sensor="temp1"} 55 node_hwmon_temp_celsius{chip="hwmon4",sensor="temp2"} 54 node_hwmon_temp_celsius{chip="platform_coretemp_0",sensor="temp1"} 55 node_hwmon_temp_celsius{chip="platform_coretemp_0",sensor="temp2"} 54 node_hwmon_temp_celsius{chip="platform_coretemp_0",sensor="temp3"} 52 node_hwmon_temp_celsius{chip="platform_coretemp_0",sensor="temp4"} 53 node_hwmon_temp_celsius{chip="platform_coretemp_0",sensor="temp5"} 50 node_hwmon_temp_celsius{chip="platform_coretemp_1",sensor="temp1"} 55 node_hwmon_temp_celsius{chip="platform_coretemp_1",sensor="temp2"} 54 node_hwmon_temp_celsius{chip="platform_coretemp_1",sensor="temp3"} 52 node_hwmon_temp_celsius{chip="platform_coretemp_1",sensor="temp4"} 53 node_hwmon_temp_celsius{chip="platform_coretemp_1",sensor="temp5"} 50 # HELP node_hwmon_temp_crit_alarm_celsius Hardware monitor for temperature (crit_alarm) # TYPE node_hwmon_temp_crit_alarm_celsius gauge node_hwmon_temp_crit_alarm_celsius{chip="hwmon4",sensor="temp1"} 0 node_hwmon_temp_crit_alarm_celsius{chip="hwmon4",sensor="temp2"} 0 node_hwmon_temp_crit_alarm_celsius{chip="platform_coretemp_0",sensor="temp1"} 0 node_hwmon_temp_crit_alarm_celsius{chip="platform_coretemp_0",sensor="temp2"} 0 node_hwmon_temp_crit_alarm_celsius{chip="platform_coretemp_0",sensor="temp3"} 0 node_hwmon_temp_crit_alarm_celsius{chip="platform_coretemp_0",sensor="temp4"} 0 node_hwmon_temp_crit_alarm_celsius{chip="platform_coretemp_0",sensor="temp5"} 0 node_hwmon_temp_crit_alarm_celsius{chip="platform_coretemp_1",sensor="temp1"} 0 node_hwmon_temp_crit_alarm_celsius{chip="platform_coretemp_1",sensor="temp2"} 0 node_hwmon_temp_crit_alarm_celsius{chip="platform_coretemp_1",sensor="temp3"} 0 node_hwmon_temp_crit_alarm_celsius{chip="platform_coretemp_1",sensor="temp4"} 0 node_hwmon_temp_crit_alarm_celsius{chip="platform_coretemp_1",sensor="temp5"} 0 # HELP node_hwmon_temp_crit_celsius Hardware monitor for temperature (crit) # TYPE node_hwmon_temp_crit_celsius gauge node_hwmon_temp_crit_celsius{chip="hwmon4",sensor="temp1"} 100 node_hwmon_temp_crit_celsius{chip="hwmon4",sensor="temp2"} 100 node_hwmon_temp_crit_celsius{chip="platform_coretemp_0",sensor="temp1"} 100 node_hwmon_temp_crit_celsius{chip="platform_coretemp_0",sensor="temp2"} 100 node_hwmon_temp_crit_celsius{chip="platform_coretemp_0",sensor="temp3"} 100 node_hwmon_temp_crit_celsius{chip="platform_coretemp_0",sensor="temp4"} 100 node_hwmon_temp_crit_celsius{chip="platform_coretemp_0",sensor="temp5"} 100 node_hwmon_temp_crit_celsius{chip="platform_coretemp_1",sensor="temp1"} 100 node_hwmon_temp_crit_celsius{chip="platform_coretemp_1",sensor="temp2"} 100 node_hwmon_temp_crit_celsius{chip="platform_coretemp_1",sensor="temp3"} 100 node_hwmon_temp_crit_celsius{chip="platform_coretemp_1",sensor="temp4"} 100 node_hwmon_temp_crit_celsius{chip="platform_coretemp_1",sensor="temp5"} 100 # HELP node_hwmon_temp_max_celsius Hardware monitor for temperature (max) # TYPE node_hwmon_temp_max_celsius gauge node_hwmon_temp_max_celsius{chip="hwmon4",sensor="temp1"} 100 node_hwmon_temp_max_celsius{chip="hwmon4",sensor="temp2"} 100 node_hwmon_temp_max_celsius{chip="platform_coretemp_0",sensor="temp1"} 84 node_hwmon_temp_max_celsius{chip="platform_coretemp_0",sensor="temp2"} 84 node_hwmon_temp_max_celsius{chip="platform_coretemp_0",sensor="temp3"} 84 node_hwmon_temp_max_celsius{chip="platform_coretemp_0",sensor="temp4"} 84 node_hwmon_temp_max_celsius{chip="platform_coretemp_0",sensor="temp5"} 84 node_hwmon_temp_max_celsius{chip="platform_coretemp_1",sensor="temp1"} 84 node_hwmon_temp_max_celsius{chip="platform_coretemp_1",sensor="temp2"} 84 node_hwmon_temp_max_celsius{chip="platform_coretemp_1",sensor="temp3"} 84 node_hwmon_temp_max_celsius{chip="platform_coretemp_1",sensor="temp4"} 84 node_hwmon_temp_max_celsius{chip="platform_coretemp_1",sensor="temp5"} 84 # HELP node_infiniband_legacy_data_received_bytes_total Number of data octets received on all links # TYPE node_infiniband_legacy_data_received_bytes_total counter node_infiniband_legacy_data_received_bytes_total{device="mlx4_0",port="1"} 1.8527668e+07 node_infiniband_legacy_data_received_bytes_total{device="mlx4_0",port="2"} 1.8527668e+07 # HELP node_infiniband_legacy_data_transmitted_bytes_total Number of data octets transmitted on all links # TYPE node_infiniband_legacy_data_transmitted_bytes_total counter node_infiniband_legacy_data_transmitted_bytes_total{device="mlx4_0",port="1"} 1.493376e+07 node_infiniband_legacy_data_transmitted_bytes_total{device="mlx4_0",port="2"} 1.493376e+07 # HELP node_infiniband_legacy_multicast_packets_received_total Number of multicast packets received # TYPE node_infiniband_legacy_multicast_packets_received_total counter node_infiniband_legacy_multicast_packets_received_total{device="mlx4_0",port="1"} 93 node_infiniband_legacy_multicast_packets_received_total{device="mlx4_0",port="2"} 93 # HELP node_infiniband_legacy_multicast_packets_transmitted_total Number of multicast packets transmitted # TYPE node_infiniband_legacy_multicast_packets_transmitted_total counter node_infiniband_legacy_multicast_packets_transmitted_total{device="mlx4_0",port="1"} 16 node_infiniband_legacy_multicast_packets_transmitted_total{device="mlx4_0",port="2"} 16 # HELP node_infiniband_legacy_packets_received_total Number of data packets received on all links # TYPE node_infiniband_legacy_packets_received_total counter node_infiniband_legacy_packets_received_total{device="mlx4_0",port="1"} 0 node_infiniband_legacy_packets_received_total{device="mlx4_0",port="2"} 0 # HELP node_infiniband_legacy_packets_transmitted_total Number of data packets received on all links # TYPE node_infiniband_legacy_packets_transmitted_total counter node_infiniband_legacy_packets_transmitted_total{device="mlx4_0",port="1"} 0 node_infiniband_legacy_packets_transmitted_total{device="mlx4_0",port="2"} 0 # HELP node_infiniband_legacy_unicast_packets_received_total Number of unicast packets received # TYPE node_infiniband_legacy_unicast_packets_received_total counter node_infiniband_legacy_unicast_packets_received_total{device="mlx4_0",port="1"} 61148 node_infiniband_legacy_unicast_packets_received_total{device="mlx4_0",port="2"} 61148 # HELP node_infiniband_legacy_unicast_packets_transmitted_total Number of unicast packets transmitted # TYPE node_infiniband_legacy_unicast_packets_transmitted_total counter node_infiniband_legacy_unicast_packets_transmitted_total{device="mlx4_0",port="1"} 61239 node_infiniband_legacy_unicast_packets_transmitted_total{device="mlx4_0",port="2"} 61239 # HELP node_infiniband_link_downed_total Number of times the link failed to recover from an error state and went down # TYPE node_infiniband_link_downed_total counter node_infiniband_link_downed_total{device="mlx4_0",port="1"} 0 node_infiniband_link_downed_total{device="mlx4_0",port="2"} 0 # HELP node_infiniband_link_error_recovery_total Number of times the link successfully recovered from an error state # TYPE node_infiniband_link_error_recovery_total counter node_infiniband_link_error_recovery_total{device="mlx4_0",port="1"} 0 node_infiniband_link_error_recovery_total{device="mlx4_0",port="2"} 0 # HELP node_infiniband_multicast_packets_received_total Number of multicast packets received (including errors) # TYPE node_infiniband_multicast_packets_received_total counter node_infiniband_multicast_packets_received_total{device="mlx4_0",port="1"} 93 node_infiniband_multicast_packets_received_total{device="mlx4_0",port="2"} 0 # HELP node_infiniband_multicast_packets_transmitted_total Number of multicast packets transmitted (including errors) # TYPE node_infiniband_multicast_packets_transmitted_total counter node_infiniband_multicast_packets_transmitted_total{device="mlx4_0",port="1"} 16 node_infiniband_multicast_packets_transmitted_total{device="mlx4_0",port="2"} 0 # HELP node_infiniband_port_data_received_bytes Number of data octets received on all links # TYPE node_infiniband_port_data_received_bytes counter node_infiniband_port_data_received_bytes{device="mlx4_0",port="1"} 1.8527668e+07 node_infiniband_port_data_received_bytes{device="mlx4_0",port="2"} 0 # HELP node_infiniband_port_data_transmitted_bytes Number of data octets transmitted on all links # TYPE node_infiniband_port_data_transmitted_bytes counter node_infiniband_port_data_transmitted_bytes{device="mlx4_0",port="1"} 1.493376e+07 node_infiniband_port_data_transmitted_bytes{device="mlx4_0",port="2"} 0 # HELP node_infiniband_unicast_packets_received_total Number of unicast packets received (including errors) # TYPE node_infiniband_unicast_packets_received_total counter node_infiniband_unicast_packets_received_total{device="mlx4_0",port="1"} 61148 node_infiniband_unicast_packets_received_total{device="mlx4_0",port="2"} 0 # HELP node_infiniband_unicast_packets_transmitted_total Number of unicast packets transmitted (including errors) # TYPE node_infiniband_unicast_packets_transmitted_total counter node_infiniband_unicast_packets_transmitted_total{device="mlx4_0",port="1"} 61239 node_infiniband_unicast_packets_transmitted_total{device="mlx4_0",port="2"} 0 # HELP node_interrupts Interrupt details. # TYPE node_interrupts counter node_interrupts{CPU="0",devices="",info="APIC ICR read retries",type="RTR"} 0 node_interrupts{CPU="0",devices="",info="Function call interrupts",type="CAL"} 148554 node_interrupts{CPU="0",devices="",info="IRQ work interrupts",type="IWI"} 1.509379e+06 node_interrupts{CPU="0",devices="",info="Local timer interrupts",type="LOC"} 1.74326351e+08 node_interrupts{CPU="0",devices="",info="Machine check exceptions",type="MCE"} 0 node_interrupts{CPU="0",devices="",info="Machine check polls",type="MCP"} 2406 node_interrupts{CPU="0",devices="",info="Non-maskable interrupts",type="NMI"} 47 node_interrupts{CPU="0",devices="",info="Performance monitoring interrupts",type="PMI"} 47 node_interrupts{CPU="0",devices="",info="Rescheduling interrupts",type="RES"} 1.0847134e+07 node_interrupts{CPU="0",devices="",info="Spurious interrupts",type="SPU"} 0 node_interrupts{CPU="0",devices="",info="TLB shootdowns",type="TLB"} 1.0460334e+07 node_interrupts{CPU="0",devices="",info="Thermal event interrupts",type="TRM"} 0 node_interrupts{CPU="0",devices="",info="Threshold APIC interrupts",type="THR"} 0 node_interrupts{CPU="0",devices="acpi",info="IR-IO-APIC-fasteoi",type="9"} 398553 node_interrupts{CPU="0",devices="ahci",info="IR-PCI-MSI-edge",type="43"} 7.434032e+06 node_interrupts{CPU="0",devices="dmar0",info="DMAR_MSI-edge",type="40"} 0 node_interrupts{CPU="0",devices="dmar1",info="DMAR_MSI-edge",type="41"} 0 node_interrupts{CPU="0",devices="ehci_hcd:usb1, mmc0",info="IR-IO-APIC-fasteoi",type="16"} 328511 node_interrupts{CPU="0",devices="ehci_hcd:usb2",info="IR-IO-APIC-fasteoi",type="23"} 1.451445e+06 node_interrupts{CPU="0",devices="i8042",info="IR-IO-APIC-edge",type="1"} 17960 node_interrupts{CPU="0",devices="i8042",info="IR-IO-APIC-edge",type="12"} 380847 node_interrupts{CPU="0",devices="i915",info="IR-PCI-MSI-edge",type="44"} 140636 node_interrupts{CPU="0",devices="iwlwifi",info="IR-PCI-MSI-edge",type="46"} 4.3078464e+07 node_interrupts{CPU="0",devices="mei_me",info="IR-PCI-MSI-edge",type="45"} 4 node_interrupts{CPU="0",devices="rtc0",info="IR-IO-APIC-edge",type="8"} 1 node_interrupts{CPU="0",devices="snd_hda_intel",info="IR-PCI-MSI-edge",type="47"} 350 node_interrupts{CPU="0",devices="timer",info="IR-IO-APIC-edge",type="0"} 18 node_interrupts{CPU="0",devices="xhci_hcd",info="IR-PCI-MSI-edge",type="42"} 378324 node_interrupts{CPU="1",devices="",info="APIC ICR read retries",type="RTR"} 0 node_interrupts{CPU="1",devices="",info="Function call interrupts",type="CAL"} 157441 node_interrupts{CPU="1",devices="",info="IRQ work interrupts",type="IWI"} 2.411776e+06 node_interrupts{CPU="1",devices="",info="Local timer interrupts",type="LOC"} 1.35776678e+08 node_interrupts{CPU="1",devices="",info="Machine check exceptions",type="MCE"} 0 node_interrupts{CPU="1",devices="",info="Machine check polls",type="MCP"} 2399 node_interrupts{CPU="1",devices="",info="Non-maskable interrupts",type="NMI"} 5031 node_interrupts{CPU="1",devices="",info="Performance monitoring interrupts",type="PMI"} 5031 node_interrupts{CPU="1",devices="",info="Rescheduling interrupts",type="RES"} 9.111507e+06 node_interrupts{CPU="1",devices="",info="Spurious interrupts",type="SPU"} 0 node_interrupts{CPU="1",devices="",info="TLB shootdowns",type="TLB"} 9.918429e+06 node_interrupts{CPU="1",devices="",info="Thermal event interrupts",type="TRM"} 0 node_interrupts{CPU="1",devices="",info="Threshold APIC interrupts",type="THR"} 0 node_interrupts{CPU="1",devices="acpi",info="IR-IO-APIC-fasteoi",type="9"} 2320 node_interrupts{CPU="1",devices="ahci",info="IR-PCI-MSI-edge",type="43"} 8.092205e+06 node_interrupts{CPU="1",devices="dmar0",info="DMAR_MSI-edge",type="40"} 0 node_interrupts{CPU="1",devices="dmar1",info="DMAR_MSI-edge",type="41"} 0 node_interrupts{CPU="1",devices="ehci_hcd:usb1, mmc0",info="IR-IO-APIC-fasteoi",type="16"} 322879 node_interrupts{CPU="1",devices="ehci_hcd:usb2",info="IR-IO-APIC-fasteoi",type="23"} 3.333499e+06 node_interrupts{CPU="1",devices="i8042",info="IR-IO-APIC-edge",type="1"} 105 node_interrupts{CPU="1",devices="i8042",info="IR-IO-APIC-edge",type="12"} 1021 node_interrupts{CPU="1",devices="i915",info="IR-PCI-MSI-edge",type="44"} 226313 node_interrupts{CPU="1",devices="iwlwifi",info="IR-PCI-MSI-edge",type="46"} 130 node_interrupts{CPU="1",devices="mei_me",info="IR-PCI-MSI-edge",type="45"} 22 node_interrupts{CPU="1",devices="rtc0",info="IR-IO-APIC-edge",type="8"} 0 node_interrupts{CPU="1",devices="snd_hda_intel",info="IR-PCI-MSI-edge",type="47"} 224 node_interrupts{CPU="1",devices="timer",info="IR-IO-APIC-edge",type="0"} 0 node_interrupts{CPU="1",devices="xhci_hcd",info="IR-PCI-MSI-edge",type="42"} 1.734637e+06 node_interrupts{CPU="2",devices="",info="APIC ICR read retries",type="RTR"} 0 node_interrupts{CPU="2",devices="",info="Function call interrupts",type="CAL"} 142912 node_interrupts{CPU="2",devices="",info="IRQ work interrupts",type="IWI"} 1.512975e+06 node_interrupts{CPU="2",devices="",info="Local timer interrupts",type="LOC"} 1.68393257e+08 node_interrupts{CPU="2",devices="",info="Machine check exceptions",type="MCE"} 0 node_interrupts{CPU="2",devices="",info="Machine check polls",type="MCP"} 2399 node_interrupts{CPU="2",devices="",info="Non-maskable interrupts",type="NMI"} 6211 node_interrupts{CPU="2",devices="",info="Performance monitoring interrupts",type="PMI"} 6211 node_interrupts{CPU="2",devices="",info="Rescheduling interrupts",type="RES"} 1.5999335e+07 node_interrupts{CPU="2",devices="",info="Spurious interrupts",type="SPU"} 0 node_interrupts{CPU="2",devices="",info="TLB shootdowns",type="TLB"} 1.0494258e+07 node_interrupts{CPU="2",devices="",info="Thermal event interrupts",type="TRM"} 0 node_interrupts{CPU="2",devices="",info="Threshold APIC interrupts",type="THR"} 0 node_interrupts{CPU="2",devices="acpi",info="IR-IO-APIC-fasteoi",type="9"} 824 node_interrupts{CPU="2",devices="ahci",info="IR-PCI-MSI-edge",type="43"} 6.478877e+06 node_interrupts{CPU="2",devices="dmar0",info="DMAR_MSI-edge",type="40"} 0 node_interrupts{CPU="2",devices="dmar1",info="DMAR_MSI-edge",type="41"} 0 node_interrupts{CPU="2",devices="ehci_hcd:usb1, mmc0",info="IR-IO-APIC-fasteoi",type="16"} 293782 node_interrupts{CPU="2",devices="ehci_hcd:usb2",info="IR-IO-APIC-fasteoi",type="23"} 1.092032e+06 node_interrupts{CPU="2",devices="i8042",info="IR-IO-APIC-edge",type="1"} 28 node_interrupts{CPU="2",devices="i8042",info="IR-IO-APIC-edge",type="12"} 240 node_interrupts{CPU="2",devices="i915",info="IR-PCI-MSI-edge",type="44"} 347 node_interrupts{CPU="2",devices="iwlwifi",info="IR-PCI-MSI-edge",type="46"} 460171 node_interrupts{CPU="2",devices="mei_me",info="IR-PCI-MSI-edge",type="45"} 0 node_interrupts{CPU="2",devices="rtc0",info="IR-IO-APIC-edge",type="8"} 0 node_interrupts{CPU="2",devices="snd_hda_intel",info="IR-PCI-MSI-edge",type="47"} 0 node_interrupts{CPU="2",devices="timer",info="IR-IO-APIC-edge",type="0"} 0 node_interrupts{CPU="2",devices="xhci_hcd",info="IR-PCI-MSI-edge",type="42"} 440240 node_interrupts{CPU="3",devices="",info="APIC ICR read retries",type="RTR"} 0 node_interrupts{CPU="3",devices="",info="Function call interrupts",type="CAL"} 155528 node_interrupts{CPU="3",devices="",info="IRQ work interrupts",type="IWI"} 2.428828e+06 node_interrupts{CPU="3",devices="",info="Local timer interrupts",type="LOC"} 1.30980079e+08 node_interrupts{CPU="3",devices="",info="Machine check exceptions",type="MCE"} 0 node_interrupts{CPU="3",devices="",info="Machine check polls",type="MCP"} 2399 node_interrupts{CPU="3",devices="",info="Non-maskable interrupts",type="NMI"} 4968 node_interrupts{CPU="3",devices="",info="Performance monitoring interrupts",type="PMI"} 4968 node_interrupts{CPU="3",devices="",info="Rescheduling interrupts",type="RES"} 7.45726e+06 node_interrupts{CPU="3",devices="",info="Spurious interrupts",type="SPU"} 0 node_interrupts{CPU="3",devices="",info="TLB shootdowns",type="TLB"} 1.0345022e+07 node_interrupts{CPU="3",devices="",info="Thermal event interrupts",type="TRM"} 0 node_interrupts{CPU="3",devices="",info="Threshold APIC interrupts",type="THR"} 0 node_interrupts{CPU="3",devices="acpi",info="IR-IO-APIC-fasteoi",type="9"} 863 node_interrupts{CPU="3",devices="ahci",info="IR-PCI-MSI-edge",type="43"} 7.492252e+06 node_interrupts{CPU="3",devices="dmar0",info="DMAR_MSI-edge",type="40"} 0 node_interrupts{CPU="3",devices="dmar1",info="DMAR_MSI-edge",type="41"} 0 node_interrupts{CPU="3",devices="ehci_hcd:usb1, mmc0",info="IR-IO-APIC-fasteoi",type="16"} 351412 node_interrupts{CPU="3",devices="ehci_hcd:usb2",info="IR-IO-APIC-fasteoi",type="23"} 2.644609e+06 node_interrupts{CPU="3",devices="i8042",info="IR-IO-APIC-edge",type="1"} 28 node_interrupts{CPU="3",devices="i8042",info="IR-IO-APIC-edge",type="12"} 198 node_interrupts{CPU="3",devices="i915",info="IR-PCI-MSI-edge",type="44"} 633 node_interrupts{CPU="3",devices="iwlwifi",info="IR-PCI-MSI-edge",type="46"} 290 node_interrupts{CPU="3",devices="mei_me",info="IR-PCI-MSI-edge",type="45"} 0 node_interrupts{CPU="3",devices="rtc0",info="IR-IO-APIC-edge",type="8"} 0 node_interrupts{CPU="3",devices="snd_hda_intel",info="IR-PCI-MSI-edge",type="47"} 0 node_interrupts{CPU="3",devices="timer",info="IR-IO-APIC-edge",type="0"} 0 node_interrupts{CPU="3",devices="xhci_hcd",info="IR-PCI-MSI-edge",type="42"} 2.434308e+06 # HELP node_intr Total number of interrupts serviced. # TYPE node_intr counter node_intr 8.885917e+06 # HELP node_ipvs_backend_connections_active The current active connections by local and remote address. # TYPE node_ipvs_backend_connections_active gauge node_ipvs_backend_connections_active{local_address="192.168.0.22",local_port="3306",proto="TCP",remote_address="192.168.82.22",remote_port="3306"} 248 node_ipvs_backend_connections_active{local_address="192.168.0.22",local_port="3306",proto="TCP",remote_address="192.168.83.21",remote_port="3306"} 248 node_ipvs_backend_connections_active{local_address="192.168.0.22",local_port="3306",proto="TCP",remote_address="192.168.83.24",remote_port="3306"} 248 node_ipvs_backend_connections_active{local_address="192.168.0.55",local_port="3306",proto="TCP",remote_address="192.168.49.32",remote_port="3306"} 0 node_ipvs_backend_connections_active{local_address="192.168.0.55",local_port="3306",proto="TCP",remote_address="192.168.50.26",remote_port="3306"} 0 node_ipvs_backend_connections_active{local_address="192.168.0.57",local_port="3306",proto="TCP",remote_address="192.168.50.21",remote_port="3306"} 1498 node_ipvs_backend_connections_active{local_address="192.168.0.57",local_port="3306",proto="TCP",remote_address="192.168.82.21",remote_port="3306"} 1499 node_ipvs_backend_connections_active{local_address="192.168.0.57",local_port="3306",proto="TCP",remote_address="192.168.84.22",remote_port="3306"} 0 # HELP node_ipvs_backend_connections_inactive The current inactive connections by local and remote address. # TYPE node_ipvs_backend_connections_inactive gauge node_ipvs_backend_connections_inactive{local_address="192.168.0.22",local_port="3306",proto="TCP",remote_address="192.168.82.22",remote_port="3306"} 2 node_ipvs_backend_connections_inactive{local_address="192.168.0.22",local_port="3306",proto="TCP",remote_address="192.168.83.21",remote_port="3306"} 1 node_ipvs_backend_connections_inactive{local_address="192.168.0.22",local_port="3306",proto="TCP",remote_address="192.168.83.24",remote_port="3306"} 2 node_ipvs_backend_connections_inactive{local_address="192.168.0.55",local_port="3306",proto="TCP",remote_address="192.168.49.32",remote_port="3306"} 0 node_ipvs_backend_connections_inactive{local_address="192.168.0.55",local_port="3306",proto="TCP",remote_address="192.168.50.26",remote_port="3306"} 0 node_ipvs_backend_connections_inactive{local_address="192.168.0.57",local_port="3306",proto="TCP",remote_address="192.168.50.21",remote_port="3306"} 0 node_ipvs_backend_connections_inactive{local_address="192.168.0.57",local_port="3306",proto="TCP",remote_address="192.168.82.21",remote_port="3306"} 0 node_ipvs_backend_connections_inactive{local_address="192.168.0.57",local_port="3306",proto="TCP",remote_address="192.168.84.22",remote_port="3306"} 0 # HELP node_ipvs_backend_weight The current backend weight by local and remote address. # TYPE node_ipvs_backend_weight gauge node_ipvs_backend_weight{local_address="192.168.0.22",local_port="3306",proto="TCP",remote_address="192.168.82.22",remote_port="3306"} 100 node_ipvs_backend_weight{local_address="192.168.0.22",local_port="3306",proto="TCP",remote_address="192.168.83.21",remote_port="3306"} 100 node_ipvs_backend_weight{local_address="192.168.0.22",local_port="3306",proto="TCP",remote_address="192.168.83.24",remote_port="3306"} 100 node_ipvs_backend_weight{local_address="192.168.0.55",local_port="3306",proto="TCP",remote_address="192.168.49.32",remote_port="3306"} 100 node_ipvs_backend_weight{local_address="192.168.0.55",local_port="3306",proto="TCP",remote_address="192.168.50.26",remote_port="3306"} 0 node_ipvs_backend_weight{local_address="192.168.0.57",local_port="3306",proto="TCP",remote_address="192.168.50.21",remote_port="3306"} 100 node_ipvs_backend_weight{local_address="192.168.0.57",local_port="3306",proto="TCP",remote_address="192.168.82.21",remote_port="3306"} 100 node_ipvs_backend_weight{local_address="192.168.0.57",local_port="3306",proto="TCP",remote_address="192.168.84.22",remote_port="3306"} 0 # HELP node_ipvs_connections_total The total number of connections made. # TYPE node_ipvs_connections_total counter node_ipvs_connections_total 2.3765872e+07 # HELP node_ipvs_incoming_bytes_total The total amount of incoming data. # TYPE node_ipvs_incoming_bytes_total counter node_ipvs_incoming_bytes_total 8.9991519156915e+13 # HELP node_ipvs_incoming_packets_total The total number of incoming packets. # TYPE node_ipvs_incoming_packets_total counter node_ipvs_incoming_packets_total 3.811989221e+09 # HELP node_ipvs_outgoing_bytes_total The total amount of outgoing data. # TYPE node_ipvs_outgoing_bytes_total counter node_ipvs_outgoing_bytes_total 0 # HELP node_ipvs_outgoing_packets_total The total number of outgoing packets. # TYPE node_ipvs_outgoing_packets_total counter node_ipvs_outgoing_packets_total 0 # HELP node_ksmd_full_scans_total ksmd 'full_scans' file. # TYPE node_ksmd_full_scans_total counter node_ksmd_full_scans_total 323 # HELP node_ksmd_merge_across_nodes ksmd 'merge_across_nodes' file. # TYPE node_ksmd_merge_across_nodes gauge node_ksmd_merge_across_nodes 1 # HELP node_ksmd_pages_shared ksmd 'pages_shared' file. # TYPE node_ksmd_pages_shared gauge node_ksmd_pages_shared 1 # HELP node_ksmd_pages_sharing ksmd 'pages_sharing' file. # TYPE node_ksmd_pages_sharing gauge node_ksmd_pages_sharing 255 # HELP node_ksmd_pages_to_scan ksmd 'pages_to_scan' file. # TYPE node_ksmd_pages_to_scan gauge node_ksmd_pages_to_scan 100 # HELP node_ksmd_pages_unshared ksmd 'pages_unshared' file. # TYPE node_ksmd_pages_unshared gauge node_ksmd_pages_unshared 0 # HELP node_ksmd_pages_volatile ksmd 'pages_volatile' file. # TYPE node_ksmd_pages_volatile gauge node_ksmd_pages_volatile 0 # HELP node_ksmd_run ksmd 'run' file. # TYPE node_ksmd_run gauge node_ksmd_run 1 # HELP node_ksmd_sleep_seconds ksmd 'sleep_millisecs' file. # TYPE node_ksmd_sleep_seconds gauge node_ksmd_sleep_seconds 0.02 # HELP node_load1 1m load average. # TYPE node_load1 gauge node_load1 0.21 # HELP node_load15 15m load average. # TYPE node_load15 gauge node_load15 0.39 # HELP node_load5 5m load average. # TYPE node_load5 gauge node_load5 0.37 # HELP node_md_blocks Total number of blocks on device. # TYPE node_md_blocks gauge node_md_blocks{device="md0"} 248896 node_md_blocks{device="md00"} 4.186624e+06 node_md_blocks{device="md10"} 3.14159265e+08 node_md_blocks{device="md11"} 4.190208e+06 node_md_blocks{device="md12"} 3.886394368e+09 node_md_blocks{device="md126"} 1.855870976e+09 node_md_blocks{device="md127"} 3.12319552e+08 node_md_blocks{device="md219"} 7932 node_md_blocks{device="md3"} 5.853468288e+09 node_md_blocks{device="md4"} 4.883648e+06 node_md_blocks{device="md6"} 1.95310144e+08 node_md_blocks{device="md7"} 7.813735424e+09 node_md_blocks{device="md8"} 1.95310144e+08 node_md_blocks{device="md9"} 523968 # HELP node_md_blocks_synced Number of blocks synced on device. # TYPE node_md_blocks_synced gauge node_md_blocks_synced{device="md0"} 248896 node_md_blocks_synced{device="md00"} 4.186624e+06 node_md_blocks_synced{device="md10"} 3.14159265e+08 node_md_blocks_synced{device="md11"} 4.190208e+06 node_md_blocks_synced{device="md12"} 3.886394368e+09 node_md_blocks_synced{device="md126"} 1.855870976e+09 node_md_blocks_synced{device="md127"} 3.12319552e+08 node_md_blocks_synced{device="md219"} 7932 node_md_blocks_synced{device="md3"} 5.853468288e+09 node_md_blocks_synced{device="md4"} 4.883648e+06 node_md_blocks_synced{device="md6"} 1.6775552e+07 node_md_blocks_synced{device="md7"} 7.813735424e+09 node_md_blocks_synced{device="md8"} 1.6775552e+07 node_md_blocks_synced{device="md9"} 523968 # HELP node_md_disks Total number of disks of device. # TYPE node_md_disks gauge node_md_disks{device="md0"} 2 node_md_disks{device="md00"} 1 node_md_disks{device="md10"} 2 node_md_disks{device="md11"} 2 node_md_disks{device="md12"} 2 node_md_disks{device="md126"} 2 node_md_disks{device="md127"} 2 node_md_disks{device="md219"} 0 node_md_disks{device="md3"} 8 node_md_disks{device="md4"} 2 node_md_disks{device="md6"} 2 node_md_disks{device="md7"} 4 node_md_disks{device="md8"} 2 node_md_disks{device="md9"} 4 # HELP node_md_disks_active Number of active disks of device. # TYPE node_md_disks_active gauge node_md_disks_active{device="md0"} 2 node_md_disks_active{device="md00"} 1 node_md_disks_active{device="md10"} 2 node_md_disks_active{device="md11"} 2 node_md_disks_active{device="md12"} 2 node_md_disks_active{device="md126"} 2 node_md_disks_active{device="md127"} 2 node_md_disks_active{device="md219"} 0 node_md_disks_active{device="md3"} 8 node_md_disks_active{device="md4"} 2 node_md_disks_active{device="md6"} 1 node_md_disks_active{device="md7"} 3 node_md_disks_active{device="md8"} 2 node_md_disks_active{device="md9"} 4 # HELP node_md_is_active Indicator whether the md-device is active or not. # TYPE node_md_is_active gauge node_md_is_active{device="md0"} 1 node_md_is_active{device="md00"} 1 node_md_is_active{device="md10"} 1 node_md_is_active{device="md11"} 1 node_md_is_active{device="md12"} 1 node_md_is_active{device="md126"} 1 node_md_is_active{device="md127"} 1 node_md_is_active{device="md219"} 0 node_md_is_active{device="md3"} 1 node_md_is_active{device="md4"} 0 node_md_is_active{device="md6"} 1 node_md_is_active{device="md7"} 1 node_md_is_active{device="md8"} 1 node_md_is_active{device="md9"} 1 # HELP node_megacli_drive_count megacli: drive error and event counters # TYPE node_megacli_drive_count gauge node_megacli_drive_count{enclosure="32",slot="0",type="Media Error Count"} 0 node_megacli_drive_count{enclosure="32",slot="0",type="Other Error Count"} 0 node_megacli_drive_count{enclosure="32",slot="0",type="Predictive Failure Count"} 0 node_megacli_drive_count{enclosure="32",slot="1",type="Media Error Count"} 0 node_megacli_drive_count{enclosure="32",slot="1",type="Other Error Count"} 0 node_megacli_drive_count{enclosure="32",slot="1",type="Predictive Failure Count"} 0 node_megacli_drive_count{enclosure="32",slot="2",type="Media Error Count"} 0 node_megacli_drive_count{enclosure="32",slot="2",type="Other Error Count"} 0 node_megacli_drive_count{enclosure="32",slot="2",type="Predictive Failure Count"} 0 node_megacli_drive_count{enclosure="32",slot="3",type="Media Error Count"} 0 node_megacli_drive_count{enclosure="32",slot="3",type="Other Error Count"} 0 node_megacli_drive_count{enclosure="32",slot="3",type="Predictive Failure Count"} 23 # HELP node_megacli_drive_temperature_celsius megacli: drive temperature # TYPE node_megacli_drive_temperature_celsius gauge node_megacli_drive_temperature_celsius{enclosure="32",slot="0"} 37 node_megacli_drive_temperature_celsius{enclosure="32",slot="2"} 39 node_megacli_drive_temperature_celsius{enclosure="32",slot="3"} 38 # HELP node_memory_Active Memory information field Active. # TYPE node_memory_Active gauge node_memory_Active 2.287017984e+09 # HELP node_memory_Active_anon Memory information field Active_anon. # TYPE node_memory_Active_anon gauge node_memory_Active_anon 2.068484096e+09 # HELP node_memory_Active_file Memory information field Active_file. # TYPE node_memory_Active_file gauge node_memory_Active_file 2.18533888e+08 # HELP node_memory_AnonHugePages Memory information field AnonHugePages. # TYPE node_memory_AnonHugePages gauge node_memory_AnonHugePages 0 # HELP node_memory_AnonPages Memory information field AnonPages. # TYPE node_memory_AnonPages gauge node_memory_AnonPages 2.298032128e+09 # HELP node_memory_Bounce Memory information field Bounce. # TYPE node_memory_Bounce gauge node_memory_Bounce 0 # HELP node_memory_Buffers Memory information field Buffers. # TYPE node_memory_Buffers gauge node_memory_Buffers 2.256896e+07 # HELP node_memory_Cached Memory information field Cached. # TYPE node_memory_Cached gauge node_memory_Cached 9.53229312e+08 # HELP node_memory_CommitLimit Memory information field CommitLimit. # TYPE node_memory_CommitLimit gauge node_memory_CommitLimit 6.210940928e+09 # HELP node_memory_Committed_AS Memory information field Committed_AS. # TYPE node_memory_Committed_AS gauge node_memory_Committed_AS 8.023486464e+09 # HELP node_memory_DirectMap2M Memory information field DirectMap2M. # TYPE node_memory_DirectMap2M gauge node_memory_DirectMap2M 3.787456512e+09 # HELP node_memory_DirectMap4k Memory information field DirectMap4k. # TYPE node_memory_DirectMap4k gauge node_memory_DirectMap4k 1.9011584e+08 # HELP node_memory_Dirty Memory information field Dirty. # TYPE node_memory_Dirty gauge node_memory_Dirty 1.077248e+06 # HELP node_memory_HardwareCorrupted Memory information field HardwareCorrupted. # TYPE node_memory_HardwareCorrupted gauge node_memory_HardwareCorrupted 0 # HELP node_memory_HugePages_Free Memory information field HugePages_Free. # TYPE node_memory_HugePages_Free gauge node_memory_HugePages_Free 0 # HELP node_memory_HugePages_Rsvd Memory information field HugePages_Rsvd. # TYPE node_memory_HugePages_Rsvd gauge node_memory_HugePages_Rsvd 0 # HELP node_memory_HugePages_Surp Memory information field HugePages_Surp. # TYPE node_memory_HugePages_Surp gauge node_memory_HugePages_Surp 0 # HELP node_memory_HugePages_Total Memory information field HugePages_Total. # TYPE node_memory_HugePages_Total gauge node_memory_HugePages_Total 0 # HELP node_memory_Hugepagesize Memory information field Hugepagesize. # TYPE node_memory_Hugepagesize gauge node_memory_Hugepagesize 2.097152e+06 # HELP node_memory_Inactive Memory information field Inactive. # TYPE node_memory_Inactive gauge node_memory_Inactive 1.053417472e+09 # HELP node_memory_Inactive_anon Memory information field Inactive_anon. # TYPE node_memory_Inactive_anon gauge node_memory_Inactive_anon 9.04245248e+08 # HELP node_memory_Inactive_file Memory information field Inactive_file. # TYPE node_memory_Inactive_file gauge node_memory_Inactive_file 1.49172224e+08 # HELP node_memory_KernelStack Memory information field KernelStack. # TYPE node_memory_KernelStack gauge node_memory_KernelStack 5.9392e+06 # HELP node_memory_Mapped Memory information field Mapped. # TYPE node_memory_Mapped gauge node_memory_Mapped 2.4496128e+08 # HELP node_memory_MemFree Memory information field MemFree. # TYPE node_memory_MemFree gauge node_memory_MemFree 2.30883328e+08 # HELP node_memory_MemTotal Memory information field MemTotal. # TYPE node_memory_MemTotal gauge node_memory_MemTotal 3.831959552e+09 # HELP node_memory_Mlocked Memory information field Mlocked. # TYPE node_memory_Mlocked gauge node_memory_Mlocked 32768 # HELP node_memory_NFS_Unstable Memory information field NFS_Unstable. # TYPE node_memory_NFS_Unstable gauge node_memory_NFS_Unstable 0 # HELP node_memory_PageTables Memory information field PageTables. # TYPE node_memory_PageTables gauge node_memory_PageTables 7.7017088e+07 # HELP node_memory_SReclaimable Memory information field SReclaimable. # TYPE node_memory_SReclaimable gauge node_memory_SReclaimable 4.5846528e+07 # HELP node_memory_SUnreclaim Memory information field SUnreclaim. # TYPE node_memory_SUnreclaim gauge node_memory_SUnreclaim 5.545984e+07 # HELP node_memory_Shmem Memory information field Shmem. # TYPE node_memory_Shmem gauge node_memory_Shmem 6.0809216e+08 # HELP node_memory_Slab Memory information field Slab. # TYPE node_memory_Slab gauge node_memory_Slab 1.01306368e+08 # HELP node_memory_SwapCached Memory information field SwapCached. # TYPE node_memory_SwapCached gauge node_memory_SwapCached 1.97124096e+08 # HELP node_memory_SwapFree Memory information field SwapFree. # TYPE node_memory_SwapFree gauge node_memory_SwapFree 3.23108864e+09 # HELP node_memory_SwapTotal Memory information field SwapTotal. # TYPE node_memory_SwapTotal gauge node_memory_SwapTotal 4.2949632e+09 # HELP node_memory_Unevictable Memory information field Unevictable. # TYPE node_memory_Unevictable gauge node_memory_Unevictable 32768 # HELP node_memory_VmallocChunk Memory information field VmallocChunk. # TYPE node_memory_VmallocChunk gauge node_memory_VmallocChunk 3.5183963009024e+13 # HELP node_memory_VmallocTotal Memory information field VmallocTotal. # TYPE node_memory_VmallocTotal gauge node_memory_VmallocTotal 3.5184372087808e+13 # HELP node_memory_VmallocUsed Memory information field VmallocUsed. # TYPE node_memory_VmallocUsed gauge node_memory_VmallocUsed 3.6130816e+08 # HELP node_memory_Writeback Memory information field Writeback. # TYPE node_memory_Writeback gauge node_memory_Writeback 0 # HELP node_memory_WritebackTmp Memory information field WritebackTmp. # TYPE node_memory_WritebackTmp gauge node_memory_WritebackTmp 0 # HELP node_memory_numa_Active Memory information field Active. # TYPE node_memory_numa_Active gauge node_memory_numa_Active{node="0"} 5.58733312e+09 node_memory_numa_Active{node="1"} 5.739003904e+09 # HELP node_memory_numa_Active_anon Memory information field Active_anon. # TYPE node_memory_numa_Active_anon gauge node_memory_numa_Active_anon{node="0"} 7.07915776e+08 node_memory_numa_Active_anon{node="1"} 6.04635136e+08 # HELP node_memory_numa_Active_file Memory information field Active_file. # TYPE node_memory_numa_Active_file gauge node_memory_numa_Active_file{node="0"} 4.879417344e+09 node_memory_numa_Active_file{node="1"} 5.134368768e+09 # HELP node_memory_numa_AnonHugePages Memory information field AnonHugePages. # TYPE node_memory_numa_AnonHugePages gauge node_memory_numa_AnonHugePages{node="0"} 1.50994944e+08 node_memory_numa_AnonHugePages{node="1"} 9.2274688e+07 # HELP node_memory_numa_AnonPages Memory information field AnonPages. # TYPE node_memory_numa_AnonPages gauge node_memory_numa_AnonPages{node="0"} 8.07112704e+08 node_memory_numa_AnonPages{node="1"} 6.88058368e+08 # HELP node_memory_numa_Bounce Memory information field Bounce. # TYPE node_memory_numa_Bounce gauge node_memory_numa_Bounce{node="0"} 0 node_memory_numa_Bounce{node="1"} 0 # HELP node_memory_numa_Dirty Memory information field Dirty. # TYPE node_memory_numa_Dirty gauge node_memory_numa_Dirty{node="0"} 20480 node_memory_numa_Dirty{node="1"} 122880 # HELP node_memory_numa_FilePages Memory information field FilePages. # TYPE node_memory_numa_FilePages gauge node_memory_numa_FilePages{node="0"} 7.1855017984e+10 node_memory_numa_FilePages{node="1"} 8.5585088512e+10 # HELP node_memory_numa_HugePages_Free Memory information field HugePages_Free. # TYPE node_memory_numa_HugePages_Free gauge node_memory_numa_HugePages_Free{node="0"} 0 node_memory_numa_HugePages_Free{node="1"} 0 # HELP node_memory_numa_HugePages_Surp Memory information field HugePages_Surp. # TYPE node_memory_numa_HugePages_Surp gauge node_memory_numa_HugePages_Surp{node="0"} 0 node_memory_numa_HugePages_Surp{node="1"} 0 # HELP node_memory_numa_HugePages_Total Memory information field HugePages_Total. # TYPE node_memory_numa_HugePages_Total gauge node_memory_numa_HugePages_Total{node="0"} 0 node_memory_numa_HugePages_Total{node="1"} 0 # HELP node_memory_numa_Inactive Memory information field Inactive. # TYPE node_memory_numa_Inactive gauge node_memory_numa_Inactive{node="0"} 6.0569788416e+10 node_memory_numa_Inactive{node="1"} 7.3165406208e+10 # HELP node_memory_numa_Inactive_anon Memory information field Inactive_anon. # TYPE node_memory_numa_Inactive_anon gauge node_memory_numa_Inactive_anon{node="0"} 3.48626944e+08 node_memory_numa_Inactive_anon{node="1"} 2.91930112e+08 # HELP node_memory_numa_Inactive_file Memory information field Inactive_file. # TYPE node_memory_numa_Inactive_file gauge node_memory_numa_Inactive_file{node="0"} 6.0221161472e+10 node_memory_numa_Inactive_file{node="1"} 7.2873476096e+10 # HELP node_memory_numa_KernelStack Memory information field KernelStack. # TYPE node_memory_numa_KernelStack gauge node_memory_numa_KernelStack{node="0"} 3.4832384e+07 node_memory_numa_KernelStack{node="1"} 3.1850496e+07 # HELP node_memory_numa_Mapped Memory information field Mapped. # TYPE node_memory_numa_Mapped gauge node_memory_numa_Mapped{node="0"} 9.1570176e+08 node_memory_numa_Mapped{node="1"} 8.84850688e+08 # HELP node_memory_numa_MemFree Memory information field MemFree. # TYPE node_memory_numa_MemFree gauge node_memory_numa_MemFree{node="0"} 5.4303100928e+10 node_memory_numa_MemFree{node="1"} 4.0586022912e+10 # HELP node_memory_numa_MemTotal Memory information field MemTotal. # TYPE node_memory_numa_MemTotal gauge node_memory_numa_MemTotal{node="0"} 1.3740271616e+11 node_memory_numa_MemTotal{node="1"} 1.37438953472e+11 # HELP node_memory_numa_MemUsed Memory information field MemUsed. # TYPE node_memory_numa_MemUsed gauge node_memory_numa_MemUsed{node="0"} 8.3099615232e+10 node_memory_numa_MemUsed{node="1"} 9.685293056e+10 # HELP node_memory_numa_Mlocked Memory information field Mlocked. # TYPE node_memory_numa_Mlocked gauge node_memory_numa_Mlocked{node="0"} 0 node_memory_numa_Mlocked{node="1"} 0 # HELP node_memory_numa_NFS_Unstable Memory information field NFS_Unstable. # TYPE node_memory_numa_NFS_Unstable gauge node_memory_numa_NFS_Unstable{node="0"} 0 node_memory_numa_NFS_Unstable{node="1"} 0 # HELP node_memory_numa_PageTables Memory information field PageTables. # TYPE node_memory_numa_PageTables gauge node_memory_numa_PageTables{node="0"} 1.46743296e+08 node_memory_numa_PageTables{node="1"} 1.27254528e+08 # HELP node_memory_numa_SReclaimable Memory information field SReclaimable. # TYPE node_memory_numa_SReclaimable gauge node_memory_numa_SReclaimable{node="0"} 4.580478976e+09 node_memory_numa_SReclaimable{node="1"} 4.724822016e+09 # HELP node_memory_numa_SUnreclaim Memory information field SUnreclaim. # TYPE node_memory_numa_SUnreclaim gauge node_memory_numa_SUnreclaim{node="0"} 2.23352832e+09 node_memory_numa_SUnreclaim{node="1"} 2.464391168e+09 # HELP node_memory_numa_Shmem Memory information field Shmem. # TYPE node_memory_numa_Shmem gauge node_memory_numa_Shmem{node="0"} 4.900864e+07 node_memory_numa_Shmem{node="1"} 8.968192e+07 # HELP node_memory_numa_Slab Memory information field Slab. # TYPE node_memory_numa_Slab gauge node_memory_numa_Slab{node="0"} 6.814007296e+09 node_memory_numa_Slab{node="1"} 7.189213184e+09 # HELP node_memory_numa_Unevictable Memory information field Unevictable. # TYPE node_memory_numa_Unevictable gauge node_memory_numa_Unevictable{node="0"} 0 node_memory_numa_Unevictable{node="1"} 0 # HELP node_memory_numa_Writeback Memory information field Writeback. # TYPE node_memory_numa_Writeback gauge node_memory_numa_Writeback{node="0"} 0 node_memory_numa_Writeback{node="1"} 0 # HELP node_memory_numa_WritebackTmp Memory information field WritebackTmp. # TYPE node_memory_numa_WritebackTmp gauge node_memory_numa_WritebackTmp{node="0"} 0 node_memory_numa_WritebackTmp{node="1"} 0 # HELP node_memory_numa_interleave_hit_total Memory information field interleave_hit_total. # TYPE node_memory_numa_interleave_hit_total counter node_memory_numa_interleave_hit_total{node="0"} 57146 node_memory_numa_interleave_hit_total{node="1"} 57286 # HELP node_memory_numa_local_node_total Memory information field local_node_total. # TYPE node_memory_numa_local_node_total counter node_memory_numa_local_node_total{node="0"} 1.93454780853e+11 node_memory_numa_local_node_total{node="1"} 3.2671904655e+11 # HELP node_memory_numa_numa_foreign_total Memory information field numa_foreign_total. # TYPE node_memory_numa_numa_foreign_total counter node_memory_numa_numa_foreign_total{node="0"} 5.98586233e+10 node_memory_numa_numa_foreign_total{node="1"} 1.2624528e+07 # HELP node_memory_numa_numa_hit_total Memory information field numa_hit_total. # TYPE node_memory_numa_numa_hit_total counter node_memory_numa_numa_hit_total{node="0"} 1.93460335812e+11 node_memory_numa_numa_hit_total{node="1"} 3.26720946761e+11 # HELP node_memory_numa_numa_miss_total Memory information field numa_miss_total. # TYPE node_memory_numa_numa_miss_total counter node_memory_numa_numa_miss_total{node="0"} 1.2624528e+07 node_memory_numa_numa_miss_total{node="1"} 5.9858626709e+10 # HELP node_memory_numa_other_node_total Memory information field other_node_total. # TYPE node_memory_numa_other_node_total counter node_memory_numa_other_node_total{node="0"} 1.8179487e+07 node_memory_numa_other_node_total{node="1"} 5.986052692e+10 # HELP node_mountstats_nfs_age_seconds_total The age of the NFS mount in seconds. # TYPE node_mountstats_nfs_age_seconds_total counter node_mountstats_nfs_age_seconds_total{export="192.168.1.1:/srv/test"} 13968 # HELP node_mountstats_nfs_direct_read_bytes_total Number of bytes read using the read() syscall in O_DIRECT mode. # TYPE node_mountstats_nfs_direct_read_bytes_total counter node_mountstats_nfs_direct_read_bytes_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_direct_write_bytes_total Number of bytes written using the write() syscall in O_DIRECT mode. # TYPE node_mountstats_nfs_direct_write_bytes_total counter node_mountstats_nfs_direct_write_bytes_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_event_attribute_invalidate_total Number of times cached inode attributes are invalidated. # TYPE node_mountstats_nfs_event_attribute_invalidate_total counter node_mountstats_nfs_event_attribute_invalidate_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_event_data_invalidate_total Number of times an inode cache is cleared. # TYPE node_mountstats_nfs_event_data_invalidate_total counter node_mountstats_nfs_event_data_invalidate_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_event_dnode_revalidate_total Number of times cached dentry nodes are re-validated from the server. # TYPE node_mountstats_nfs_event_dnode_revalidate_total counter node_mountstats_nfs_event_dnode_revalidate_total{export="192.168.1.1:/srv/test"} 226 # HELP node_mountstats_nfs_event_inode_revalidate_total Number of times cached inode attributes are re-validated from the server. # TYPE node_mountstats_nfs_event_inode_revalidate_total counter node_mountstats_nfs_event_inode_revalidate_total{export="192.168.1.1:/srv/test"} 52 # HELP node_mountstats_nfs_event_jukebox_delay_total Number of times the NFS server indicated EJUKEBOX; retrieving data from offline storage. # TYPE node_mountstats_nfs_event_jukebox_delay_total counter node_mountstats_nfs_event_jukebox_delay_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_event_pnfs_read_total Number of NFS v4.1+ pNFS reads. # TYPE node_mountstats_nfs_event_pnfs_read_total counter node_mountstats_nfs_event_pnfs_read_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_event_pnfs_write_total Number of NFS v4.1+ pNFS writes. # TYPE node_mountstats_nfs_event_pnfs_write_total counter node_mountstats_nfs_event_pnfs_write_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_event_short_read_total Number of times the NFS server gave less data than expected while reading. # TYPE node_mountstats_nfs_event_short_read_total counter node_mountstats_nfs_event_short_read_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_event_short_write_total Number of times the NFS server wrote less data than expected while writing. # TYPE node_mountstats_nfs_event_short_write_total counter node_mountstats_nfs_event_short_write_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_event_silly_rename_total Number of times a file was removed while still open by another process. # TYPE node_mountstats_nfs_event_silly_rename_total counter node_mountstats_nfs_event_silly_rename_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_event_truncation_total Number of times files have been truncated. # TYPE node_mountstats_nfs_event_truncation_total counter node_mountstats_nfs_event_truncation_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_event_vfs_access_total Number of times permissions have been checked. # TYPE node_mountstats_nfs_event_vfs_access_total counter node_mountstats_nfs_event_vfs_access_total{export="192.168.1.1:/srv/test"} 398 # HELP node_mountstats_nfs_event_vfs_file_release_total Number of times files have been closed and released. # TYPE node_mountstats_nfs_event_vfs_file_release_total counter node_mountstats_nfs_event_vfs_file_release_total{export="192.168.1.1:/srv/test"} 77 # HELP node_mountstats_nfs_event_vfs_flush_total Number of pending writes that have been forcefully flushed to the server. # TYPE node_mountstats_nfs_event_vfs_flush_total counter node_mountstats_nfs_event_vfs_flush_total{export="192.168.1.1:/srv/test"} 77 # HELP node_mountstats_nfs_event_vfs_fsync_total Number of times fsync() has been called on directories and files. # TYPE node_mountstats_nfs_event_vfs_fsync_total counter node_mountstats_nfs_event_vfs_fsync_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_event_vfs_getdents_total Number of times directory entries have been read with getdents(). # TYPE node_mountstats_nfs_event_vfs_getdents_total counter node_mountstats_nfs_event_vfs_getdents_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_event_vfs_lock_total Number of times locking has been attempted on a file. # TYPE node_mountstats_nfs_event_vfs_lock_total counter node_mountstats_nfs_event_vfs_lock_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_event_vfs_lookup_total Number of times a directory lookup has occurred. # TYPE node_mountstats_nfs_event_vfs_lookup_total counter node_mountstats_nfs_event_vfs_lookup_total{export="192.168.1.1:/srv/test"} 13 # HELP node_mountstats_nfs_event_vfs_open_total Number of times cached inode attributes are invalidated. # TYPE node_mountstats_nfs_event_vfs_open_total counter node_mountstats_nfs_event_vfs_open_total{export="192.168.1.1:/srv/test"} 1 # HELP node_mountstats_nfs_event_vfs_read_page_total Number of pages read directly via mmap()'d files. # TYPE node_mountstats_nfs_event_vfs_read_page_total counter node_mountstats_nfs_event_vfs_read_page_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_event_vfs_read_pages_total Number of times a group of pages have been read. # TYPE node_mountstats_nfs_event_vfs_read_pages_total counter node_mountstats_nfs_event_vfs_read_pages_total{export="192.168.1.1:/srv/test"} 331 # HELP node_mountstats_nfs_event_vfs_setattr_total Number of times directory entries have been read with getdents(). # TYPE node_mountstats_nfs_event_vfs_setattr_total counter node_mountstats_nfs_event_vfs_setattr_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_event_vfs_update_page_total Number of updates (and potential writes) to pages. # TYPE node_mountstats_nfs_event_vfs_update_page_total counter node_mountstats_nfs_event_vfs_update_page_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_event_vfs_write_page_total Number of pages written directly via mmap()'d files. # TYPE node_mountstats_nfs_event_vfs_write_page_total counter node_mountstats_nfs_event_vfs_write_page_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_event_vfs_write_pages_total Number of times a group of pages have been written. # TYPE node_mountstats_nfs_event_vfs_write_pages_total counter node_mountstats_nfs_event_vfs_write_pages_total{export="192.168.1.1:/srv/test"} 47 # HELP node_mountstats_nfs_event_write_extension_total Number of times a file has been grown due to writes beyond its existing end. # TYPE node_mountstats_nfs_event_write_extension_total counter node_mountstats_nfs_event_write_extension_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_operations_major_timeouts_total Number of times a request has had a major timeout for a given operation. # TYPE node_mountstats_nfs_operations_major_timeouts_total counter node_mountstats_nfs_operations_major_timeouts_total{export="192.168.1.1:/srv/test",operation="NULL"} 0 node_mountstats_nfs_operations_major_timeouts_total{export="192.168.1.1:/srv/test",operation="READ"} 0 node_mountstats_nfs_operations_major_timeouts_total{export="192.168.1.1:/srv/test",operation="WRITE"} 0 # HELP node_mountstats_nfs_operations_queue_time_seconds_total Duration all requests spent queued for transmission for a given operation before they were sent, in seconds. # TYPE node_mountstats_nfs_operations_queue_time_seconds_total counter node_mountstats_nfs_operations_queue_time_seconds_total{export="192.168.1.1:/srv/test",operation="NULL"} 0 node_mountstats_nfs_operations_queue_time_seconds_total{export="192.168.1.1:/srv/test",operation="READ"} 0.006 node_mountstats_nfs_operations_queue_time_seconds_total{export="192.168.1.1:/srv/test",operation="WRITE"} 0 # HELP node_mountstats_nfs_operations_received_bytes_total Number of bytes received for a given operation, including RPC headers and payload. # TYPE node_mountstats_nfs_operations_received_bytes_total counter node_mountstats_nfs_operations_received_bytes_total{export="192.168.1.1:/srv/test",operation="NULL"} 0 node_mountstats_nfs_operations_received_bytes_total{export="192.168.1.1:/srv/test",operation="READ"} 1.210292152e+09 node_mountstats_nfs_operations_received_bytes_total{export="192.168.1.1:/srv/test",operation="WRITE"} 0 # HELP node_mountstats_nfs_operations_request_time_seconds_total Duration all requests took from when a request was enqueued to when it was completely handled for a given operation, in seconds. # TYPE node_mountstats_nfs_operations_request_time_seconds_total counter node_mountstats_nfs_operations_request_time_seconds_total{export="192.168.1.1:/srv/test",operation="NULL"} 0 node_mountstats_nfs_operations_request_time_seconds_total{export="192.168.1.1:/srv/test",operation="READ"} 79.407 node_mountstats_nfs_operations_request_time_seconds_total{export="192.168.1.1:/srv/test",operation="WRITE"} 0 # HELP node_mountstats_nfs_operations_requests_total Number of requests performed for a given operation. # TYPE node_mountstats_nfs_operations_requests_total counter node_mountstats_nfs_operations_requests_total{export="192.168.1.1:/srv/test",operation="NULL"} 0 node_mountstats_nfs_operations_requests_total{export="192.168.1.1:/srv/test",operation="READ"} 1298 node_mountstats_nfs_operations_requests_total{export="192.168.1.1:/srv/test",operation="WRITE"} 0 # HELP node_mountstats_nfs_operations_response_time_seconds_total Duration all requests took to get a reply back after a request for a given operation was transmitted, in seconds. # TYPE node_mountstats_nfs_operations_response_time_seconds_total counter node_mountstats_nfs_operations_response_time_seconds_total{export="192.168.1.1:/srv/test",operation="NULL"} 0 node_mountstats_nfs_operations_response_time_seconds_total{export="192.168.1.1:/srv/test",operation="READ"} 79.386 node_mountstats_nfs_operations_response_time_seconds_total{export="192.168.1.1:/srv/test",operation="WRITE"} 0 # HELP node_mountstats_nfs_operations_sent_bytes_total Number of bytes sent for a given operation, including RPC headers and payload. # TYPE node_mountstats_nfs_operations_sent_bytes_total counter node_mountstats_nfs_operations_sent_bytes_total{export="192.168.1.1:/srv/test",operation="NULL"} 0 node_mountstats_nfs_operations_sent_bytes_total{export="192.168.1.1:/srv/test",operation="READ"} 207680 node_mountstats_nfs_operations_sent_bytes_total{export="192.168.1.1:/srv/test",operation="WRITE"} 0 # HELP node_mountstats_nfs_operations_transmissions_total Number of times an actual RPC request has been transmitted for a given operation. # TYPE node_mountstats_nfs_operations_transmissions_total counter node_mountstats_nfs_operations_transmissions_total{export="192.168.1.1:/srv/test",operation="NULL"} 0 node_mountstats_nfs_operations_transmissions_total{export="192.168.1.1:/srv/test",operation="READ"} 1298 node_mountstats_nfs_operations_transmissions_total{export="192.168.1.1:/srv/test",operation="WRITE"} 0 # HELP node_mountstats_nfs_read_bytes_total Number of bytes read using the read() syscall. # TYPE node_mountstats_nfs_read_bytes_total counter node_mountstats_nfs_read_bytes_total{export="192.168.1.1:/srv/test"} 1.20764023e+09 # HELP node_mountstats_nfs_read_pages_total Number of pages read directly via mmap()'d files. # TYPE node_mountstats_nfs_read_pages_total counter node_mountstats_nfs_read_pages_total{export="192.168.1.1:/srv/test"} 295483 # HELP node_mountstats_nfs_total_read_bytes_total Number of bytes read from the NFS server, in total. # TYPE node_mountstats_nfs_total_read_bytes_total counter node_mountstats_nfs_total_read_bytes_total{export="192.168.1.1:/srv/test"} 1.210214218e+09 # HELP node_mountstats_nfs_total_write_bytes_total Number of bytes written to the NFS server, in total. # TYPE node_mountstats_nfs_total_write_bytes_total counter node_mountstats_nfs_total_write_bytes_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_transport_backlog_queue_total Total number of items added to the RPC backlog queue. # TYPE node_mountstats_nfs_transport_backlog_queue_total counter node_mountstats_nfs_transport_backlog_queue_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_transport_bad_transaction_ids_total Number of times the NFS server sent a response with a transaction ID unknown to this client. # TYPE node_mountstats_nfs_transport_bad_transaction_ids_total counter node_mountstats_nfs_transport_bad_transaction_ids_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_transport_bind_total Number of times the client has had to establish a connection from scratch to the NFS server. # TYPE node_mountstats_nfs_transport_bind_total counter node_mountstats_nfs_transport_bind_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_transport_connect_total Number of times the client has made a TCP connection to the NFS server. # TYPE node_mountstats_nfs_transport_connect_total counter node_mountstats_nfs_transport_connect_total{export="192.168.1.1:/srv/test"} 1 # HELP node_mountstats_nfs_transport_idle_time_seconds Duration since the NFS mount last saw any RPC traffic, in seconds. # TYPE node_mountstats_nfs_transport_idle_time_seconds gauge node_mountstats_nfs_transport_idle_time_seconds{export="192.168.1.1:/srv/test"} 11 # HELP node_mountstats_nfs_transport_maximum_rpc_slots Maximum number of simultaneously active RPC requests ever used. # TYPE node_mountstats_nfs_transport_maximum_rpc_slots gauge node_mountstats_nfs_transport_maximum_rpc_slots{export="192.168.1.1:/srv/test"} 24 # HELP node_mountstats_nfs_transport_pending_queue_total Total number of items added to the RPC transmission pending queue. # TYPE node_mountstats_nfs_transport_pending_queue_total counter node_mountstats_nfs_transport_pending_queue_total{export="192.168.1.1:/srv/test"} 5726 # HELP node_mountstats_nfs_transport_receives_total Number of RPC responses for this mount received from the NFS server. # TYPE node_mountstats_nfs_transport_receives_total counter node_mountstats_nfs_transport_receives_total{export="192.168.1.1:/srv/test"} 6428 # HELP node_mountstats_nfs_transport_sending_queue_total Total number of items added to the RPC transmission sending queue. # TYPE node_mountstats_nfs_transport_sending_queue_total counter node_mountstats_nfs_transport_sending_queue_total{export="192.168.1.1:/srv/test"} 26 # HELP node_mountstats_nfs_transport_sends_total Number of RPC requests for this mount sent to the NFS server. # TYPE node_mountstats_nfs_transport_sends_total counter node_mountstats_nfs_transport_sends_total{export="192.168.1.1:/srv/test"} 6428 # HELP node_mountstats_nfs_write_bytes_total Number of bytes written using the write() syscall. # TYPE node_mountstats_nfs_write_bytes_total counter node_mountstats_nfs_write_bytes_total{export="192.168.1.1:/srv/test"} 0 # HELP node_mountstats_nfs_write_pages_total Number of pages written directly via mmap()'d files. # TYPE node_mountstats_nfs_write_pages_total counter node_mountstats_nfs_write_pages_total{export="192.168.1.1:/srv/test"} 0 # HELP node_netstat_Icmp6_InCsumErrors Statistic Icmp6InCsumErrors. # TYPE node_netstat_Icmp6_InCsumErrors untyped node_netstat_Icmp6_InCsumErrors 0 # HELP node_netstat_Icmp6_InDestUnreachs Statistic Icmp6InDestUnreachs. # TYPE node_netstat_Icmp6_InDestUnreachs untyped node_netstat_Icmp6_InDestUnreachs 0 # HELP node_netstat_Icmp6_InEchoReplies Statistic Icmp6InEchoReplies. # TYPE node_netstat_Icmp6_InEchoReplies untyped node_netstat_Icmp6_InEchoReplies 0 # HELP node_netstat_Icmp6_InEchos Statistic Icmp6InEchos. # TYPE node_netstat_Icmp6_InEchos untyped node_netstat_Icmp6_InEchos 0 # HELP node_netstat_Icmp6_InErrors Statistic Icmp6InErrors. # TYPE node_netstat_Icmp6_InErrors untyped node_netstat_Icmp6_InErrors 0 # HELP node_netstat_Icmp6_InGroupMembQueries Statistic Icmp6InGroupMembQueries. # TYPE node_netstat_Icmp6_InGroupMembQueries untyped node_netstat_Icmp6_InGroupMembQueries 0 # HELP node_netstat_Icmp6_InGroupMembReductions Statistic Icmp6InGroupMembReductions. # TYPE node_netstat_Icmp6_InGroupMembReductions untyped node_netstat_Icmp6_InGroupMembReductions 0 # HELP node_netstat_Icmp6_InGroupMembResponses Statistic Icmp6InGroupMembResponses. # TYPE node_netstat_Icmp6_InGroupMembResponses untyped node_netstat_Icmp6_InGroupMembResponses 0 # HELP node_netstat_Icmp6_InMLDv2Reports Statistic Icmp6InMLDv2Reports. # TYPE node_netstat_Icmp6_InMLDv2Reports untyped node_netstat_Icmp6_InMLDv2Reports 0 # HELP node_netstat_Icmp6_InMsgs Statistic Icmp6InMsgs. # TYPE node_netstat_Icmp6_InMsgs untyped node_netstat_Icmp6_InMsgs 0 # HELP node_netstat_Icmp6_InNeighborAdvertisements Statistic Icmp6InNeighborAdvertisements. # TYPE node_netstat_Icmp6_InNeighborAdvertisements untyped node_netstat_Icmp6_InNeighborAdvertisements 0 # HELP node_netstat_Icmp6_InNeighborSolicits Statistic Icmp6InNeighborSolicits. # TYPE node_netstat_Icmp6_InNeighborSolicits untyped node_netstat_Icmp6_InNeighborSolicits 0 # HELP node_netstat_Icmp6_InParmProblems Statistic Icmp6InParmProblems. # TYPE node_netstat_Icmp6_InParmProblems untyped node_netstat_Icmp6_InParmProblems 0 # HELP node_netstat_Icmp6_InPktTooBigs Statistic Icmp6InPktTooBigs. # TYPE node_netstat_Icmp6_InPktTooBigs untyped node_netstat_Icmp6_InPktTooBigs 0 # HELP node_netstat_Icmp6_InRedirects Statistic Icmp6InRedirects. # TYPE node_netstat_Icmp6_InRedirects untyped node_netstat_Icmp6_InRedirects 0 # HELP node_netstat_Icmp6_InRouterAdvertisements Statistic Icmp6InRouterAdvertisements. # TYPE node_netstat_Icmp6_InRouterAdvertisements untyped node_netstat_Icmp6_InRouterAdvertisements 0 # HELP node_netstat_Icmp6_InRouterSolicits Statistic Icmp6InRouterSolicits. # TYPE node_netstat_Icmp6_InRouterSolicits untyped node_netstat_Icmp6_InRouterSolicits 0 # HELP node_netstat_Icmp6_InTimeExcds Statistic Icmp6InTimeExcds. # TYPE node_netstat_Icmp6_InTimeExcds untyped node_netstat_Icmp6_InTimeExcds 0 # HELP node_netstat_Icmp6_OutDestUnreachs Statistic Icmp6OutDestUnreachs. # TYPE node_netstat_Icmp6_OutDestUnreachs untyped node_netstat_Icmp6_OutDestUnreachs 0 # HELP node_netstat_Icmp6_OutEchoReplies Statistic Icmp6OutEchoReplies. # TYPE node_netstat_Icmp6_OutEchoReplies untyped node_netstat_Icmp6_OutEchoReplies 0 # HELP node_netstat_Icmp6_OutEchos Statistic Icmp6OutEchos. # TYPE node_netstat_Icmp6_OutEchos untyped node_netstat_Icmp6_OutEchos 0 # HELP node_netstat_Icmp6_OutErrors Statistic Icmp6OutErrors. # TYPE node_netstat_Icmp6_OutErrors untyped node_netstat_Icmp6_OutErrors 0 # HELP node_netstat_Icmp6_OutGroupMembQueries Statistic Icmp6OutGroupMembQueries. # TYPE node_netstat_Icmp6_OutGroupMembQueries untyped node_netstat_Icmp6_OutGroupMembQueries 0 # HELP node_netstat_Icmp6_OutGroupMembReductions Statistic Icmp6OutGroupMembReductions. # TYPE node_netstat_Icmp6_OutGroupMembReductions untyped node_netstat_Icmp6_OutGroupMembReductions 0 # HELP node_netstat_Icmp6_OutGroupMembResponses Statistic Icmp6OutGroupMembResponses. # TYPE node_netstat_Icmp6_OutGroupMembResponses untyped node_netstat_Icmp6_OutGroupMembResponses 0 # HELP node_netstat_Icmp6_OutMLDv2Reports Statistic Icmp6OutMLDv2Reports. # TYPE node_netstat_Icmp6_OutMLDv2Reports untyped node_netstat_Icmp6_OutMLDv2Reports 4 # HELP node_netstat_Icmp6_OutMsgs Statistic Icmp6OutMsgs. # TYPE node_netstat_Icmp6_OutMsgs untyped node_netstat_Icmp6_OutMsgs 8 # HELP node_netstat_Icmp6_OutNeighborAdvertisements Statistic Icmp6OutNeighborAdvertisements. # TYPE node_netstat_Icmp6_OutNeighborAdvertisements untyped node_netstat_Icmp6_OutNeighborAdvertisements 0 # HELP node_netstat_Icmp6_OutNeighborSolicits Statistic Icmp6OutNeighborSolicits. # TYPE node_netstat_Icmp6_OutNeighborSolicits untyped node_netstat_Icmp6_OutNeighborSolicits 1 # HELP node_netstat_Icmp6_OutParmProblems Statistic Icmp6OutParmProblems. # TYPE node_netstat_Icmp6_OutParmProblems untyped node_netstat_Icmp6_OutParmProblems 0 # HELP node_netstat_Icmp6_OutPktTooBigs Statistic Icmp6OutPktTooBigs. # TYPE node_netstat_Icmp6_OutPktTooBigs untyped node_netstat_Icmp6_OutPktTooBigs 0 # HELP node_netstat_Icmp6_OutRedirects Statistic Icmp6OutRedirects. # TYPE node_netstat_Icmp6_OutRedirects untyped node_netstat_Icmp6_OutRedirects 0 # HELP node_netstat_Icmp6_OutRouterAdvertisements Statistic Icmp6OutRouterAdvertisements. # TYPE node_netstat_Icmp6_OutRouterAdvertisements untyped node_netstat_Icmp6_OutRouterAdvertisements 0 # HELP node_netstat_Icmp6_OutRouterSolicits Statistic Icmp6OutRouterSolicits. # TYPE node_netstat_Icmp6_OutRouterSolicits untyped node_netstat_Icmp6_OutRouterSolicits 3 # HELP node_netstat_Icmp6_OutTimeExcds Statistic Icmp6OutTimeExcds. # TYPE node_netstat_Icmp6_OutTimeExcds untyped node_netstat_Icmp6_OutTimeExcds 0 # HELP node_netstat_Icmp6_OutType133 Statistic Icmp6OutType133. # TYPE node_netstat_Icmp6_OutType133 untyped node_netstat_Icmp6_OutType133 3 # HELP node_netstat_Icmp6_OutType135 Statistic Icmp6OutType135. # TYPE node_netstat_Icmp6_OutType135 untyped node_netstat_Icmp6_OutType135 1 # HELP node_netstat_Icmp6_OutType143 Statistic Icmp6OutType143. # TYPE node_netstat_Icmp6_OutType143 untyped node_netstat_Icmp6_OutType143 4 # HELP node_netstat_IcmpMsg_InType3 Statistic IcmpMsgInType3. # TYPE node_netstat_IcmpMsg_InType3 untyped node_netstat_IcmpMsg_InType3 104 # HELP node_netstat_IcmpMsg_OutType3 Statistic IcmpMsgOutType3. # TYPE node_netstat_IcmpMsg_OutType3 untyped node_netstat_IcmpMsg_OutType3 120 # HELP node_netstat_Icmp_InAddrMaskReps Statistic IcmpInAddrMaskReps. # TYPE node_netstat_Icmp_InAddrMaskReps untyped node_netstat_Icmp_InAddrMaskReps 0 # HELP node_netstat_Icmp_InAddrMasks Statistic IcmpInAddrMasks. # TYPE node_netstat_Icmp_InAddrMasks untyped node_netstat_Icmp_InAddrMasks 0 # HELP node_netstat_Icmp_InCsumErrors Statistic IcmpInCsumErrors. # TYPE node_netstat_Icmp_InCsumErrors untyped node_netstat_Icmp_InCsumErrors 0 # HELP node_netstat_Icmp_InDestUnreachs Statistic IcmpInDestUnreachs. # TYPE node_netstat_Icmp_InDestUnreachs untyped node_netstat_Icmp_InDestUnreachs 104 # HELP node_netstat_Icmp_InEchoReps Statistic IcmpInEchoReps. # TYPE node_netstat_Icmp_InEchoReps untyped node_netstat_Icmp_InEchoReps 0 # HELP node_netstat_Icmp_InEchos Statistic IcmpInEchos. # TYPE node_netstat_Icmp_InEchos untyped node_netstat_Icmp_InEchos 0 # HELP node_netstat_Icmp_InErrors Statistic IcmpInErrors. # TYPE node_netstat_Icmp_InErrors untyped node_netstat_Icmp_InErrors 0 # HELP node_netstat_Icmp_InMsgs Statistic IcmpInMsgs. # TYPE node_netstat_Icmp_InMsgs untyped node_netstat_Icmp_InMsgs 104 # HELP node_netstat_Icmp_InParmProbs Statistic IcmpInParmProbs. # TYPE node_netstat_Icmp_InParmProbs untyped node_netstat_Icmp_InParmProbs 0 # HELP node_netstat_Icmp_InRedirects Statistic IcmpInRedirects. # TYPE node_netstat_Icmp_InRedirects untyped node_netstat_Icmp_InRedirects 0 # HELP node_netstat_Icmp_InSrcQuenchs Statistic IcmpInSrcQuenchs. # TYPE node_netstat_Icmp_InSrcQuenchs untyped node_netstat_Icmp_InSrcQuenchs 0 # HELP node_netstat_Icmp_InTimeExcds Statistic IcmpInTimeExcds. # TYPE node_netstat_Icmp_InTimeExcds untyped node_netstat_Icmp_InTimeExcds 0 # HELP node_netstat_Icmp_InTimestampReps Statistic IcmpInTimestampReps. # TYPE node_netstat_Icmp_InTimestampReps untyped node_netstat_Icmp_InTimestampReps 0 # HELP node_netstat_Icmp_InTimestamps Statistic IcmpInTimestamps. # TYPE node_netstat_Icmp_InTimestamps untyped node_netstat_Icmp_InTimestamps 0 # HELP node_netstat_Icmp_OutAddrMaskReps Statistic IcmpOutAddrMaskReps. # TYPE node_netstat_Icmp_OutAddrMaskReps untyped node_netstat_Icmp_OutAddrMaskReps 0 # HELP node_netstat_Icmp_OutAddrMasks Statistic IcmpOutAddrMasks. # TYPE node_netstat_Icmp_OutAddrMasks untyped node_netstat_Icmp_OutAddrMasks 0 # HELP node_netstat_Icmp_OutDestUnreachs Statistic IcmpOutDestUnreachs. # TYPE node_netstat_Icmp_OutDestUnreachs untyped node_netstat_Icmp_OutDestUnreachs 120 # HELP node_netstat_Icmp_OutEchoReps Statistic IcmpOutEchoReps. # TYPE node_netstat_Icmp_OutEchoReps untyped node_netstat_Icmp_OutEchoReps 0 # HELP node_netstat_Icmp_OutEchos Statistic IcmpOutEchos. # TYPE node_netstat_Icmp_OutEchos untyped node_netstat_Icmp_OutEchos 0 # HELP node_netstat_Icmp_OutErrors Statistic IcmpOutErrors. # TYPE node_netstat_Icmp_OutErrors untyped node_netstat_Icmp_OutErrors 0 # HELP node_netstat_Icmp_OutMsgs Statistic IcmpOutMsgs. # TYPE node_netstat_Icmp_OutMsgs untyped node_netstat_Icmp_OutMsgs 120 # HELP node_netstat_Icmp_OutParmProbs Statistic IcmpOutParmProbs. # TYPE node_netstat_Icmp_OutParmProbs untyped node_netstat_Icmp_OutParmProbs 0 # HELP node_netstat_Icmp_OutRedirects Statistic IcmpOutRedirects. # TYPE node_netstat_Icmp_OutRedirects untyped node_netstat_Icmp_OutRedirects 0 # HELP node_netstat_Icmp_OutSrcQuenchs Statistic IcmpOutSrcQuenchs. # TYPE node_netstat_Icmp_OutSrcQuenchs untyped node_netstat_Icmp_OutSrcQuenchs 0 # HELP node_netstat_Icmp_OutTimeExcds Statistic IcmpOutTimeExcds. # TYPE node_netstat_Icmp_OutTimeExcds untyped node_netstat_Icmp_OutTimeExcds 0 # HELP node_netstat_Icmp_OutTimestampReps Statistic IcmpOutTimestampReps. # TYPE node_netstat_Icmp_OutTimestampReps untyped node_netstat_Icmp_OutTimestampReps 0 # HELP node_netstat_Icmp_OutTimestamps Statistic IcmpOutTimestamps. # TYPE node_netstat_Icmp_OutTimestamps untyped node_netstat_Icmp_OutTimestamps 0 # HELP node_netstat_Ip6_FragCreates Statistic Ip6FragCreates. # TYPE node_netstat_Ip6_FragCreates untyped node_netstat_Ip6_FragCreates 0 # HELP node_netstat_Ip6_FragFails Statistic Ip6FragFails. # TYPE node_netstat_Ip6_FragFails untyped node_netstat_Ip6_FragFails 0 # HELP node_netstat_Ip6_FragOKs Statistic Ip6FragOKs. # TYPE node_netstat_Ip6_FragOKs untyped node_netstat_Ip6_FragOKs 0 # HELP node_netstat_Ip6_InAddrErrors Statistic Ip6InAddrErrors. # TYPE node_netstat_Ip6_InAddrErrors untyped node_netstat_Ip6_InAddrErrors 0 # HELP node_netstat_Ip6_InBcastOctets Statistic Ip6InBcastOctets. # TYPE node_netstat_Ip6_InBcastOctets untyped node_netstat_Ip6_InBcastOctets 0 # HELP node_netstat_Ip6_InCEPkts Statistic Ip6InCEPkts. # TYPE node_netstat_Ip6_InCEPkts untyped node_netstat_Ip6_InCEPkts 0 # HELP node_netstat_Ip6_InDelivers Statistic Ip6InDelivers. # TYPE node_netstat_Ip6_InDelivers untyped node_netstat_Ip6_InDelivers 0 # HELP node_netstat_Ip6_InDiscards Statistic Ip6InDiscards. # TYPE node_netstat_Ip6_InDiscards untyped node_netstat_Ip6_InDiscards 0 # HELP node_netstat_Ip6_InECT0Pkts Statistic Ip6InECT0Pkts. # TYPE node_netstat_Ip6_InECT0Pkts untyped node_netstat_Ip6_InECT0Pkts 0 # HELP node_netstat_Ip6_InECT1Pkts Statistic Ip6InECT1Pkts. # TYPE node_netstat_Ip6_InECT1Pkts untyped node_netstat_Ip6_InECT1Pkts 0 # HELP node_netstat_Ip6_InHdrErrors Statistic Ip6InHdrErrors. # TYPE node_netstat_Ip6_InHdrErrors untyped node_netstat_Ip6_InHdrErrors 0 # HELP node_netstat_Ip6_InMcastOctets Statistic Ip6InMcastOctets. # TYPE node_netstat_Ip6_InMcastOctets untyped node_netstat_Ip6_InMcastOctets 112 # HELP node_netstat_Ip6_InMcastPkts Statistic Ip6InMcastPkts. # TYPE node_netstat_Ip6_InMcastPkts untyped node_netstat_Ip6_InMcastPkts 2 # HELP node_netstat_Ip6_InNoECTPkts Statistic Ip6InNoECTPkts. # TYPE node_netstat_Ip6_InNoECTPkts untyped node_netstat_Ip6_InNoECTPkts 7 # HELP node_netstat_Ip6_InNoRoutes Statistic Ip6InNoRoutes. # TYPE node_netstat_Ip6_InNoRoutes untyped node_netstat_Ip6_InNoRoutes 5 # HELP node_netstat_Ip6_InOctets Statistic Ip6InOctets. # TYPE node_netstat_Ip6_InOctets untyped node_netstat_Ip6_InOctets 460 # HELP node_netstat_Ip6_InReceives Statistic Ip6InReceives. # TYPE node_netstat_Ip6_InReceives untyped node_netstat_Ip6_InReceives 7 # HELP node_netstat_Ip6_InTooBigErrors Statistic Ip6InTooBigErrors. # TYPE node_netstat_Ip6_InTooBigErrors untyped node_netstat_Ip6_InTooBigErrors 0 # HELP node_netstat_Ip6_InTruncatedPkts Statistic Ip6InTruncatedPkts. # TYPE node_netstat_Ip6_InTruncatedPkts untyped node_netstat_Ip6_InTruncatedPkts 0 # HELP node_netstat_Ip6_InUnknownProtos Statistic Ip6InUnknownProtos. # TYPE node_netstat_Ip6_InUnknownProtos untyped node_netstat_Ip6_InUnknownProtos 0 # HELP node_netstat_Ip6_OutBcastOctets Statistic Ip6OutBcastOctets. # TYPE node_netstat_Ip6_OutBcastOctets untyped node_netstat_Ip6_OutBcastOctets 0 # HELP node_netstat_Ip6_OutDiscards Statistic Ip6OutDiscards. # TYPE node_netstat_Ip6_OutDiscards untyped node_netstat_Ip6_OutDiscards 0 # HELP node_netstat_Ip6_OutForwDatagrams Statistic Ip6OutForwDatagrams. # TYPE node_netstat_Ip6_OutForwDatagrams untyped node_netstat_Ip6_OutForwDatagrams 0 # HELP node_netstat_Ip6_OutMcastOctets Statistic Ip6OutMcastOctets. # TYPE node_netstat_Ip6_OutMcastOctets untyped node_netstat_Ip6_OutMcastOctets 840 # HELP node_netstat_Ip6_OutMcastPkts Statistic Ip6OutMcastPkts. # TYPE node_netstat_Ip6_OutMcastPkts untyped node_netstat_Ip6_OutMcastPkts 12 # HELP node_netstat_Ip6_OutNoRoutes Statistic Ip6OutNoRoutes. # TYPE node_netstat_Ip6_OutNoRoutes untyped node_netstat_Ip6_OutNoRoutes 3003 # HELP node_netstat_Ip6_OutOctets Statistic Ip6OutOctets. # TYPE node_netstat_Ip6_OutOctets untyped node_netstat_Ip6_OutOctets 536 # HELP node_netstat_Ip6_OutRequests Statistic Ip6OutRequests. # TYPE node_netstat_Ip6_OutRequests untyped node_netstat_Ip6_OutRequests 8 # HELP node_netstat_Ip6_ReasmFails Statistic Ip6ReasmFails. # TYPE node_netstat_Ip6_ReasmFails untyped node_netstat_Ip6_ReasmFails 0 # HELP node_netstat_Ip6_ReasmOKs Statistic Ip6ReasmOKs. # TYPE node_netstat_Ip6_ReasmOKs untyped node_netstat_Ip6_ReasmOKs 0 # HELP node_netstat_Ip6_ReasmReqds Statistic Ip6ReasmReqds. # TYPE node_netstat_Ip6_ReasmReqds untyped node_netstat_Ip6_ReasmReqds 0 # HELP node_netstat_Ip6_ReasmTimeout Statistic Ip6ReasmTimeout. # TYPE node_netstat_Ip6_ReasmTimeout untyped node_netstat_Ip6_ReasmTimeout 0 # HELP node_netstat_IpExt_InBcastOctets Statistic IpExtInBcastOctets. # TYPE node_netstat_IpExt_InBcastOctets untyped node_netstat_IpExt_InBcastOctets 0 # HELP node_netstat_IpExt_InBcastPkts Statistic IpExtInBcastPkts. # TYPE node_netstat_IpExt_InBcastPkts untyped node_netstat_IpExt_InBcastPkts 0 # HELP node_netstat_IpExt_InMcastOctets Statistic IpExtInMcastOctets. # TYPE node_netstat_IpExt_InMcastOctets untyped node_netstat_IpExt_InMcastOctets 0 # HELP node_netstat_IpExt_InMcastPkts Statistic IpExtInMcastPkts. # TYPE node_netstat_IpExt_InMcastPkts untyped node_netstat_IpExt_InMcastPkts 0 # HELP node_netstat_IpExt_InNoRoutes Statistic IpExtInNoRoutes. # TYPE node_netstat_IpExt_InNoRoutes untyped node_netstat_IpExt_InNoRoutes 0 # HELP node_netstat_IpExt_InOctets Statistic IpExtInOctets. # TYPE node_netstat_IpExt_InOctets untyped node_netstat_IpExt_InOctets 6.28639697e+09 # HELP node_netstat_IpExt_InTruncatedPkts Statistic IpExtInTruncatedPkts. # TYPE node_netstat_IpExt_InTruncatedPkts untyped node_netstat_IpExt_InTruncatedPkts 0 # HELP node_netstat_IpExt_OutBcastOctets Statistic IpExtOutBcastOctets. # TYPE node_netstat_IpExt_OutBcastOctets untyped node_netstat_IpExt_OutBcastOctets 0 # HELP node_netstat_IpExt_OutBcastPkts Statistic IpExtOutBcastPkts. # TYPE node_netstat_IpExt_OutBcastPkts untyped node_netstat_IpExt_OutBcastPkts 0 # HELP node_netstat_IpExt_OutMcastOctets Statistic IpExtOutMcastOctets. # TYPE node_netstat_IpExt_OutMcastOctets untyped node_netstat_IpExt_OutMcastOctets 0 # HELP node_netstat_IpExt_OutMcastPkts Statistic IpExtOutMcastPkts. # TYPE node_netstat_IpExt_OutMcastPkts untyped node_netstat_IpExt_OutMcastPkts 0 # HELP node_netstat_IpExt_OutOctets Statistic IpExtOutOctets. # TYPE node_netstat_IpExt_OutOctets untyped node_netstat_IpExt_OutOctets 2.786264347e+09 # HELP node_netstat_Ip_DefaultTTL Statistic IpDefaultTTL. # TYPE node_netstat_Ip_DefaultTTL untyped node_netstat_Ip_DefaultTTL 64 # HELP node_netstat_Ip_ForwDatagrams Statistic IpForwDatagrams. # TYPE node_netstat_Ip_ForwDatagrams untyped node_netstat_Ip_ForwDatagrams 397750 # HELP node_netstat_Ip_Forwarding Statistic IpForwarding. # TYPE node_netstat_Ip_Forwarding untyped node_netstat_Ip_Forwarding 1 # HELP node_netstat_Ip_FragCreates Statistic IpFragCreates. # TYPE node_netstat_Ip_FragCreates untyped node_netstat_Ip_FragCreates 0 # HELP node_netstat_Ip_FragFails Statistic IpFragFails. # TYPE node_netstat_Ip_FragFails untyped node_netstat_Ip_FragFails 0 # HELP node_netstat_Ip_FragOKs Statistic IpFragOKs. # TYPE node_netstat_Ip_FragOKs untyped node_netstat_Ip_FragOKs 0 # HELP node_netstat_Ip_InAddrErrors Statistic IpInAddrErrors. # TYPE node_netstat_Ip_InAddrErrors untyped node_netstat_Ip_InAddrErrors 25 # HELP node_netstat_Ip_InDelivers Statistic IpInDelivers. # TYPE node_netstat_Ip_InDelivers untyped node_netstat_Ip_InDelivers 5.7340175e+07 # HELP node_netstat_Ip_InDiscards Statistic IpInDiscards. # TYPE node_netstat_Ip_InDiscards untyped node_netstat_Ip_InDiscards 0 # HELP node_netstat_Ip_InHdrErrors Statistic IpInHdrErrors. # TYPE node_netstat_Ip_InHdrErrors untyped node_netstat_Ip_InHdrErrors 0 # HELP node_netstat_Ip_InReceives Statistic IpInReceives. # TYPE node_netstat_Ip_InReceives untyped node_netstat_Ip_InReceives 5.7740232e+07 # HELP node_netstat_Ip_InUnknownProtos Statistic IpInUnknownProtos. # TYPE node_netstat_Ip_InUnknownProtos untyped node_netstat_Ip_InUnknownProtos 0 # HELP node_netstat_Ip_OutDiscards Statistic IpOutDiscards. # TYPE node_netstat_Ip_OutDiscards untyped node_netstat_Ip_OutDiscards 0 # HELP node_netstat_Ip_OutNoRoutes Statistic IpOutNoRoutes. # TYPE node_netstat_Ip_OutNoRoutes untyped node_netstat_Ip_OutNoRoutes 54 # HELP node_netstat_Ip_OutRequests Statistic IpOutRequests. # TYPE node_netstat_Ip_OutRequests untyped node_netstat_Ip_OutRequests 5.5365537e+07 # HELP node_netstat_Ip_ReasmFails Statistic IpReasmFails. # TYPE node_netstat_Ip_ReasmFails untyped node_netstat_Ip_ReasmFails 0 # HELP node_netstat_Ip_ReasmOKs Statistic IpReasmOKs. # TYPE node_netstat_Ip_ReasmOKs untyped node_netstat_Ip_ReasmOKs 0 # HELP node_netstat_Ip_ReasmReqds Statistic IpReasmReqds. # TYPE node_netstat_Ip_ReasmReqds untyped node_netstat_Ip_ReasmReqds 0 # HELP node_netstat_Ip_ReasmTimeout Statistic IpReasmTimeout. # TYPE node_netstat_Ip_ReasmTimeout untyped node_netstat_Ip_ReasmTimeout 0 # HELP node_netstat_TcpExt_ArpFilter Statistic TcpExtArpFilter. # TYPE node_netstat_TcpExt_ArpFilter untyped node_netstat_TcpExt_ArpFilter 0 # HELP node_netstat_TcpExt_DelayedACKLocked Statistic TcpExtDelayedACKLocked. # TYPE node_netstat_TcpExt_DelayedACKLocked untyped node_netstat_TcpExt_DelayedACKLocked 17 # HELP node_netstat_TcpExt_DelayedACKLost Statistic TcpExtDelayedACKLost. # TYPE node_netstat_TcpExt_DelayedACKLost untyped node_netstat_TcpExt_DelayedACKLost 9 # HELP node_netstat_TcpExt_DelayedACKs Statistic TcpExtDelayedACKs. # TYPE node_netstat_TcpExt_DelayedACKs untyped node_netstat_TcpExt_DelayedACKs 102471 # HELP node_netstat_TcpExt_EmbryonicRsts Statistic TcpExtEmbryonicRsts. # TYPE node_netstat_TcpExt_EmbryonicRsts untyped node_netstat_TcpExt_EmbryonicRsts 0 # HELP node_netstat_TcpExt_IPReversePathFilter Statistic TcpExtIPReversePathFilter. # TYPE node_netstat_TcpExt_IPReversePathFilter untyped node_netstat_TcpExt_IPReversePathFilter 0 # HELP node_netstat_TcpExt_ListenDrops Statistic TcpExtListenDrops. # TYPE node_netstat_TcpExt_ListenDrops untyped node_netstat_TcpExt_ListenDrops 0 # HELP node_netstat_TcpExt_ListenOverflows Statistic TcpExtListenOverflows. # TYPE node_netstat_TcpExt_ListenOverflows untyped node_netstat_TcpExt_ListenOverflows 0 # HELP node_netstat_TcpExt_LockDroppedIcmps Statistic TcpExtLockDroppedIcmps. # TYPE node_netstat_TcpExt_LockDroppedIcmps untyped node_netstat_TcpExt_LockDroppedIcmps 0 # HELP node_netstat_TcpExt_OfoPruned Statistic TcpExtOfoPruned. # TYPE node_netstat_TcpExt_OfoPruned untyped node_netstat_TcpExt_OfoPruned 0 # HELP node_netstat_TcpExt_OutOfWindowIcmps Statistic TcpExtOutOfWindowIcmps. # TYPE node_netstat_TcpExt_OutOfWindowIcmps untyped node_netstat_TcpExt_OutOfWindowIcmps 0 # HELP node_netstat_TcpExt_PAWSActive Statistic TcpExtPAWSActive. # TYPE node_netstat_TcpExt_PAWSActive untyped node_netstat_TcpExt_PAWSActive 0 # HELP node_netstat_TcpExt_PAWSEstab Statistic TcpExtPAWSEstab. # TYPE node_netstat_TcpExt_PAWSEstab untyped node_netstat_TcpExt_PAWSEstab 6 # HELP node_netstat_TcpExt_PAWSPassive Statistic TcpExtPAWSPassive. # TYPE node_netstat_TcpExt_PAWSPassive untyped node_netstat_TcpExt_PAWSPassive 0 # HELP node_netstat_TcpExt_PruneCalled Statistic TcpExtPruneCalled. # TYPE node_netstat_TcpExt_PruneCalled untyped node_netstat_TcpExt_PruneCalled 0 # HELP node_netstat_TcpExt_RcvPruned Statistic TcpExtRcvPruned. # TYPE node_netstat_TcpExt_RcvPruned untyped node_netstat_TcpExt_RcvPruned 0 # HELP node_netstat_TcpExt_SyncookiesFailed Statistic TcpExtSyncookiesFailed. # TYPE node_netstat_TcpExt_SyncookiesFailed untyped node_netstat_TcpExt_SyncookiesFailed 2 # HELP node_netstat_TcpExt_SyncookiesRecv Statistic TcpExtSyncookiesRecv. # TYPE node_netstat_TcpExt_SyncookiesRecv untyped node_netstat_TcpExt_SyncookiesRecv 0 # HELP node_netstat_TcpExt_SyncookiesSent Statistic TcpExtSyncookiesSent. # TYPE node_netstat_TcpExt_SyncookiesSent untyped node_netstat_TcpExt_SyncookiesSent 0 # HELP node_netstat_TcpExt_TCPAbortFailed Statistic TcpExtTCPAbortFailed. # TYPE node_netstat_TcpExt_TCPAbortFailed untyped node_netstat_TcpExt_TCPAbortFailed 0 # HELP node_netstat_TcpExt_TCPAbortOnClose Statistic TcpExtTCPAbortOnClose. # TYPE node_netstat_TcpExt_TCPAbortOnClose untyped node_netstat_TcpExt_TCPAbortOnClose 4 # HELP node_netstat_TcpExt_TCPAbortOnData Statistic TcpExtTCPAbortOnData. # TYPE node_netstat_TcpExt_TCPAbortOnData untyped node_netstat_TcpExt_TCPAbortOnData 41 # HELP node_netstat_TcpExt_TCPAbortOnLinger Statistic TcpExtTCPAbortOnLinger. # TYPE node_netstat_TcpExt_TCPAbortOnLinger untyped node_netstat_TcpExt_TCPAbortOnLinger 0 # HELP node_netstat_TcpExt_TCPAbortOnMemory Statistic TcpExtTCPAbortOnMemory. # TYPE node_netstat_TcpExt_TCPAbortOnMemory untyped node_netstat_TcpExt_TCPAbortOnMemory 0 # HELP node_netstat_TcpExt_TCPAbortOnTimeout Statistic TcpExtTCPAbortOnTimeout. # TYPE node_netstat_TcpExt_TCPAbortOnTimeout untyped node_netstat_TcpExt_TCPAbortOnTimeout 0 # HELP node_netstat_TcpExt_TCPBacklogDrop Statistic TcpExtTCPBacklogDrop. # TYPE node_netstat_TcpExt_TCPBacklogDrop untyped node_netstat_TcpExt_TCPBacklogDrop 0 # HELP node_netstat_TcpExt_TCPChallengeACK Statistic TcpExtTCPChallengeACK. # TYPE node_netstat_TcpExt_TCPChallengeACK untyped node_netstat_TcpExt_TCPChallengeACK 2 # HELP node_netstat_TcpExt_TCPDSACKIgnoredNoUndo Statistic TcpExtTCPDSACKIgnoredNoUndo. # TYPE node_netstat_TcpExt_TCPDSACKIgnoredNoUndo untyped node_netstat_TcpExt_TCPDSACKIgnoredNoUndo 1 # HELP node_netstat_TcpExt_TCPDSACKIgnoredOld Statistic TcpExtTCPDSACKIgnoredOld. # TYPE node_netstat_TcpExt_TCPDSACKIgnoredOld untyped node_netstat_TcpExt_TCPDSACKIgnoredOld 0 # HELP node_netstat_TcpExt_TCPDSACKOfoRecv Statistic TcpExtTCPDSACKOfoRecv. # TYPE node_netstat_TcpExt_TCPDSACKOfoRecv untyped node_netstat_TcpExt_TCPDSACKOfoRecv 0 # HELP node_netstat_TcpExt_TCPDSACKOfoSent Statistic TcpExtTCPDSACKOfoSent. # TYPE node_netstat_TcpExt_TCPDSACKOfoSent untyped node_netstat_TcpExt_TCPDSACKOfoSent 0 # HELP node_netstat_TcpExt_TCPDSACKOldSent Statistic TcpExtTCPDSACKOldSent. # TYPE node_netstat_TcpExt_TCPDSACKOldSent untyped node_netstat_TcpExt_TCPDSACKOldSent 9 # HELP node_netstat_TcpExt_TCPDSACKRecv Statistic TcpExtTCPDSACKRecv. # TYPE node_netstat_TcpExt_TCPDSACKRecv untyped node_netstat_TcpExt_TCPDSACKRecv 5 # HELP node_netstat_TcpExt_TCPDSACKUndo Statistic TcpExtTCPDSACKUndo. # TYPE node_netstat_TcpExt_TCPDSACKUndo untyped node_netstat_TcpExt_TCPDSACKUndo 0 # HELP node_netstat_TcpExt_TCPDeferAcceptDrop Statistic TcpExtTCPDeferAcceptDrop. # TYPE node_netstat_TcpExt_TCPDeferAcceptDrop untyped node_netstat_TcpExt_TCPDeferAcceptDrop 0 # HELP node_netstat_TcpExt_TCPDirectCopyFromBacklog Statistic TcpExtTCPDirectCopyFromBacklog. # TYPE node_netstat_TcpExt_TCPDirectCopyFromBacklog untyped node_netstat_TcpExt_TCPDirectCopyFromBacklog 0 # HELP node_netstat_TcpExt_TCPDirectCopyFromPrequeue Statistic TcpExtTCPDirectCopyFromPrequeue. # TYPE node_netstat_TcpExt_TCPDirectCopyFromPrequeue untyped node_netstat_TcpExt_TCPDirectCopyFromPrequeue 168808 # HELP node_netstat_TcpExt_TCPFACKReorder Statistic TcpExtTCPFACKReorder. # TYPE node_netstat_TcpExt_TCPFACKReorder untyped node_netstat_TcpExt_TCPFACKReorder 0 # HELP node_netstat_TcpExt_TCPFastRetrans Statistic TcpExtTCPFastRetrans. # TYPE node_netstat_TcpExt_TCPFastRetrans untyped node_netstat_TcpExt_TCPFastRetrans 1 # HELP node_netstat_TcpExt_TCPForwardRetrans Statistic TcpExtTCPForwardRetrans. # TYPE node_netstat_TcpExt_TCPForwardRetrans untyped node_netstat_TcpExt_TCPForwardRetrans 0 # HELP node_netstat_TcpExt_TCPFullUndo Statistic TcpExtTCPFullUndo. # TYPE node_netstat_TcpExt_TCPFullUndo untyped node_netstat_TcpExt_TCPFullUndo 0 # HELP node_netstat_TcpExt_TCPHPAcks Statistic TcpExtTCPHPAcks. # TYPE node_netstat_TcpExt_TCPHPAcks untyped node_netstat_TcpExt_TCPHPAcks 3.744565e+06 # HELP node_netstat_TcpExt_TCPHPHits Statistic TcpExtTCPHPHits. # TYPE node_netstat_TcpExt_TCPHPHits untyped node_netstat_TcpExt_TCPHPHits 4.471289e+06 # HELP node_netstat_TcpExt_TCPHPHitsToUser Statistic TcpExtTCPHPHitsToUser. # TYPE node_netstat_TcpExt_TCPHPHitsToUser untyped node_netstat_TcpExt_TCPHPHitsToUser 26 # HELP node_netstat_TcpExt_TCPLoss Statistic TcpExtTCPLoss. # TYPE node_netstat_TcpExt_TCPLoss untyped node_netstat_TcpExt_TCPLoss 0 # HELP node_netstat_TcpExt_TCPLossFailures Statistic TcpExtTCPLossFailures. # TYPE node_netstat_TcpExt_TCPLossFailures untyped node_netstat_TcpExt_TCPLossFailures 0 # HELP node_netstat_TcpExt_TCPLossUndo Statistic TcpExtTCPLossUndo. # TYPE node_netstat_TcpExt_TCPLossUndo untyped node_netstat_TcpExt_TCPLossUndo 48 # HELP node_netstat_TcpExt_TCPLostRetransmit Statistic TcpExtTCPLostRetransmit. # TYPE node_netstat_TcpExt_TCPLostRetransmit untyped node_netstat_TcpExt_TCPLostRetransmit 0 # HELP node_netstat_TcpExt_TCPMD5NotFound Statistic TcpExtTCPMD5NotFound. # TYPE node_netstat_TcpExt_TCPMD5NotFound untyped node_netstat_TcpExt_TCPMD5NotFound 0 # HELP node_netstat_TcpExt_TCPMD5Unexpected Statistic TcpExtTCPMD5Unexpected. # TYPE node_netstat_TcpExt_TCPMD5Unexpected untyped node_netstat_TcpExt_TCPMD5Unexpected 0 # HELP node_netstat_TcpExt_TCPMemoryPressures Statistic TcpExtTCPMemoryPressures. # TYPE node_netstat_TcpExt_TCPMemoryPressures untyped node_netstat_TcpExt_TCPMemoryPressures 0 # HELP node_netstat_TcpExt_TCPMinTTLDrop Statistic TcpExtTCPMinTTLDrop. # TYPE node_netstat_TcpExt_TCPMinTTLDrop untyped node_netstat_TcpExt_TCPMinTTLDrop 0 # HELP node_netstat_TcpExt_TCPPartialUndo Statistic TcpExtTCPPartialUndo. # TYPE node_netstat_TcpExt_TCPPartialUndo untyped node_netstat_TcpExt_TCPPartialUndo 0 # HELP node_netstat_TcpExt_TCPPrequeueDropped Statistic TcpExtTCPPrequeueDropped. # TYPE node_netstat_TcpExt_TCPPrequeueDropped untyped node_netstat_TcpExt_TCPPrequeueDropped 0 # HELP node_netstat_TcpExt_TCPPrequeued Statistic TcpExtTCPPrequeued. # TYPE node_netstat_TcpExt_TCPPrequeued untyped node_netstat_TcpExt_TCPPrequeued 80568 # HELP node_netstat_TcpExt_TCPPureAcks Statistic TcpExtTCPPureAcks. # TYPE node_netstat_TcpExt_TCPPureAcks untyped node_netstat_TcpExt_TCPPureAcks 1.43394e+06 # HELP node_netstat_TcpExt_TCPRcvCollapsed Statistic TcpExtTCPRcvCollapsed. # TYPE node_netstat_TcpExt_TCPRcvCollapsed untyped node_netstat_TcpExt_TCPRcvCollapsed 0 # HELP node_netstat_TcpExt_TCPRenoFailures Statistic TcpExtTCPRenoFailures. # TYPE node_netstat_TcpExt_TCPRenoFailures untyped node_netstat_TcpExt_TCPRenoFailures 0 # HELP node_netstat_TcpExt_TCPRenoRecovery Statistic TcpExtTCPRenoRecovery. # TYPE node_netstat_TcpExt_TCPRenoRecovery untyped node_netstat_TcpExt_TCPRenoRecovery 0 # HELP node_netstat_TcpExt_TCPRenoRecoveryFail Statistic TcpExtTCPRenoRecoveryFail. # TYPE node_netstat_TcpExt_TCPRenoRecoveryFail untyped node_netstat_TcpExt_TCPRenoRecoveryFail 0 # HELP node_netstat_TcpExt_TCPRenoReorder Statistic TcpExtTCPRenoReorder. # TYPE node_netstat_TcpExt_TCPRenoReorder untyped node_netstat_TcpExt_TCPRenoReorder 0 # HELP node_netstat_TcpExt_TCPReqQFullDoCookies Statistic TcpExtTCPReqQFullDoCookies. # TYPE node_netstat_TcpExt_TCPReqQFullDoCookies untyped node_netstat_TcpExt_TCPReqQFullDoCookies 0 # HELP node_netstat_TcpExt_TCPReqQFullDrop Statistic TcpExtTCPReqQFullDrop. # TYPE node_netstat_TcpExt_TCPReqQFullDrop untyped node_netstat_TcpExt_TCPReqQFullDrop 0 # HELP node_netstat_TcpExt_TCPSACKDiscard Statistic TcpExtTCPSACKDiscard. # TYPE node_netstat_TcpExt_TCPSACKDiscard untyped node_netstat_TcpExt_TCPSACKDiscard 0 # HELP node_netstat_TcpExt_TCPSACKReneging Statistic TcpExtTCPSACKReneging. # TYPE node_netstat_TcpExt_TCPSACKReneging untyped node_netstat_TcpExt_TCPSACKReneging 0 # HELP node_netstat_TcpExt_TCPSACKReorder Statistic TcpExtTCPSACKReorder. # TYPE node_netstat_TcpExt_TCPSACKReorder untyped node_netstat_TcpExt_TCPSACKReorder 0 # HELP node_netstat_TcpExt_TCPSYNChallenge Statistic TcpExtTCPSYNChallenge. # TYPE node_netstat_TcpExt_TCPSYNChallenge untyped node_netstat_TcpExt_TCPSYNChallenge 2 # HELP node_netstat_TcpExt_TCPSackFailures Statistic TcpExtTCPSackFailures. # TYPE node_netstat_TcpExt_TCPSackFailures untyped node_netstat_TcpExt_TCPSackFailures 1 # HELP node_netstat_TcpExt_TCPSackMerged Statistic TcpExtTCPSackMerged. # TYPE node_netstat_TcpExt_TCPSackMerged untyped node_netstat_TcpExt_TCPSackMerged 2 # HELP node_netstat_TcpExt_TCPSackRecovery Statistic TcpExtTCPSackRecovery. # TYPE node_netstat_TcpExt_TCPSackRecovery untyped node_netstat_TcpExt_TCPSackRecovery 1 # HELP node_netstat_TcpExt_TCPSackRecoveryFail Statistic TcpExtTCPSackRecoveryFail. # TYPE node_netstat_TcpExt_TCPSackRecoveryFail untyped node_netstat_TcpExt_TCPSackRecoveryFail 0 # HELP node_netstat_TcpExt_TCPSackShiftFallback Statistic TcpExtTCPSackShiftFallback. # TYPE node_netstat_TcpExt_TCPSackShiftFallback untyped node_netstat_TcpExt_TCPSackShiftFallback 5 # HELP node_netstat_TcpExt_TCPSackShifted Statistic TcpExtTCPSackShifted. # TYPE node_netstat_TcpExt_TCPSackShifted untyped node_netstat_TcpExt_TCPSackShifted 0 # HELP node_netstat_TcpExt_TCPSchedulerFailed Statistic TcpExtTCPSchedulerFailed. # TYPE node_netstat_TcpExt_TCPSchedulerFailed untyped node_netstat_TcpExt_TCPSchedulerFailed 0 # HELP node_netstat_TcpExt_TCPSlowStartRetrans Statistic TcpExtTCPSlowStartRetrans. # TYPE node_netstat_TcpExt_TCPSlowStartRetrans untyped node_netstat_TcpExt_TCPSlowStartRetrans 1 # HELP node_netstat_TcpExt_TCPSpuriousRTOs Statistic TcpExtTCPSpuriousRTOs. # TYPE node_netstat_TcpExt_TCPSpuriousRTOs untyped node_netstat_TcpExt_TCPSpuriousRTOs 0 # HELP node_netstat_TcpExt_TCPTSReorder Statistic TcpExtTCPTSReorder. # TYPE node_netstat_TcpExt_TCPTSReorder untyped node_netstat_TcpExt_TCPTSReorder 0 # HELP node_netstat_TcpExt_TCPTimeWaitOverflow Statistic TcpExtTCPTimeWaitOverflow. # TYPE node_netstat_TcpExt_TCPTimeWaitOverflow untyped node_netstat_TcpExt_TCPTimeWaitOverflow 0 # HELP node_netstat_TcpExt_TCPTimeouts Statistic TcpExtTCPTimeouts. # TYPE node_netstat_TcpExt_TCPTimeouts untyped node_netstat_TcpExt_TCPTimeouts 115 # HELP node_netstat_TcpExt_TW Statistic TcpExtTW. # TYPE node_netstat_TcpExt_TW untyped node_netstat_TcpExt_TW 388812 # HELP node_netstat_TcpExt_TWKilled Statistic TcpExtTWKilled. # TYPE node_netstat_TcpExt_TWKilled untyped node_netstat_TcpExt_TWKilled 0 # HELP node_netstat_TcpExt_TWRecycled Statistic TcpExtTWRecycled. # TYPE node_netstat_TcpExt_TWRecycled untyped node_netstat_TcpExt_TWRecycled 0 # HELP node_netstat_Tcp_ActiveOpens Statistic TcpActiveOpens. # TYPE node_netstat_Tcp_ActiveOpens untyped node_netstat_Tcp_ActiveOpens 3556 # HELP node_netstat_Tcp_AttemptFails Statistic TcpAttemptFails. # TYPE node_netstat_Tcp_AttemptFails untyped node_netstat_Tcp_AttemptFails 341 # HELP node_netstat_Tcp_CurrEstab Statistic TcpCurrEstab. # TYPE node_netstat_Tcp_CurrEstab untyped node_netstat_Tcp_CurrEstab 0 # HELP node_netstat_Tcp_EstabResets Statistic TcpEstabResets. # TYPE node_netstat_Tcp_EstabResets untyped node_netstat_Tcp_EstabResets 161 # HELP node_netstat_Tcp_InCsumErrors Statistic TcpInCsumErrors. # TYPE node_netstat_Tcp_InCsumErrors untyped node_netstat_Tcp_InCsumErrors 0 # HELP node_netstat_Tcp_InErrs Statistic TcpInErrs. # TYPE node_netstat_Tcp_InErrs untyped node_netstat_Tcp_InErrs 5 # HELP node_netstat_Tcp_InSegs Statistic TcpInSegs. # TYPE node_netstat_Tcp_InSegs untyped node_netstat_Tcp_InSegs 5.7252008e+07 # HELP node_netstat_Tcp_MaxConn Statistic TcpMaxConn. # TYPE node_netstat_Tcp_MaxConn untyped node_netstat_Tcp_MaxConn -1 # HELP node_netstat_Tcp_OutRsts Statistic TcpOutRsts. # TYPE node_netstat_Tcp_OutRsts untyped node_netstat_Tcp_OutRsts 1003 # HELP node_netstat_Tcp_OutSegs Statistic TcpOutSegs. # TYPE node_netstat_Tcp_OutSegs untyped node_netstat_Tcp_OutSegs 5.4915039e+07 # HELP node_netstat_Tcp_PassiveOpens Statistic TcpPassiveOpens. # TYPE node_netstat_Tcp_PassiveOpens untyped node_netstat_Tcp_PassiveOpens 230 # HELP node_netstat_Tcp_RetransSegs Statistic TcpRetransSegs. # TYPE node_netstat_Tcp_RetransSegs untyped node_netstat_Tcp_RetransSegs 227 # HELP node_netstat_Tcp_RtoAlgorithm Statistic TcpRtoAlgorithm. # TYPE node_netstat_Tcp_RtoAlgorithm untyped node_netstat_Tcp_RtoAlgorithm 1 # HELP node_netstat_Tcp_RtoMax Statistic TcpRtoMax. # TYPE node_netstat_Tcp_RtoMax untyped node_netstat_Tcp_RtoMax 120000 # HELP node_netstat_Tcp_RtoMin Statistic TcpRtoMin. # TYPE node_netstat_Tcp_RtoMin untyped node_netstat_Tcp_RtoMin 200 # HELP node_netstat_Udp6_IgnoredMulti Statistic Udp6IgnoredMulti. # TYPE node_netstat_Udp6_IgnoredMulti untyped node_netstat_Udp6_IgnoredMulti 0 # HELP node_netstat_Udp6_InCsumErrors Statistic Udp6InCsumErrors. # TYPE node_netstat_Udp6_InCsumErrors untyped node_netstat_Udp6_InCsumErrors 0 # HELP node_netstat_Udp6_InDatagrams Statistic Udp6InDatagrams. # TYPE node_netstat_Udp6_InDatagrams untyped node_netstat_Udp6_InDatagrams 0 # HELP node_netstat_Udp6_InErrors Statistic Udp6InErrors. # TYPE node_netstat_Udp6_InErrors untyped node_netstat_Udp6_InErrors 0 # HELP node_netstat_Udp6_NoPorts Statistic Udp6NoPorts. # TYPE node_netstat_Udp6_NoPorts untyped node_netstat_Udp6_NoPorts 0 # HELP node_netstat_Udp6_OutDatagrams Statistic Udp6OutDatagrams. # TYPE node_netstat_Udp6_OutDatagrams untyped node_netstat_Udp6_OutDatagrams 0 # HELP node_netstat_Udp6_RcvbufErrors Statistic Udp6RcvbufErrors. # TYPE node_netstat_Udp6_RcvbufErrors untyped node_netstat_Udp6_RcvbufErrors 0 # HELP node_netstat_Udp6_SndbufErrors Statistic Udp6SndbufErrors. # TYPE node_netstat_Udp6_SndbufErrors untyped node_netstat_Udp6_SndbufErrors 0 # HELP node_netstat_UdpLite6_InCsumErrors Statistic UdpLite6InCsumErrors. # TYPE node_netstat_UdpLite6_InCsumErrors untyped node_netstat_UdpLite6_InCsumErrors 0 # HELP node_netstat_UdpLite6_InDatagrams Statistic UdpLite6InDatagrams. # TYPE node_netstat_UdpLite6_InDatagrams untyped node_netstat_UdpLite6_InDatagrams 0 # HELP node_netstat_UdpLite6_InErrors Statistic UdpLite6InErrors. # TYPE node_netstat_UdpLite6_InErrors untyped node_netstat_UdpLite6_InErrors 0 # HELP node_netstat_UdpLite6_NoPorts Statistic UdpLite6NoPorts. # TYPE node_netstat_UdpLite6_NoPorts untyped node_netstat_UdpLite6_NoPorts 0 # HELP node_netstat_UdpLite6_OutDatagrams Statistic UdpLite6OutDatagrams. # TYPE node_netstat_UdpLite6_OutDatagrams untyped node_netstat_UdpLite6_OutDatagrams 0 # HELP node_netstat_UdpLite6_RcvbufErrors Statistic UdpLite6RcvbufErrors. # TYPE node_netstat_UdpLite6_RcvbufErrors untyped node_netstat_UdpLite6_RcvbufErrors 0 # HELP node_netstat_UdpLite6_SndbufErrors Statistic UdpLite6SndbufErrors. # TYPE node_netstat_UdpLite6_SndbufErrors untyped node_netstat_UdpLite6_SndbufErrors 0 # HELP node_netstat_UdpLite_InCsumErrors Statistic UdpLiteInCsumErrors. # TYPE node_netstat_UdpLite_InCsumErrors untyped node_netstat_UdpLite_InCsumErrors 0 # HELP node_netstat_UdpLite_InDatagrams Statistic UdpLiteInDatagrams. # TYPE node_netstat_UdpLite_InDatagrams untyped node_netstat_UdpLite_InDatagrams 0 # HELP node_netstat_UdpLite_InErrors Statistic UdpLiteInErrors. # TYPE node_netstat_UdpLite_InErrors untyped node_netstat_UdpLite_InErrors 0 # HELP node_netstat_UdpLite_NoPorts Statistic UdpLiteNoPorts. # TYPE node_netstat_UdpLite_NoPorts untyped node_netstat_UdpLite_NoPorts 0 # HELP node_netstat_UdpLite_OutDatagrams Statistic UdpLiteOutDatagrams. # TYPE node_netstat_UdpLite_OutDatagrams untyped node_netstat_UdpLite_OutDatagrams 0 # HELP node_netstat_UdpLite_RcvbufErrors Statistic UdpLiteRcvbufErrors. # TYPE node_netstat_UdpLite_RcvbufErrors untyped node_netstat_UdpLite_RcvbufErrors 0 # HELP node_netstat_UdpLite_SndbufErrors Statistic UdpLiteSndbufErrors. # TYPE node_netstat_UdpLite_SndbufErrors untyped node_netstat_UdpLite_SndbufErrors 0 # HELP node_netstat_Udp_InCsumErrors Statistic UdpInCsumErrors. # TYPE node_netstat_Udp_InCsumErrors untyped node_netstat_Udp_InCsumErrors 0 # HELP node_netstat_Udp_InDatagrams Statistic UdpInDatagrams. # TYPE node_netstat_Udp_InDatagrams untyped node_netstat_Udp_InDatagrams 88542 # HELP node_netstat_Udp_InErrors Statistic UdpInErrors. # TYPE node_netstat_Udp_InErrors untyped node_netstat_Udp_InErrors 0 # HELP node_netstat_Udp_NoPorts Statistic UdpNoPorts. # TYPE node_netstat_Udp_NoPorts untyped node_netstat_Udp_NoPorts 120 # HELP node_netstat_Udp_OutDatagrams Statistic UdpOutDatagrams. # TYPE node_netstat_Udp_OutDatagrams untyped node_netstat_Udp_OutDatagrams 53028 # HELP node_netstat_Udp_RcvbufErrors Statistic UdpRcvbufErrors. # TYPE node_netstat_Udp_RcvbufErrors untyped node_netstat_Udp_RcvbufErrors 0 # HELP node_netstat_Udp_SndbufErrors Statistic UdpSndbufErrors. # TYPE node_netstat_Udp_SndbufErrors untyped node_netstat_Udp_SndbufErrors 0 # HELP node_network_receive_bytes Network device statistic receive_bytes. # TYPE node_network_receive_bytes gauge node_network_receive_bytes{device="docker0"} 6.4910168e+07 node_network_receive_bytes{device="eth0"} 6.8210035552e+10 node_network_receive_bytes{device="lo"} 4.35303245e+08 node_network_receive_bytes{device="lxcbr0"} 0 node_network_receive_bytes{device="tun0"} 1888 node_network_receive_bytes{device="veth4B09XN"} 648 node_network_receive_bytes{device="wlan0"} 1.0437182923e+10 # HELP node_network_receive_compressed Network device statistic receive_compressed. # TYPE node_network_receive_compressed gauge node_network_receive_compressed{device="docker0"} 0 node_network_receive_compressed{device="eth0"} 0 node_network_receive_compressed{device="lo"} 0 node_network_receive_compressed{device="lxcbr0"} 0 node_network_receive_compressed{device="tun0"} 0 node_network_receive_compressed{device="veth4B09XN"} 0 node_network_receive_compressed{device="wlan0"} 0 # HELP node_network_receive_drop Network device statistic receive_drop. # TYPE node_network_receive_drop gauge node_network_receive_drop{device="docker0"} 0 node_network_receive_drop{device="eth0"} 0 node_network_receive_drop{device="lo"} 0 node_network_receive_drop{device="lxcbr0"} 0 node_network_receive_drop{device="tun0"} 0 node_network_receive_drop{device="veth4B09XN"} 0 node_network_receive_drop{device="wlan0"} 0 # HELP node_network_receive_errs Network device statistic receive_errs. # TYPE node_network_receive_errs gauge node_network_receive_errs{device="docker0"} 0 node_network_receive_errs{device="eth0"} 0 node_network_receive_errs{device="lo"} 0 node_network_receive_errs{device="lxcbr0"} 0 node_network_receive_errs{device="tun0"} 0 node_network_receive_errs{device="veth4B09XN"} 0 node_network_receive_errs{device="wlan0"} 0 # HELP node_network_receive_fifo Network device statistic receive_fifo. # TYPE node_network_receive_fifo gauge node_network_receive_fifo{device="docker0"} 0 node_network_receive_fifo{device="eth0"} 0 node_network_receive_fifo{device="lo"} 0 node_network_receive_fifo{device="lxcbr0"} 0 node_network_receive_fifo{device="tun0"} 0 node_network_receive_fifo{device="veth4B09XN"} 0 node_network_receive_fifo{device="wlan0"} 0 # HELP node_network_receive_frame Network device statistic receive_frame. # TYPE node_network_receive_frame gauge node_network_receive_frame{device="docker0"} 0 node_network_receive_frame{device="eth0"} 0 node_network_receive_frame{device="lo"} 0 node_network_receive_frame{device="lxcbr0"} 0 node_network_receive_frame{device="tun0"} 0 node_network_receive_frame{device="veth4B09XN"} 0 node_network_receive_frame{device="wlan0"} 0 # HELP node_network_receive_multicast Network device statistic receive_multicast. # TYPE node_network_receive_multicast gauge node_network_receive_multicast{device="docker0"} 0 node_network_receive_multicast{device="eth0"} 0 node_network_receive_multicast{device="lo"} 0 node_network_receive_multicast{device="lxcbr0"} 0 node_network_receive_multicast{device="tun0"} 0 node_network_receive_multicast{device="veth4B09XN"} 0 node_network_receive_multicast{device="wlan0"} 0 # HELP node_network_receive_packets Network device statistic receive_packets. # TYPE node_network_receive_packets gauge node_network_receive_packets{device="docker0"} 1.065585e+06 node_network_receive_packets{device="eth0"} 5.20993275e+08 node_network_receive_packets{device="lo"} 1.832522e+06 node_network_receive_packets{device="lxcbr0"} 0 node_network_receive_packets{device="tun0"} 24 node_network_receive_packets{device="veth4B09XN"} 8 node_network_receive_packets{device="wlan0"} 1.3899359e+07 # HELP node_network_transmit_bytes Network device statistic transmit_bytes. # TYPE node_network_transmit_bytes gauge node_network_transmit_bytes{device="docker0"} 2.681662018e+09 node_network_transmit_bytes{device="eth0"} 9.315587528e+09 node_network_transmit_bytes{device="lo"} 4.35303245e+08 node_network_transmit_bytes{device="lxcbr0"} 2.630299e+06 node_network_transmit_bytes{device="tun0"} 67120 node_network_transmit_bytes{device="veth4B09XN"} 1.943284e+06 node_network_transmit_bytes{device="wlan0"} 2.85164936e+09 # HELP node_network_transmit_compressed Network device statistic transmit_compressed. # TYPE node_network_transmit_compressed gauge node_network_transmit_compressed{device="docker0"} 0 node_network_transmit_compressed{device="eth0"} 0 node_network_transmit_compressed{device="lo"} 0 node_network_transmit_compressed{device="lxcbr0"} 0 node_network_transmit_compressed{device="tun0"} 0 node_network_transmit_compressed{device="veth4B09XN"} 0 node_network_transmit_compressed{device="wlan0"} 0 # HELP node_network_transmit_drop Network device statistic transmit_drop. # TYPE node_network_transmit_drop gauge node_network_transmit_drop{device="docker0"} 0 node_network_transmit_drop{device="eth0"} 0 node_network_transmit_drop{device="lo"} 0 node_network_transmit_drop{device="lxcbr0"} 0 node_network_transmit_drop{device="tun0"} 0 node_network_transmit_drop{device="veth4B09XN"} 0 node_network_transmit_drop{device="wlan0"} 0 # HELP node_network_transmit_errs Network device statistic transmit_errs. # TYPE node_network_transmit_errs gauge node_network_transmit_errs{device="docker0"} 0 node_network_transmit_errs{device="eth0"} 0 node_network_transmit_errs{device="lo"} 0 node_network_transmit_errs{device="lxcbr0"} 0 node_network_transmit_errs{device="tun0"} 0 node_network_transmit_errs{device="veth4B09XN"} 0 node_network_transmit_errs{device="wlan0"} 0 # HELP node_network_transmit_fifo Network device statistic transmit_fifo. # TYPE node_network_transmit_fifo gauge node_network_transmit_fifo{device="docker0"} 0 node_network_transmit_fifo{device="eth0"} 0 node_network_transmit_fifo{device="lo"} 0 node_network_transmit_fifo{device="lxcbr0"} 0 node_network_transmit_fifo{device="tun0"} 0 node_network_transmit_fifo{device="veth4B09XN"} 0 node_network_transmit_fifo{device="wlan0"} 0 # HELP node_network_transmit_frame Network device statistic transmit_frame. # TYPE node_network_transmit_frame gauge node_network_transmit_frame{device="docker0"} 0 node_network_transmit_frame{device="eth0"} 0 node_network_transmit_frame{device="lo"} 0 node_network_transmit_frame{device="lxcbr0"} 0 node_network_transmit_frame{device="tun0"} 0 node_network_transmit_frame{device="veth4B09XN"} 0 node_network_transmit_frame{device="wlan0"} 0 # HELP node_network_transmit_multicast Network device statistic transmit_multicast. # TYPE node_network_transmit_multicast gauge node_network_transmit_multicast{device="docker0"} 0 node_network_transmit_multicast{device="eth0"} 0 node_network_transmit_multicast{device="lo"} 0 node_network_transmit_multicast{device="lxcbr0"} 0 node_network_transmit_multicast{device="tun0"} 0 node_network_transmit_multicast{device="veth4B09XN"} 0 node_network_transmit_multicast{device="wlan0"} 0 # HELP node_network_transmit_packets Network device statistic transmit_packets. # TYPE node_network_transmit_packets gauge node_network_transmit_packets{device="docker0"} 1.929779e+06 node_network_transmit_packets{device="eth0"} 4.3451486e+07 node_network_transmit_packets{device="lo"} 1.832522e+06 node_network_transmit_packets{device="lxcbr0"} 28339 node_network_transmit_packets{device="tun0"} 934 node_network_transmit_packets{device="veth4B09XN"} 10640 node_network_transmit_packets{device="wlan0"} 1.17262e+07 # HELP node_nf_conntrack_entries Number of currently allocated flow entries for connection tracking. # TYPE node_nf_conntrack_entries gauge node_nf_conntrack_entries 123 # HELP node_nf_conntrack_entries_limit Maximum size of connection tracking table. # TYPE node_nf_conntrack_entries_limit gauge node_nf_conntrack_entries_limit 65536 # HELP node_nfs_net_connections Number of connections at the network layer. # TYPE node_nfs_net_connections counter node_nfs_net_connections{protocol="tcp"} 45 # HELP node_nfs_net_reads Number of reads at the network layer. # TYPE node_nfs_net_reads counter node_nfs_net_reads{protocol="tcp"} 69 node_nfs_net_reads{protocol="udp"} 70 # HELP node_nfs_procedures Number of NFS procedures invoked. # TYPE node_nfs_procedures counter node_nfs_procedures{procedure="access",version="3"} 1.17661341e+08 node_nfs_procedures{procedure="access",version="4"} 58 node_nfs_procedures{procedure="close",version="4"} 28 node_nfs_procedures{procedure="commit",version="3"} 23729 node_nfs_procedures{procedure="commit",version="4"} 83 node_nfs_procedures{procedure="create",version="2"} 52 node_nfs_procedures{procedure="create",version="3"} 2.993289e+06 node_nfs_procedures{procedure="create",version="4"} 15 node_nfs_procedures{procedure="create_session",version="4"} 32 node_nfs_procedures{procedure="delegreturn",version="4"} 97 node_nfs_procedures{procedure="destroy_session",version="4"} 67 node_nfs_procedures{procedure="exchange_id",version="4"} 58 node_nfs_procedures{procedure="fs_locations",version="4"} 32 node_nfs_procedures{procedure="fsid_present",version="4"} 11 node_nfs_procedures{procedure="fsinfo",version="3"} 2 node_nfs_procedures{procedure="fsinfo",version="4"} 68 node_nfs_procedures{procedure="fsstat",version="3"} 13332 node_nfs_procedures{procedure="get_lease_time",version="4"} 28 node_nfs_procedures{procedure="getacl",version="4"} 36 node_nfs_procedures{procedure="getattr",version="2"} 57 node_nfs_procedures{procedure="getattr",version="3"} 1.061909262e+09 node_nfs_procedures{procedure="getattr",version="4"} 88 node_nfs_procedures{procedure="getdeviceinfo",version="4"} 1 node_nfs_procedures{procedure="layoutcommit",version="4"} 26 node_nfs_procedures{procedure="layoutget",version="4"} 90 node_nfs_procedures{procedure="layoutreturn",version="4"} 0 node_nfs_procedures{procedure="link",version="2"} 17 node_nfs_procedures{procedure="link",version="3"} 0 node_nfs_procedures{procedure="link",version="4"} 21 node_nfs_procedures{procedure="lock",version="4"} 39 node_nfs_procedures{procedure="lockt",version="4"} 68 node_nfs_procedures{procedure="locku",version="4"} 59 node_nfs_procedures{procedure="lookup",version="2"} 71 node_nfs_procedures{procedure="lookup",version="3"} 4.077635e+06 node_nfs_procedures{procedure="lookup",version="4"} 29 node_nfs_procedures{procedure="lookup_root",version="4"} 74 node_nfs_procedures{procedure="mkdir",version="2"} 50 node_nfs_procedures{procedure="mkdir",version="3"} 590 node_nfs_procedures{procedure="mknod",version="3"} 0 node_nfs_procedures{procedure="null",version="2"} 16 node_nfs_procedures{procedure="null",version="3"} 0 node_nfs_procedures{procedure="null",version="4"} 98 node_nfs_procedures{procedure="open",version="4"} 85 node_nfs_procedures{procedure="open_confirm",version="4"} 23 node_nfs_procedures{procedure="open_downgrade",version="4"} 1 node_nfs_procedures{procedure="open_noattr",version="4"} 24 node_nfs_procedures{procedure="pathconf",version="3"} 1 node_nfs_procedures{procedure="pathconf",version="4"} 53 node_nfs_procedures{procedure="read",version="2"} 45 node_nfs_procedures{procedure="read",version="3"} 2.9391916e+07 node_nfs_procedures{procedure="read",version="4"} 51 node_nfs_procedures{procedure="readdir",version="2"} 70 node_nfs_procedures{procedure="readdir",version="3"} 3983 node_nfs_procedures{procedure="readdir",version="4"} 66 node_nfs_procedures{procedure="readdirplus",version="3"} 92385 node_nfs_procedures{procedure="readlink",version="2"} 73 node_nfs_procedures{procedure="readlink",version="3"} 5 node_nfs_procedures{procedure="readlink",version="4"} 54 node_nfs_procedures{procedure="reclaim_complete",version="4"} 35 node_nfs_procedures{procedure="release_lockowner",version="4"} 85 node_nfs_procedures{procedure="remove",version="2"} 83 node_nfs_procedures{procedure="remove",version="3"} 7815 node_nfs_procedures{procedure="remove",version="4"} 69 node_nfs_procedures{procedure="rename",version="2"} 61 node_nfs_procedures{procedure="rename",version="3"} 1130 node_nfs_procedures{procedure="rename",version="4"} 96 node_nfs_procedures{procedure="renew",version="4"} 83 node_nfs_procedures{procedure="rmdir",version="2"} 23 node_nfs_procedures{procedure="rmdir",version="3"} 15 node_nfs_procedures{procedure="root",version="2"} 52 node_nfs_procedures{procedure="secinfo",version="4"} 81 node_nfs_procedures{procedure="sequence",version="4"} 13 node_nfs_procedures{procedure="server_caps",version="4"} 56 node_nfs_procedures{procedure="setacl",version="4"} 49 node_nfs_procedures{procedure="setattr",version="2"} 74 node_nfs_procedures{procedure="setattr",version="3"} 48906 node_nfs_procedures{procedure="setattr",version="4"} 73 node_nfs_procedures{procedure="setclientid",version="4"} 12 node_nfs_procedures{procedure="setclientid_confirm",version="4"} 84 node_nfs_procedures{procedure="statfs",version="2"} 82 node_nfs_procedures{procedure="statfs",version="4"} 86 node_nfs_procedures{procedure="symlink",version="2"} 53 node_nfs_procedures{procedure="symlink",version="3"} 0 node_nfs_procedures{procedure="symlink",version="4"} 84 node_nfs_procedures{procedure="write",version="2"} 0 node_nfs_procedures{procedure="write",version="3"} 2.570425e+06 node_nfs_procedures{procedure="write",version="4"} 54 node_nfs_procedures{procedure="writecache",version="2"} 86 # HELP node_nfs_rpc_authentication_refreshes Number of RPC authentication refreshes performed. # TYPE node_nfs_rpc_authentication_refreshes counter node_nfs_rpc_authentication_refreshes 1.218815394e+09 # HELP node_nfs_rpc_operations Number of RPCs performed. # TYPE node_nfs_rpc_operations counter node_nfs_rpc_operations 1.218785755e+09 # HELP node_nfs_rpc_retransmissions Number of RPC transmissions performed. # TYPE node_nfs_rpc_retransmissions counter node_nfs_rpc_retransmissions 374636 # HELP node_procs_blocked Number of processes blocked waiting for I/O to complete. # TYPE node_procs_blocked gauge node_procs_blocked 0 # HELP node_procs_running Number of processes in runnable state. # TYPE node_procs_running gauge node_procs_running 2 # HELP node_qdisc_bytes_total Number of bytes sent. # TYPE node_qdisc_bytes_total counter node_qdisc_bytes_total{device="eth0",kind="pfifo_fast"} 83 node_qdisc_bytes_total{device="wlan0",kind="fq"} 42 # HELP node_qdisc_drops_total Number of packets dropped. # TYPE node_qdisc_drops_total counter node_qdisc_drops_total{device="eth0",kind="pfifo_fast"} 0 node_qdisc_drops_total{device="wlan0",kind="fq"} 1 # HELP node_qdisc_overlimits_total Number of overlimit packets. # TYPE node_qdisc_overlimits_total counter node_qdisc_overlimits_total{device="eth0",kind="pfifo_fast"} 0 node_qdisc_overlimits_total{device="wlan0",kind="fq"} 0 # HELP node_qdisc_packets_total Number of packets sent. # TYPE node_qdisc_packets_total counter node_qdisc_packets_total{device="eth0",kind="pfifo_fast"} 83 node_qdisc_packets_total{device="wlan0",kind="fq"} 42 # HELP node_qdisc_requeues_total Number of packets dequeued, not transmitted, and requeued. # TYPE node_qdisc_requeues_total counter node_qdisc_requeues_total{device="eth0",kind="pfifo_fast"} 2 node_qdisc_requeues_total{device="wlan0",kind="fq"} 1 # HELP node_scrape_collector_duration_seconds node_exporter: Duration of a collector scrape. # TYPE node_scrape_collector_duration_seconds gauge # HELP node_scrape_collector_success node_exporter: Whether a collector succeeded. # TYPE node_scrape_collector_success gauge node_scrape_collector_success{collector="arp"} 1 node_scrape_collector_success{collector="bcache"} 1 node_scrape_collector_success{collector="bonding"} 1 node_scrape_collector_success{collector="buddyinfo"} 1 node_scrape_collector_success{collector="conntrack"} 1 node_scrape_collector_success{collector="cpu"} 1 node_scrape_collector_success{collector="diskstats"} 1 node_scrape_collector_success{collector="drbd"} 1 node_scrape_collector_success{collector="edac"} 1 node_scrape_collector_success{collector="entropy"} 1 node_scrape_collector_success{collector="filefd"} 1 node_scrape_collector_success{collector="hwmon"} 1 node_scrape_collector_success{collector="infiniband"} 1 node_scrape_collector_success{collector="interrupts"} 1 node_scrape_collector_success{collector="ipvs"} 1 node_scrape_collector_success{collector="ksmd"} 1 node_scrape_collector_success{collector="loadavg"} 1 node_scrape_collector_success{collector="mdadm"} 1 node_scrape_collector_success{collector="megacli"} 1 node_scrape_collector_success{collector="meminfo"} 1 node_scrape_collector_success{collector="meminfo_numa"} 1 node_scrape_collector_success{collector="mountstats"} 1 node_scrape_collector_success{collector="netdev"} 1 node_scrape_collector_success{collector="netstat"} 1 node_scrape_collector_success{collector="nfs"} 1 node_scrape_collector_success{collector="qdisc"} 1 node_scrape_collector_success{collector="sockstat"} 1 node_scrape_collector_success{collector="stat"} 1 node_scrape_collector_success{collector="textfile"} 1 node_scrape_collector_success{collector="wifi"} 1 node_scrape_collector_success{collector="xfs"} 1 node_scrape_collector_success{collector="zfs"} 1 # HELP node_sockstat_FRAG_inuse Number of FRAG sockets in state inuse. # TYPE node_sockstat_FRAG_inuse gauge node_sockstat_FRAG_inuse 0 # HELP node_sockstat_FRAG_memory Number of FRAG sockets in state memory. # TYPE node_sockstat_FRAG_memory gauge node_sockstat_FRAG_memory 0 # HELP node_sockstat_RAW_inuse Number of RAW sockets in state inuse. # TYPE node_sockstat_RAW_inuse gauge node_sockstat_RAW_inuse 0 # HELP node_sockstat_TCP_alloc Number of TCP sockets in state alloc. # TYPE node_sockstat_TCP_alloc gauge node_sockstat_TCP_alloc 17 # HELP node_sockstat_TCP_inuse Number of TCP sockets in state inuse. # TYPE node_sockstat_TCP_inuse gauge node_sockstat_TCP_inuse 4 # HELP node_sockstat_TCP_mem Number of TCP sockets in state mem. # TYPE node_sockstat_TCP_mem gauge node_sockstat_TCP_mem 1 # HELP node_sockstat_TCP_mem_bytes Number of TCP sockets in state mem_bytes. # TYPE node_sockstat_TCP_mem_bytes gauge node_sockstat_TCP_mem_bytes 4096 # HELP node_sockstat_TCP_orphan Number of TCP sockets in state orphan. # TYPE node_sockstat_TCP_orphan gauge node_sockstat_TCP_orphan 0 # HELP node_sockstat_TCP_tw Number of TCP sockets in state tw. # TYPE node_sockstat_TCP_tw gauge node_sockstat_TCP_tw 4 # HELP node_sockstat_UDPLITE_inuse Number of UDPLITE sockets in state inuse. # TYPE node_sockstat_UDPLITE_inuse gauge node_sockstat_UDPLITE_inuse 0 # HELP node_sockstat_UDP_inuse Number of UDP sockets in state inuse. # TYPE node_sockstat_UDP_inuse gauge node_sockstat_UDP_inuse 0 # HELP node_sockstat_UDP_mem Number of UDP sockets in state mem. # TYPE node_sockstat_UDP_mem gauge node_sockstat_UDP_mem 0 # HELP node_sockstat_UDP_mem_bytes Number of UDP sockets in state mem_bytes. # TYPE node_sockstat_UDP_mem_bytes gauge node_sockstat_UDP_mem_bytes 0 # HELP node_sockstat_sockets_used Number of sockets sockets in state used. # TYPE node_sockstat_sockets_used gauge node_sockstat_sockets_used 229 # HELP node_textfile_mtime Unixtime mtime of textfiles successfully read. # TYPE node_textfile_mtime gauge # HELP node_textfile_scrape_error 1 if there was an error opening or reading a file, 0 otherwise # TYPE node_textfile_scrape_error gauge node_textfile_scrape_error 0 # HELP node_wifi_interface_frequency_hertz The current frequency a WiFi interface is operating at, in hertz. # TYPE node_wifi_interface_frequency_hertz gauge node_wifi_interface_frequency_hertz{device="wlan0"} 2.412e+09 node_wifi_interface_frequency_hertz{device="wlan1"} 2.412e+09 # HELP node_wifi_station_beacon_loss_total The total number of times a station has detected a beacon loss. # TYPE node_wifi_station_beacon_loss_total counter node_wifi_station_beacon_loss_total{device="wlan0"} 1 # HELP node_wifi_station_connected_seconds_total The total number of seconds a station has been connected to an access point. # TYPE node_wifi_station_connected_seconds_total counter node_wifi_station_connected_seconds_total{device="wlan0"} 30 # HELP node_wifi_station_inactive_seconds The number of seconds since any wireless activity has occurred on a station. # TYPE node_wifi_station_inactive_seconds gauge node_wifi_station_inactive_seconds{device="wlan0"} 0.4 # HELP node_wifi_station_info Labeled WiFi interface station information as provided by the operating system. # TYPE node_wifi_station_info gauge node_wifi_station_info{bssid="00:11:22:33:44:55",device="wlan0",mode="client",ssid="Example"} 1 # HELP node_wifi_station_receive_bits_per_second The current WiFi receive bitrate of a station, in bits per second. # TYPE node_wifi_station_receive_bits_per_second gauge node_wifi_station_receive_bits_per_second{device="wlan0"} 1.28e+08 # HELP node_wifi_station_signal_dbm The current WiFi signal strength, in decibel-milliwatts (dBm). # TYPE node_wifi_station_signal_dbm gauge node_wifi_station_signal_dbm{device="wlan0"} -52 # HELP node_wifi_station_transmit_bits_per_second The current WiFi transmit bitrate of a station, in bits per second. # TYPE node_wifi_station_transmit_bits_per_second gauge node_wifi_station_transmit_bits_per_second{device="wlan0"} 1.64e+08 # HELP node_wifi_station_transmit_failed_total The total number of times a station has failed to send a packet. # TYPE node_wifi_station_transmit_failed_total counter node_wifi_station_transmit_failed_total{device="wlan0"} 2 # HELP node_wifi_station_transmit_retries_total The total number of times a station has had to retry while sending a packet. # TYPE node_wifi_station_transmit_retries_total counter node_wifi_station_transmit_retries_total{device="wlan0"} 10 # HELP node_xfs_allocation_btree_compares_total Number of allocation B-tree compares for a filesystem. # TYPE node_xfs_allocation_btree_compares_total counter node_xfs_allocation_btree_compares_total{device="sda1"} 0 # HELP node_xfs_allocation_btree_lookups_total Number of allocation B-tree lookups for a filesystem. # TYPE node_xfs_allocation_btree_lookups_total counter node_xfs_allocation_btree_lookups_total{device="sda1"} 0 # HELP node_xfs_allocation_btree_records_deleted_total Number of allocation B-tree records deleted for a filesystem. # TYPE node_xfs_allocation_btree_records_deleted_total counter node_xfs_allocation_btree_records_deleted_total{device="sda1"} 0 # HELP node_xfs_allocation_btree_records_inserted_total Number of allocation B-tree records inserted for a filesystem. # TYPE node_xfs_allocation_btree_records_inserted_total counter node_xfs_allocation_btree_records_inserted_total{device="sda1"} 0 # HELP node_xfs_block_map_btree_compares_total Number of block map B-tree compares for a filesystem. # TYPE node_xfs_block_map_btree_compares_total counter node_xfs_block_map_btree_compares_total{device="sda1"} 0 # HELP node_xfs_block_map_btree_lookups_total Number of block map B-tree lookups for a filesystem. # TYPE node_xfs_block_map_btree_lookups_total counter node_xfs_block_map_btree_lookups_total{device="sda1"} 0 # HELP node_xfs_block_map_btree_records_deleted_total Number of block map B-tree records deleted for a filesystem. # TYPE node_xfs_block_map_btree_records_deleted_total counter node_xfs_block_map_btree_records_deleted_total{device="sda1"} 0 # HELP node_xfs_block_map_btree_records_inserted_total Number of block map B-tree records inserted for a filesystem. # TYPE node_xfs_block_map_btree_records_inserted_total counter node_xfs_block_map_btree_records_inserted_total{device="sda1"} 0 # HELP node_xfs_block_mapping_extent_list_compares_total Number of extent list compares for a filesystem. # TYPE node_xfs_block_mapping_extent_list_compares_total counter node_xfs_block_mapping_extent_list_compares_total{device="sda1"} 0 # HELP node_xfs_block_mapping_extent_list_deletions_total Number of extent list deletions for a filesystem. # TYPE node_xfs_block_mapping_extent_list_deletions_total counter node_xfs_block_mapping_extent_list_deletions_total{device="sda1"} 1 # HELP node_xfs_block_mapping_extent_list_insertions_total Number of extent list insertions for a filesystem. # TYPE node_xfs_block_mapping_extent_list_insertions_total counter node_xfs_block_mapping_extent_list_insertions_total{device="sda1"} 1 # HELP node_xfs_block_mapping_extent_list_lookups_total Number of extent list lookups for a filesystem. # TYPE node_xfs_block_mapping_extent_list_lookups_total counter node_xfs_block_mapping_extent_list_lookups_total{device="sda1"} 91 # HELP node_xfs_block_mapping_reads_total Number of block map for read operations for a filesystem. # TYPE node_xfs_block_mapping_reads_total counter node_xfs_block_mapping_reads_total{device="sda1"} 61 # HELP node_xfs_block_mapping_unmaps_total Number of block unmaps (deletes) for a filesystem. # TYPE node_xfs_block_mapping_unmaps_total counter node_xfs_block_mapping_unmaps_total{device="sda1"} 1 # HELP node_xfs_block_mapping_writes_total Number of block map for write operations for a filesystem. # TYPE node_xfs_block_mapping_writes_total counter node_xfs_block_mapping_writes_total{device="sda1"} 29 # HELP node_xfs_extent_allocation_blocks_allocated_total Number of blocks allocated for a filesystem. # TYPE node_xfs_extent_allocation_blocks_allocated_total counter node_xfs_extent_allocation_blocks_allocated_total{device="sda1"} 872 # HELP node_xfs_extent_allocation_blocks_freed_total Number of blocks freed for a filesystem. # TYPE node_xfs_extent_allocation_blocks_freed_total counter node_xfs_extent_allocation_blocks_freed_total{device="sda1"} 0 # HELP node_xfs_extent_allocation_extents_allocated_total Number of extents allocated for a filesystem. # TYPE node_xfs_extent_allocation_extents_allocated_total counter node_xfs_extent_allocation_extents_allocated_total{device="sda1"} 1 # HELP node_xfs_extent_allocation_extents_freed_total Number of extents freed for a filesystem. # TYPE node_xfs_extent_allocation_extents_freed_total counter node_xfs_extent_allocation_extents_freed_total{device="sda1"} 0 # HELP node_zfs_arc_anon_evictable_data kstat.zfs.misc.arcstats.anon_evictable_data # TYPE node_zfs_arc_anon_evictable_data untyped node_zfs_arc_anon_evictable_data 0 # HELP node_zfs_arc_anon_evictable_metadata kstat.zfs.misc.arcstats.anon_evictable_metadata # TYPE node_zfs_arc_anon_evictable_metadata untyped node_zfs_arc_anon_evictable_metadata 0 # HELP node_zfs_arc_anon_size kstat.zfs.misc.arcstats.anon_size # TYPE node_zfs_arc_anon_size untyped node_zfs_arc_anon_size 1.91744e+06 # HELP node_zfs_arc_arc_loaned_bytes kstat.zfs.misc.arcstats.arc_loaned_bytes # TYPE node_zfs_arc_arc_loaned_bytes untyped node_zfs_arc_arc_loaned_bytes 0 # HELP node_zfs_arc_arc_meta_limit kstat.zfs.misc.arcstats.arc_meta_limit # TYPE node_zfs_arc_arc_meta_limit untyped node_zfs_arc_arc_meta_limit 6.275982336e+09 # HELP node_zfs_arc_arc_meta_max kstat.zfs.misc.arcstats.arc_meta_max # TYPE node_zfs_arc_arc_meta_max untyped node_zfs_arc_arc_meta_max 4.49286096e+08 # HELP node_zfs_arc_arc_meta_min kstat.zfs.misc.arcstats.arc_meta_min # TYPE node_zfs_arc_arc_meta_min untyped node_zfs_arc_arc_meta_min 1.6777216e+07 # HELP node_zfs_arc_arc_meta_used kstat.zfs.misc.arcstats.arc_meta_used # TYPE node_zfs_arc_arc_meta_used untyped node_zfs_arc_arc_meta_used 3.08103632e+08 # HELP node_zfs_arc_arc_need_free kstat.zfs.misc.arcstats.arc_need_free # TYPE node_zfs_arc_arc_need_free untyped node_zfs_arc_arc_need_free 0 # HELP node_zfs_arc_arc_no_grow kstat.zfs.misc.arcstats.arc_no_grow # TYPE node_zfs_arc_arc_no_grow untyped node_zfs_arc_arc_no_grow 0 # HELP node_zfs_arc_arc_prune kstat.zfs.misc.arcstats.arc_prune # TYPE node_zfs_arc_arc_prune untyped node_zfs_arc_arc_prune 0 # HELP node_zfs_arc_arc_sys_free kstat.zfs.misc.arcstats.arc_sys_free # TYPE node_zfs_arc_arc_sys_free untyped node_zfs_arc_arc_sys_free 2.61496832e+08 # HELP node_zfs_arc_arc_tempreserve kstat.zfs.misc.arcstats.arc_tempreserve # TYPE node_zfs_arc_arc_tempreserve untyped node_zfs_arc_arc_tempreserve 0 # HELP node_zfs_arc_c kstat.zfs.misc.arcstats.c # TYPE node_zfs_arc_c untyped node_zfs_arc_c 1.643208777e+09 # HELP node_zfs_arc_c_max kstat.zfs.misc.arcstats.c_max # TYPE node_zfs_arc_c_max untyped node_zfs_arc_c_max 8.367976448e+09 # HELP node_zfs_arc_c_min kstat.zfs.misc.arcstats.c_min # TYPE node_zfs_arc_c_min untyped node_zfs_arc_c_min 3.3554432e+07 # HELP node_zfs_arc_data_size kstat.zfs.misc.arcstats.data_size # TYPE node_zfs_arc_data_size untyped node_zfs_arc_data_size 1.29583616e+09 # HELP node_zfs_arc_deleted kstat.zfs.misc.arcstats.deleted # TYPE node_zfs_arc_deleted untyped node_zfs_arc_deleted 60403 # HELP node_zfs_arc_demand_data_hits kstat.zfs.misc.arcstats.demand_data_hits # TYPE node_zfs_arc_demand_data_hits untyped node_zfs_arc_demand_data_hits 7.221032e+06 # HELP node_zfs_arc_demand_data_misses kstat.zfs.misc.arcstats.demand_data_misses # TYPE node_zfs_arc_demand_data_misses untyped node_zfs_arc_demand_data_misses 73300 # HELP node_zfs_arc_demand_metadata_hits kstat.zfs.misc.arcstats.demand_metadata_hits # TYPE node_zfs_arc_demand_metadata_hits untyped node_zfs_arc_demand_metadata_hits 1.464353e+06 # HELP node_zfs_arc_demand_metadata_misses kstat.zfs.misc.arcstats.demand_metadata_misses # TYPE node_zfs_arc_demand_metadata_misses untyped node_zfs_arc_demand_metadata_misses 498170 # HELP node_zfs_arc_duplicate_buffers kstat.zfs.misc.arcstats.duplicate_buffers # TYPE node_zfs_arc_duplicate_buffers untyped node_zfs_arc_duplicate_buffers 0 # HELP node_zfs_arc_duplicate_buffers_size kstat.zfs.misc.arcstats.duplicate_buffers_size # TYPE node_zfs_arc_duplicate_buffers_size untyped node_zfs_arc_duplicate_buffers_size 0 # HELP node_zfs_arc_duplicate_reads kstat.zfs.misc.arcstats.duplicate_reads # TYPE node_zfs_arc_duplicate_reads untyped node_zfs_arc_duplicate_reads 0 # HELP node_zfs_arc_evict_l2_cached kstat.zfs.misc.arcstats.evict_l2_cached # TYPE node_zfs_arc_evict_l2_cached untyped node_zfs_arc_evict_l2_cached 0 # HELP node_zfs_arc_evict_l2_eligible kstat.zfs.misc.arcstats.evict_l2_eligible # TYPE node_zfs_arc_evict_l2_eligible untyped node_zfs_arc_evict_l2_eligible 8.99251456e+09 # HELP node_zfs_arc_evict_l2_ineligible kstat.zfs.misc.arcstats.evict_l2_ineligible # TYPE node_zfs_arc_evict_l2_ineligible untyped node_zfs_arc_evict_l2_ineligible 9.92552448e+08 # HELP node_zfs_arc_evict_l2_skip kstat.zfs.misc.arcstats.evict_l2_skip # TYPE node_zfs_arc_evict_l2_skip untyped node_zfs_arc_evict_l2_skip 0 # HELP node_zfs_arc_evict_not_enough kstat.zfs.misc.arcstats.evict_not_enough # TYPE node_zfs_arc_evict_not_enough untyped node_zfs_arc_evict_not_enough 680 # HELP node_zfs_arc_evict_skip kstat.zfs.misc.arcstats.evict_skip # TYPE node_zfs_arc_evict_skip untyped node_zfs_arc_evict_skip 2.265729e+06 # HELP node_zfs_arc_hash_chain_max kstat.zfs.misc.arcstats.hash_chain_max # TYPE node_zfs_arc_hash_chain_max untyped node_zfs_arc_hash_chain_max 3 # HELP node_zfs_arc_hash_chains kstat.zfs.misc.arcstats.hash_chains # TYPE node_zfs_arc_hash_chains untyped node_zfs_arc_hash_chains 412 # HELP node_zfs_arc_hash_collisions kstat.zfs.misc.arcstats.hash_collisions # TYPE node_zfs_arc_hash_collisions untyped node_zfs_arc_hash_collisions 50564 # HELP node_zfs_arc_hash_elements kstat.zfs.misc.arcstats.hash_elements # TYPE node_zfs_arc_hash_elements untyped node_zfs_arc_hash_elements 42359 # HELP node_zfs_arc_hash_elements_max kstat.zfs.misc.arcstats.hash_elements_max # TYPE node_zfs_arc_hash_elements_max untyped node_zfs_arc_hash_elements_max 88245 # HELP node_zfs_arc_hdr_size kstat.zfs.misc.arcstats.hdr_size # TYPE node_zfs_arc_hdr_size untyped node_zfs_arc_hdr_size 1.636108e+07 # HELP node_zfs_arc_hits kstat.zfs.misc.arcstats.hits # TYPE node_zfs_arc_hits untyped node_zfs_arc_hits 8.772612e+06 # HELP node_zfs_arc_l2_abort_lowmem kstat.zfs.misc.arcstats.l2_abort_lowmem # TYPE node_zfs_arc_l2_abort_lowmem untyped node_zfs_arc_l2_abort_lowmem 0 # HELP node_zfs_arc_l2_asize kstat.zfs.misc.arcstats.l2_asize # TYPE node_zfs_arc_l2_asize untyped node_zfs_arc_l2_asize 0 # HELP node_zfs_arc_l2_cdata_free_on_write kstat.zfs.misc.arcstats.l2_cdata_free_on_write # TYPE node_zfs_arc_l2_cdata_free_on_write untyped node_zfs_arc_l2_cdata_free_on_write 0 # HELP node_zfs_arc_l2_cksum_bad kstat.zfs.misc.arcstats.l2_cksum_bad # TYPE node_zfs_arc_l2_cksum_bad untyped node_zfs_arc_l2_cksum_bad 0 # HELP node_zfs_arc_l2_compress_failures kstat.zfs.misc.arcstats.l2_compress_failures # TYPE node_zfs_arc_l2_compress_failures untyped node_zfs_arc_l2_compress_failures 0 # HELP node_zfs_arc_l2_compress_successes kstat.zfs.misc.arcstats.l2_compress_successes # TYPE node_zfs_arc_l2_compress_successes untyped node_zfs_arc_l2_compress_successes 0 # HELP node_zfs_arc_l2_compress_zeros kstat.zfs.misc.arcstats.l2_compress_zeros # TYPE node_zfs_arc_l2_compress_zeros untyped node_zfs_arc_l2_compress_zeros 0 # HELP node_zfs_arc_l2_evict_l1cached kstat.zfs.misc.arcstats.l2_evict_l1cached # TYPE node_zfs_arc_l2_evict_l1cached untyped node_zfs_arc_l2_evict_l1cached 0 # HELP node_zfs_arc_l2_evict_lock_retry kstat.zfs.misc.arcstats.l2_evict_lock_retry # TYPE node_zfs_arc_l2_evict_lock_retry untyped node_zfs_arc_l2_evict_lock_retry 0 # HELP node_zfs_arc_l2_evict_reading kstat.zfs.misc.arcstats.l2_evict_reading # TYPE node_zfs_arc_l2_evict_reading untyped node_zfs_arc_l2_evict_reading 0 # HELP node_zfs_arc_l2_feeds kstat.zfs.misc.arcstats.l2_feeds # TYPE node_zfs_arc_l2_feeds untyped node_zfs_arc_l2_feeds 0 # HELP node_zfs_arc_l2_free_on_write kstat.zfs.misc.arcstats.l2_free_on_write # TYPE node_zfs_arc_l2_free_on_write untyped node_zfs_arc_l2_free_on_write 0 # HELP node_zfs_arc_l2_hdr_size kstat.zfs.misc.arcstats.l2_hdr_size # TYPE node_zfs_arc_l2_hdr_size untyped node_zfs_arc_l2_hdr_size 0 # HELP node_zfs_arc_l2_hits kstat.zfs.misc.arcstats.l2_hits # TYPE node_zfs_arc_l2_hits untyped node_zfs_arc_l2_hits 0 # HELP node_zfs_arc_l2_io_error kstat.zfs.misc.arcstats.l2_io_error # TYPE node_zfs_arc_l2_io_error untyped node_zfs_arc_l2_io_error 0 # HELP node_zfs_arc_l2_misses kstat.zfs.misc.arcstats.l2_misses # TYPE node_zfs_arc_l2_misses untyped node_zfs_arc_l2_misses 0 # HELP node_zfs_arc_l2_read_bytes kstat.zfs.misc.arcstats.l2_read_bytes # TYPE node_zfs_arc_l2_read_bytes untyped node_zfs_arc_l2_read_bytes 0 # HELP node_zfs_arc_l2_rw_clash kstat.zfs.misc.arcstats.l2_rw_clash # TYPE node_zfs_arc_l2_rw_clash untyped node_zfs_arc_l2_rw_clash 0 # HELP node_zfs_arc_l2_size kstat.zfs.misc.arcstats.l2_size # TYPE node_zfs_arc_l2_size untyped node_zfs_arc_l2_size 0 # HELP node_zfs_arc_l2_write_bytes kstat.zfs.misc.arcstats.l2_write_bytes # TYPE node_zfs_arc_l2_write_bytes untyped node_zfs_arc_l2_write_bytes 0 # HELP node_zfs_arc_l2_writes_done kstat.zfs.misc.arcstats.l2_writes_done # TYPE node_zfs_arc_l2_writes_done untyped node_zfs_arc_l2_writes_done 0 # HELP node_zfs_arc_l2_writes_error kstat.zfs.misc.arcstats.l2_writes_error # TYPE node_zfs_arc_l2_writes_error untyped node_zfs_arc_l2_writes_error 0 # HELP node_zfs_arc_l2_writes_lock_retry kstat.zfs.misc.arcstats.l2_writes_lock_retry # TYPE node_zfs_arc_l2_writes_lock_retry untyped node_zfs_arc_l2_writes_lock_retry 0 # HELP node_zfs_arc_l2_writes_sent kstat.zfs.misc.arcstats.l2_writes_sent # TYPE node_zfs_arc_l2_writes_sent untyped node_zfs_arc_l2_writes_sent 0 # HELP node_zfs_arc_memory_direct_count kstat.zfs.misc.arcstats.memory_direct_count # TYPE node_zfs_arc_memory_direct_count untyped node_zfs_arc_memory_direct_count 542 # HELP node_zfs_arc_memory_indirect_count kstat.zfs.misc.arcstats.memory_indirect_count # TYPE node_zfs_arc_memory_indirect_count untyped node_zfs_arc_memory_indirect_count 3006 # HELP node_zfs_arc_memory_throttle_count kstat.zfs.misc.arcstats.memory_throttle_count # TYPE node_zfs_arc_memory_throttle_count untyped node_zfs_arc_memory_throttle_count 0 # HELP node_zfs_arc_metadata_size kstat.zfs.misc.arcstats.metadata_size # TYPE node_zfs_arc_metadata_size untyped node_zfs_arc_metadata_size 1.7529856e+08 # HELP node_zfs_arc_mfu_evictable_data kstat.zfs.misc.arcstats.mfu_evictable_data # TYPE node_zfs_arc_mfu_evictable_data untyped node_zfs_arc_mfu_evictable_data 1.017613824e+09 # HELP node_zfs_arc_mfu_evictable_metadata kstat.zfs.misc.arcstats.mfu_evictable_metadata # TYPE node_zfs_arc_mfu_evictable_metadata untyped node_zfs_arc_mfu_evictable_metadata 9.163776e+06 # HELP node_zfs_arc_mfu_ghost_evictable_data kstat.zfs.misc.arcstats.mfu_ghost_evictable_data # TYPE node_zfs_arc_mfu_ghost_evictable_data untyped node_zfs_arc_mfu_ghost_evictable_data 9.6731136e+07 # HELP node_zfs_arc_mfu_ghost_evictable_metadata kstat.zfs.misc.arcstats.mfu_ghost_evictable_metadata # TYPE node_zfs_arc_mfu_ghost_evictable_metadata untyped node_zfs_arc_mfu_ghost_evictable_metadata 8.205312e+06 # HELP node_zfs_arc_mfu_ghost_hits kstat.zfs.misc.arcstats.mfu_ghost_hits # TYPE node_zfs_arc_mfu_ghost_hits untyped node_zfs_arc_mfu_ghost_hits 821 # HELP node_zfs_arc_mfu_ghost_size kstat.zfs.misc.arcstats.mfu_ghost_size # TYPE node_zfs_arc_mfu_ghost_size untyped node_zfs_arc_mfu_ghost_size 1.04936448e+08 # HELP node_zfs_arc_mfu_hits kstat.zfs.misc.arcstats.mfu_hits # TYPE node_zfs_arc_mfu_hits untyped node_zfs_arc_mfu_hits 7.829854e+06 # HELP node_zfs_arc_mfu_size kstat.zfs.misc.arcstats.mfu_size # TYPE node_zfs_arc_mfu_size untyped node_zfs_arc_mfu_size 1.066623488e+09 # HELP node_zfs_arc_misses kstat.zfs.misc.arcstats.misses # TYPE node_zfs_arc_misses untyped node_zfs_arc_misses 604635 # HELP node_zfs_arc_mru_evictable_data kstat.zfs.misc.arcstats.mru_evictable_data # TYPE node_zfs_arc_mru_evictable_data untyped node_zfs_arc_mru_evictable_data 2.78091264e+08 # HELP node_zfs_arc_mru_evictable_metadata kstat.zfs.misc.arcstats.mru_evictable_metadata # TYPE node_zfs_arc_mru_evictable_metadata untyped node_zfs_arc_mru_evictable_metadata 1.8606592e+07 # HELP node_zfs_arc_mru_ghost_evictable_data kstat.zfs.misc.arcstats.mru_ghost_evictable_data # TYPE node_zfs_arc_mru_ghost_evictable_data untyped node_zfs_arc_mru_ghost_evictable_data 8.83765248e+08 # HELP node_zfs_arc_mru_ghost_evictable_metadata kstat.zfs.misc.arcstats.mru_ghost_evictable_metadata # TYPE node_zfs_arc_mru_ghost_evictable_metadata untyped node_zfs_arc_mru_ghost_evictable_metadata 1.1596288e+08 # HELP node_zfs_arc_mru_ghost_hits kstat.zfs.misc.arcstats.mru_ghost_hits # TYPE node_zfs_arc_mru_ghost_hits untyped node_zfs_arc_mru_ghost_hits 21100 # HELP node_zfs_arc_mru_ghost_size kstat.zfs.misc.arcstats.mru_ghost_size # TYPE node_zfs_arc_mru_ghost_size untyped node_zfs_arc_mru_ghost_size 9.99728128e+08 # HELP node_zfs_arc_mru_hits kstat.zfs.misc.arcstats.mru_hits # TYPE node_zfs_arc_mru_hits untyped node_zfs_arc_mru_hits 855535 # HELP node_zfs_arc_mru_size kstat.zfs.misc.arcstats.mru_size # TYPE node_zfs_arc_mru_size untyped node_zfs_arc_mru_size 4.02593792e+08 # HELP node_zfs_arc_mutex_miss kstat.zfs.misc.arcstats.mutex_miss # TYPE node_zfs_arc_mutex_miss untyped node_zfs_arc_mutex_miss 2 # HELP node_zfs_arc_other_size kstat.zfs.misc.arcstats.other_size # TYPE node_zfs_arc_other_size untyped node_zfs_arc_other_size 1.16443992e+08 # HELP node_zfs_arc_p kstat.zfs.misc.arcstats.p # TYPE node_zfs_arc_p untyped node_zfs_arc_p 5.16395305e+08 # HELP node_zfs_arc_prefetch_data_hits kstat.zfs.misc.arcstats.prefetch_data_hits # TYPE node_zfs_arc_prefetch_data_hits untyped node_zfs_arc_prefetch_data_hits 3615 # HELP node_zfs_arc_prefetch_data_misses kstat.zfs.misc.arcstats.prefetch_data_misses # TYPE node_zfs_arc_prefetch_data_misses untyped node_zfs_arc_prefetch_data_misses 17094 # HELP node_zfs_arc_prefetch_metadata_hits kstat.zfs.misc.arcstats.prefetch_metadata_hits # TYPE node_zfs_arc_prefetch_metadata_hits untyped node_zfs_arc_prefetch_metadata_hits 83612 # HELP node_zfs_arc_prefetch_metadata_misses kstat.zfs.misc.arcstats.prefetch_metadata_misses # TYPE node_zfs_arc_prefetch_metadata_misses untyped node_zfs_arc_prefetch_metadata_misses 16071 # HELP node_zfs_arc_size kstat.zfs.misc.arcstats.size # TYPE node_zfs_arc_size untyped node_zfs_arc_size 1.603939792e+09 # HELP node_zfs_dmu_tx_dmu_tx_assigned kstat.zfs.misc.dmu_tx.dmu_tx_assigned # TYPE node_zfs_dmu_tx_dmu_tx_assigned untyped node_zfs_dmu_tx_dmu_tx_assigned 3.532844e+06 # HELP node_zfs_dmu_tx_dmu_tx_delay kstat.zfs.misc.dmu_tx.dmu_tx_delay # TYPE node_zfs_dmu_tx_dmu_tx_delay untyped node_zfs_dmu_tx_dmu_tx_delay 0 # HELP node_zfs_dmu_tx_dmu_tx_dirty_delay kstat.zfs.misc.dmu_tx.dmu_tx_dirty_delay # TYPE node_zfs_dmu_tx_dmu_tx_dirty_delay untyped node_zfs_dmu_tx_dmu_tx_dirty_delay 0 # HELP node_zfs_dmu_tx_dmu_tx_dirty_over_max kstat.zfs.misc.dmu_tx.dmu_tx_dirty_over_max # TYPE node_zfs_dmu_tx_dmu_tx_dirty_over_max untyped node_zfs_dmu_tx_dmu_tx_dirty_over_max 0 # HELP node_zfs_dmu_tx_dmu_tx_dirty_throttle kstat.zfs.misc.dmu_tx.dmu_tx_dirty_throttle # TYPE node_zfs_dmu_tx_dmu_tx_dirty_throttle untyped node_zfs_dmu_tx_dmu_tx_dirty_throttle 0 # HELP node_zfs_dmu_tx_dmu_tx_error kstat.zfs.misc.dmu_tx.dmu_tx_error # TYPE node_zfs_dmu_tx_dmu_tx_error untyped node_zfs_dmu_tx_dmu_tx_error 0 # HELP node_zfs_dmu_tx_dmu_tx_group kstat.zfs.misc.dmu_tx.dmu_tx_group # TYPE node_zfs_dmu_tx_dmu_tx_group untyped node_zfs_dmu_tx_dmu_tx_group 0 # HELP node_zfs_dmu_tx_dmu_tx_memory_reclaim kstat.zfs.misc.dmu_tx.dmu_tx_memory_reclaim # TYPE node_zfs_dmu_tx_dmu_tx_memory_reclaim untyped node_zfs_dmu_tx_dmu_tx_memory_reclaim 0 # HELP node_zfs_dmu_tx_dmu_tx_memory_reserve kstat.zfs.misc.dmu_tx.dmu_tx_memory_reserve # TYPE node_zfs_dmu_tx_dmu_tx_memory_reserve untyped node_zfs_dmu_tx_dmu_tx_memory_reserve 0 # HELP node_zfs_dmu_tx_dmu_tx_quota kstat.zfs.misc.dmu_tx.dmu_tx_quota # TYPE node_zfs_dmu_tx_dmu_tx_quota untyped node_zfs_dmu_tx_dmu_tx_quota 0 # HELP node_zfs_dmu_tx_dmu_tx_suspended kstat.zfs.misc.dmu_tx.dmu_tx_suspended # TYPE node_zfs_dmu_tx_dmu_tx_suspended untyped node_zfs_dmu_tx_dmu_tx_suspended 0 # HELP node_zfs_fm_erpt_dropped kstat.zfs.misc.fm.erpt-dropped # TYPE node_zfs_fm_erpt_dropped untyped node_zfs_fm_erpt_dropped 18 # HELP node_zfs_fm_erpt_set_failed kstat.zfs.misc.fm.erpt-set-failed # TYPE node_zfs_fm_erpt_set_failed untyped node_zfs_fm_erpt_set_failed 0 # HELP node_zfs_fm_fmri_set_failed kstat.zfs.misc.fm.fmri-set-failed # TYPE node_zfs_fm_fmri_set_failed untyped node_zfs_fm_fmri_set_failed 0 # HELP node_zfs_fm_payload_set_failed kstat.zfs.misc.fm.payload-set-failed # TYPE node_zfs_fm_payload_set_failed untyped node_zfs_fm_payload_set_failed 0 # HELP node_zfs_vdev_cache_delegations kstat.zfs.misc.vdev_cache_stats.delegations # TYPE node_zfs_vdev_cache_delegations untyped node_zfs_vdev_cache_delegations 40 # HELP node_zfs_vdev_cache_hits kstat.zfs.misc.vdev_cache_stats.hits # TYPE node_zfs_vdev_cache_hits untyped node_zfs_vdev_cache_hits 0 # HELP node_zfs_vdev_cache_misses kstat.zfs.misc.vdev_cache_stats.misses # TYPE node_zfs_vdev_cache_misses untyped node_zfs_vdev_cache_misses 0 # HELP node_zfs_xuio_onloan_read_buf kstat.zfs.misc.xuio_stats.onloan_read_buf # TYPE node_zfs_xuio_onloan_read_buf untyped node_zfs_xuio_onloan_read_buf 32 # HELP node_zfs_xuio_onloan_write_buf kstat.zfs.misc.xuio_stats.onloan_write_buf # TYPE node_zfs_xuio_onloan_write_buf untyped node_zfs_xuio_onloan_write_buf 0 # HELP node_zfs_xuio_read_buf_copied kstat.zfs.misc.xuio_stats.read_buf_copied # TYPE node_zfs_xuio_read_buf_copied untyped node_zfs_xuio_read_buf_copied 0 # HELP node_zfs_xuio_read_buf_nocopy kstat.zfs.misc.xuio_stats.read_buf_nocopy # TYPE node_zfs_xuio_read_buf_nocopy untyped node_zfs_xuio_read_buf_nocopy 0 # HELP node_zfs_xuio_write_buf_copied kstat.zfs.misc.xuio_stats.write_buf_copied # TYPE node_zfs_xuio_write_buf_copied untyped node_zfs_xuio_write_buf_copied 0 # HELP node_zfs_xuio_write_buf_nocopy kstat.zfs.misc.xuio_stats.write_buf_nocopy # TYPE node_zfs_xuio_write_buf_nocopy untyped node_zfs_xuio_write_buf_nocopy 0 # HELP node_zfs_zfetch_bogus_streams kstat.zfs.misc.zfetchstats.bogus_streams # TYPE node_zfs_zfetch_bogus_streams untyped node_zfs_zfetch_bogus_streams 0 # HELP node_zfs_zfetch_colinear_hits kstat.zfs.misc.zfetchstats.colinear_hits # TYPE node_zfs_zfetch_colinear_hits untyped node_zfs_zfetch_colinear_hits 0 # HELP node_zfs_zfetch_colinear_misses kstat.zfs.misc.zfetchstats.colinear_misses # TYPE node_zfs_zfetch_colinear_misses untyped node_zfs_zfetch_colinear_misses 11 # HELP node_zfs_zfetch_hits kstat.zfs.misc.zfetchstats.hits # TYPE node_zfs_zfetch_hits untyped node_zfs_zfetch_hits 7.067992e+06 # HELP node_zfs_zfetch_misses kstat.zfs.misc.zfetchstats.misses # TYPE node_zfs_zfetch_misses untyped node_zfs_zfetch_misses 11 # HELP node_zfs_zfetch_reclaim_failures kstat.zfs.misc.zfetchstats.reclaim_failures # TYPE node_zfs_zfetch_reclaim_failures untyped node_zfs_zfetch_reclaim_failures 11 # HELP node_zfs_zfetch_reclaim_successes kstat.zfs.misc.zfetchstats.reclaim_successes # TYPE node_zfs_zfetch_reclaim_successes untyped node_zfs_zfetch_reclaim_successes 0 # HELP node_zfs_zfetch_streams_noresets kstat.zfs.misc.zfetchstats.streams_noresets # TYPE node_zfs_zfetch_streams_noresets untyped node_zfs_zfetch_streams_noresets 2 # HELP node_zfs_zfetch_streams_resets kstat.zfs.misc.zfetchstats.streams_resets # TYPE node_zfs_zfetch_streams_resets untyped node_zfs_zfetch_streams_resets 0 # HELP node_zfs_zfetch_stride_hits kstat.zfs.misc.zfetchstats.stride_hits # TYPE node_zfs_zfetch_stride_hits untyped node_zfs_zfetch_stride_hits 7.06799e+06 # HELP node_zfs_zfetch_stride_misses kstat.zfs.misc.zfetchstats.stride_misses # TYPE node_zfs_zfetch_stride_misses untyped node_zfs_zfetch_stride_misses 0 # HELP node_zfs_zil_zil_commit_count kstat.zfs.misc.zil.zil_commit_count # TYPE node_zfs_zil_zil_commit_count untyped node_zfs_zil_zil_commit_count 10 # HELP node_zfs_zil_zil_commit_writer_count kstat.zfs.misc.zil.zil_commit_writer_count # TYPE node_zfs_zil_zil_commit_writer_count untyped node_zfs_zil_zil_commit_writer_count 0 # HELP node_zfs_zil_zil_itx_copied_bytes kstat.zfs.misc.zil.zil_itx_copied_bytes # TYPE node_zfs_zil_zil_itx_copied_bytes untyped node_zfs_zil_zil_itx_copied_bytes 0 # HELP node_zfs_zil_zil_itx_copied_count kstat.zfs.misc.zil.zil_itx_copied_count # TYPE node_zfs_zil_zil_itx_copied_count untyped node_zfs_zil_zil_itx_copied_count 0 # HELP node_zfs_zil_zil_itx_count kstat.zfs.misc.zil.zil_itx_count # TYPE node_zfs_zil_zil_itx_count untyped node_zfs_zil_zil_itx_count 0 # HELP node_zfs_zil_zil_itx_indirect_bytes kstat.zfs.misc.zil.zil_itx_indirect_bytes # TYPE node_zfs_zil_zil_itx_indirect_bytes untyped node_zfs_zil_zil_itx_indirect_bytes 0 # HELP node_zfs_zil_zil_itx_indirect_count kstat.zfs.misc.zil.zil_itx_indirect_count # TYPE node_zfs_zil_zil_itx_indirect_count untyped node_zfs_zil_zil_itx_indirect_count 0 # HELP node_zfs_zil_zil_itx_metaslab_normal_bytes kstat.zfs.misc.zil.zil_itx_metaslab_normal_bytes # TYPE node_zfs_zil_zil_itx_metaslab_normal_bytes untyped node_zfs_zil_zil_itx_metaslab_normal_bytes 0 # HELP node_zfs_zil_zil_itx_metaslab_normal_count kstat.zfs.misc.zil.zil_itx_metaslab_normal_count # TYPE node_zfs_zil_zil_itx_metaslab_normal_count untyped node_zfs_zil_zil_itx_metaslab_normal_count 0 # HELP node_zfs_zil_zil_itx_metaslab_slog_bytes kstat.zfs.misc.zil.zil_itx_metaslab_slog_bytes # TYPE node_zfs_zil_zil_itx_metaslab_slog_bytes untyped node_zfs_zil_zil_itx_metaslab_slog_bytes 0 # HELP node_zfs_zil_zil_itx_metaslab_slog_count kstat.zfs.misc.zil.zil_itx_metaslab_slog_count # TYPE node_zfs_zil_zil_itx_metaslab_slog_count untyped node_zfs_zil_zil_itx_metaslab_slog_count 0 # HELP node_zfs_zil_zil_itx_needcopy_bytes kstat.zfs.misc.zil.zil_itx_needcopy_bytes # TYPE node_zfs_zil_zil_itx_needcopy_bytes untyped node_zfs_zil_zil_itx_needcopy_bytes 0 # HELP node_zfs_zil_zil_itx_needcopy_count kstat.zfs.misc.zil.zil_itx_needcopy_count # TYPE node_zfs_zil_zil_itx_needcopy_count untyped node_zfs_zil_zil_itx_needcopy_count 0 # HELP node_zfs_zpool_nread kstat.zfs.misc.io.nread # TYPE node_zfs_zpool_nread untyped node_zfs_zpool_nread{zpool="pool1"} 1.88416e+06 node_zfs_zpool_nread{zpool="poolz1"} 2.82624e+06 # HELP node_zfs_zpool_nwritten kstat.zfs.misc.io.nwritten # TYPE node_zfs_zpool_nwritten untyped node_zfs_zpool_nwritten{zpool="pool1"} 3.206144e+06 node_zfs_zpool_nwritten{zpool="poolz1"} 2.680501248e+09 # HELP node_zfs_zpool_rcnt kstat.zfs.misc.io.rcnt # TYPE node_zfs_zpool_rcnt untyped node_zfs_zpool_rcnt{zpool="pool1"} 0 node_zfs_zpool_rcnt{zpool="poolz1"} 0 # HELP node_zfs_zpool_reads kstat.zfs.misc.io.reads # TYPE node_zfs_zpool_reads untyped node_zfs_zpool_reads{zpool="pool1"} 22 node_zfs_zpool_reads{zpool="poolz1"} 33 # HELP node_zfs_zpool_rlentime kstat.zfs.misc.io.rlentime # TYPE node_zfs_zpool_rlentime untyped node_zfs_zpool_rlentime{zpool="pool1"} 1.04112268e+08 node_zfs_zpool_rlentime{zpool="poolz1"} 6.472105124093e+12 # HELP node_zfs_zpool_rtime kstat.zfs.misc.io.rtime # TYPE node_zfs_zpool_rtime untyped node_zfs_zpool_rtime{zpool="pool1"} 2.4168078e+07 node_zfs_zpool_rtime{zpool="poolz1"} 9.82909164e+09 # HELP node_zfs_zpool_rupdate kstat.zfs.misc.io.rupdate # TYPE node_zfs_zpool_rupdate untyped node_zfs_zpool_rupdate{zpool="pool1"} 7.921048984922e+13 node_zfs_zpool_rupdate{zpool="poolz1"} 1.10734831944501e+14 # HELP node_zfs_zpool_wcnt kstat.zfs.misc.io.wcnt # TYPE node_zfs_zpool_wcnt untyped node_zfs_zpool_wcnt{zpool="pool1"} 0 node_zfs_zpool_wcnt{zpool="poolz1"} 0 # HELP node_zfs_zpool_wlentime kstat.zfs.misc.io.wlentime # TYPE node_zfs_zpool_wlentime untyped node_zfs_zpool_wlentime{zpool="pool1"} 1.04112268e+08 node_zfs_zpool_wlentime{zpool="poolz1"} 6.472105124093e+12 # HELP node_zfs_zpool_writes kstat.zfs.misc.io.writes # TYPE node_zfs_zpool_writes untyped node_zfs_zpool_writes{zpool="pool1"} 132 node_zfs_zpool_writes{zpool="poolz1"} 25294 # HELP node_zfs_zpool_wtime kstat.zfs.misc.io.wtime # TYPE node_zfs_zpool_wtime untyped node_zfs_zpool_wtime{zpool="pool1"} 7.155162e+06 node_zfs_zpool_wtime{zpool="poolz1"} 9.673715628e+09 # HELP node_zfs_zpool_wupdate kstat.zfs.misc.io.wupdate # TYPE node_zfs_zpool_wupdate untyped node_zfs_zpool_wupdate{zpool="pool1"} 7.9210489694949e+13 node_zfs_zpool_wupdate{zpool="poolz1"} 1.10734831833266e+14 # HELP process_cpu_seconds_total Total user and system CPU time spent in seconds. # TYPE process_cpu_seconds_total counter # HELP process_max_fds Maximum number of open file descriptors. # TYPE process_max_fds gauge # HELP process_open_fds Number of open file descriptors. # TYPE process_open_fds gauge # HELP process_resident_memory_bytes Resident memory size in bytes. # TYPE process_resident_memory_bytes gauge # HELP process_start_time_seconds Start time of the process since unix epoch in seconds. # TYPE process_start_time_seconds gauge # HELP process_virtual_memory_bytes Virtual memory size in bytes. # TYPE process_virtual_memory_bytes gauge # HELP testmetric1_1 Metric read from collector/fixtures/textfile/two_metric_files/metrics1.prom # TYPE testmetric1_1 untyped testmetric1_1{foo="bar"} 10 # HELP testmetric1_2 Metric read from collector/fixtures/textfile/two_metric_files/metrics1.prom # TYPE testmetric1_2 untyped testmetric1_2{foo="baz"} 20 # HELP testmetric2_1 Metric read from collector/fixtures/textfile/two_metric_files/metrics2.prom # TYPE testmetric2_1 untyped testmetric2_1{foo="bar"} 30 1441205977284 # HELP testmetric2_2 Metric read from collector/fixtures/textfile/two_metric_files/metrics2.prom # TYPE testmetric2_2 untyped testmetric2_2{foo="baz"} 40 1441205977284 prometheus-node-exporter-0.15.2+ds/collector/fixtures/ip_vs_result.txt000066400000000000000000000112501321450230300262730ustar00rootroot00000000000000# HELP node_ipvs_backend_connections_active The current active connections by local and remote address. # TYPE node_ipvs_backend_connections_active gauge node_ipvs_backend_connections_active{local_address="192.168.0.22",local_port="3306",proto="TCP",remote_address="192.168.82.22",remote_port="3306"} 248 node_ipvs_backend_connections_active{local_address="192.168.0.22",local_port="3306",proto="TCP",remote_address="192.168.83.21",remote_port="3306"} 248 node_ipvs_backend_connections_active{local_address="192.168.0.22",local_port="3306",proto="TCP",remote_address="192.168.83.24",remote_port="3306"} 248 node_ipvs_backend_connections_active{local_address="192.168.0.55",local_port="3306",proto="TCP",remote_address="192.168.49.32",remote_port="3306"} 0 node_ipvs_backend_connections_active{local_address="192.168.0.55",local_port="3306",proto="TCP",remote_address="192.168.50.26",remote_port="3306"} 0 node_ipvs_backend_connections_active{local_address="192.168.0.57",local_port="3306",proto="TCP",remote_address="192.168.50.21",remote_port="3306"} 1498 node_ipvs_backend_connections_active{local_address="192.168.0.57",local_port="3306",proto="TCP",remote_address="192.168.82.21",remote_port="3306"} 1499 node_ipvs_backend_connections_active{local_address="192.168.0.57",local_port="3306",proto="TCP",remote_address="192.168.84.22",remote_port="3306"} 0 # HELP node_ipvs_backend_connections_inactive The current inactive connections by local and remote address. # TYPE node_ipvs_backend_connections_inactive gauge node_ipvs_backend_connections_inactive{local_address="192.168.0.22",local_port="3306",proto="TCP",remote_address="192.168.82.22",remote_port="3306"} 2 node_ipvs_backend_connections_inactive{local_address="192.168.0.22",local_port="3306",proto="TCP",remote_address="192.168.83.21",remote_port="3306"} 1 node_ipvs_backend_connections_inactive{local_address="192.168.0.22",local_port="3306",proto="TCP",remote_address="192.168.83.24",remote_port="3306"} 2 node_ipvs_backend_connections_inactive{local_address="192.168.0.55",local_port="3306",proto="TCP",remote_address="192.168.49.32",remote_port="3306"} 0 node_ipvs_backend_connections_inactive{local_address="192.168.0.55",local_port="3306",proto="TCP",remote_address="192.168.50.26",remote_port="3306"} 0 node_ipvs_backend_connections_inactive{local_address="192.168.0.57",local_port="3306",proto="TCP",remote_address="192.168.50.21",remote_port="3306"} 0 node_ipvs_backend_connections_inactive{local_address="192.168.0.57",local_port="3306",proto="TCP",remote_address="192.168.82.21",remote_port="3306"} 0 node_ipvs_backend_connections_inactive{local_address="192.168.0.57",local_port="3306",proto="TCP",remote_address="192.168.84.22",remote_port="3306"} 0 # HELP node_ipvs_backend_weight The current backend weight by local and remote address. # TYPE node_ipvs_backend_weight gauge node_ipvs_backend_weight{local_address="192.168.0.22",local_port="3306",proto="TCP",remote_address="192.168.82.22",remote_port="3306"} 100 node_ipvs_backend_weight{local_address="192.168.0.22",local_port="3306",proto="TCP",remote_address="192.168.83.21",remote_port="3306"} 100 node_ipvs_backend_weight{local_address="192.168.0.22",local_port="3306",proto="TCP",remote_address="192.168.83.24",remote_port="3306"} 100 node_ipvs_backend_weight{local_address="192.168.0.55",local_port="3306",proto="TCP",remote_address="192.168.49.32",remote_port="3306"} 100 node_ipvs_backend_weight{local_address="192.168.0.55",local_port="3306",proto="TCP",remote_address="192.168.50.26",remote_port="3306"} 0 node_ipvs_backend_weight{local_address="192.168.0.57",local_port="3306",proto="TCP",remote_address="192.168.50.21",remote_port="3306"} 100 node_ipvs_backend_weight{local_address="192.168.0.57",local_port="3306",proto="TCP",remote_address="192.168.82.21",remote_port="3306"} 100 node_ipvs_backend_weight{local_address="192.168.0.57",local_port="3306",proto="TCP",remote_address="192.168.84.22",remote_port="3306"} 0 # HELP node_ipvs_connections_total The total number of connections made. # TYPE node_ipvs_connections_total counter node_ipvs_connections_total 2.3765872e+07 # HELP node_ipvs_incoming_bytes_total The total amount of incoming data. # TYPE node_ipvs_incoming_bytes_total counter node_ipvs_incoming_bytes_total 8.9991519156915e+13 # HELP node_ipvs_incoming_packets_total The total number of incoming packets. # TYPE node_ipvs_incoming_packets_total counter node_ipvs_incoming_packets_total 3.811989221e+09 # HELP node_ipvs_outgoing_bytes_total The total amount of outgoing data. # TYPE node_ipvs_outgoing_bytes_total counter node_ipvs_outgoing_bytes_total 0 # HELP node_ipvs_outgoing_packets_total The total number of outgoing packets. # TYPE node_ipvs_outgoing_packets_total counter node_ipvs_outgoing_packets_total 0 prometheus-node-exporter-0.15.2+ds/collector/fixtures/megacli000077500000000000000000000000751321450230300243460ustar00rootroot00000000000000#!/usr/bin/env bash cat "$(dirname "$0")/megacli_disks.txt" prometheus-node-exporter-0.15.2+ds/collector/fixtures/megacli_adapter.txt000066400000000000000000000221341321450230300266610ustar00rootroot00000000000000Adapter #0 ============================================================================== Versions ================ Product Name : PERC 6/i Integrated Serial No : 1234567890123456 FW Package Build: 6.3.3.0002 Mfg. Data ================ Mfg. Date : 06/24/08 Rework Date : 06/24/08 Revision No : Battery FRU : N/A Image Versions in Flash: ================ FW Version : 1.22.52-1909 BIOS Version : 2.04.00 WebBIOS Version : 1.1-46-e_15-Rel Ctrl-R Version : 1.02-015B Preboot CLI Version: 01.00-022:#%00005 Boot Block Version : 1.00.00.01-0011 Pending Images in Flash ================ None PCI Info ================ Controller Id : 0000 Vendor Id : 1000 Device Id : 0060 SubVendorId : 1028 SubDeviceId : 1f0c Host Interface : PCIE Link Speed : 0 Number of Frontend Port: 0 Device Interface : PCIE Number of Backend Port: 8 Port : Address 0 5000c50028f2083d 1 5000c50023cb3f39 2 5000c50023cea805 3 5000c50029124491 4 0000000000000000 5 0000000000000000 6 0000000000000000 7 0000000000000000 HW Configuration ================ SAS Address : 5a4badb01e219100 BBU : Present Alarm : Absent NVRAM : Present Serial Debugger : Present Memory : Present Flash : Present Memory Size : 256MB TPM : Absent On board Expander: Absent Upgrade Key : Absent Temperature sensor for ROC : Absent Temperature sensor for controller : Absent Settings ================ Current Time : 14:55:23 7/4, 2014 Predictive Fail Poll Interval : 300sec Interrupt Throttle Active Count : 16 Interrupt Throttle Completion : 50us Rebuild Rate : 30% PR Rate : 30% BGI Rate : 30% Check Consistency Rate : 30% Reconstruction Rate : 30% Cache Flush Interval : 4s Max Drives to Spinup at One Time : 2 Delay Among Spinup Groups : 12s Physical Drive Coercion Mode : 128MB Cluster Mode : Disabled Alarm : Disabled Auto Rebuild : Enabled Battery Warning : Enabled Ecc Bucket Size : 15 Ecc Bucket Leak Rate : 1440 Minutes Restore HotSpare on Insertion : Disabled Expose Enclosure Devices : Disabled Maintain PD Fail History : Disabled Host Request Reordering : Enabled Auto Detect BackPlane Enabled : SGPIO/i2c SEP Load Balance Mode : Auto Use FDE Only : No Security Key Assigned : No Security Key Failed : No Security Key Not Backedup : No Default LD PowerSave Policy : Controller Defined Maximum number of direct attached drives to spin up in 1 min : 0 Auto Enhanced Import : No Any Offline VD Cache Preserved : No Allow Boot with Preserved Cache : No Disable Online Controller Reset : No PFK in NVRAM : No Use disk activity for locate : No POST delay : 90 seconds BIOS Error Handling : Stop On Errors Current Boot Mode :Normal Capabilities ================ RAID Level Supported : RAID0, RAID1, RAID5, RAID6, RAID00, RAID10, RAID50, RAID60, PRL 11, PRL 11 with spanning, SRL 3 supported, PRL11-RLQ0 DDF layout with no span, PRL11-RLQ0 DDF layout with span Supported Drives : SAS, SATA Allowed Mixing: Mix in Enclosure Allowed Status ================ ECC Bucket Count : 0 Limitations ================ Max Arms Per VD : 32 Max Spans Per VD : 8 Max Arrays : 128 Max Number of VDs : 64 Max Parallel Commands : 1008 Max SGE Count : 80 Max Data Transfer Size : 8192 sectors Max Strips PerIO : 42 Max LD per array : 16 Min Strip Size : 8 KB Max Strip Size : 1.0 MB Max Configurable CacheCade Size: 0 GB Current Size of CacheCade : 0 GB Current Size of FW Cache : 0 MB Device Present ================ Virtual Drives : 1 Degraded : 0 Offline : 0 Physical Devices : 5 Disks : 4 Critical Disks : 0 Failed Disks : 0 Supported Adapter Operations ================ Rebuild Rate : Yes CC Rate : Yes BGI Rate : Yes Reconstruct Rate : Yes Patrol Read Rate : Yes Alarm Control : Yes Cluster Support : No BBU : Yes Spanning : Yes Dedicated Hot Spare : Yes Revertible Hot Spares : Yes Foreign Config Import : Yes Self Diagnostic : Yes Allow Mixed Redundancy on Array : No Global Hot Spares : Yes Deny SCSI Passthrough : No Deny SMP Passthrough : No Deny STP Passthrough : No Support Security : No Snapshot Enabled : No Support the OCE without adding drives : No Support PFK : No Support PI : No Support Boot Time PFK Change : No Disable Online PFK Change : No Support Shield State : No Block SSD Write Disk Cache Change: No Supported VD Operations ================ Read Policy : Yes Write Policy : Yes IO Policy : Yes Access Policy : Yes Disk Cache Policy : Yes Reconstruction : Yes Deny Locate : No Deny CC : No Allow Ctrl Encryption: No Enable LDBBM : No Support Breakmirror : No Power Savings : No Supported PD Operations ================ Force Online : Yes Force Offline : Yes Force Rebuild : Yes Deny Force Failed : No Deny Force Good/Bad : No Deny Missing Replace : No Deny Clear : No Deny Locate : No Support Temperature : No NCQ : No Disable Copyback : No Enable JBOD : No Enable Copyback on SMART : No Enable Copyback to SSD on SMART Error : No Enable SSD Patrol Read : No PR Correct Unconfigured Areas : Yes Error Counters ================ Memory Correctable Errors : 0 Memory Uncorrectable Errors : 0 Cluster Information ================ Cluster Permitted : No Cluster Active : No Default Settings ================ Phy Polarity : 0 Phy PolaritySplit : 0 Background Rate : 30 Strip Size : 64kB Flush Time : 4 seconds Write Policy : WB Read Policy : None Cache When BBU Bad : Disabled Cached IO : No SMART Mode : Mode 6 Alarm Disable : No Coercion Mode : 128MB ZCR Config : Unknown Dirty LED Shows Drive Activity : No BIOS Continue on Error : 0 Spin Down Mode : None Allowed Device Type : SAS/SATA Mix Allow Mix in Enclosure : Yes Allow HDD SAS/SATA Mix in VD : No Allow SSD SAS/SATA Mix in VD : No Allow HDD/SSD Mix in VD : No Allow SATA in Cluster : No Max Chained Enclosures : 1 Disable Ctrl-R : No Enable Web BIOS : No Direct PD Mapping : Yes BIOS Enumerate VDs : Yes Restore Hot Spare on Insertion : No Expose Enclosure Devices : No Maintain PD Fail History : No Disable Puncturing : No Zero Based Enclosure Enumeration : Yes PreBoot CLI Enabled : No LED Show Drive Activity : No Cluster Disable : Yes SAS Disable : No Auto Detect BackPlane Enable : SGPIO/i2c SEP Use FDE Only : No Enable Led Header : No Delay during POST : 0 EnableCrashDump : No Disable Online Controller Reset : No EnableLDBBM : No Un-Certified Hard Disk Drives : Block Treat Single span R1E as R10 : No Max LD per array : 16 Power Saving option : All power saving options are enabled Default spin down time in minutes: 0 Enable JBOD : No Time taken to detect CME : 60s Exit Code: 0x00 prometheus-node-exporter-0.15.2+ds/collector/fixtures/megacli_disks.txt000066400000000000000000000111661321450230300263610ustar00rootroot00000000000000 Adapter #0 Enclosure Device ID: 32 Slot Number: 0 Drive's position: DiskGroup: 0, Span: 0, Arm: 0 Enclosure position: N/A Device Id: 0 WWN: Sequence Number: 2 Media Error Count: 0 Other Error Count: 0 Predictive Failure Count: 0 Last Predictive Failure Event Seq Number: 0 PD Type: SAS Raw Size: 419.186 GB [0x3465f870 Sectors] Non Coerced Size: 418.686 GB [0x3455f870 Sectors] Coerced Size: 418.625 GB [0x34540000 Sectors] Sector Size: 0 Firmware state: Online, Spun Up Device Firmware Level: ES64 Shield Counter: 0 Successful diagnostics completion on : N/A SAS Address(0): 0x5000c50028f2083d SAS Address(1): 0x0 Connected Port Number: 0(path0) Inquiry Data: SEAGATE ST3450857SS ES643SK26856 FDE Capable: Not Capable FDE Enable: Disable Secured: Unsecured Locked: Unlocked Needs EKM Attention: No Foreign State: None Device Speed: Unknown Link Speed: Unknown Media Type: Hard Disk Device Drive Temperature :37C (98.60 F) PI Eligibility: No Drive is formatted for PI information: No PI: No PI Port-0 : Port status: Active Port's Linkspeed: Unknown Port-1 : Port status: Active Port's Linkspeed: Unknown Drive has flagged a S.M.A.R.T alert : No Enclosure Device ID: 32 Slot Number: 1 Drive's position: DiskGroup: 0, Span: 0, Arm: 1 Enclosure position: N/A Device Id: 1 WWN: Sequence Number: 2 Media Error Count: 0 Other Error Count: 0 Predictive Failure Count: 0 Last Predictive Failure Event Seq Number: 0 PD Type: SAS Raw Size: 419.186 GB [0x3465f870 Sectors] Non Coerced Size: 418.686 GB [0x3455f870 Sectors] Coerced Size: 418.625 GB [0x34540000 Sectors] Sector Size: 0 Firmware state: Online, Spun Up Device Firmware Level: ES62 Shield Counter: 0 Successful diagnostics completion on : N/A SAS Address(0): 0x5000c50023cb3f39 SAS Address(1): 0x0 Connected Port Number: 1(path0) Inquiry Data: SEAGATE ST3450857SS ES623SK16HLC FDE Capable: Not Capable FDE Enable: Disable Secured: Unsecured Locked: Unlocked Needs EKM Attention: No Foreign State: None Device Speed: Unknown Link Speed: Unknown Media Type: Hard Disk Device Drive Temperature : N/A PI Eligibility: No Drive is formatted for PI information: No PI: No PI Port-0 : Port status: Active Port's Linkspeed: Unknown Port-1 : Port status: Active Port's Linkspeed: Unknown Drive has flagged a S.M.A.R.T alert : No Enclosure Device ID: 32 Slot Number: 2 Drive's position: DiskGroup: 0, Span: 1, Arm: 0 Enclosure position: N/A Device Id: 2 WWN: Sequence Number: 2 Media Error Count: 0 Other Error Count: 0 Predictive Failure Count: 0 Last Predictive Failure Event Seq Number: 0 PD Type: SAS Raw Size: 419.186 GB [0x3465f870 Sectors] Non Coerced Size: 418.686 GB [0x3455f870 Sectors] Coerced Size: 418.625 GB [0x34540000 Sectors] Sector Size: 0 Firmware state: Online, Spun Up Device Firmware Level: ES62 Shield Counter: 0 Successful diagnostics completion on : N/A SAS Address(0): 0x5000c50023cea805 SAS Address(1): 0x0 Connected Port Number: 2(path0) Inquiry Data: SEAGATE ST3450857SS ES623SK189BR FDE Capable: Not Capable FDE Enable: Disable Secured: Unsecured Locked: Unlocked Needs EKM Attention: No Foreign State: None Device Speed: Unknown Link Speed: Unknown Media Type: Hard Disk Device Drive Temperature :39C (102.20 F) PI Eligibility: No Drive is formatted for PI information: No PI: No PI Port-0 : Port status: Active Port's Linkspeed: Unknown Port-1 : Port status: Active Port's Linkspeed: Unknown Drive has flagged a S.M.A.R.T alert : No Enclosure Device ID: 32 Slot Number: 3 Drive's position: DiskGroup: 0, Span: 1, Arm: 1 Enclosure position: N/A Device Id: 3 WWN: Sequence Number: 2 Media Error Count: 0 Other Error Count: 0 Predictive Failure Count: 23 Last Predictive Failure Event Seq Number: 0 PD Type: SAS Raw Size: 419.186 GB [0x3465f870 Sectors] Non Coerced Size: 418.686 GB [0x3455f870 Sectors] Coerced Size: 418.625 GB [0x34540000 Sectors] Sector Size: 0 Firmware state: Online, Spun Up Device Firmware Level: ES64 Shield Counter: 0 Successful diagnostics completion on : N/A SAS Address(0): 0x5000c50029124491 SAS Address(1): 0x0 Connected Port Number: 3(path0) Inquiry Data: SEAGATE ST3450857SS ES643SK27GQ9 FDE Capable: Not Capable FDE Enable: Disable Secured: Unsecured Locked: Unlocked Needs EKM Attention: No Foreign State: None Device Speed: Unknown Link Speed: Unknown Media Type: Hard Disk Device Drive Temperature :38C (100.40 F) PI Eligibility: No Drive is formatted for PI information: No PI: No PI Port-0 : Port status: Active Port's Linkspeed: Unknown Port-1 : Port status: Active Port's Linkspeed: Unknown Drive has flagged a S.M.A.R.T alert : No Exit Code: 0x00 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/000077500000000000000000000000001321450230300237605ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/10/000077500000000000000000000000001321450230300242005ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/10/mountstats000066400000000000000000000034431321450230300263500ustar00rootroot00000000000000device rootfs mounted on / with fstype rootfs device sysfs mounted on /sys with fstype sysfs device proc mounted on /proc with fstype proc device /dev/sda1 mounted on / with fstype ext4 device 192.168.1.1:/srv/test mounted on /mnt/nfs/test with fstype nfs4 statvers=1.1 opts: rw,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,acregmin=3,acregmax=60,acdirmin=30,acdirmax=60,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.5,local_lock=none age: 13968 caps: caps=0xfff7,wtmult=512,dtsize=32768,bsize=0,namlen=255 nfsv4: bm0=0xfdffafff,bm1=0xf9be3e,bm2=0x0,acl=0x0,pnfs=not configured sec: flavor=1,pseudoflavor=1 events: 52 226 0 0 1 13 398 0 0 331 0 47 0 0 77 0 0 77 0 0 0 0 0 0 0 0 0 bytes: 1207640230 0 0 0 1210214218 0 295483 0 RPC iostats version: 1.0 p/v: 100003/4 (nfs) xprt: tcp 832 0 1 0 11 6428 6428 0 12154 0 24 26 5726 per-op statistics NULL: 0 0 0 0 0 0 0 0 READ: 1298 1298 0 207680 1210292152 6 79386 79407 WRITE: 0 0 0 0 0 0 0 0 device 192.168.1.1:/srv/test mounted on /mnt/nfs/test-dupe with fstype nfs4 statvers=1.1 opts: rw,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,acregmin=3,acregmax=60,acdirmin=30,acdirmax=60,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.5,local_lock=none age: 13968 caps: caps=0xfff7,wtmult=512,dtsize=32768,bsize=0,namlen=255 nfsv4: bm0=0xfdffafff,bm1=0xf9be3e,bm2=0x0,acl=0x0,pnfs=not configured sec: flavor=1,pseudoflavor=1 events: 52 226 0 0 1 13 398 0 0 331 0 47 0 0 77 0 0 77 0 0 0 0 0 0 0 0 0 bytes: 1207640230 0 0 0 1210214218 0 295483 0 RPC iostats version: 1.0 p/v: 100003/4 (nfs) xprt: tcp 832 0 1 0 11 6428 6428 0 12154 0 24 26 5726 per-op statistics NULL: 0 0 0 0 0 0 0 0 READ: 1298 1298 0 207680 1210292152 6 79386 79407 WRITE: 0 0 0 0 0 0 0 0 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/buddyinfo000066400000000000000000000004541321450230300256710ustar00rootroot00000000000000Node 0, zone DMA 1 0 1 0 2 1 1 0 1 1 3 Node 0, zone DMA32 759 572 791 475 194 45 12 0 0 0 0 Node 0, zone Normal 4381 1093 185 1530 567 102 4 0 0 0 0 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/diskstats000066400000000000000000000047171321450230300257250ustar00rootroot00000000000000 1 0 ram0 0 0 0 0 0 0 0 0 0 0 0 1 1 ram1 0 0 0 0 0 0 0 0 0 0 0 1 2 ram2 0 0 0 0 0 0 0 0 0 0 0 1 3 ram3 0 0 0 0 0 0 0 0 0 0 0 1 4 ram4 0 0 0 0 0 0 0 0 0 0 0 1 5 ram5 0 0 0 0 0 0 0 0 0 0 0 1 6 ram6 0 0 0 0 0 0 0 0 0 0 0 1 7 ram7 0 0 0 0 0 0 0 0 0 0 0 1 8 ram8 0 0 0 0 0 0 0 0 0 0 0 1 9 ram9 0 0 0 0 0 0 0 0 0 0 0 1 10 ram10 0 0 0 0 0 0 0 0 0 0 0 1 11 ram11 0 0 0 0 0 0 0 0 0 0 0 1 12 ram12 0 0 0 0 0 0 0 0 0 0 0 1 13 ram13 0 0 0 0 0 0 0 0 0 0 0 1 14 ram14 0 0 0 0 0 0 0 0 0 0 0 1 15 ram15 0 0 0 0 0 0 0 0 0 0 0 7 0 loop0 0 0 0 0 0 0 0 0 0 0 0 7 1 loop1 0 0 0 0 0 0 0 0 0 0 0 7 2 loop2 0 0 0 0 0 0 0 0 0 0 0 7 3 loop3 0 0 0 0 0 0 0 0 0 0 0 7 4 loop4 0 0 0 0 0 0 0 0 0 0 0 7 5 loop5 0 0 0 0 0 0 0 0 0 0 0 7 6 loop6 0 0 0 0 0 0 0 0 0 0 0 7 7 loop7 0 0 0 0 0 0 0 0 0 0 0 8 0 sda 25354637 34367663 1003346126 18492372 28444756 11134226 505697032 63877960 0 9653880 82621804 8 1 sda1 250 0 2000 36 0 0 0 0 0 36 36 8 2 sda2 246 0 1968 32 0 0 0 0 0 32 32 8 3 sda3 340 13 2818 52 11 8 152 8 0 56 60 8 4 sda4 25353629 34367650 1003337964 18492232 27448755 11134218 505696880 61593380 0 7576432 80332428 252 0 dm-0 59910002 0 1003337218 46229572 39231014 0 505696880 1158557800 0 11325968 1206301256 252 1 dm-1 388 0 3104 84 74 0 592 0 0 76 84 252 2 dm-2 11571 0 308350 6536 153522 0 5093416 122884 0 65400 129416 252 3 dm-3 3870 0 3870 104 0 0 0 0 0 16 104 252 4 dm-4 392 0 1034 28 38 0 137 16 0 24 44 252 5 dm-5 3729 0 84279 924 98918 0 1151688 104684 0 58848 105632 179 0 mmcblk0 192 3 1560 156 0 0 0 0 0 136 156 179 1 mmcblk0p1 17 3 160 24 0 0 0 0 0 24 24 179 2 mmcblk0p2 95 0 760 68 0 0 0 0 0 68 68 2 0 fd0 2 0 16 80 0 0 0 0 0 80 80 254 0 vda 1775784 15386 32670882 8655768 6038856 20711856 213637440 2069221364 0 41614592 2077872228 254 1 vda1 668 85 5984 956 207 4266 35784 32772 0 8808 33720 254 2 vda2 1774936 15266 32663262 8654692 5991028 20707590 213601656 2069152216 0 41607628 2077801992 11 0 sr0 0 0 0 0 0 0 0 0 0 0 0 259 0 nvme0n1 47114 4 4643973 21650 1078320 43950 39451633 1011053 0 222766 1032546 259 1 nvme0n1p1 1140 0 9370 16 1 0 1 0 0 16 16 259 2 nvme0n1p2 45914 4 4631243 21626 1036885 43950 39451632 919480 0 131580 940970 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/drbd000066400000000000000000000004101321450230300246110ustar00rootroot00000000000000version: 8.4.3 (api:1/proto:86-101) srcversion: 1A9F77B1CA5FF92235C2213 1: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----- ns:17324442 nr:10961011 dw:28263521 dr:118696670 al:1100 bm:221 lo:12345 pe:12346 ua:12347 ap:12348 ep:1 wo:d oos:12349 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/interrupts000066400000000000000000000042751321450230300261320ustar00rootroot00000000000000 CPU0 CPU1 CPU2 CPU3 0: 18 0 0 0 IR-IO-APIC-edge timer 1: 17960 105 28 28 IR-IO-APIC-edge i8042 8: 1 0 0 0 IR-IO-APIC-edge rtc0 9: 398553 2320 824 863 IR-IO-APIC-fasteoi acpi 12: 380847 1021 240 198 IR-IO-APIC-edge i8042 16: 328511 322879 293782 351412 IR-IO-APIC-fasteoi ehci_hcd:usb1, mmc0 23: 1451445 3333499 1092032 2644609 IR-IO-APIC-fasteoi ehci_hcd:usb2 40: 0 0 0 0 DMAR_MSI-edge dmar0 41: 0 0 0 0 DMAR_MSI-edge dmar1 42: 378324 1734637 440240 2434308 IR-PCI-MSI-edge xhci_hcd 43: 7434032 8092205 6478877 7492252 IR-PCI-MSI-edge ahci 44: 140636 226313 347 633 IR-PCI-MSI-edge i915 45: 4 22 0 0 IR-PCI-MSI-edge mei_me 46: 43078464 130 460171 290 IR-PCI-MSI-edge iwlwifi 47: 350 224 0 0 IR-PCI-MSI-edge snd_hda_intel NMI: 47 5031 6211 4968 Non-maskable interrupts LOC: 174326351 135776678 168393257 130980079 Local timer interrupts SPU: 0 0 0 0 Spurious interrupts PMI: 47 5031 6211 4968 Performance monitoring interrupts IWI: 1509379 2411776 1512975 2428828 IRQ work interrupts RTR: 0 0 0 0 APIC ICR read retries RES: 10847134 9111507 15999335 7457260 Rescheduling interrupts CAL: 148554 157441 142912 155528 Function call interrupts TLB: 10460334 9918429 10494258 10345022 TLB shootdowns TRM: 0 0 0 0 Thermal event interrupts THR: 0 0 0 0 Threshold APIC interrupts MCE: 0 0 0 0 Machine check exceptions MCP: 2406 2399 2399 2399 Machine check polls ERR: 0 MIS: 0 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/loadavg000066400000000000000000000000331321450230300253140ustar00rootroot000000000000000.21 0.37 0.39 1/719 19737 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/mdstat000066400000000000000000000031361321450230300252020ustar00rootroot00000000000000Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md3 : active raid6 sda1[8] sdh1[7] sdg1[6] sdf1[5] sde1[11] sdd1[3] sdc1[10] sdb1[9] 5853468288 blocks super 1.2 level 6, 64k chunk, algorithm 2 [8/8] [UUUUUUUU] md127 : active raid1 sdi2[0] sdj2[1] 312319552 blocks [2/2] [UU] md0 : active raid1 sdi1[0] sdj1[1] 248896 blocks [2/2] [UU] md4 : inactive raid1 sda3[0] sdb3[1] 4883648 blocks [2/2] [UU] md6 : active raid1 sdb2[2] sda2[0] 195310144 blocks [2/1] [U_] [=>...................] recovery = 8.5% (16775552/195310144) finish=17.0min speed=259783K/sec md8 : active raid1 sdb1[1] sda1[0] 195310144 blocks [2/2] [UU] [=>...................] resync = 8.5% (16775552/195310144) finish=17.0min speed=259783K/sec md7 : active raid6 sdb1[0] sde1[3] sdd1[2] sdc1[1] 7813735424 blocks super 1.2 level 6, 512k chunk, algorithm 2 [4/3] [U_UU] bitmap: 0/30 pages [0KB], 65536KB chunk md9 : active raid1 sdc2[2] sdd2[3] sdb2[1] sda2[0] 523968 blocks super 1.2 [4/4] [UUUU] resync=DELAYED md10 : active raid0 sda1[0] sdb1[1] 314159265 blocks 64k chunks md11 : active (auto-read-only) raid1 sdb2[0] sdc2[1] 4190208 blocks super 1.2 [2/2] [UU] resync=PENDING md12 : active raid0 sdc2[0] sdd2[1] 3886394368 blocks super 1.2 512k chunks md126 : active raid0 sdb[1] sdc[0] 1855870976 blocks super external:/md127/0 128k chunks md219 : inactive sdb[2](S) sdc[1](S) sda[0](S) 7932 blocks super external:imsm md00 : active raid0 xvdb[0] 4186624 blocks super 1.2 256k chunks unused devices: prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/mdstat_invalid000066400000000000000000000001421321450230300267020ustar00rootroot00000000000000Personalities : [invalid] md3 : invalid 314159265 blocks 64k chunks unused devices: prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/meminfo000066400000000000000000000022221321450230300253330ustar00rootroot00000000000000MemTotal: 3742148 kB MemFree: 225472 kB Buffers: 22040 kB Cached: 930888 kB SwapCached: 192504 kB Active: 2233416 kB Inactive: 1028728 kB Active(anon): 2020004 kB Inactive(anon): 883052 kB Active(file): 213412 kB Inactive(file): 145676 kB Unevictable: 32 kB Mlocked: 32 kB SwapTotal: 4194300 kB SwapFree: 3155360 kB Dirty: 1052 kB Writeback: 0 kB AnonPages: 2244172 kB Mapped: 239220 kB Shmem: 593840 kB Slab: 98932 kB SReclaimable: 44772 kB SUnreclaim: 54160 kB KernelStack: 5800 kB PageTables: 75212 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 6065372 kB Committed_AS: 7835436 kB VmallocTotal: 34359738367 kB VmallocUsed: 352840 kB VmallocChunk: 34359338876 kB HardwareCorrupted: 0 kB AnonHugePages: 0 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB DirectMap4k: 185660 kB DirectMap2M: 3698688 kB prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/mounts000066400000000000000000000041201321450230300252250ustar00rootroot00000000000000rootfs / rootfs rw 0 0 sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 udev /dev devtmpfs rw,relatime,size=10240k,nr_inodes=1008585,mode=755 0 0 devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 tmpfs /run tmpfs rw,nosuid,relatime,size=1617716k,mode=755 0 0 /dev/dm-2 / ext4 rw,relatime,errors=remount-ro,data=ordered 0 0 securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0 tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0 tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0 tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0 cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd 0 0 pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0 cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0 cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0 cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0 cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0 cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0 cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0 cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0 systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0 mqueue /dev/mqueue mqueue rw,relatime 0 0 debugfs /sys/kernel/debug debugfs rw,relatime 0 0 hugetlbfs /dev/hugepages hugetlbfs rw,relatime 0 0 fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0 /dev/sda3 /boot ext2 rw,relatime 0 0 rpc_pipefs /run/rpc_pipefs rpc_pipefs rw,relatime 0 0 binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0 tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=808860k,mode=700,uid=1000,gid=1000 0 0 gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/net/000077500000000000000000000000001321450230300245465ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/net/arp000066400000000000000000000010211321450230300252450ustar00rootroot00000000000000IP address HW type Flags HW address Mask Device 192.168.1.1 0x1 0x2 cc:aa:dd:ee:aa:bb * eth0 192.168.1.2 0x1 0x2 bb:cc:dd:ee:ff:aa * eth0 192.168.1.3 0x1 0x2 aa:bb:cc:dd:ee:ff * eth0 192.168.1.4 0x1 0x2 dd:ee:ff:aa:bb:cc * eth1 192.168.1.5 0x1 0x2 ee:ff:aa:bb:cc:dd * eth1 192.168.1.6 0x1 0x2 ff:aa:bb:cc:dd:ee * eth1 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/net/dev000066400000000000000000000021001321450230300252400ustar00rootroot00000000000000Inter-| Receive | Transmit face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed tun0: 1888 24 0 0 0 0 0 0 67120 934 0 0 0 0 0 0 veth4B09XN: 648 8 0 0 0 0 0 0 1943284 10640 0 0 0 0 0 0 lo: 435303245 1832522 0 0 0 0 0 0 435303245 1832522 0 0 0 0 0 0 eth0:68210035552 520993275 0 0 0 0 0 0 9315587528 43451486 0 0 0 0 0 0 lxcbr0: 0 0 0 0 0 0 0 0 2630299 28339 0 0 0 0 0 0 wlan0: 10437182923 13899359 0 0 0 0 0 0 2851649360 11726200 0 0 0 0 0 0 docker0: 64910168 1065585 0 0 0 0 0 0 2681662018 1929779 0 0 0 0 0 0 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/net/ip_vs000066400000000000000000000013021321450230300256050ustar00rootroot00000000000000IP Virtual Server version 1.2.1 (size=4096) Prot LocalAddress:Port Scheduler Flags -> RemoteAddress:Port Forward Weight ActiveConn InActConn TCP C0A80016:0CEA wlc -> C0A85216:0CEA Tunnel 100 248 2 -> C0A85318:0CEA Tunnel 100 248 2 -> C0A85315:0CEA Tunnel 100 248 1 TCP C0A80039:0CEA wlc -> C0A85416:0CEA Tunnel 0 0 0 -> C0A85215:0CEA Tunnel 100 1499 0 -> C0A83215:0CEA Tunnel 100 1498 0 TCP C0A80037:0CEA wlc -> C0A8321A:0CEA Tunnel 0 0 0 -> C0A83120:0CEA Tunnel 100 0 0 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/net/ip_vs_stats000066400000000000000000000004621321450230300270310ustar00rootroot00000000000000 Total Incoming Outgoing Incoming Outgoing Conns Packets Packets Bytes Bytes 16AA370 E33656E5 0 51D8C8883AB3 0 Conns/s Pkts/s Pkts/s Bytes/s Bytes/s 4 1FB3C 0 1282A8F 0 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/net/netstat000066400000000000000000000032321321450230300261530ustar00rootroot00000000000000TcpExt: SyncookiesSent SyncookiesRecv SyncookiesFailed EmbryonicRsts PruneCalled RcvPruned OfoPruned OutOfWindowIcmps LockDroppedIcmps ArpFilter TW TWRecycled TWKilled PAWSPassive PAWSActive PAWSEstab DelayedACKs DelayedACKLocked DelayedACKLost ListenOverflows ListenDrops TCPPrequeued TCPDirectCopyFromBacklog TCPDirectCopyFromPrequeue TCPPrequeueDropped TCPHPHits TCPHPHitsToUser TCPPureAcks TCPHPAcks TCPRenoRecovery TCPSackRecovery TCPSACKReneging TCPFACKReorder TCPSACKReorder TCPRenoReorder TCPTSReorder TCPFullUndo TCPPartialUndo TCPDSACKUndo TCPLossUndo TCPLoss TCPLostRetransmit TCPRenoFailures TCPSackFailures TCPLossFailures TCPFastRetrans TCPForwardRetrans TCPSlowStartRetrans TCPTimeouts TCPRenoRecoveryFail TCPSackRecoveryFail TCPSchedulerFailed TCPRcvCollapsed TCPDSACKOldSent TCPDSACKOfoSent TCPDSACKRecv TCPDSACKOfoRecv TCPAbortOnData TCPAbortOnClose TCPAbortOnMemory TCPAbortOnTimeout TCPAbortOnLinger TCPAbortFailed TCPMemoryPressures TCPSACKDiscard TCPDSACKIgnoredOld TCPDSACKIgnoredNoUndo TCPSpuriousRTOs TCPMD5NotFound TCPMD5Unexpected TCPSackShifted TCPSackMerged TCPSackShiftFallback TCPBacklogDrop TCPMinTTLDrop TCPDeferAcceptDrop IPReversePathFilter TCPTimeWaitOverflow TCPReqQFullDoCookies TCPReqQFullDrop TCPChallengeACK TCPSYNChallenge TcpExt: 0 0 2 0 0 0 0 0 0 0 388812 0 0 0 0 6 102471 17 9 0 0 80568 0 168808 0 4471289 26 1433940 3744565 0 1 0 0 0 0 0 0 0 0 48 0 0 0 1 0 1 0 1 115 0 0 0 0 9 0 5 0 41 4 0 0 0 0 0 0 0 1 0 0 0 0 2 5 0 0 0 0 0 0 0 2 2 IpExt: InNoRoutes InTruncatedPkts InMcastPkts OutMcastPkts InBcastPkts OutBcastPkts InOctets OutOctets InMcastOctets OutMcastOctets InBcastOctets OutBcastOctets IpExt: 0 0 0 0 0 0 6286396970 2786264347 0 0 0 0 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/net/rpc/000077500000000000000000000000001321450230300253325ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/net/rpc/nfs000066400000000000000000000006001321450230300260370ustar00rootroot00000000000000net 70 70 69 45 rpc 1218785755 374636 1218815394 proc2 18 16 57 74 52 71 73 45 86 0 52 83 61 17 53 50 23 70 82 proc3 22 0 1061909262 48906 4077635 117661341 5 29391916 2570425 2993289 590 0 0 7815 15 1130 0 3983 92385 13332 2 1 23729 proc4 48 98 51 54 83 85 23 24 1 28 73 68 83 12 84 39 68 59 58 88 29 74 69 96 21 84 15 53 86 54 66 56 97 36 49 32 85 81 11 58 32 67 13 28 35 90 1 26 0 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/net/snmp000066400000000000000000000022621321450230300254500ustar00rootroot00000000000000Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqds ReasmOKs ReasmFails FragOKs FragFails FragCreates Ip: 1 64 57740232 0 25 397750 0 0 57340175 55365537 0 54 0 0 0 0 0 0 0 Icmp: InMsgs InErrors InCsumErrors InDestUnreachs InTimeExcds InParmProbs InSrcQuenchs InRedirects InEchos InEchoReps InTimestamps InTimestampReps InAddrMasks InAddrMaskReps OutMsgs OutErrors OutDestUnreachs OutTimeExcds OutParmProbs OutSrcQuenchs OutRedirects OutEchos OutEchoReps OutTimestamps OutTimestampReps OutAddrMasks OutAddrMaskReps Icmp: 104 0 0 104 0 0 0 0 0 0 0 0 0 0 120 0 120 0 0 0 0 0 0 0 0 0 0 IcmpMsg: InType3 OutType3 IcmpMsg: 104 120 Tcp: RtoAlgorithm RtoMin RtoMax MaxConn ActiveOpens PassiveOpens AttemptFails EstabResets CurrEstab InSegs OutSegs RetransSegs InErrs OutRsts InCsumErrors Tcp: 1 200 120000 -1 3556 230 341 161 0 57252008 54915039 227 5 1003 0 Udp: InDatagrams NoPorts InErrors OutDatagrams RcvbufErrors SndbufErrors InCsumErrors Udp: 88542 120 0 53028 0 0 0 UdpLite: InDatagrams NoPorts InErrors OutDatagrams RcvbufErrors SndbufErrors InCsumErrors UdpLite: 0 0 0 0 0 0 0 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/net/snmp6000066400000000000000000000056531321450230300255450ustar00rootroot00000000000000Ip6InReceives 7 Ip6InHdrErrors 0 Ip6InTooBigErrors 0 Ip6InNoRoutes 5 Ip6InAddrErrors 0 Ip6InUnknownProtos 0 Ip6InTruncatedPkts 0 Ip6InDiscards 0 Ip6InDelivers 0 Ip6OutForwDatagrams 0 Ip6OutRequests 8 Ip6OutDiscards 0 Ip6OutNoRoutes 3003 Ip6ReasmTimeout 0 Ip6ReasmReqds 0 Ip6ReasmOKs 0 Ip6ReasmFails 0 Ip6FragOKs 0 Ip6FragFails 0 Ip6FragCreates 0 Ip6InMcastPkts 2 Ip6OutMcastPkts 12 Ip6InOctets 460 Ip6OutOctets 536 Ip6InMcastOctets 112 Ip6OutMcastOctets 840 Ip6InBcastOctets 0 Ip6OutBcastOctets 0 Ip6InNoECTPkts 7 Ip6InECT1Pkts 0 Ip6InECT0Pkts 0 Ip6InCEPkts 0 Icmp6InMsgs 0 Icmp6InErrors 0 Icmp6OutMsgs 8 Icmp6OutErrors 0 Icmp6InCsumErrors 0 Icmp6InDestUnreachs 0 Icmp6InPktTooBigs 0 Icmp6InTimeExcds 0 Icmp6InParmProblems 0 Icmp6InEchos 0 Icmp6InEchoReplies 0 Icmp6InGroupMembQueries 0 Icmp6InGroupMembResponses 0 Icmp6InGroupMembReductions 0 Icmp6InRouterSolicits 0 Icmp6InRouterAdvertisements 0 Icmp6InNeighborSolicits 0 Icmp6InNeighborAdvertisements 0 Icmp6InRedirects 0 Icmp6InMLDv2Reports 0 Icmp6OutDestUnreachs 0 Icmp6OutPktTooBigs 0 Icmp6OutTimeExcds 0 Icmp6OutParmProblems 0 Icmp6OutEchos 0 Icmp6OutEchoReplies 0 Icmp6OutGroupMembQueries 0 Icmp6OutGroupMembResponses 0 Icmp6OutGroupMembReductions 0 Icmp6OutRouterSolicits 3 Icmp6OutRouterAdvertisements 0 Icmp6OutNeighborSolicits 1 Icmp6OutNeighborAdvertisements 0 Icmp6OutRedirects 0 Icmp6OutMLDv2Reports 4 Icmp6OutType133 3 Icmp6OutType135 1 Icmp6OutType143 4 Udp6InDatagrams 0 Udp6NoPorts 0 Udp6InErrors 0 Udp6OutDatagrams 0 Udp6RcvbufErrors 0 Udp6SndbufErrors 0 Udp6InCsumErrors 0 Udp6IgnoredMulti 0 UdpLite6InDatagrams 0 UdpLite6NoPorts 0 UdpLite6InErrors 0 UdpLite6OutDatagrams 0 UdpLite6RcvbufErrors 0 UdpLite6SndbufErrors 0 UdpLite6InCsumErrors 0 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/net/sockstat000066400000000000000000000002041321450230300263200ustar00rootroot00000000000000sockets: used 229 TCP: inuse 4 orphan 0 tw 4 alloc 17 mem 1 UDP: inuse 0 mem 0 UDPLITE: inuse 0 RAW: inuse 0 FRAG: inuse 0 memory 0 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/net/sockstat_rhe4000066400000000000000000000001551321450230300272470ustar00rootroot00000000000000sockets: used 229 TCP: inuse 4 orphan 0 tw 4 alloc 17 mem 1 UDP: inuse 0 RAW: inuse 0 FRAG: inuse 0 memory 0 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/net/tcpstat000066400000000000000000000007021321450230300261520ustar00rootroot00000000000000 sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode 0: 00000000:0016 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 2740 1 ffff88003d3af3c0 100 0 0 10 0 1: 0F02000A:0016 0202000A:8B6B 01 00000000:00000000 02:000AC99B 00000000 0 0 3652 4 ffff88003d3ae040 21 4 31 47 46 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/self00007770000000000000000000000000132145023030024772210ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/spl/000077500000000000000000000000001321450230300245565ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/spl/kstat/000077500000000000000000000000001321450230300257045ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/spl/kstat/zfs/000077500000000000000000000000001321450230300265065ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/spl/kstat/zfs/arcstats000066400000000000000000000075661321450230300302730ustar00rootroot000000000000006 1 0x01 91 4368 5266997922 97951858082072 name type data hits 4 8772612 misses 4 604635 demand_data_hits 4 7221032 demand_data_misses 4 73300 demand_metadata_hits 4 1464353 demand_metadata_misses 4 498170 prefetch_data_hits 4 3615 prefetch_data_misses 4 17094 prefetch_metadata_hits 4 83612 prefetch_metadata_misses 4 16071 mru_hits 4 855535 mru_ghost_hits 4 21100 mfu_hits 4 7829854 mfu_ghost_hits 4 821 deleted 4 60403 mutex_miss 4 2 evict_skip 4 2265729 evict_not_enough 4 680 evict_l2_cached 4 0 evict_l2_eligible 4 8992514560 evict_l2_ineligible 4 992552448 evict_l2_skip 4 0 hash_elements 4 42359 hash_elements_max 4 88245 hash_collisions 4 50564 hash_chains 4 412 hash_chain_max 4 3 p 4 516395305 c 4 1643208777 c_min 4 33554432 c_max 4 8367976448 size 4 1603939792 hdr_size 4 16361080 data_size 4 1295836160 metadata_size 4 175298560 other_size 4 116443992 anon_size 4 1917440 anon_evictable_data 4 0 anon_evictable_metadata 4 0 mru_size 4 402593792 mru_evictable_data 4 278091264 mru_evictable_metadata 4 18606592 mru_ghost_size 4 999728128 mru_ghost_evictable_data 4 883765248 mru_ghost_evictable_metadata 4 115962880 mfu_size 4 1066623488 mfu_evictable_data 4 1017613824 mfu_evictable_metadata 4 9163776 mfu_ghost_size 4 104936448 mfu_ghost_evictable_data 4 96731136 mfu_ghost_evictable_metadata 4 8205312 l2_hits 4 0 l2_misses 4 0 l2_feeds 4 0 l2_rw_clash 4 0 l2_read_bytes 4 0 l2_write_bytes 4 0 l2_writes_sent 4 0 l2_writes_done 4 0 l2_writes_error 4 0 l2_writes_lock_retry 4 0 l2_evict_lock_retry 4 0 l2_evict_reading 4 0 l2_evict_l1cached 4 0 l2_free_on_write 4 0 l2_cdata_free_on_write 4 0 l2_abort_lowmem 4 0 l2_cksum_bad 4 0 l2_io_error 4 0 l2_size 4 0 l2_asize 4 0 l2_hdr_size 4 0 l2_compress_successes 4 0 l2_compress_zeros 4 0 l2_compress_failures 4 0 memory_throttle_count 4 0 duplicate_buffers 4 0 duplicate_buffers_size 4 0 duplicate_reads 4 0 memory_direct_count 4 542 memory_indirect_count 4 3006 arc_no_grow 4 0 arc_tempreserve 4 0 arc_loaned_bytes 4 0 arc_prune 4 0 arc_meta_used 4 308103632 arc_meta_limit 4 6275982336 arc_meta_max 4 449286096 arc_meta_min 4 16777216 arc_need_free 4 0 arc_sys_free 4 261496832 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/spl/kstat/zfs/dmu_tx000066400000000000000000000010101321450230300277210ustar00rootroot000000000000005 1 0x01 11 528 8010436841 354962070418194 name type data dmu_tx_assigned 4 3532844 dmu_tx_delay 4 0 dmu_tx_error 4 0 dmu_tx_suspended 4 0 dmu_tx_group 4 0 dmu_tx_memory_reserve 4 0 dmu_tx_memory_reclaim 4 0 dmu_tx_dirty_throttle 4 0 dmu_tx_dirty_delay 4 0 dmu_tx_dirty_over_max 4 0 dmu_tx_quota 4 0 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/spl/kstat/zfs/fm000066400000000000000000000003611321450230300270330ustar00rootroot000000000000000 1 0x01 4 192 8007255140 354329591145385 name type data erpt-dropped 4 18 erpt-set-failed 4 0 fmri-set-failed 4 0 payload-set-failed 4 0 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/spl/kstat/zfs/pool1/000077500000000000000000000000001321450230300275405ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/spl/kstat/zfs/pool1/io000066400000000000000000000004241321450230300300720ustar00rootroot0000000000000012 3 0x00 1 80 79205351707403 395818011156865 nread nwritten reads writes wtime wlentime wupdate rtime rlentime rupdate wcnt rcnt 1884160 3206144 22 132 7155162 104112268 79210489694949 24168078 104112268 79210489849220 0 0 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/spl/kstat/zfs/poolz1/000077500000000000000000000000001321450230300277325ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/spl/kstat/zfs/poolz1/io000066400000000000000000000004441321450230300302660ustar00rootroot0000000000000016 3 0x00 1 80 79568650431241 395832279341621 nread nwritten reads writes wtime wlentime wupdate rtime rlentime rupdate wcnt rcnt 2826240 2680501248 33 25294 9673715628 6472105124093 110734831833266 9829091640 6472105124093 110734831944501 0 0 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/spl/kstat/zfs/vdev_cache_stats000066400000000000000000000003121321450230300317320ustar00rootroot000000000000008 1 0x01 3 144 8012540758 352116106118781 name type data delegations 4 40 hits 4 0 misses 4 0 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/spl/kstat/zfs/xuio_stats000066400000000000000000000004771321450230300306430ustar00rootroot000000000000002 1 0x01 6 288 8009100742 353415816865654 name type data onloan_read_buf 4 32 onloan_write_buf 4 0 read_buf_copied 4 0 read_buf_nocopy 4 0 write_buf_copied 4 0 write_buf_nocopy 4 0 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/spl/kstat/zfs/zfetchstats000066400000000000000000000010211321450230300307650ustar00rootroot000000000000004 1 0x01 11 528 8010434610 345692669858836 name type data hits 4 7067992 misses 4 11 colinear_hits 4 0 colinear_misses 4 11 stride_hits 4 7067990 stride_misses 4 0 reclaim_successes 4 0 reclaim_failures 4 11 streams_resets 4 0 streams_noresets 4 2 bogus_streams 4 0 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/spl/kstat/zfs/zil000066400000000000000000000011211321450230300272220ustar00rootroot000000000000007 1 0x01 13 624 8012538347 351689526932992 name type data zil_commit_count 4 10 zil_commit_writer_count 4 0 zil_itx_count 4 0 zil_itx_indirect_count 4 0 zil_itx_indirect_bytes 4 0 zil_itx_copied_count 4 0 zil_itx_copied_bytes 4 0 zil_itx_needcopy_count 4 0 zil_itx_needcopy_bytes 4 0 zil_itx_metaslab_normal_count 4 0 zil_itx_metaslab_normal_bytes 4 0 zil_itx_metaslab_slog_count 4 0 zil_itx_metaslab_slog_bytes 4 0 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/stat000066400000000000000000000040561321450230300246630ustar00rootroot00000000000000cpu 301854 612 111922 8979004 3552 2 3944 0 0 0 cpu0 44490 19 21045 1087069 220 1 3410 0 0 0 cpu1 47869 23 16474 1110787 591 0 46 0 0 0 cpu2 46504 36 15916 1112321 441 0 326 0 0 0 cpu3 47054 102 15683 1113230 533 0 60 0 0 0 cpu4 28413 25 10776 1140321 217 0 8 0 0 0 cpu5 29271 101 11586 1136270 672 0 30 0 0 0 cpu6 29152 36 10276 1139721 319 0 29 0 0 0 cpu7 29098 268 10164 1139282 555 0 31 0 0 0 intr 8885917 17 0 0 0 0 0 0 0 1 79281 0 0 0 0 0 0 0 231237 0 0 0 0 250586 103 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 223424 190745 13 906 1283803 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ctxt 38014093 btime 1418183276 processes 26442 procs_running 2 procs_blocked 0 softirq 5057579 250191 1481983 1647 211099 186066 0 1783454 622196 12499 508444 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/sys/000077500000000000000000000000001321450230300245765ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/sys/fs/000077500000000000000000000000001321450230300252065ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/sys/fs/file-nr000066400000000000000000000000171321450230300264630ustar00rootroot000000000000001024 0 1631329 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/sys/kernel/000077500000000000000000000000001321450230300260565ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/sys/kernel/random/000077500000000000000000000000001321450230300273365ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/sys/kernel/random/entropy_avail000066400000000000000000000000051321450230300321300ustar00rootroot000000000000001337 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/sys/net/000077500000000000000000000000001321450230300253645ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/sys/net/netfilter/000077500000000000000000000000001321450230300273605ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/sys/net/netfilter/nf_conntrack_count000066400000000000000000000000041321450230300331520ustar00rootroot00000000000000123 prometheus-node-exporter-0.15.2+ds/collector/fixtures/proc/sys/net/netfilter/nf_conntrack_max000066400000000000000000000000061321450230300326110ustar00rootroot0000000000000065536 prometheus-node-exporter-0.15.2+ds/collector/fixtures/qdisc/000077500000000000000000000000001321450230300241205ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/qdisc/results.json000066400000000000000000000004441321450230300265160ustar00rootroot00000000000000[ { "IfaceName": "wlan0", "Bytes": 42, "Packets": 42, "Requeues": 1, "Kind": "fq", "Drops": 1 }, { "IfaceName": "eth0", "Bytes": 83, "Packets": 83, "Requeues": 2, "Kind": "pfifo_fast" } ] prometheus-node-exporter-0.15.2+ds/collector/fixtures/sys.ttar000066400000000000000000002046431321450230300245400ustar00rootroot00000000000000# Archive created by ttar -C collector/fixtures -c -f collector/fixtures/sys.ttar sys Directory: sys Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus/cpu Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus/cpu/devices Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus/cpu/devices/cpu0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus/cpu/devices/cpu0/cpufreq Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/cpu/devices/cpu0/cpufreq/scaling_cur_freq Lines: 1 1699981 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/cpu/devices/cpu0/cpufreq/scaling_max_freq Lines: 1 3700000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/cpu/devices/cpu0/cpufreq/scaling_min_freq Lines: 1 800000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus/cpu/devices/cpu0/thermal_throttle Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/cpu/devices/cpu0/thermal_throttle/core_throttle_count Lines: 1 5 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/cpu/devices/cpu0/thermal_throttle/package_throttle_count Lines: 1 30 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus/cpu/devices/cpu1 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus/cpu/devices/cpu1/cpufreq Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/cpu/devices/cpu1/cpufreq/scaling_cur_freq Lines: 1 1699981 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/cpu/devices/cpu1/cpufreq/scaling_max_freq Lines: 1 3700000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/cpu/devices/cpu1/cpufreq/scaling_min_freq Lines: 1 800000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus/cpu/devices/cpu1/thermal_throttle Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/cpu/devices/cpu1/thermal_throttle/core_throttle_count Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/cpu/devices/cpu1/thermal_throttle/package_throttle_count Lines: 1 30 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus/cpu/devices/cpu2 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus/cpu/devices/cpu2/thermal_throttle Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/cpu/devices/cpu2/thermal_throttle/core_throttle_count Lines: 1 40 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/cpu/devices/cpu2/thermal_throttle/package_throttle_count Lines: 1 6 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus/cpu/devices/cpu3 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus/cpu/devices/cpu3/cpufreq Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/cpu/devices/cpu3/cpufreq/scaling_cur_freq Lines: 1 8000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/cpu/devices/cpu3/cpufreq/scaling_max_freq Lines: 1 4200000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/cpu/devices/cpu3/cpufreq/scaling_min_freq Lines: 1 1000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus/node Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus/node/devices Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus/node/devices/node0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus/node/devices/node0/cpu0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus/node/devices/node0/cpu0/thermal_throttle Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/node/devices/node0/cpu0/thermal_throttle/package_throttle_count Lines: 1 30 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus/node/devices/node0/cpu1 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus/node/devices/node0/cpu1/thermal_throttle Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/node/devices/node0/cpu1/thermal_throttle/package_throttle_count Lines: 1 30 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/node/devices/node0/cpulist Lines: 1 0-3 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus/node/devices/node1 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/node/devices/node1/cpulist Lines: 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/hwmon Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/hwmon/hwmon0 SymlinkTo: ../../devices/platform/coretemp.0/hwmon/hwmon0 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/hwmon/hwmon1 SymlinkTo: ../../devices/platform/coretemp.1/hwmon/hwmon1 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/hwmon/hwmon2 SymlinkTo: ../../devices/platform/applesmc.768/hwmon/hwmon2 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/hwmon/hwmon3 SymlinkTo: ../../devices/platform/nct6775.656/hwmon/hwmon3 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/hwmon/hwmon4 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/hwmon/hwmon4/temp1_crit Lines: 1 100000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/hwmon/hwmon4/temp1_crit_alarm Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/hwmon/hwmon4/temp1_input Lines: 1 55000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/hwmon/hwmon4/temp1_label Lines: 1 foosensor Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/hwmon/hwmon4/temp1_max Lines: 1 100000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/hwmon/hwmon4/temp2_crit Lines: 1 100000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/hwmon/hwmon4/temp2_crit_alarm Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/hwmon/hwmon4/temp2_input Lines: 1 54000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/hwmon/hwmon4/temp2_label Lines: 1 foosensor Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/hwmon/hwmon4/temp2_max Lines: 1 100000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/infiniband Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/infiniband/mlx4_0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/infiniband/mlx4_0/ports Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/infiniband/mlx4_0/ports/1 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/infiniband/mlx4_0/ports/1/counters Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/1/counters/link_downed Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/1/counters/link_error_recovery Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/1/counters/multicast_rcv_packets Lines: 1 93 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/1/counters/multicast_xmit_packets Lines: 1 16 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/1/counters/port_rcv_data Lines: 1 4631917 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/1/counters/port_xmit_data Lines: 1 3733440 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/1/counters/unicast_rcv_packets Lines: 1 61148 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/1/counters/unicast_xmit_packets Lines: 1 61239 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/infiniband/mlx4_0/ports/1/counters_ext Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/1/counters_ext/port_multicast_rcv_packets Lines: 1 93 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/1/counters_ext/port_multicast_xmit_packets Lines: 1 16 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/1/counters_ext/port_rcv_data_64 Lines: 1 4631917 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/1/counters_ext/port_rcv_packets_64 Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/1/counters_ext/port_unicast_rcv_packets Lines: 1 61148 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/1/counters_ext/port_unicast_xmit_packets Lines: 1 61239 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/1/counters_ext/port_xmit_data_64 Lines: 1 3733440 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/1/counters_ext/port_xmit_packets_64 Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/infiniband/mlx4_0/ports/2 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/infiniband/mlx4_0/ports/2/counters Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/2/counters/link_downed Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/2/counters/link_error_recovery Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/2/counters/multicast_rcv_packets Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/2/counters/multicast_xmit_packets Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/2/counters/port_rcv_data Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/2/counters/port_xmit_data Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/2/counters/unicast_rcv_packets Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/2/counters/unicast_xmit_packets Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/infiniband/mlx4_0/ports/2/counters_ext Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/2/counters_ext/port_multicast_rcv_packets Lines: 1 93 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/2/counters_ext/port_multicast_xmit_packets Lines: 1 16 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/2/counters_ext/port_rcv_data_64 Lines: 1 4631917 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/2/counters_ext/port_rcv_packets_64 Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/2/counters_ext/port_unicast_rcv_packets Lines: 1 61148 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/2/counters_ext/port_unicast_xmit_packets Lines: 1 61239 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/2/counters_ext/port_xmit_data_64 Lines: 1 3733440 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/2/counters_ext/port_xmit_packets_64 Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/net Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/net/bond0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/net/bond0/bonding Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/bonding/slaves Lines: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bonding_masters Lines: 1 bond0 dmz int Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/net/dmz Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/net/dmz/bonding Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/bonding/slaves Lines: 1 eth0 eth4 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/net/dmz/slave_eth0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/slave_eth0/operstate Lines: 1 up Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/net/dmz/slave_eth4 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/slave_eth4/operstate Lines: 1 up Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/net/int Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/net/int/bonding Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/bonding/slaves Lines: 1 eth5 eth1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/net/int/slave_eth1 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/slave_eth1/operstate Lines: 1 down Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/net/int/slave_eth5 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/slave_eth5/operstate Lines: 1 up Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:0d.0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:0d.0/ata4 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/dirty_data Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_day Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_day/bypassed Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_day/cache_bypass_hits Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_day/cache_bypass_misses Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_day/cache_hit_ratio Lines: 1 100 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_day/cache_hits Lines: 1 289 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_day/cache_miss_collisions Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_day/cache_misses Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_day/cache_readaheads Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_five_minute Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_five_minute/bypassed Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_five_minute/cache_bypass_hits Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_five_minute/cache_bypass_misses Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_five_minute/cache_hit_ratio Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_five_minute/cache_hits Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_five_minute/cache_miss_collisions Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_five_minute/cache_misses Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_five_minute/cache_readaheads Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_hour Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_hour/bypassed Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_hour/cache_bypass_hits Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_hour/cache_bypass_misses Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_hour/cache_hit_ratio Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_hour/cache_hits Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_hour/cache_miss_collisions Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_hour/cache_misses Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_hour/cache_readaheads Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_total Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_total/bypassed Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_total/cache_bypass_hits Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_total/cache_bypass_misses Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_total/cache_hit_ratio Lines: 1 100 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_total/cache_hits Lines: 1 546 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_total/cache_miss_collisions Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_total/cache_misses Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_total/cache_readaheads Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:0d.0/ata5 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:0d.0/ata5/host4 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:0d.0/ata5/host4/target4:0:0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:0d.0/ata5/host4/target4:0:0/4:0:0:0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:0d.0/ata5/host4/target4:0:0/4:0:0:0/block Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:0d.0/ata5/host4/target4:0:0/4:0:0:0/block/sdc Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:0d.0/ata5/host4/target4:0:0/4:0:0:0/block/sdc/bcache Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata5/host4/target4:0:0/4:0:0:0/block/sdc/bcache/io_errors Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata5/host4/target4:0:0/4:0:0:0/block/sdc/bcache/metadata_written Lines: 1 512 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata5/host4/target4:0:0/4:0:0:0/block/sdc/bcache/priority_stats Lines: 5 Unused: 99% Metadata: 0% Average: 10473 Sectors per Q: 64 Quantiles: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20946 20946 20946 20946 20946 20946 20946 20946 20946 20946 20946 20946 20946 20946 20946 20946] Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata5/host4/target4:0:0/4:0:0:0/block/sdc/bcache/written Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/platform Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/platform/applesmc.768 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/applesmc.768/fan1_input Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/applesmc.768/fan1_label Lines: 1 Left side Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/applesmc.768/fan1_manual Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/applesmc.768/fan1_max Lines: 1 6156 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/applesmc.768/fan1_min Lines: 1 2160 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/applesmc.768/fan1_output Lines: 1 2160 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/applesmc.768/fan1_safe Lines: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/applesmc.768/fan2_input Lines: 1 1998 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/applesmc.768/fan2_label Lines: 1 Right side Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/applesmc.768/fan2_manual Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/applesmc.768/fan2_max Lines: 1 5700 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/applesmc.768/fan2_min Lines: 1 2000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/applesmc.768/fan2_output Lines: 1 2000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/applesmc.768/fan2_safe Lines: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/platform/applesmc.768/hwmon Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/platform/applesmc.768/hwmon/hwmon2 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/applesmc.768/hwmon/hwmon2/device SymlinkTo: ../../../applesmc.768 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/applesmc.768/name Lines: 1 applesmc Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/platform/coretemp.0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/platform/coretemp.0/hwmon Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/platform/coretemp.0/hwmon/hwmon0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/device SymlinkTo: ../../../coretemp.0 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/name Lines: 1 coretemp Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp1_crit Lines: 1 100000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp1_crit_alarm Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp1_input Lines: 1 55000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp1_label Lines: 1 Physical id 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp1_max Lines: 1 84000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp2_crit Lines: 1 100000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp2_crit_alarm Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp2_input Lines: 1 54000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp2_label Lines: 1 Core 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp2_max Lines: 1 84000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp3_crit Lines: 1 100000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp3_crit_alarm Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp3_input Lines: 1 52000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp3_label Lines: 1 Core 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp3_max Lines: 1 84000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp4_crit Lines: 1 100000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp4_crit_alarm Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp4_input Lines: 1 53000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp4_label Lines: 1 Core 2 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp4_max Lines: 1 84000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp5_crit Lines: 1 100000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp5_crit_alarm Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp5_input Lines: 1 50000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp5_label Lines: 1 Core 3 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.0/hwmon/hwmon0/temp5_max Lines: 1 84000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/platform/coretemp.1 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/platform/coretemp.1/hwmon Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/platform/coretemp.1/hwmon/hwmon1 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/device SymlinkTo: ../../../coretemp.1 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/name Lines: 1 coretemp Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp1_crit Lines: 1 100000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp1_crit_alarm Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp1_input Lines: 1 55000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp1_label Lines: 1 Physical id 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp1_max Lines: 1 84000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp2_crit Lines: 1 100000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp2_crit_alarm Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp2_input Lines: 1 54000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp2_label Lines: 1 Core 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp2_max Lines: 1 84000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp3_crit Lines: 1 100000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp3_crit_alarm Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp3_input Lines: 1 52000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp3_label Lines: 1 Core 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp3_max Lines: 1 84000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp4_crit Lines: 1 100000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp4_crit_alarm Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp4_input Lines: 1 53000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp4_label Lines: 1 Core 2 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp4_max Lines: 1 84000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp5_crit Lines: 1 100000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp5_crit_alarm Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp5_input Lines: 1 50000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp5_label Lines: 1 Core 3 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/coretemp.1/hwmon/hwmon1/temp5_max Lines: 1 84000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/platform/nct6775.656 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/platform/nct6775.656/hwmon Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/platform/nct6775.656/hwmon/hwmon3 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/fan2_alarm Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/fan2_beep Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/fan2_input Lines: 1 1098 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/fan2_min Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/fan2_pulses Lines: 1 2 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/fan2_target Lines: 1 27000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/fan2_tolerance Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/in0_alarm Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/in0_beep Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/in0_input Lines: 1 792 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/in0_max Lines: 1 1744 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/in0_min Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/in1_alarm Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/in1_beep Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/in1_input Lines: 1 1024 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/in1_max Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/in1_min Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/intrusion0_alarm Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/intrusion0_beep Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/intrusion1_alarm Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/intrusion1_beep Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/name Lines: 1 nct6779 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_auto_point1_pwm Lines: 1 153 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_auto_point1_temp Lines: 1 30000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_auto_point2_pwm Lines: 1 255 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_auto_point2_temp Lines: 1 70000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_auto_point3_pwm Lines: 1 255 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_auto_point3_temp Lines: 1 70000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_auto_point4_pwm Lines: 1 255 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_auto_point4_temp Lines: 1 70000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_auto_point5_pwm Lines: 1 255 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_auto_point5_temp Lines: 1 75000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_crit_temp_tolerance Lines: 1 2000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_enable Lines: 1 5 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_floor Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_mode Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_start Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_step_down_time Lines: 1 100 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_step_up_time Lines: 1 100 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_stop_time Lines: 1 6000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_target_temp Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_temp_sel Lines: 1 7 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_temp_tolerance Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_weight_duty_base Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_weight_duty_step Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_weight_temp_sel Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_weight_temp_step Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_weight_temp_step_base Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm1_weight_temp_step_tol Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/edac Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/edac/mc Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/edac/mc/mc0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/edac/mc/mc0/ce_count Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/edac/mc/mc0/ce_noinfo_count Lines: 1 2 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/edac/mc/mc0/csrow0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/edac/mc/mc0/csrow0/ce_count Lines: 1 3 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/edac/mc/mc0/csrow0/ue_count Lines: 1 4 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/edac/mc/mc0/ue_count Lines: 1 5 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/edac/mc/mc0/ue_noinfo_count Lines: 1 6 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/node Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/node/node0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/node/node0/meminfo Lines: 30 Node 0 MemTotal: 134182340 kB Node 0 MemFree: 53030372 kB Node 0 MemUsed: 81151968 kB Node 0 Active: 5456380 kB Node 0 Inactive: 59150184 kB Node 0 Active(anon): 691324 kB Node 0 Inactive(anon): 340456 kB Node 0 Active(file): 4765056 kB Node 0 Inactive(file): 58809728 kB Node 0 Unevictable: 0 kB Node 0 Mlocked: 0 kB Node 0 Dirty: 20 kB Node 0 Writeback: 0 kB Node 0 FilePages: 70170916 kB Node 0 Mapped: 894240 kB Node 0 AnonPages: 788196 kB Node 0 Shmem: 47860 kB Node 0 KernelStack: 34016 kB Node 0 PageTables: 143304 kB Node 0 NFS_Unstable: 0 kB Node 0 Bounce: 0 kB Node 0 WritebackTmp: 0 kB Node 0 Slab: 6654304 kB Node 0 SReclaimable: 4473124 kB Node 0 SUnreclaim: 2181180 kB Node 0 AnonHugePages: 147456 kB Node 0 HugePages_Total: 0 Node 0 HugePages_Free: 0 Node 0 HugePages_Surp: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/node/node0/numastat Lines: 6 numa_hit 193460335812 numa_miss 12624528 numa_foreign 59858623300 interleave_hit 57146 local_node 193454780853 other_node 18179487 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/node/node1 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/node/node1/meminfo Lines: 30 Node 1 MemTotal: 134217728 kB Node 1 MemFree: 39634788 kB Node 1 MemUsed: 94582940 kB Node 1 Active: 5604496 kB Node 1 Inactive: 71450592 kB Node 1 Active(anon): 590464 kB Node 1 Inactive(anon): 285088 kB Node 1 Active(file): 5014032 kB Node 1 Inactive(file): 71165504 kB Node 1 Unevictable: 0 kB Node 1 Mlocked: 0 kB Node 1 Dirty: 120 kB Node 1 Writeback: 0 kB Node 1 FilePages: 83579188 kB Node 1 Mapped: 864112 kB Node 1 AnonPages: 671932 kB Node 1 Shmem: 87580 kB Node 1 KernelStack: 31104 kB Node 1 PageTables: 124272 kB Node 1 NFS_Unstable: 0 kB Node 1 Bounce: 0 kB Node 1 WritebackTmp: 0 kB Node 1 Slab: 7020716 kB Node 1 SReclaimable: 4614084 kB Node 1 SUnreclaim: 2406632 kB Node 1 AnonHugePages: 90112 kB Node 1 HugePages_Total: 0 Node 1 HugePages_Free: 0 Node 1 HugePages_Surp: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/node/node1/numastat Lines: 6 numa_hit 326720946761 numa_miss 59858626709 numa_foreign 12624528 interleave_hit 57286 local_node 326719046550 other_node 59860526920 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/fs Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/fs/bcache Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/average_key_size Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0 SymlinkTo: ../../../devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/btree_cache_size Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/cache0 SymlinkTo: ../../../devices/pci0000:00/0000:00:0d.0/ata5/host4/target4:0:0/4:0:0:0/block/sdc/bcache # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/cache_available_percent Lines: 1 100 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/congested Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/internal Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/internal/active_journal_entries Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/internal/btree_nodes Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/internal/btree_read_average_duration_us Lines: 1 1305 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/internal/cache_read_races Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/root_usage_percent Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_day Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_day/bypassed Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_day/cache_bypass_hits Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_day/cache_bypass_misses Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_day/cache_hit_ratio Lines: 1 100 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_day/cache_hits Lines: 1 289 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_day/cache_miss_collisions Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_day/cache_misses Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_day/cache_readaheads Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_five_minute Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_five_minute/bypassed Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_five_minute/cache_bypass_hits Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_five_minute/cache_bypass_misses Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_five_minute/cache_hit_ratio Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_five_minute/cache_hits Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_five_minute/cache_miss_collisions Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_five_minute/cache_misses Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_five_minute/cache_readaheads Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_hour Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_hour/bypassed Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_hour/cache_bypass_hits Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_hour/cache_bypass_misses Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_hour/cache_hit_ratio Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_hour/cache_hits Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_hour/cache_miss_collisions Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_hour/cache_misses Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_hour/cache_readaheads Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_total Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_total/bypassed Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_total/cache_bypass_hits Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_total/cache_bypass_misses Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_total/cache_hit_ratio Lines: 1 100 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_total/cache_hits Lines: 1 546 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_total/cache_miss_collisions Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_total/cache_misses Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_total/cache_readaheads Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/tree_depth Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/fs/xfs Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/fs/xfs/sda1 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/fs/xfs/sda1/stats Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/xfs/sda1/stats/stats Lines: 24 extent_alloc 1 872 0 0 abt 0 0 0 0 blk_map 61 29 1 1 1 91 0 bmbt 0 0 0 0 dir 3 2 1 52 trans 4 40 0 ig 5 1 0 4 0 0 1 log 8 21 0 5821 4 push_ail 44 0 1102 15 0 2 0 2 0 2 xstrat 1 0 rw 28 0 attr 0 0 0 0 icluster 2 2 2 vnodes 4 0 0 0 1 1 1 0 buf 22 25 14 0 0 8 0 8 8 abtb2 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 abtc2 2 1 1 1 0 0 0 0 0 0 0 0 0 0 0 bmbt2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ibt2 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 fibt2 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 rmapbt 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 qm 0 0 0 0 0 0 0 0 xpc 3571712 3568056 0 debug 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/kernel Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/kernel/mm Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/kernel/mm/ksm Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/kernel/mm/ksm/full_scans Lines: 1 323 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/kernel/mm/ksm/merge_across_nodes Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/kernel/mm/ksm/pages_shared Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/kernel/mm/ksm/pages_sharing Lines: 1 255 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/kernel/mm/ksm/pages_to_scan Lines: 1 100 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/kernel/mm/ksm/pages_unshared Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/kernel/mm/ksm/pages_volatile Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/kernel/mm/ksm/run Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/kernel/mm/ksm/sleep_millisecs Lines: 1 20 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/.unpacked Lines: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - prometheus-node-exporter-0.15.2+ds/collector/fixtures/textfile/000077500000000000000000000000001321450230300246415ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/textfile/no_metric_files.out000066400000000000000000000002361321450230300305340ustar00rootroot00000000000000name: "node_textfile_scrape_error" help: "1 if there was an error opening or reading a file, 0 otherwise" type: GAUGE metric: < gauge: < value: 0 > > prometheus-node-exporter-0.15.2+ds/collector/fixtures/textfile/no_metric_files/000077500000000000000000000000001321450230300300025ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/textfile/no_metric_files/non_matching_file.txt000066400000000000000000000000351321450230300342040ustar00rootroot00000000000000This file should be ignored. prometheus-node-exporter-0.15.2+ds/collector/fixtures/textfile/nonexistent_path.out000066400000000000000000000002361321450230300307650ustar00rootroot00000000000000name: "node_textfile_scrape_error" help: "1 if there was an error opening or reading a file, 0 otherwise" type: GAUGE metric: < gauge: < value: 1 > > prometheus-node-exporter-0.15.2+ds/collector/fixtures/textfile/two_metric_files.out000066400000000000000000000024431321450230300307330ustar00rootroot00000000000000name: "node_textfile_mtime" help: "Unixtime mtime of textfiles successfully read." type: GAUGE metric: < label: < name: "file" value: "metrics1.prom" > gauge: < value: 1 > > metric: < label: < name: "file" value: "metrics2.prom" > gauge: < value: 2 > > name: "node_textfile_scrape_error" help: "1 if there was an error opening or reading a file, 0 otherwise" type: GAUGE metric: < gauge: < value: 0 > > name: "testmetric1_1" help: "Metric read from fixtures/textfile/two_metric_files/metrics1.prom" type: UNTYPED metric: < label: < name: "foo" value: "bar" > untyped: < value: 10 > > name: "testmetric1_2" help: "Metric read from fixtures/textfile/two_metric_files/metrics1.prom" type: UNTYPED metric: < label: < name: "foo" value: "baz" > untyped: < value: 20 > > name: "testmetric2_1" help: "Metric read from fixtures/textfile/two_metric_files/metrics2.prom" type: UNTYPED metric: < label: < name: "foo" value: "bar" > untyped: < value: 30 > timestamp_ms: 1441205977284 > name: "testmetric2_2" help: "Metric read from fixtures/textfile/two_metric_files/metrics2.prom" type: UNTYPED metric: < label: < name: "foo" value: "baz" > untyped: < value: 40 > timestamp_ms: 1441205977284 > prometheus-node-exporter-0.15.2+ds/collector/fixtures/textfile/two_metric_files/000077500000000000000000000000001321450230300301775ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/textfile/two_metric_files/metrics1.prom000066400000000000000000000000701321450230300326220ustar00rootroot00000000000000testmetric1_1{foo="bar"} 10 testmetric1_2{foo="baz"} 20 prometheus-node-exporter-0.15.2+ds/collector/fixtures/textfile/two_metric_files/metrics2.prom000066400000000000000000000001241321450230300326230ustar00rootroot00000000000000testmetric2_1{foo="bar"} 30 1441205977284 testmetric2_2{foo="baz"} 40 1441205977284 non_matching_file.txt000066400000000000000000000000351321450230300343220ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/textfile/two_metric_filesThis file should be ignored. prometheus-node-exporter-0.15.2+ds/collector/fixtures/wifi/000077500000000000000000000000001321450230300237535ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/wifi/interfaces.json000066400000000000000000000002151321450230300267670ustar00rootroot00000000000000[ { "name": "wlan0", "type": 2, "frequency": 2412 }, { "name": "wlan1", "type": 3, "frequency": 2412 }, { "type": 10 } ] prometheus-node-exporter-0.15.2+ds/collector/fixtures/wifi/wlan0/000077500000000000000000000000001321450230300247745ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/fixtures/wifi/wlan0/bss.json000066400000000000000000000000731321450230300264560ustar00rootroot00000000000000{ "ssid": "Example", "bssid": "ABEiM0RV", "status": 1 } prometheus-node-exporter-0.15.2+ds/collector/fixtures/wifi/wlan0/stationinfo.json000066400000000000000000000003031321450230300302200ustar00rootroot00000000000000{ "connected": 30000000000, "inactive": 400000000, "receivebitrate": 128000000, "transmitbitrate": 164000000, "signal": -52, "transmitretries": 10, "transmitfailed": 2, "beaconloss": 1 } prometheus-node-exporter-0.15.2+ds/collector/ganglia/000077500000000000000000000000001321450230300225465ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/collector/ganglia/format.go000066400000000000000000000046111321450230300243670ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package ganglia provides types for unmarshalling gmond's XML output. // // Not used elements in gmond's XML output are commented. // In case you want to use them, please change the names so that one // can understand without needing to know what the acronym stands for. package ganglia import "encoding/xml" // ExtraElement describes EXTRA_ELEMENT elements. type ExtraElement struct { Name string `xml:"NAME,attr"` Val string `xml:"VAL,attr"` } // ExtraData describes EXTRA_DATA elements. type ExtraData struct { ExtraElements []ExtraElement `xml:"EXTRA_ELEMENT"` } // Metric describes METRIC elements. type Metric struct { Name string `xml:"NAME,attr"` Value float64 `xml:"VAL,attr"` /* Unit string `xml:"UNITS,attr"` Slope string `xml:"SLOPE,attr"` Tn int `xml:"TN,attr"` Tmax int `xml:"TMAX,attr"` Dmax int `xml:"DMAX,attr"` */ ExtraData ExtraData `xml:"EXTRA_DATA"` } // Host describes HOST elements. type Host struct { Name string `xml:"NAME,attr"` /* Ip string `xml:"IP,attr"` Tags string `xml:"TAGS,attr"` Reported int `xml:"REPORTED,attr"` Tn int `xml:"TN,attr"` Tmax int `xml:"TMAX,attr"` Dmax int `xml:"DMAX,attr"` Location string `xml:"LOCATION,attr"` GmondStarted int `xml:"GMOND_STARTED",attr"` */ Metrics []Metric `xml:"METRIC"` } // Cluster describes CLUSTER elements. type Cluster struct { Name string `xml:"NAME,attr"` /* Owner string `xml:"OWNER,attr"` LatLong string `xml:"LATLONG,attr"` Url string `xml:"URL,attr"` Localtime int `xml:"LOCALTIME,attr"` */ Hosts []Host `xml:"HOST"` } // Ganglia describes the top-level XML structure. type Ganglia struct { XMLNAME xml.Name `xml:"GANGLIA_XML"` Clusters []Cluster `xml:"CLUSTER"` } prometheus-node-exporter-0.15.2+ds/collector/gmond.go000066400000000000000000000057731321450230300226130ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nogmond package collector import ( "bufio" "encoding/xml" "fmt" "io" "net" "regexp" "time" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" "github.com/prometheus/node_exporter/collector/ganglia" ) const ( gangliaAddress = "127.0.0.1:8649" gangliaProto = "tcp" gangliaTimeout = 30 * time.Second gangliaNamespace = "ganglia" ) type gmondCollector struct { metrics map[string]*prometheus.GaugeVec } func init() { registerCollector("gmond", defaultDisabled, NewGmondCollector) } var illegalCharsRE = regexp.MustCompile(`[^a-zA-Z0-9_]`) // NewGmondCollector returns a new Collector scraping ganglia. func NewGmondCollector() (Collector, error) { warnDeprecated("gmond") c := gmondCollector{ metrics: map[string]*prometheus.GaugeVec{}, } return &c, nil } func (c *gmondCollector) Update(ch chan<- prometheus.Metric) error { conn, err := net.Dial(gangliaProto, gangliaAddress) log.Debugf("gmondCollector Update") if err != nil { return fmt.Errorf("can't connect to gmond: %s", err) } conn.SetDeadline(time.Now().Add(gangliaTimeout)) ganglia := ganglia.Ganglia{} decoder := xml.NewDecoder(bufio.NewReader(conn)) decoder.CharsetReader = toUtf8 err = decoder.Decode(&ganglia) if err != nil { return fmt.Errorf("couldn't parse xml: %s", err) } for _, cluster := range ganglia.Clusters { for _, host := range cluster.Hosts { for _, metric := range host.Metrics { name := illegalCharsRE.ReplaceAllString(metric.Name, "_") c.setMetric(name, cluster.Name, metric) } } } for _, m := range c.metrics { m.Collect(ch) } return err } func (c *gmondCollector) setMetric(name, cluster string, metric ganglia.Metric) { if _, ok := c.metrics[name]; !ok { var desc string var title string for _, element := range metric.ExtraData.ExtraElements { switch element.Name { case "DESC": desc = element.Val case "TITLE": title = element.Val } if title != "" && desc != "" { break } } log.Debugf("Register %s: %s", name, desc) c.metrics[name] = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Namespace: gangliaNamespace, Name: name, Help: desc, }, []string{"cluster"}, ) } log.Debugf("Set %s{cluster=%q}: %f", name, cluster, metric.Value) c.metrics[name].WithLabelValues(cluster).Set(metric.Value) } func toUtf8(charset string, input io.Reader) (io.Reader, error) { return input, nil //FIXME } prometheus-node-exporter-0.15.2+ds/collector/helper.go000066400000000000000000000016231321450230300227540ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "io/ioutil" "strconv" "strings" ) func readUintFromFile(path string) (uint64, error) { data, err := ioutil.ReadFile(path) if err != nil { return 0, err } value, err := strconv.ParseUint(strings.TrimSpace(string(data)), 10, 64) if err != nil { return 0, err } return value, nil } prometheus-node-exporter-0.15.2+ds/collector/hwmon_linux.go000066400000000000000000000327151321450230300240520ustar00rootroot00000000000000// Copyright 2016 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nohwmon package collector import ( "errors" "io/ioutil" "os" "path" "path/filepath" "regexp" "strconv" "strings" "syscall" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" ) var ( hwmonInvalidMetricChars = regexp.MustCompile("[^a-z0-9:_]") hwmonFilenameFormat = regexp.MustCompile(`^(?P[^0-9]+)(?P[0-9]*)?(_(?P.+))?$`) hwmonLabelDesc = []string{"chip", "sensor"} hwmonChipNameLabelDesc = []string{"chip", "chip_name"} hwmonSensorTypes = []string{ "vrm", "beep_enable", "update_interval", "in", "cpu", "fan", "pwm", "temp", "curr", "power", "energy", "humidity", "intrusion", } ) func init() { registerCollector("hwmon", defaultEnabled, NewHwMonCollector) } type hwMonCollector struct{} // NewHwMonCollector returns a new Collector exposing /sys/class/hwmon stats // (similar to lm-sensors). func NewHwMonCollector() (Collector, error) { return &hwMonCollector{}, nil } func cleanMetricName(name string) string { lower := strings.ToLower(name) replaced := hwmonInvalidMetricChars.ReplaceAllLiteralString(lower, "_") cleaned := strings.Trim(replaced, "_") return cleaned } func addValueFile(data map[string]map[string]string, sensor string, prop string, file string) { raw, err := sysReadFile(file) if err != nil { return } value := strings.Trim(string(raw), "\n") if _, ok := data[sensor]; !ok { data[sensor] = make(map[string]string) } data[sensor][prop] = value } // sysReadFile is a simplified ioutil.ReadFile that invokes syscall.Read directly. func sysReadFile(file string) ([]byte, error) { f, err := os.Open(file) if err != nil { return nil, err } defer f.Close() // On some machines, hwmon drivers are broken and return EAGAIN. This causes // Go's ioutil.ReadFile implementation to poll forever. // // Since we either want to read data or bail immediately, do the simplest // possible read using syscall directly. b := make([]byte, 128) n, err := syscall.Read(int(f.Fd()), b) if err != nil { return nil, err } return b[:n], nil } // explodeSensorFilename splits a sensor name into _. func explodeSensorFilename(filename string) (ok bool, sensorType string, sensorNum int, sensorProperty string) { matches := hwmonFilenameFormat.FindStringSubmatch(filename) if len(matches) == 0 { return false, sensorType, sensorNum, sensorProperty } for i, match := range hwmonFilenameFormat.SubexpNames() { if i >= len(matches) { return true, sensorType, sensorNum, sensorProperty } if match == "type" { sensorType = matches[i] } if match == "property" { sensorProperty = matches[i] } if match == "id" && len(matches[i]) > 0 { if num, err := strconv.Atoi(matches[i]); err == nil { sensorNum = num } else { return false, sensorType, sensorNum, sensorProperty } } } return true, sensorType, sensorNum, sensorProperty } func collectSensorData(dir string, data map[string]map[string]string) error { sensorFiles, dirError := ioutil.ReadDir(dir) if dirError != nil { return dirError } for _, file := range sensorFiles { filename := file.Name() ok, sensorType, sensorNum, sensorProperty := explodeSensorFilename(filename) if !ok { continue } for _, t := range hwmonSensorTypes { if t == sensorType { addValueFile(data, sensorType+strconv.Itoa(sensorNum), sensorProperty, path.Join(dir, file.Name())) break } } } return nil } func (c *hwMonCollector) updateHwmon(ch chan<- prometheus.Metric, dir string) error { hwmonName, err := c.hwmonName(dir) if err != nil { return err } data := make(map[string]map[string]string) err = collectSensorData(dir, data) if err != nil { return err } if _, err := os.Stat(path.Join(dir, "device")); err == nil { err := collectSensorData(path.Join(dir, "device"), data) if err != nil { return err } } hwmonChipName, err := c.hwmonHumanReadableChipName(dir) if err == nil { // sensor chip metadata desc := prometheus.NewDesc( "node_hwmon_chip_names", "Annotation metric for human-readable chip names", hwmonChipNameLabelDesc, nil, ) ch <- prometheus.MustNewConstMetric( desc, prometheus.GaugeValue, 1.0, hwmonName, hwmonChipName, ) } // Format all sensors. for sensor, sensorData := range data { _, sensorType, _, _ := explodeSensorFilename(sensor) labels := []string{hwmonName, sensor} if labelText, ok := sensorData["label"]; ok { label := cleanMetricName(labelText) if label != "" { desc := prometheus.NewDesc("node_hwmon_sensor_label", "Label for given chip and sensor", []string{"chip", "sensor", "label"}, nil) ch <- prometheus.MustNewConstMetric(desc, prometheus.GaugeValue, 1.0, hwmonName, sensor, label) } } if sensorType == "beep_enable" { value := 0.0 if sensorData[""] == "1" { value = 1.0 } metricName := "node_hwmon_beep_enabled" desc := prometheus.NewDesc(metricName, "Hardware beep enabled", hwmonLabelDesc, nil) ch <- prometheus.MustNewConstMetric( desc, prometheus.GaugeValue, value, labels...) continue } if sensorType == "vrm" { parsedValue, err := strconv.ParseFloat(sensorData[""], 64) if err != nil { continue } metricName := "node_hwmon_voltage_regulator_version" desc := prometheus.NewDesc(metricName, "Hardware voltage regulator", hwmonLabelDesc, nil) ch <- prometheus.MustNewConstMetric( desc, prometheus.GaugeValue, parsedValue, labels...) continue } if sensorType == "update_interval" { parsedValue, err := strconv.ParseFloat(sensorData[""], 64) if err != nil { continue } metricName := "node_hwmon_update_interval_seconds" desc := prometheus.NewDesc(metricName, "Hardware monitor update interval", hwmonLabelDesc, nil) ch <- prometheus.MustNewConstMetric( desc, prometheus.GaugeValue, parsedValue*0.001, labels...) continue } prefix := "node_hwmon_" + sensorType for element, value := range sensorData { if element == "label" { continue } name := prefix if element == "input" { // input is actually the value if _, ok := sensorData[""]; ok { name = name + "_input" } } else if element != "" { name = name + "_" + cleanMetricName(element) } parsedValue, err := strconv.ParseFloat(value, 64) if err != nil { continue } // special elements, fault, alarm & beep should be handed out without units if element == "fault" || element == "alarm" { desc := prometheus.NewDesc(name, "Hardware sensor "+element+" status ("+sensorType+")", hwmonLabelDesc, nil) ch <- prometheus.MustNewConstMetric(desc, prometheus.GaugeValue, parsedValue, labels...) continue } if element == "beep" { desc := prometheus.NewDesc(name+"_enabled", "Hardware monitor sensor has beeping enabled", hwmonLabelDesc, nil) ch <- prometheus.MustNewConstMetric(desc, prometheus.GaugeValue, parsedValue, labels...) continue } // everything else should get a unit if sensorType == "in" || sensorType == "cpu" { desc := prometheus.NewDesc(name+"_volts", "Hardware monitor for voltage ("+element+")", hwmonLabelDesc, nil) ch <- prometheus.MustNewConstMetric( desc, prometheus.GaugeValue, parsedValue*0.001, labels...) continue } if sensorType == "temp" && element != "type" { desc := prometheus.NewDesc(name+"_celsius", "Hardware monitor for temperature ("+element+")", hwmonLabelDesc, nil) ch <- prometheus.MustNewConstMetric( desc, prometheus.GaugeValue, parsedValue*0.001, labels...) continue } if sensorType == "curr" { desc := prometheus.NewDesc(name+"_amps", "Hardware monitor for current ("+element+")", hwmonLabelDesc, nil) ch <- prometheus.MustNewConstMetric( desc, prometheus.GaugeValue, parsedValue*0.001, labels...) continue } if sensorType == "energy" { desc := prometheus.NewDesc(name+"_joule_total", "Hardware monitor for joules used so far ("+element+")", hwmonLabelDesc, nil) ch <- prometheus.MustNewConstMetric( desc, prometheus.CounterValue, parsedValue/1000000.0, labels...) continue } if sensorType == "power" && element == "accuracy" { desc := prometheus.NewDesc(name, "Hardware monitor power meter accuracy, as a ratio", hwmonLabelDesc, nil) ch <- prometheus.MustNewConstMetric( desc, prometheus.GaugeValue, parsedValue/1000000.0, labels...) continue } if sensorType == "power" && (element == "average_interval" || element == "average_interval_min" || element == "average_interval_max") { desc := prometheus.NewDesc(name+"_seconds", "Hardware monitor power usage update interval ("+element+")", hwmonLabelDesc, nil) ch <- prometheus.MustNewConstMetric( desc, prometheus.GaugeValue, parsedValue*0.001, labels...) continue } if sensorType == "power" { desc := prometheus.NewDesc(name+"_watt", "Hardware monitor for power usage in watts ("+element+")", hwmonLabelDesc, nil) ch <- prometheus.MustNewConstMetric( desc, prometheus.GaugeValue, parsedValue/1000000.0, labels...) continue } if sensorType == "humidity" { desc := prometheus.NewDesc(name, "Hardware monitor for humidity, as a ratio (multiply with 100.0 to get the humidity as a percentage) ("+element+")", hwmonLabelDesc, nil) ch <- prometheus.MustNewConstMetric( desc, prometheus.GaugeValue, parsedValue/1000000.0, labels...) continue } if sensorType == "fan" && (element == "input" || element == "min" || element == "max" || element == "target") { desc := prometheus.NewDesc(name+"_rpm", "Hardware monitor for fan revolutions per minute ("+element+")", hwmonLabelDesc, nil) ch <- prometheus.MustNewConstMetric( desc, prometheus.GaugeValue, parsedValue, labels...) continue } // fallback, just dump the metric as is desc := prometheus.NewDesc(name, "Hardware monitor "+sensorType+" element "+element, hwmonLabelDesc, nil) ch <- prometheus.MustNewConstMetric( desc, prometheus.GaugeValue, parsedValue, labels...) } } return nil } func (c *hwMonCollector) hwmonName(dir string) (string, error) { // generate a name for a sensor path // sensor numbering depends on the order of linux module loading and // is thus unstable. // However the path of the device has to be stable: // - /sys/devices// // Some hardware monitors have a "name" file that exports a human // readbale name that can be used. // human readable names would be bat0 or coretemp, while a path string // could be platform_applesmc.768 // preference 1: construct a name based on device name, always unique devicePath, devErr := filepath.EvalSymlinks(path.Join(dir, "device")) if devErr == nil { devPathPrefix, devName := path.Split(devicePath) _, devType := path.Split(strings.TrimRight(devPathPrefix, "/")) cleanDevName := cleanMetricName(devName) cleanDevType := cleanMetricName(devType) if cleanDevType != "" && cleanDevName != "" { return cleanDevType + "_" + cleanDevName, nil } if cleanDevName != "" { return cleanDevName, nil } } // preference 2: is there a name file sysnameRaw, nameErr := ioutil.ReadFile(path.Join(dir, "name")) if nameErr == nil && string(sysnameRaw) != "" { cleanName := cleanMetricName(string(sysnameRaw)) if cleanName != "" { return cleanName, nil } } // it looks bad, name and device don't provide enough information // return a hwmon[0-9]* name realDir, err := filepath.EvalSymlinks(dir) if err != nil { return "", err } // take the last path element, this will be hwmonX _, name := path.Split(realDir) cleanName := cleanMetricName(name) if cleanName != "" { return cleanName, nil } return "", errors.New("Could not derive a monitoring name for " + dir) } // hwmonHumanReadableChipName is similar to the methods in hwmonName, but with // different precedences -- we can allow duplicates here. func (c *hwMonCollector) hwmonHumanReadableChipName(dir string) (string, error) { sysnameRaw, nameErr := ioutil.ReadFile(path.Join(dir, "name")) if nameErr != nil { return "", nameErr } if string(sysnameRaw) != "" { cleanName := cleanMetricName(string(sysnameRaw)) if cleanName != "" { return cleanName, nil } } return "", errors.New("Could not derive a human-readable chip type for " + dir) } func (c *hwMonCollector) Update(ch chan<- prometheus.Metric) error { // Step 1: scan /sys/class/hwmon, resolve all symlinks and call // updatesHwmon for each folder hwmonPathName := path.Join(sysFilePath("class"), "hwmon") hwmonFiles, err := ioutil.ReadDir(hwmonPathName) if err != nil { if os.IsNotExist(err) { log.Debug("hwmon collector metrics are not available for this system") return nil } return err } for _, hwDir := range hwmonFiles { hwmonXPathName := path.Join(hwmonPathName, hwDir.Name()) if hwDir.Mode()&os.ModeSymlink > 0 { hwDir, err = os.Stat(hwmonXPathName) if err != nil { continue } } if !hwDir.IsDir() { continue } if lastErr := c.updateHwmon(ch, hwmonXPathName); lastErr != nil { err = lastErr } } return err } prometheus-node-exporter-0.15.2+ds/collector/infiniband_linux.go000066400000000000000000000172731321450230300250250ustar00rootroot00000000000000// Copyright 2017 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build linux // +build !noinfiniband package collector import ( "errors" "os" "path/filepath" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" ) const infinibandPath = "class/infiniband" var ( errInfinibandNoDevicesFound = errors.New("no InfiniBand devices detected") errInfinibandNoPortsFound = errors.New("no InfiniBand ports detected") ) type infinibandCollector struct { metricDescs map[string]*prometheus.Desc counters map[string]infinibandMetric legacyCounters map[string]infinibandMetric } type infinibandMetric struct { File string Help string } func init() { registerCollector("infiniband", defaultEnabled, NewInfiniBandCollector) } // NewInfiniBandCollector returns a new Collector exposing InfiniBand stats. func NewInfiniBandCollector() (Collector, error) { var i infinibandCollector // Filenames of all InfiniBand counter metrics including a detailed description. i.counters = map[string]infinibandMetric{ "link_downed_total": {"link_downed", "Number of times the link failed to recover from an error state and went down"}, "link_error_recovery_total": {"link_error_recovery", "Number of times the link successfully recovered from an error state"}, "multicast_packets_received_total": {"multicast_rcv_packets", "Number of multicast packets received (including errors)"}, "multicast_packets_transmitted_total": {"multicast_xmit_packets", "Number of multicast packets transmitted (including errors)"}, "port_data_received_bytes": {"port_rcv_data", "Number of data octets received on all links"}, "port_data_transmitted_bytes": {"port_xmit_data", "Number of data octets transmitted on all links"}, "unicast_packets_received_total": {"unicast_rcv_packets", "Number of unicast packets received (including errors)"}, "unicast_packets_transmitted_total": {"unicast_xmit_packets", "Number of unicast packets transmitted (including errors)"}, } // Deprecated counters for some older versions of InfiniBand drivers. i.legacyCounters = map[string]infinibandMetric{ "legacy_multicast_packets_received_total": {"port_multicast_rcv_packets", "Number of multicast packets received"}, "legacy_multicast_packets_transmitted_total": {"port_multicast_xmit_packets", "Number of multicast packets transmitted"}, "legacy_data_received_bytes_total": {"port_rcv_data_64", "Number of data octets received on all links"}, "legacy_packets_received_total": {"port_rcv_packets_64", "Number of data packets received on all links"}, "legacy_unicast_packets_received_total": {"port_unicast_rcv_packets", "Number of unicast packets received"}, "legacy_unicast_packets_transmitted_total": {"port_unicast_xmit_packets", "Number of unicast packets transmitted"}, "legacy_data_transmitted_bytes_total": {"port_xmit_data_64", "Number of data octets transmitted on all links"}, "legacy_packets_transmitted_total": {"port_xmit_packets_64", "Number of data packets received on all links"}, } subsystem := "infiniband" i.metricDescs = make(map[string]*prometheus.Desc) for metricName, infinibandMetric := range i.counters { i.metricDescs[metricName] = prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, metricName), infinibandMetric.Help, []string{"device", "port"}, nil, ) } for metricName, infinibandMetric := range i.legacyCounters { i.metricDescs[metricName] = prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, metricName), infinibandMetric.Help, []string{"device", "port"}, nil, ) } return &i, nil } // infinibandDevices retrieves a list of InfiniBand devices. func infinibandDevices(infinibandPath string) ([]string, error) { devices, err := filepath.Glob(filepath.Join(infinibandPath, "/*")) if err != nil { return nil, err } if len(devices) < 1 { log.Debugf("Unable to detect InfiniBand devices") err = errInfinibandNoDevicesFound return nil, err } // Extract just the filenames which equate to the device names. for i, device := range devices { devices[i] = filepath.Base(device) } return devices, nil } // Retrieve a list of ports for the InfiniBand device. func infinibandPorts(infinibandPath, device string) ([]string, error) { ports, err := filepath.Glob(filepath.Join(infinibandPath, device, "ports/*")) if err != nil { return nil, err } if len(ports) < 1 { log.Debugf("Unable to detect ports for %s", device) err = errInfinibandNoPortsFound return nil, err } // Extract just the filenames which equates to the port numbers. for i, port := range ports { ports[i] = filepath.Base(port) } return ports, nil } func readMetric(directory, metricFile string) (uint64, error) { metric, err := readUintFromFile(filepath.Join(directory, metricFile)) if err != nil { log.Debugf("Error reading %q file", metricFile) return 0, err } // According to Mellanox, the following metrics "are divided by 4 unconditionally" // as they represent the amount of data being transmitted and received per lane. // Mellanox cards have 4 lanes per port, so all values must be multiplied by 4 // to get the expected value. switch metricFile { case "port_rcv_data", "port_xmit_data", "port_rcv_data_64", "port_xmit_data_64": metric *= 4 } return metric, nil } func (c *infinibandCollector) Update(ch chan<- prometheus.Metric) error { devices, err := infinibandDevices(sysFilePath(infinibandPath)) // If no devices are found or another error is raised while attempting to find devices, // InfiniBand is likely not installed and the collector should be skipped. switch err { case nil: case errInfinibandNoDevicesFound: return nil default: return err } for _, device := range devices { ports, err := infinibandPorts(sysFilePath(infinibandPath), device) // If no ports are found for the specified device, skip to the next device. switch err { case nil: case errInfinibandNoPortsFound: continue default: return err } for _, port := range ports { portFiles := sysFilePath(filepath.Join(infinibandPath, device, "ports", port)) // Add metrics for the InfiniBand counters. for metricName, infinibandMetric := range c.counters { if _, err := os.Stat(filepath.Join(portFiles, "counters", infinibandMetric.File)); os.IsNotExist(err) { continue } metric, err := readMetric(filepath.Join(portFiles, "counters"), infinibandMetric.File) if err != nil { return err } ch <- prometheus.MustNewConstMetric( c.metricDescs[metricName], prometheus.CounterValue, float64(metric), device, port, ) } // Add metrics for the legacy InfiniBand counters. for metricName, infinibandMetric := range c.legacyCounters { if _, err := os.Stat(filepath.Join(portFiles, "counters_ext", infinibandMetric.File)); os.IsNotExist(err) { continue } metric, err := readMetric(filepath.Join(portFiles, "counters_ext"), infinibandMetric.File) if err != nil { return err } ch <- prometheus.MustNewConstMetric( c.metricDescs[metricName], prometheus.CounterValue, float64(metric), device, port, ) } } } return nil } prometheus-node-exporter-0.15.2+ds/collector/infiniband_linux_test.go000066400000000000000000000022001321450230300260440ustar00rootroot00000000000000// Copyright 2017 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "testing" ) func TestInfiniBandDevices(t *testing.T) { devices, err := infinibandDevices("fixtures/sys/class/infiniband") if err != nil { t.Fatal(err) } if l := len(devices); l != 1 { t.Fatalf("Retrieved an unexpected number of InfiniBand devices: %d", l) } } func TestInfiniBandPorts(t *testing.T) { ports, err := infinibandPorts("fixtures/sys/class/infiniband", "mlx4_0") if err != nil { t.Fatal(err) } if l := len(ports); l != 2 { t.Fatalf("Retrieved an unexpected number of InfiniBand ports: %d", l) } } prometheus-node-exporter-0.15.2+ds/collector/interrupts_common.go000066400000000000000000000022351321450230300252640ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build linux openbsd // +build !nointerrupts package collector import "github.com/prometheus/client_golang/prometheus" type interruptsCollector struct { desc typedDesc } func init() { registerCollector("interrupts", defaultDisabled, NewInterruptsCollector) } // NewInterruptsCollector returns a new Collector exposing interrupts stats. func NewInterruptsCollector() (Collector, error) { return &interruptsCollector{ desc: typedDesc{prometheus.NewDesc( namespace+"_interrupts", "Interrupt details.", interruptLabelNames, nil, ), prometheus.CounterValue}, }, nil } prometheus-node-exporter-0.15.2+ds/collector/interrupts_linux.go000066400000000000000000000047461321450230300251440ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nointerrupts package collector import ( "bufio" "errors" "fmt" "io" "os" "strconv" "strings" "github.com/prometheus/client_golang/prometheus" ) var ( interruptLabelNames = []string{"CPU", "type", "info", "devices"} ) func (c *interruptsCollector) Update(ch chan<- prometheus.Metric) (err error) { interrupts, err := getInterrupts() if err != nil { return fmt.Errorf("couldn't get interrupts: %s", err) } for name, interrupt := range interrupts { for cpuNo, value := range interrupt.values { fv, err := strconv.ParseFloat(value, 64) if err != nil { return fmt.Errorf("invalid value %s in interrupts: %s", value, err) } ch <- c.desc.mustNewConstMetric(fv, strconv.Itoa(cpuNo), name, interrupt.info, interrupt.devices) } } return err } type interrupt struct { info string devices string values []string } func getInterrupts() (map[string]interrupt, error) { file, err := os.Open(procFilePath("interrupts")) if err != nil { return nil, err } defer file.Close() return parseInterrupts(file) } func parseInterrupts(r io.Reader) (map[string]interrupt, error) { var ( interrupts = map[string]interrupt{} scanner = bufio.NewScanner(r) ) if !scanner.Scan() { return nil, errors.New("interrupts empty") } cpuNum := len(strings.Fields(scanner.Text())) // one header per cpu for scanner.Scan() { parts := strings.Fields(scanner.Text()) if len(parts) < cpuNum+2 { // irq + one column per cpu + details, continue // we ignore ERR and MIS for now } intName := parts[0][:len(parts[0])-1] // remove trailing : intr := interrupt{ values: parts[1 : cpuNum+1], } if _, err := strconv.Atoi(intName); err == nil { // numeral interrupt intr.info = parts[cpuNum+1] intr.devices = strings.Join(parts[cpuNum+2:], " ") } else { intr.info = strings.Join(parts[cpuNum+1:], " ") } interrupts[intName] = intr } return interrupts, scanner.Err() } prometheus-node-exporter-0.15.2+ds/collector/interrupts_linux_test.go000066400000000000000000000021261321450230300261710ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "os" "testing" ) func TestInterrupts(t *testing.T) { file, err := os.Open("fixtures/proc/interrupts") if err != nil { t.Fatal(err) } defer file.Close() interrupts, err := parseInterrupts(file) if err != nil { t.Fatal(err) } if want, got := "5031", interrupts["NMI"].values[1]; want != got { t.Errorf("want interrupts %s, got %s", want, got) } if want, got := "4968", interrupts["NMI"].values[3]; want != got { t.Errorf("want interrupts %s, got %s", want, got) } } prometheus-node-exporter-0.15.2+ds/collector/interrupts_openbsd.go000066400000000000000000000055521321450230300254330ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nointerrupts package collector import ( "fmt" "strconv" "github.com/prometheus/client_golang/prometheus" ) /* #include #include #include #include #include struct intr { int vector; char device[128]; u_int64_t count; }; int sysctl_nintr(void) { int nintr, mib[4]; size_t siz; mib[0] = CTL_KERN; mib[1] = KERN_INTRCNT; mib[2] = KERN_INTRCNT_NUM; siz = sizeof(nintr); if (sysctl(mib, 3, &nintr, &siz, NULL, 0) < 0) { return -1; } return nintr; } int sysctl_intr(struct intr *intr, int idx) { int mib[4]; size_t siz; u_quad_t cnt; mib[0] = CTL_KERN; mib[1] = KERN_INTRCNT; mib[2] = KERN_INTRCNT_NAME; mib[3] = idx; siz = sizeof intr->device; if (sysctl(mib, 4, intr->device, &siz, NULL, 0) < 0) { return -1; } mib[0] = CTL_KERN; mib[1] = KERN_INTRCNT; mib[2] = KERN_INTRCNT_VECTOR; mib[3] = idx; siz = sizeof intr->vector; if (sysctl(mib, 4, &intr->vector, &siz, NULL, 0) < 0) { return -1; } mib[0] = CTL_KERN; mib[1] = KERN_INTRCNT; mib[2] = KERN_INTRCNT_CNT; mib[3] = idx; siz = sizeof(cnt); if (sysctl(mib, 4, &cnt, &siz, NULL, 0) < 0) { return -1; } intr->count = cnt; return 1; } */ import "C" var ( interruptLabelNames = []string{"CPU", "type", "devices"} ) func (c *interruptsCollector) Update(ch chan<- prometheus.Metric) error { interrupts, err := getInterrupts() if err != nil { return fmt.Errorf("couldn't get interrupts: %s", err) } for dev, interrupt := range interrupts { for cpuNo, value := range interrupt.values { ch <- c.desc.mustNewConstMetric( value, strconv.Itoa(cpuNo), fmt.Sprintf("%d", interrupt.vector), dev, ) } } return nil } type interrupt struct { vector int device string values []float64 } func getInterrupts() (map[string]interrupt, error) { var ( cintr C.struct_intr interrupts = map[string]interrupt{} ) nintr := C.sysctl_nintr() for i := C.int(0); i < nintr; i++ { _, err := C.sysctl_intr(&cintr, i) if err != nil { return nil, err } dev := C.GoString(&cintr.device[0]) interrupts[dev] = interrupt{ vector: int(cintr.vector), device: dev, // XXX: openbsd appears to only handle interrupts on cpu 0. values: []float64{float64(cintr.count)}, } } return interrupts, nil } prometheus-node-exporter-0.15.2+ds/collector/ipvs_linux.go000066400000000000000000000115331321450230300236760ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !noipvs package collector import ( "fmt" "os" "strconv" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" "github.com/prometheus/procfs" ) type ipvsCollector struct { Collector fs procfs.FS backendConnectionsActive, backendConnectionsInact, backendWeight typedDesc connections, incomingPackets, outgoingPackets, incomingBytes, outgoingBytes typedDesc } func init() { registerCollector("ipvs", defaultEnabled, NewIPVSCollector) } // NewIPVSCollector sets up a new collector for IPVS metrics. It accepts the // "procfs" config parameter to override the default proc location (/proc). func NewIPVSCollector() (Collector, error) { return newIPVSCollector() } func newIPVSCollector() (*ipvsCollector, error) { var ( ipvsBackendLabelNames = []string{ "local_address", "local_port", "remote_address", "remote_port", "proto", } c ipvsCollector err error subsystem = "ipvs" ) c.fs, err = procfs.NewFS(*procPath) if err != nil { return nil, err } c.connections = typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "connections_total"), "The total number of connections made.", nil, nil, ), prometheus.CounterValue} c.incomingPackets = typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "incoming_packets_total"), "The total number of incoming packets.", nil, nil, ), prometheus.CounterValue} c.outgoingPackets = typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "outgoing_packets_total"), "The total number of outgoing packets.", nil, nil, ), prometheus.CounterValue} c.incomingBytes = typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "incoming_bytes_total"), "The total amount of incoming data.", nil, nil, ), prometheus.CounterValue} c.outgoingBytes = typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "outgoing_bytes_total"), "The total amount of outgoing data.", nil, nil, ), prometheus.CounterValue} c.backendConnectionsActive = typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "backend_connections_active"), "The current active connections by local and remote address.", ipvsBackendLabelNames, nil, ), prometheus.GaugeValue} c.backendConnectionsInact = typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "backend_connections_inactive"), "The current inactive connections by local and remote address.", ipvsBackendLabelNames, nil, ), prometheus.GaugeValue} c.backendWeight = typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "backend_weight"), "The current backend weight by local and remote address.", ipvsBackendLabelNames, nil, ), prometheus.GaugeValue} return &c, nil } func (c *ipvsCollector) Update(ch chan<- prometheus.Metric) error { ipvsStats, err := c.fs.NewIPVSStats() if err != nil { // Cannot access ipvs metrics, report no error. if os.IsNotExist(err) { log.Debug("ipvs collector metrics are not available for this system") return nil } return fmt.Errorf("could not get IPVS stats: %s", err) } ch <- c.connections.mustNewConstMetric(float64(ipvsStats.Connections)) ch <- c.incomingPackets.mustNewConstMetric(float64(ipvsStats.IncomingPackets)) ch <- c.outgoingPackets.mustNewConstMetric(float64(ipvsStats.OutgoingPackets)) ch <- c.incomingBytes.mustNewConstMetric(float64(ipvsStats.IncomingBytes)) ch <- c.outgoingBytes.mustNewConstMetric(float64(ipvsStats.OutgoingBytes)) backendStats, err := c.fs.NewIPVSBackendStatus() if err != nil { return fmt.Errorf("could not get backend status: %s", err) } for _, backend := range backendStats { labelValues := []string{ backend.LocalAddress.String(), strconv.FormatUint(uint64(backend.LocalPort), 10), backend.RemoteAddress.String(), strconv.FormatUint(uint64(backend.RemotePort), 10), backend.Proto, } ch <- c.backendConnectionsActive.mustNewConstMetric(float64(backend.ActiveConn), labelValues...) ch <- c.backendConnectionsInact.mustNewConstMetric(float64(backend.InactConn), labelValues...) ch <- c.backendWeight.mustNewConstMetric(float64(backend.Weight), labelValues...) } return nil } prometheus-node-exporter-0.15.2+ds/collector/ipvs_linux_test.go000066400000000000000000000120611321450230300247320ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "fmt" "io/ioutil" "net/http" "net/http/httptest" "strings" "testing" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" "gopkg.in/alecthomas/kingpin.v2" ) func TestIPVSCollector(t *testing.T) { if _, err := kingpin.CommandLine.Parse([]string{"--path.procfs", "fixtures/proc"}); err != nil { t.Fatal(err) } collector, err := newIPVSCollector() if err != nil { t.Fatal(err) } sink := make(chan prometheus.Metric) go func() { err = collector.Update(sink) if err != nil { panic(fmt.Sprintf("failed to update collector: %v", err)) } }() for expected, got := range map[string]string{ prometheus.NewDesc("node_ipvs_connections_total", "The total number of connections made.", nil, nil).String(): (<-sink).Desc().String(), prometheus.NewDesc("node_ipvs_incoming_packets_total", "The total number of incoming packets.", nil, nil).String(): (<-sink).Desc().String(), prometheus.NewDesc("node_ipvs_outgoing_packets_total", "The total number of outgoing packets.", nil, nil).String(): (<-sink).Desc().String(), prometheus.NewDesc("node_ipvs_incoming_bytes_total", "The total amount of incoming data.", nil, nil).String(): (<-sink).Desc().String(), prometheus.NewDesc("node_ipvs_outgoing_bytes_total", "The total amount of outgoing data.", nil, nil).String(): (<-sink).Desc().String(), prometheus.NewDesc("node_ipvs_backend_connections_active", "The current active connections by local and remote address.", []string{"local_address", "local_port", "remote_address", "remote_port", "proto"}, nil).String(): (<-sink).Desc().String(), prometheus.NewDesc("node_ipvs_backend_connections_inactive", "The current inactive connections by local and remote address.", []string{"local_address", "local_port", "remote_address", "remote_port", "proto"}, nil).String(): (<-sink).Desc().String(), prometheus.NewDesc("node_ipvs_backend_weight", "The current backend weight by local and remote address.", []string{"local_address", "local_port", "remote_address", "remote_port", "proto"}, nil).String(): (<-sink).Desc().String(), } { if expected != got { t.Fatalf("Expected '%s' but got '%s'", expected, got) } } } // mock collector type miniCollector struct { c Collector } func (c miniCollector) Collect(ch chan<- prometheus.Metric) { c.c.Update(ch) } func (c miniCollector) Describe(ch chan<- *prometheus.Desc) { prometheus.NewGauge(prometheus.GaugeOpts{ Namespace: "fake", Subsystem: "fake", Name: "fake", Help: "fake", }).Describe(ch) } func TestIPVSCollectorResponse(t *testing.T) { if _, err := kingpin.CommandLine.Parse([]string{"--path.procfs", "fixtures/proc"}); err != nil { t.Fatal(err) } collector, err := NewIPVSCollector() if err != nil { t.Fatal(err) } prometheus.MustRegister(miniCollector{c: collector}) rw := httptest.NewRecorder() promhttp.Handler().ServeHTTP(rw, &http.Request{}) metricsFile := "fixtures/ip_vs_result.txt" wantMetrics, err := ioutil.ReadFile(metricsFile) if err != nil { t.Fatalf("unable to read input test file %s: %s", metricsFile, err) } wantLines := strings.Split(string(wantMetrics), "\n") gotLines := strings.Split(string(rw.Body.String()), "\n") gotLinesIdx := 0 // Until the Prometheus Go client library offers better testability // (https://github.com/prometheus/client_golang/issues/58), we simply compare // verbatim text-format metrics outputs, but ignore any lines we don't have // in the fixture. Put differently, we are only testing that each line from // the fixture is present, in the order given. wantLoop: for _, want := range wantLines { for _, got := range gotLines[gotLinesIdx:] { if want == got { // this is a line we are interested in, and it is correct continue wantLoop } else { gotLinesIdx++ } } // if this point is reached, the line we want was missing t.Fatalf("Missing expected output line(s), first missing line is %s", want) } } prometheus-node-exporter-0.15.2+ds/collector/ksmd_linux.go000066400000000000000000000042131321450230300236500ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !noksmd package collector import ( "fmt" "path" "github.com/prometheus/client_golang/prometheus" ) var ( ksmdFiles = []string{"full_scans", "merge_across_nodes", "pages_shared", "pages_sharing", "pages_to_scan", "pages_unshared", "pages_volatile", "run", "sleep_millisecs"} ) type ksmdCollector struct { metricDescs map[string]*prometheus.Desc } func init() { registerCollector("ksmd", defaultDisabled, NewKsmdCollector) } func getCanonicalMetricName(filename string) string { switch filename { case "full_scans": return filename + "_total" case "sleep_millisecs": return "sleep_seconds" default: return filename } } // NewKsmdCollector returns a new Collector exposing kernel/system statistics. func NewKsmdCollector() (Collector, error) { subsystem := "ksmd" descs := make(map[string]*prometheus.Desc) for _, n := range ksmdFiles { descs[n] = prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, getCanonicalMetricName(n)), fmt.Sprintf("ksmd '%s' file.", n), nil, nil) } return &ksmdCollector{descs}, nil } // Update implements Collector and exposes kernel and system statistics. func (c *ksmdCollector) Update(ch chan<- prometheus.Metric) error { for _, n := range ksmdFiles { val, err := readUintFromFile(sysFilePath(path.Join("kernel/mm/ksm", n))) if err != nil { return err } t := prometheus.GaugeValue v := float64(val) switch n { case "full_scans": t = prometheus.CounterValue case "sleep_millisecs": v /= 1000 } ch <- prometheus.MustNewConstMetric(c.metricDescs[n], t, v) } return nil } prometheus-node-exporter-0.15.2+ds/collector/loadavg.go000066400000000000000000000033021321450230300231060ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build darwin dragonfly freebsd linux netbsd openbsd solaris // +build !noloadavg package collector import ( "fmt" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" ) type loadavgCollector struct { metric []typedDesc } func init() { registerCollector("loadavg", defaultEnabled, NewLoadavgCollector) } // NewLoadavgCollector returns a new Collector exposing load average stats. func NewLoadavgCollector() (Collector, error) { return &loadavgCollector{ metric: []typedDesc{ {prometheus.NewDesc(namespace+"_load1", "1m load average.", nil, nil), prometheus.GaugeValue}, {prometheus.NewDesc(namespace+"_load5", "5m load average.", nil, nil), prometheus.GaugeValue}, {prometheus.NewDesc(namespace+"_load15", "15m load average.", nil, nil), prometheus.GaugeValue}, }, }, nil } func (c *loadavgCollector) Update(ch chan<- prometheus.Metric) error { loads, err := getLoad() if err != nil { return fmt.Errorf("couldn't get load: %s", err) } for i, load := range loads { log.Debugf("return load %d: %f", i, load) ch <- c.metric[i].mustNewConstMetric(load) } return err } prometheus-node-exporter-0.15.2+ds/collector/loadavg_freebsd.go000066400000000000000000000020401321450230300245760ustar00rootroot00000000000000// Copyright 2016 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !noloadavg package collector import ( "unsafe" "golang.org/x/sys/unix" ) func getLoad() ([]float64, error) { type loadavg struct { load [3]uint32 scale int } b, err := unix.SysctlRaw("vm.loadavg") if err != nil { return nil, err } load := *(*loadavg)(unsafe.Pointer((&b[0]))) scale := float64(load.scale) return []float64{ float64(load.load[0]) / scale, float64(load.load[1]) / scale, float64(load.load[2]) / scale, }, nil } prometheus-node-exporter-0.15.2+ds/collector/loadavg_linux.go000066400000000000000000000026151321450230300243330ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !noloadavg package collector import ( "fmt" "io/ioutil" "strconv" "strings" ) // Read loadavg from /proc. func getLoad() (loads []float64, err error) { data, err := ioutil.ReadFile(procFilePath("loadavg")) if err != nil { return nil, err } loads, err = parseLoad(string(data)) if err != nil { return nil, err } return loads, nil } // Parse /proc loadavg and return 1m, 5m and 15m. func parseLoad(data string) (loads []float64, err error) { loads = make([]float64, 3) parts := strings.Fields(data) if len(parts) < 3 { return nil, fmt.Errorf("unexpected content in %s", procFilePath("loadavg")) } for i, load := range parts[0:3] { loads[i], err = strconv.ParseFloat(load, 64) if err != nil { return nil, fmt.Errorf("could not parse load '%s': %s", load, err) } } return loads, nil } prometheus-node-exporter-0.15.2+ds/collector/loadavg_linux_test.go000066400000000000000000000016051321450230300253700ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import "testing" func TestLoad(t *testing.T) { want := []float64{0.21, 0.37, 0.39} loads, err := parseLoad("0.21 0.37 0.39 1/719 19737") if err != nil { t.Fatal(err) } for i, load := range loads { if want[i] != load { t.Fatalf("want load %f, got %f", want[i], load) } } } prometheus-node-exporter-0.15.2+ds/collector/loadavg_solaris.go000066400000000000000000000021651321450230300246500ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !noloadavg package collector import ( "errors" ) /* // Define "__stack_chk_fail" and "__stack_chk_guard" symbols. #cgo LDFLAGS: -fno-stack-protector -lssp // Ensure "hrtime_t" is defined for sys/loadavg.h #include #include */ import "C" func getLoad() ([]float64, error) { var loadavg [3]C.double samples := C.getloadavg(&loadavg[0], 3) if samples != 3 { return nil, errors.New("failed to get load average") } return []float64{float64(loadavg[0]), float64(loadavg[1]), float64(loadavg[2])}, nil } prometheus-node-exporter-0.15.2+ds/collector/loadavg_unix.go000066400000000000000000000017501321450230300241560ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build darwin dragonfly netbsd openbsd // +build !noloadavg package collector import ( "errors" ) // #include import "C" func getLoad() ([]float64, error) { var loadavg [3]C.double samples := C.getloadavg(&loadavg[0], 3) if samples != 3 { return nil, errors.New("failed to get load average") } return []float64{float64(loadavg[0]), float64(loadavg[1]), float64(loadavg[2])}, nil } prometheus-node-exporter-0.15.2+ds/collector/logind_linux.go000066400000000000000000000142551321450230300241750ustar00rootroot00000000000000// Copyright 2016 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nologind package collector import ( "fmt" "os" "strconv" "github.com/godbus/dbus" "github.com/prometheus/client_golang/prometheus" ) const ( logindSubsystem = "logind" dbusObject = "org.freedesktop.login1" dbusPath = "/org/freedesktop/login1" ) var ( // Taken from logind as of systemd v229. // "other" is the fallback value for unknown values (in case logind gets extended in the future). attrRemoteValues = []string{"true", "false"} attrTypeValues = []string{"other", "unspecified", "tty", "x11", "wayland", "mir", "web"} attrClassValues = []string{"other", "user", "greeter", "lock-screen", "background"} sessionsDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, logindSubsystem, "sessions"), "Number of sessions registered in logind.", []string{"seat", "remote", "type", "class"}, nil, ) ) type logindCollector struct{} type logindDbus struct { conn *dbus.Conn object dbus.BusObject } type logindInterface interface { listSeats() ([]string, error) listSessions() ([]logindSessionEntry, error) getSession(logindSessionEntry) *logindSession } type logindSession struct { seat string remote string sessionType string class string } // Struct elements must be public for the reflection magic of godbus to work. type logindSessionEntry struct { SessionID string UserID uint32 UserName string SeatID string SessionObjectPath dbus.ObjectPath } type logindSeatEntry struct { SeatID string SeatObjectPath dbus.ObjectPath } func init() { registerCollector("logind", defaultDisabled, NewLogindCollector) } // NewLogindCollector returns a new Collector exposing logind statistics. func NewLogindCollector() (Collector, error) { return &logindCollector{}, nil } func (lc *logindCollector) Update(ch chan<- prometheus.Metric) error { c, err := newDbus() if err != nil { return fmt.Errorf("unable to connect to dbus: %s", err) } defer c.conn.Close() return collectMetrics(ch, c) } func collectMetrics(ch chan<- prometheus.Metric, c logindInterface) error { seats, err := c.listSeats() if err != nil { return fmt.Errorf("unable to get seats: %s", err) } sessionList, err := c.listSessions() if err != nil { return fmt.Errorf("unable to get sessions: %s", err) } sessions := make(map[logindSession]float64) for _, s := range sessionList { session := c.getSession(s) if session != nil { sessions[*session]++ } } for _, remote := range attrRemoteValues { for _, sessionType := range attrTypeValues { for _, class := range attrClassValues { for _, seat := range seats { count := sessions[logindSession{seat, remote, sessionType, class}] ch <- prometheus.MustNewConstMetric( sessionsDesc, prometheus.GaugeValue, count, seat, remote, sessionType, class) } } } } return nil } func knownStringOrOther(value string, known []string) string { for i := range known { if value == known[i] { return value } } return "other" } func newDbus() (*logindDbus, error) { conn, err := dbus.SystemBusPrivate() if err != nil { return nil, err } methods := []dbus.Auth{dbus.AuthExternal(strconv.Itoa(os.Getuid()))} err = conn.Auth(methods) if err != nil { conn.Close() return nil, err } err = conn.Hello() if err != nil { conn.Close() return nil, err } object := conn.Object(dbusObject, dbus.ObjectPath(dbusPath)) return &logindDbus{ conn: conn, object: object, }, nil } func (c *logindDbus) listSeats() ([]string, error) { var result [][]interface{} err := c.object.Call(dbusObject+".Manager.ListSeats", 0).Store(&result) if err != nil { return nil, err } resultInterface := make([]interface{}, len(result)) for i := range result { resultInterface[i] = result[i] } seats := make([]logindSeatEntry, len(result)) seatsInterface := make([]interface{}, len(seats)) for i := range seats { seatsInterface[i] = &seats[i] } err = dbus.Store(resultInterface, seatsInterface...) if err != nil { return nil, err } ret := make([]string, len(seats)+1) for i := range seats { ret[i] = seats[i].SeatID } // Always add the empty seat, which is used for remote sessions like SSH ret[len(seats)] = "" return ret, nil } func (c *logindDbus) listSessions() ([]logindSessionEntry, error) { var result [][]interface{} err := c.object.Call(dbusObject+".Manager.ListSessions", 0).Store(&result) if err != nil { return nil, err } resultInterface := make([]interface{}, len(result)) for i := range result { resultInterface[i] = result[i] } sessions := make([]logindSessionEntry, len(result)) sessionsInterface := make([]interface{}, len(sessions)) for i := range sessions { sessionsInterface[i] = &sessions[i] } err = dbus.Store(resultInterface, sessionsInterface...) if err != nil { return nil, err } return sessions, nil } func (c *logindDbus) getSession(session logindSessionEntry) *logindSession { object := c.conn.Object(dbusObject, session.SessionObjectPath) remote, err := object.GetProperty(dbusObject + ".Session.Remote") if err != nil { return nil } sessionType, err := object.GetProperty(dbusObject + ".Session.Type") if err != nil { return nil } sessionTypeStr, ok := sessionType.Value().(string) if !ok { return nil } class, err := object.GetProperty(dbusObject + ".Session.Class") if err != nil { return nil } classStr, ok := class.Value().(string) if !ok { return nil } return &logindSession{ seat: session.SeatID, remote: remote.String(), sessionType: knownStringOrOther(sessionTypeStr, attrTypeValues), class: knownStringOrOther(classStr, attrClassValues), } } prometheus-node-exporter-0.15.2+ds/collector/logind_linux_test.go000066400000000000000000000055661321450230300252410ustar00rootroot00000000000000// Copyright 2016 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "testing" "github.com/godbus/dbus" "github.com/prometheus/client_golang/prometheus" ) type testLogindInterface struct{} var testSeats = []string{"seat0", ""} func (c *testLogindInterface) listSeats() ([]string, error) { return testSeats, nil } func (c *testLogindInterface) listSessions() ([]logindSessionEntry, error) { return []logindSessionEntry{ { SessionID: "1", UserID: 0, UserName: "", SeatID: "", SessionObjectPath: dbus.ObjectPath("/org/freedesktop/login1/session/1"), }, { SessionID: "2", UserID: 0, UserName: "", SeatID: "seat0", SessionObjectPath: dbus.ObjectPath("/org/freedesktop/login1/session/2"), }, }, nil } func (c *testLogindInterface) getSession(session logindSessionEntry) *logindSession { sessions := map[dbus.ObjectPath]*logindSession{ dbus.ObjectPath("/org/freedesktop/login1/session/1"): { seat: session.SeatID, remote: "true", sessionType: knownStringOrOther("tty", attrTypeValues), class: knownStringOrOther("user", attrClassValues), }, dbus.ObjectPath("/org/freedesktop/login1/session/2"): { seat: session.SeatID, remote: "false", sessionType: knownStringOrOther("x11", attrTypeValues), class: knownStringOrOther("greeter", attrClassValues), }, } return sessions[session.SessionObjectPath] } func TestLogindCollectorKnownStringOrOther(t *testing.T) { known := []string{"foo", "bar"} actual := knownStringOrOther("foo", known) expected := "foo" if actual != expected { t.Errorf("knownStringOrOther failed: got %q, expected %q.", actual, expected) } actual = knownStringOrOther("baz", known) expected = "other" if actual != expected { t.Errorf("knownStringOrOther failed: got %q, expected %q.", actual, expected) } } func TestLogindCollectorCollectMetrics(t *testing.T) { ch := make(chan prometheus.Metric) go func() { collectMetrics(ch, &testLogindInterface{}) close(ch) }() count := 0 for range ch { count++ } expected := len(testSeats) * len(attrRemoteValues) * len(attrTypeValues) * len(attrClassValues) if count != expected { t.Errorf("collectMetrics did not generate the expected number of metrics: got %d, expected %d.", count, expected) } } prometheus-node-exporter-0.15.2+ds/collector/mdadm_linux.go000066400000000000000000000207211321450230300237760ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nomdadm package collector import ( "fmt" "io/ioutil" "os" "regexp" "strconv" "strings" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" ) var ( statuslineRE = regexp.MustCompile(`(\d+) blocks .*\[(\d+)/(\d+)\] \[[U_]+\]`) raid0lineRE = regexp.MustCompile(`(\d+) blocks .*\d+k chunks`) buildlineRE = regexp.MustCompile(`\((\d+)/\d+\)`) unknownPersonalityLineRE = regexp.MustCompile(`(\d+) blocks (.*)`) raidPersonalityRE = regexp.MustCompile(`raid[0-9]+`) ) type mdStatus struct { name string active bool disksActive int64 disksTotal int64 blocksTotal int64 blocksSynced int64 } type mdadmCollector struct{} func init() { registerCollector("mdadm", defaultEnabled, NewMdadmCollector) } func evalStatusline(statusline string) (active, total, size int64, err error) { matches := statuslineRE.FindStringSubmatch(statusline) // +1 to make it more obvious that the whole string containing the info is also returned as matches[0]. if len(matches) < 3+1 { return 0, 0, 0, fmt.Errorf("too few matches found in statusline: %s", statusline) } else if len(matches) > 3+1 { return 0, 0, 0, fmt.Errorf("too many matches found in statusline: %s", statusline) } size, err = strconv.ParseInt(matches[1], 10, 64) if err != nil { return 0, 0, 0, fmt.Errorf("%s in statusline: %s", err, statusline) } total, err = strconv.ParseInt(matches[2], 10, 64) if err != nil { return 0, 0, 0, fmt.Errorf("%s in statusline: %s", err, statusline) } active, err = strconv.ParseInt(matches[3], 10, 64) if err != nil { return 0, 0, 0, fmt.Errorf("%s in statusline: %s", err, statusline) } return active, total, size, nil } func evalRaid0line(statusline string) (size int64, err error) { matches := raid0lineRE.FindStringSubmatch(statusline) if len(matches) < 2 { return 0, fmt.Errorf("invalid raid0 status line: %s", statusline) } size, err = strconv.ParseInt(matches[1], 10, 64) if err != nil { return 0, fmt.Errorf("%s in statusline: %s", err, statusline) } return size, nil } func evalUnknownPersonalitylineRE(statusline string) (size int64, err error) { matches := unknownPersonalityLineRE.FindStringSubmatch(statusline) if len(matches) != 2+1 { return 0, fmt.Errorf("invalid unknown personality status line: %s", statusline) } size, err = strconv.ParseInt(matches[1], 10, 64) if err != nil { return 0, fmt.Errorf("%s in statusline: %s", err, statusline) } return size, nil } // evalBuildline gets the size that has already been synced out of the sync-line. func evalBuildline(buildline string) (int64, error) { matches := buildlineRE.FindStringSubmatch(buildline) // +1 to make it more obvious that the whole string containing the info is also returned as matches[0]. if len(matches) < 1+1 { return 0, fmt.Errorf("too few matches found in buildline: %s", buildline) } if len(matches) > 1+1 { return 0, fmt.Errorf("too many matches found in buildline: %s", buildline) } syncedSize, err := strconv.ParseInt(matches[1], 10, 64) if err != nil { return 0, fmt.Errorf("%s in buildline: %s", err, buildline) } return syncedSize, nil } // parseMdstat parses an mdstat-file and returns a struct with the relevant infos. func parseMdstat(mdStatusFilePath string) ([]mdStatus, error) { content, err := ioutil.ReadFile(mdStatusFilePath) if err != nil { return []mdStatus{}, err } lines := strings.Split(string(content), "\n") // Each md has at least the deviceline, statusline and one empty line afterwards // so we will have probably something of the order len(lines)/3 devices // so we use that for preallocation. mdStates := make([]mdStatus, 0, len(lines)/3) for i, line := range lines { if line == "" { continue } if line[0] == ' ' || line[0] == '\t' { // Lines starting with white space are not the beginning of a md-section. continue } if strings.HasPrefix(line, "Personalities") || strings.HasPrefix(line, "unused") { // These lines contain general information. continue } mainLine := strings.Split(line, " ") if len(mainLine) < 4 { return mdStates, fmt.Errorf("error parsing mdline: %s", line) } md := mdStatus{ name: mainLine[0], active: mainLine[2] == "active", } if len(lines) <= i+3 { return mdStates, fmt.Errorf("error parsing mdstat: entry for %s has fewer lines than expected", md.name) } personality := "" for _, possiblePersonality := range mainLine[3:] { if raidPersonalityRE.MatchString(possiblePersonality) { personality = possiblePersonality break } } switch { case personality == "raid0": md.disksActive = int64(len(mainLine) - 4) // Get the number of devices from the main line. md.disksTotal = md.disksActive // Raid0 active and total is always the same if active. md.blocksTotal, err = evalRaid0line(lines[i+1]) case raidPersonalityRE.MatchString(personality): md.disksActive, md.disksTotal, md.blocksTotal, err = evalStatusline(lines[i+1]) default: log.Infof("Personality unknown: %s\n", mainLine) md.blocksTotal, err = evalUnknownPersonalitylineRE(lines[i+1]) } if err != nil { return mdStates, fmt.Errorf("error parsing mdstat: %s", err) } syncLine := lines[i+2] if strings.Contains(syncLine, "bitmap") { syncLine = lines[i+3] } // If device is syncing at the moment, get the number of currently synced bytes, // otherwise that number equals the size of the device. if strings.Contains(syncLine, "recovery") || strings.Contains(syncLine, "resync") && !strings.Contains(syncLine, "\tresync=") { md.blocksSynced, err = evalBuildline(syncLine) if err != nil { return mdStates, fmt.Errorf("error parsing mdstat: %s", err) } } else { md.blocksSynced = md.blocksTotal } mdStates = append(mdStates, md) } return mdStates, nil } // NewMdadmCollector returns a new Collector exposing raid statistics. func NewMdadmCollector() (Collector, error) { return &mdadmCollector{}, nil } var ( isActiveDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, "md", "is_active"), "Indicator whether the md-device is active or not.", []string{"device"}, nil, ) disksActiveDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, "md", "disks_active"), "Number of active disks of device.", []string{"device"}, nil, ) disksTotalDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, "md", "disks"), "Total number of disks of device.", []string{"device"}, nil, ) blocksTotalDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, "md", "blocks"), "Total number of blocks on device.", []string{"device"}, nil, ) blocksSyncedDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, "md", "blocks_synced"), "Number of blocks synced on device.", []string{"device"}, nil, ) ) func (c *mdadmCollector) Update(ch chan<- prometheus.Metric) error { statusfile := procFilePath("mdstat") mdstate, err := parseMdstat(statusfile) if err != nil { if os.IsNotExist(err) { log.Debugf("Not collecting mdstat, file does not exist: %s", statusfile) return nil } return fmt.Errorf("error parsing mdstatus: %s", err) } for _, mds := range mdstate { log.Debugf("collecting metrics for device %s", mds.name) var active float64 if mds.active { active = 1 } ch <- prometheus.MustNewConstMetric( isActiveDesc, prometheus.GaugeValue, active, mds.name, ) ch <- prometheus.MustNewConstMetric( disksActiveDesc, prometheus.GaugeValue, float64(mds.disksActive), mds.name, ) ch <- prometheus.MustNewConstMetric( disksTotalDesc, prometheus.GaugeValue, float64(mds.disksTotal), mds.name, ) ch <- prometheus.MustNewConstMetric( blocksTotalDesc, prometheus.GaugeValue, float64(mds.blocksTotal), mds.name, ) ch <- prometheus.MustNewConstMetric( blocksSyncedDesc, prometheus.GaugeValue, float64(mds.blocksSynced), mds.name, ) } return nil } prometheus-node-exporter-0.15.2+ds/collector/mdadm_linux_test.go000066400000000000000000000041601321450230300250340ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "testing" ) func TestMdadm(t *testing.T) { mdStates, err := parseMdstat("fixtures/proc/mdstat") if err != nil { t.Fatalf("parsing of reference-file failed entirely: %s", err) } refs := map[string]mdStatus{ // { "", , , , , } "md3": {"md3", true, 8, 8, 5853468288, 5853468288}, "md127": {"md127", true, 2, 2, 312319552, 312319552}, "md0": {"md0", true, 2, 2, 248896, 248896}, "md4": {"md4", false, 2, 2, 4883648, 4883648}, "md6": {"md6", true, 1, 2, 195310144, 16775552}, "md8": {"md8", true, 2, 2, 195310144, 16775552}, "md7": {"md7", true, 3, 4, 7813735424, 7813735424}, "md9": {"md9", true, 4, 4, 523968, 523968}, "md10": {"md10", true, 2, 2, 314159265, 314159265}, "md11": {"md11", true, 2, 2, 4190208, 4190208}, "md12": {"md12", true, 2, 2, 3886394368, 3886394368}, "md126": {"md126", true, 2, 2, 1855870976, 1855870976}, "md219": {"md219", false, 0, 0, 7932, 7932}, "md00": {"md00", true, 1, 1, 4186624, 4186624}, } for _, md := range mdStates { if md != refs[md.name] { t.Errorf("failed parsing md-device %s correctly: want %v, got %v", md.name, refs[md.name], md) } } if len(mdStates) != len(refs) { t.Errorf("expected number of parsed md-device to be %d, but was %d", len(refs), len(mdStates)) } } func TestInvalidMdstat(t *testing.T) { _, err := parseMdstat("fixtures/proc/mdstat_invalid") if err == nil { t.Fatalf("parsing of invalid reference file did not find any errors") } } prometheus-node-exporter-0.15.2+ds/collector/megacli.go000066400000000000000000000132251321450230300230770ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nomegacli package collector import ( "bufio" "io" "os/exec" "strconv" "strings" "github.com/prometheus/client_golang/prometheus" "gopkg.in/alecthomas/kingpin.v2" ) const ( defaultMegaCli = "megacli" adapterHeaderSep = "================" ) var ( megacliCommand = kingpin.Flag("collector.megacli.command", "Command to run megacli.").Default(defaultMegaCli).String() ) type megaCliCollector struct { cli string driveTemperature *prometheus.GaugeVec driveCounters *prometheus.GaugeVec drivePresence *prometheus.GaugeVec } func init() { registerCollector("megacli", defaultDisabled, NewMegaCliCollector) } // NewMegaCliCollector returns a new Collector exposing RAID status through // megacli. func NewMegaCliCollector() (Collector, error) { warnDeprecated("megacli") return &megaCliCollector{ cli: *megacliCommand, driveTemperature: prometheus.NewGaugeVec(prometheus.GaugeOpts{ Namespace: namespace, Name: "megacli_drive_temperature_celsius", Help: "megacli: drive temperature", }, []string{"enclosure", "slot"}), driveCounters: prometheus.NewGaugeVec(prometheus.GaugeOpts{ Namespace: namespace, Name: "megacli_drive_count", Help: "megacli: drive error and event counters", }, []string{"enclosure", "slot", "type"}), drivePresence: prometheus.NewGaugeVec(prometheus.GaugeOpts{ Namespace: namespace, Name: "megacli_adapter_disk_presence", Help: "megacli: disk presence per adapter", }, []string{"type"}), }, nil } func (c *megaCliCollector) Update(ch chan<- prometheus.Metric) error { if err := c.updateAdapter(); err != nil { return err } if err := c.updateDisks(); err != nil { return err } c.driveTemperature.Collect(ch) c.driveCounters.Collect(ch) c.drivePresence.Collect(ch) return nil } func parseMegaCliDisks(r io.Reader) (map[int]map[int]map[string]string, error) { var ( stats = map[int]map[int]map[string]string{} scanner = bufio.NewScanner(r) curEnc = -1 curSlot = -1 ) for scanner.Scan() { var err error text := strings.TrimSpace(scanner.Text()) parts := strings.SplitN(text, ":", 2) if len(parts) != 2 { // Adapter #X continue } key := strings.TrimSpace(parts[0]) value := strings.TrimSpace(parts[1]) switch { case key == "Enclosure Device ID": curEnc, err = strconv.Atoi(value) if err != nil { return nil, err } case key == "Slot Number": curSlot, err = strconv.Atoi(value) if err != nil { return nil, err } case curSlot != -1 && curEnc != -1: if _, ok := stats[curEnc]; !ok { stats[curEnc] = map[int]map[string]string{} } if _, ok := stats[curEnc][curSlot]; !ok { stats[curEnc][curSlot] = map[string]string{} } stats[curEnc][curSlot][key] = value } } return stats, scanner.Err() } func parseMegaCliAdapter(r io.Reader) (map[string]map[string]string, error) { var ( raidStats = map[string]map[string]string{} scanner = bufio.NewScanner(r) header = "" last = "" ) for scanner.Scan() { text := strings.TrimSpace(scanner.Text()) if text == adapterHeaderSep { header = last raidStats[header] = map[string]string{} continue } last = text if header == "" { // skip Adapter #X and separator continue } parts := strings.SplitN(text, ":", 2) if len(parts) != 2 { // these section never include anything we are interested in continue } key := strings.TrimSpace(parts[0]) value := strings.TrimSpace(parts[1]) raidStats[header][key] = value } return raidStats, scanner.Err() } func (c *megaCliCollector) updateAdapter() error { cmd := exec.Command(c.cli, "-AdpAllInfo", "-aALL") pipe, err := cmd.StdoutPipe() if err != nil { return err } if err := cmd.Start(); err != nil { return err } stats, err := parseMegaCliAdapter(pipe) if err != nil { return err } if err := cmd.Wait(); err != nil { return err } for k, v := range stats["Device Present"] { value, err := strconv.ParseFloat(v, 64) if err != nil { return err } c.drivePresence.WithLabelValues(k).Set(value) } return nil } func (c *megaCliCollector) updateDisks() error { var counters = []string{"Media Error Count", "Other Error Count", "Predictive Failure Count"} cmd := exec.Command(c.cli, "-PDList", "-aALL") pipe, err := cmd.StdoutPipe() if err != nil { return err } if err := cmd.Start(); err != nil { return err } stats, err := parseMegaCliDisks(pipe) if err != nil { return err } if err := cmd.Wait(); err != nil { return err } for enc, encStats := range stats { for slot, slotStats := range encStats { encStr := strconv.Itoa(enc) slotStr := strconv.Itoa(slot) tStr := slotStats["Drive Temperature"] if strings.Index(tStr, "C") > 0 { tStr = tStr[:strings.Index(tStr, "C")] t, err := strconv.ParseFloat(tStr, 64) if err != nil { return err } c.driveTemperature.WithLabelValues(encStr, slotStr).Set(t) } for _, i := range counters { counter, err := strconv.ParseFloat(slotStats[i], 64) if err != nil { return err } c.driveCounters.WithLabelValues(encStr, slotStr, i).Set(counter) } } } return nil } prometheus-node-exporter-0.15.2+ds/collector/megacli_test.go000066400000000000000000000047621321450230300241440ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nomegacli package collector import ( "os" "testing" "github.com/prometheus/client_golang/prometheus" "gopkg.in/alecthomas/kingpin.v2" ) const ( testMegaCliAdapter = "fixtures/megacli_adapter.txt" testMegaCliDisks = "fixtures/megacli_disks.txt" physicalDevicesExpected = "5" virtualDevicesDegraded = "0" ) func TestMegaCliAdapter(t *testing.T) { data, err := os.Open(testMegaCliAdapter) if err != nil { t.Fatal(err) } stats, err := parseMegaCliAdapter(data) if err != nil { t.Fatal(err) } if stats["Device Present"]["Physical Devices"] != physicalDevicesExpected { t.Fatalf("Unexpected device count: %s != %s", stats["Device Present"]["Physical Devices"], physicalDevicesExpected) } if stats["Device Present"]["Degraded"] != virtualDevicesDegraded { t.Fatalf("Unexpected degraded device count: %s != %s", stats["Device Present"]["Degraded"], virtualDevicesDegraded) } } func TestMegaCliDisks(t *testing.T) { data, err := os.Open(testMegaCliDisks) if err != nil { t.Fatal(err) } stats, err := parseMegaCliDisks(data) if err != nil { t.Fatal(err) } if stats[32][0]["Drive Temperature"] != "37C (98.60 F)" { t.Fatalf("Unexpected drive temperature: %s", stats[32][0]["Drive Temperature"]) } if stats[32][1]["Drive Temperature"] != "N/A" { t.Fatalf("Unexpected drive temperature: %s", stats[32][2]["Drive Temperature"]) } if stats[32][3]["Predictive Failure Count"] != "23" { t.Fatalf("Unexpected predictive failure count: %s", stats[32][3]["Predictive Failure Count"]) } } func TestMegaCliCollectorDoesntCrash(t *testing.T) { if _, err := kingpin.CommandLine.Parse([]string{"--collector.megacli.command", "./fixtures/megacli"}); err != nil { t.Fatal(err) } collector, err := NewMegaCliCollector() if err != nil { t.Fatal(err) } sink := make(chan prometheus.Metric) go func() { for { <-sink } }() err = collector.Update(sink) if err != nil { t.Fatal(err) } } prometheus-node-exporter-0.15.2+ds/collector/meminfo.go000066400000000000000000000032151321450230300231260ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build darwin dragonfly freebsd linux // +build !nomeminfo package collector import ( "fmt" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" ) const ( memInfoSubsystem = "memory" ) type meminfoCollector struct{} func init() { registerCollector("meminfo", defaultEnabled, NewMeminfoCollector) } // NewMeminfoCollector returns a new Collector exposing memory stats. func NewMeminfoCollector() (Collector, error) { return &meminfoCollector{}, nil } // Update calls (*meminfoCollector).getMemInfo to get the platform specific // memory metrics. func (c *meminfoCollector) Update(ch chan<- prometheus.Metric) error { memInfo, err := c.getMemInfo() if err != nil { return fmt.Errorf("couldn't get meminfo: %s", err) } log.Debugf("Set node_mem: %#v", memInfo) for k, v := range memInfo { ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, memInfoSubsystem, k), fmt.Sprintf("Memory information field %s.", k), nil, nil, ), prometheus.GaugeValue, v, ) } return nil } prometheus-node-exporter-0.15.2+ds/collector/meminfo_bsd.go000066400000000000000000000037531321450230300237650ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build freebsd dragonfly // +build !nomeminfo package collector import ( "fmt" "golang.org/x/sys/unix" ) func (c *meminfoCollector) getMemInfo() (map[string]float64, error) { info := make(map[string]float64) tmp32, err := unix.SysctlUint32("vm.stats.vm.v_page_size") if err != nil { return nil, fmt.Errorf("sysctl(vm.stats.vm.v_page_size) failed: %s", err) } size := float64(tmp32) fromPage := func(v float64) float64 { return v * size } for _, ctl := range []bsdSysctl{ {name: "active_bytes", mib: "vm.stats.vm.v_active_count", conversion: fromPage}, {name: "inactive_bytes", mib: "vm.stats.vm.v_inactive_count", conversion: fromPage}, {name: "wired_bytes", mib: "vm.stats.vm.v_wire_count", conversion: fromPage}, {name: "cache_bytes", mib: "vm.stats.vm.v_cache_count", conversion: fromPage}, {name: "buffer_bytes", mib: "vfs.bufspace", dataType: bsdSysctlTypeCLong}, {name: "free_bytes", mib: "vm.stats.vm.v_free_count", conversion: fromPage}, {name: "size_bytes", mib: "vm.stats.vm.v_page_count", conversion: fromPage}, {name: "swap_in_bytes_total", mib: "vm.stats.vm.v_swappgsin", conversion: fromPage}, {name: "swap_out_bytes_total", mib: "vm.stats.vm.v_swappgsout", conversion: fromPage}, {name: "swap_size_bytes", mib: "vm.swap_total", dataType: bsdSysctlTypeUint64}, } { v, err := ctl.Value() if err != nil { return nil, err } info[ctl.name] = v } return info, nil } prometheus-node-exporter-0.15.2+ds/collector/meminfo_darwin.go000066400000000000000000000035521321450230300244760ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nomeminfo package collector // #include import "C" import ( "encoding/binary" "fmt" "syscall" "unsafe" "golang.org/x/sys/unix" ) func (c *meminfoCollector) getMemInfo() (map[string]float64, error) { infoCount := C.mach_msg_type_number_t(C.HOST_VM_INFO_COUNT) vmstat := C.vm_statistics_data_t{} ret := C.host_statistics( C.host_t(C.mach_host_self()), C.HOST_VM_INFO, C.host_info_t(unsafe.Pointer(&vmstat)), &infoCount, ) if ret != C.KERN_SUCCESS { return nil, fmt.Errorf("Couldn't get memory statistics, host_statistics returned %d", ret) } totalb, err := unix.Sysctl("hw.memsize") if err != nil { return nil, err } // Syscall removes terminating NUL which we need to cast to uint64 total := binary.LittleEndian.Uint64([]byte(totalb + "\x00")) ps := C.natural_t(syscall.Getpagesize()) return map[string]float64{ "active_bytes_total": float64(ps * vmstat.active_count), "inactive_bytes_total": float64(ps * vmstat.inactive_count), "wired_bytes_total": float64(ps * vmstat.wire_count), "free_bytes_total": float64(ps * vmstat.free_count), "swapped_in_pages_total": float64(ps * vmstat.pageins), "swapped_out_pages_total": float64(ps * vmstat.pageouts), "bytes_total": float64(total), }, nil } prometheus-node-exporter-0.15.2+ds/collector/meminfo_linux.go000066400000000000000000000032101321450230300243400ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nomeminfo package collector import ( "bufio" "fmt" "io" "os" "regexp" "strconv" "strings" ) func (c *meminfoCollector) getMemInfo() (map[string]float64, error) { file, err := os.Open(procFilePath("meminfo")) if err != nil { return nil, err } defer file.Close() return parseMemInfo(file) } func parseMemInfo(r io.Reader) (map[string]float64, error) { var ( memInfo = map[string]float64{} scanner = bufio.NewScanner(r) re = regexp.MustCompile(`\((.*)\)`) ) for scanner.Scan() { line := scanner.Text() parts := strings.Fields(line) fv, err := strconv.ParseFloat(parts[1], 64) if err != nil { return nil, fmt.Errorf("invalid value in meminfo: %s", err) } switch len(parts) { case 2: // no unit case 3: // has unit, we presume kB fv *= 1024 default: return nil, fmt.Errorf("invalid line in meminfo: %s", line) } key := parts[0][:len(parts[0])-1] // remove trailing : from key // Active(anon) -> Active_anon key = re.ReplaceAllString(key, "_${1}") memInfo[key] = fv } return memInfo, scanner.Err() } prometheus-node-exporter-0.15.2+ds/collector/meminfo_linux_test.go000066400000000000000000000021231321450230300254010ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "os" "testing" ) func TestMemInfo(t *testing.T) { file, err := os.Open("fixtures/proc/meminfo") if err != nil { t.Fatal(err) } defer file.Close() memInfo, err := parseMemInfo(file) if err != nil { t.Fatal(err) } if want, got := 3831959552.0, memInfo["MemTotal"]; want != got { t.Errorf("want memory total %f, got %f", want, got) } if want, got := 3787456512.0, memInfo["DirectMap2M"]; want != got { t.Errorf("want memory directMap2M %f, got %f", want, got) } } prometheus-node-exporter-0.15.2+ds/collector/meminfo_numa_linux.go000066400000000000000000000106731321450230300253730ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nomeminfo_numa package collector import ( "bufio" "fmt" "io" "os" "path" "path/filepath" "regexp" "strconv" "strings" "github.com/prometheus/client_golang/prometheus" ) const ( memInfoNumaSubsystem = "memory_numa" ) var meminfoNodeRE = regexp.MustCompile(`.*devices/system/node/node([0-9]*)`) type meminfoMetric struct { metricName string metricType prometheus.ValueType numaNode string value float64 } type meminfoNumaCollector struct { metricDescs map[string]*prometheus.Desc } func init() { registerCollector("meminfo_numa", defaultDisabled, NewMeminfoNumaCollector) } // NewMeminfoNumaCollector returns a new Collector exposing memory stats. func NewMeminfoNumaCollector() (Collector, error) { return &meminfoNumaCollector{ metricDescs: map[string]*prometheus.Desc{}, }, nil } func (c *meminfoNumaCollector) Update(ch chan<- prometheus.Metric) error { metrics, err := getMemInfoNuma() if err != nil { return fmt.Errorf("couldn't get NUMA meminfo: %s", err) } for _, v := range metrics { desc, ok := c.metricDescs[v.metricName] if !ok { desc = prometheus.NewDesc( prometheus.BuildFQName(namespace, memInfoNumaSubsystem, v.metricName), fmt.Sprintf("Memory information field %s.", v.metricName), []string{"node"}, nil) c.metricDescs[v.metricName] = desc } ch <- prometheus.MustNewConstMetric(desc, v.metricType, v.value, v.numaNode) } return nil } func getMemInfoNuma() ([]meminfoMetric, error) { var ( metrics []meminfoMetric ) nodes, err := filepath.Glob(sysFilePath("devices/system/node/node[0-9]*")) if err != nil { return nil, err } for _, node := range nodes { meminfoFile, err := os.Open(path.Join(node, "meminfo")) if err != nil { return nil, err } defer meminfoFile.Close() numaInfo, err := parseMemInfoNuma(meminfoFile) if err != nil { return nil, err } metrics = append(metrics, numaInfo...) numastatFile, err := os.Open(path.Join(node, "numastat")) if err != nil { return nil, err } defer numastatFile.Close() nodeNumber := meminfoNodeRE.FindStringSubmatch(node) if nodeNumber == nil { return nil, fmt.Errorf("device node string didn't match regexp: %s", node) } numaStat, err := parseMemInfoNumaStat(numastatFile, nodeNumber[1]) if err != nil { return nil, err } metrics = append(metrics, numaStat...) } return metrics, nil } func parseMemInfoNuma(r io.Reader) ([]meminfoMetric, error) { var ( memInfo []meminfoMetric scanner = bufio.NewScanner(r) re = regexp.MustCompile(`\((.*)\)`) ) for scanner.Scan() { line := strings.TrimSpace(scanner.Text()) if line == "" { continue } parts := strings.Fields(line) fv, err := strconv.ParseFloat(parts[3], 64) if err != nil { return nil, fmt.Errorf("invalid value in meminfo: %s", err) } switch l := len(parts); { case l == 4: // no unit case l == 5 && parts[4] == "kB": // has unit fv *= 1024 default: return nil, fmt.Errorf("invalid line in meminfo: %s", line) } metric := strings.TrimRight(parts[2], ":") // Active(anon) -> Active_anon metric = re.ReplaceAllString(metric, "_${1}") memInfo = append(memInfo, meminfoMetric{metric, prometheus.GaugeValue, parts[1], fv}) } return memInfo, scanner.Err() } func parseMemInfoNumaStat(r io.Reader, nodeNumber string) ([]meminfoMetric, error) { var ( numaStat []meminfoMetric scanner = bufio.NewScanner(r) ) for scanner.Scan() { line := strings.TrimSpace(scanner.Text()) if line == "" { continue } parts := strings.Fields(line) if len(parts) != 2 { return nil, fmt.Errorf("line scan did not return 2 fields: %s", line) } fv, err := strconv.ParseFloat(parts[1], 64) if err != nil { return nil, fmt.Errorf("invalid value in numastat: %s", err) } numaStat = append(numaStat, meminfoMetric{parts[0] + "_total", prometheus.CounterValue, nodeNumber, fv}) } return numaStat, scanner.Err() } prometheus-node-exporter-0.15.2+ds/collector/meminfo_numa_linux_test.go000066400000000000000000000055201321450230300264250ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "os" "testing" ) func TestMemInfoNuma(t *testing.T) { file, err := os.Open("fixtures/sys/devices/system/node/node0/meminfo") if err != nil { t.Fatal(err) } defer file.Close() memInfo, err := parseMemInfoNuma(file) if err != nil { t.Fatal(err) } if want, got := 707915776.0, memInfo[5].value; want != got { t.Errorf("want memory Active(anon) value %f, got %f", want, got) } if want, got := "Active_anon", memInfo[5].metricName; want != got { t.Errorf("want metric Active(anon) metricName %s, got %s", want, got) } if want, got := 150994944.0, memInfo[25].value; want != got { t.Errorf("want memory AnonHugePages %f, got %f", want, got) } file, err = os.Open("fixtures/sys/devices/system/node/node1/meminfo") if err != nil { t.Fatal(err) } defer file.Close() memInfo, err = parseMemInfoNuma(file) if err != nil { t.Fatal(err) } if want, got := 291930112.0, memInfo[6].value; want != got { t.Errorf("want memory Inactive(anon) %f, got %f", want, got) } if want, got := 85585088512.0, memInfo[13].value; want != got { t.Errorf("want memory FilePages %f, got %f", want, got) } } func TestMemInfoNumaStat(t *testing.T) { file, err := os.Open("fixtures/sys/devices/system/node/node0/numastat") if err != nil { t.Fatal(err) } defer file.Close() numaStat, err := parseMemInfoNumaStat(file, "0") if err != nil { t.Fatal(err) } if want, got := 193460335812.0, numaStat[0].value; want != got { t.Errorf("want numa stat numa_hit value %f, got %f", want, got) } if want, got := "numa_hit_total", numaStat[0].metricName; want != got { t.Errorf("want numa stat numa_hit metricName %s, got %s", want, got) } if want, got := 193454780853.0, numaStat[4].value; want != got { t.Errorf("want numa stat local_node %f, got %f", want, got) } file, err = os.Open("fixtures/sys/devices/system/node/node1/numastat") if err != nil { t.Fatal(err) } defer file.Close() numaStat, err = parseMemInfoNumaStat(file, "1") if err != nil { t.Fatal(err) } if want, got := 59858626709.0, numaStat[1].value; want != got { t.Errorf("want numa stat numa_miss %f, got %f", want, got) } if want, got := 59860526920.0, numaStat[5].value; want != got { t.Errorf("want numa stat other_node %f, got %f", want, got) } } prometheus-node-exporter-0.15.2+ds/collector/mountstats_linux.go000066400000000000000000000603231321450230300251370ustar00rootroot00000000000000// Copyright 2017 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "fmt" "sort" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" "github.com/prometheus/procfs" ) type mountStatsCollector struct { // General statistics NFSAgeSecondsTotal *prometheus.Desc // Byte statistics NFSReadBytesTotal *prometheus.Desc NFSWriteBytesTotal *prometheus.Desc NFSDirectReadBytesTotal *prometheus.Desc NFSDirectWriteBytesTotal *prometheus.Desc NFSTotalReadBytesTotal *prometheus.Desc NFSTotalWriteBytesTotal *prometheus.Desc NFSReadPagesTotal *prometheus.Desc NFSWritePagesTotal *prometheus.Desc // Per-operation statistics NFSOperationsRequestsTotal *prometheus.Desc NFSOperationsTransmissionsTotal *prometheus.Desc NFSOperationsMajorTimeoutsTotal *prometheus.Desc NFSOperationsSentBytesTotal *prometheus.Desc NFSOperationsReceivedBytesTotal *prometheus.Desc NFSOperationsQueueTimeSecondsTotal *prometheus.Desc NFSOperationsResponseTimeSecondsTotal *prometheus.Desc NFSOperationsRequestTimeSecondsTotal *prometheus.Desc // Transport statistics NFSTransportBindTotal *prometheus.Desc NFSTransportConnectTotal *prometheus.Desc NFSTransportIdleTimeSeconds *prometheus.Desc NFSTransportSendsTotal *prometheus.Desc NFSTransportReceivesTotal *prometheus.Desc NFSTransportBadTransactionIDsTotal *prometheus.Desc NFSTransportBacklogQueueTotal *prometheus.Desc NFSTransportMaximumRPCSlots *prometheus.Desc NFSTransportSendingQueueTotal *prometheus.Desc NFSTransportPendingQueueTotal *prometheus.Desc // Event statistics NFSEventInodeRevalidateTotal *prometheus.Desc NFSEventDnodeRevalidateTotal *prometheus.Desc NFSEventDataInvalidateTotal *prometheus.Desc NFSEventAttributeInvalidateTotal *prometheus.Desc NFSEventVFSOpenTotal *prometheus.Desc NFSEventVFSLookupTotal *prometheus.Desc NFSEventVFSAccessTotal *prometheus.Desc NFSEventVFSUpdatePageTotal *prometheus.Desc NFSEventVFSReadPageTotal *prometheus.Desc NFSEventVFSReadPagesTotal *prometheus.Desc NFSEventVFSWritePageTotal *prometheus.Desc NFSEventVFSWritePagesTotal *prometheus.Desc NFSEventVFSGetdentsTotal *prometheus.Desc NFSEventVFSSetattrTotal *prometheus.Desc NFSEventVFSFlushTotal *prometheus.Desc NFSEventVFSFsyncTotal *prometheus.Desc NFSEventVFSLockTotal *prometheus.Desc NFSEventVFSFileReleaseTotal *prometheus.Desc NFSEventTruncationTotal *prometheus.Desc NFSEventWriteExtensionTotal *prometheus.Desc NFSEventSillyRenameTotal *prometheus.Desc NFSEventShortReadTotal *prometheus.Desc NFSEventShortWriteTotal *prometheus.Desc NFSEventJukeboxDelayTotal *prometheus.Desc NFSEventPNFSReadTotal *prometheus.Desc NFSEventPNFSWriteTotal *prometheus.Desc proc procfs.Proc } func init() { registerCollector("mountstats", defaultDisabled, NewMountStatsCollector) } // NewMountStatsCollector returns a new Collector exposing NFS statistics. func NewMountStatsCollector() (Collector, error) { fs, err := procfs.NewFS(*procPath) if err != nil { return nil, fmt.Errorf("failed to open procfs: %v", err) } proc, err := fs.Self() if err != nil { return nil, fmt.Errorf("failed to open /proc/self: %v", err) } const ( // For the time being, only NFS statistics are available via this mechanism. subsystem = "mountstats_nfs" ) var ( labels = []string{"export"} opLabels = []string{"export", "operation"} ) return &mountStatsCollector{ NFSAgeSecondsTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "age_seconds_total"), "The age of the NFS mount in seconds.", labels, nil, ), NFSReadBytesTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "read_bytes_total"), "Number of bytes read using the read() syscall.", labels, nil, ), NFSWriteBytesTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "write_bytes_total"), "Number of bytes written using the write() syscall.", labels, nil, ), NFSDirectReadBytesTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "direct_read_bytes_total"), "Number of bytes read using the read() syscall in O_DIRECT mode.", labels, nil, ), NFSDirectWriteBytesTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "direct_write_bytes_total"), "Number of bytes written using the write() syscall in O_DIRECT mode.", labels, nil, ), NFSTotalReadBytesTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "total_read_bytes_total"), "Number of bytes read from the NFS server, in total.", labels, nil, ), NFSTotalWriteBytesTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "total_write_bytes_total"), "Number of bytes written to the NFS server, in total.", labels, nil, ), NFSReadPagesTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "read_pages_total"), "Number of pages read directly via mmap()'d files.", labels, nil, ), NFSWritePagesTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "write_pages_total"), "Number of pages written directly via mmap()'d files.", labels, nil, ), NFSTransportBindTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "transport_bind_total"), "Number of times the client has had to establish a connection from scratch to the NFS server.", labels, nil, ), NFSTransportConnectTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "transport_connect_total"), "Number of times the client has made a TCP connection to the NFS server.", labels, nil, ), NFSTransportIdleTimeSeconds: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "transport_idle_time_seconds"), "Duration since the NFS mount last saw any RPC traffic, in seconds.", labels, nil, ), NFSTransportSendsTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "transport_sends_total"), "Number of RPC requests for this mount sent to the NFS server.", labels, nil, ), NFSTransportReceivesTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "transport_receives_total"), "Number of RPC responses for this mount received from the NFS server.", labels, nil, ), NFSTransportBadTransactionIDsTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "transport_bad_transaction_ids_total"), "Number of times the NFS server sent a response with a transaction ID unknown to this client.", labels, nil, ), NFSTransportBacklogQueueTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "transport_backlog_queue_total"), "Total number of items added to the RPC backlog queue.", labels, nil, ), NFSTransportMaximumRPCSlots: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "transport_maximum_rpc_slots"), "Maximum number of simultaneously active RPC requests ever used.", labels, nil, ), NFSTransportSendingQueueTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "transport_sending_queue_total"), "Total number of items added to the RPC transmission sending queue.", labels, nil, ), NFSTransportPendingQueueTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "transport_pending_queue_total"), "Total number of items added to the RPC transmission pending queue.", labels, nil, ), NFSOperationsRequestsTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "operations_requests_total"), "Number of requests performed for a given operation.", opLabels, nil, ), NFSOperationsTransmissionsTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "operations_transmissions_total"), "Number of times an actual RPC request has been transmitted for a given operation.", opLabels, nil, ), NFSOperationsMajorTimeoutsTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "operations_major_timeouts_total"), "Number of times a request has had a major timeout for a given operation.", opLabels, nil, ), NFSOperationsSentBytesTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "operations_sent_bytes_total"), "Number of bytes sent for a given operation, including RPC headers and payload.", opLabels, nil, ), NFSOperationsReceivedBytesTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "operations_received_bytes_total"), "Number of bytes received for a given operation, including RPC headers and payload.", opLabels, nil, ), NFSOperationsQueueTimeSecondsTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "operations_queue_time_seconds_total"), "Duration all requests spent queued for transmission for a given operation before they were sent, in seconds.", opLabels, nil, ), NFSOperationsResponseTimeSecondsTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "operations_response_time_seconds_total"), "Duration all requests took to get a reply back after a request for a given operation was transmitted, in seconds.", opLabels, nil, ), NFSOperationsRequestTimeSecondsTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "operations_request_time_seconds_total"), "Duration all requests took from when a request was enqueued to when it was completely handled for a given operation, in seconds.", opLabels, nil, ), NFSEventInodeRevalidateTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_inode_revalidate_total"), "Number of times cached inode attributes are re-validated from the server.", labels, nil, ), NFSEventDnodeRevalidateTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_dnode_revalidate_total"), "Number of times cached dentry nodes are re-validated from the server.", labels, nil, ), NFSEventDataInvalidateTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_data_invalidate_total"), "Number of times an inode cache is cleared.", labels, nil, ), NFSEventAttributeInvalidateTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_attribute_invalidate_total"), "Number of times cached inode attributes are invalidated.", labels, nil, ), NFSEventVFSOpenTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_vfs_open_total"), "Number of times cached inode attributes are invalidated.", labels, nil, ), NFSEventVFSLookupTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_vfs_lookup_total"), "Number of times a directory lookup has occurred.", labels, nil, ), NFSEventVFSAccessTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_vfs_access_total"), "Number of times permissions have been checked.", labels, nil, ), NFSEventVFSUpdatePageTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_vfs_update_page_total"), "Number of updates (and potential writes) to pages.", labels, nil, ), NFSEventVFSReadPageTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_vfs_read_page_total"), "Number of pages read directly via mmap()'d files.", labels, nil, ), NFSEventVFSReadPagesTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_vfs_read_pages_total"), "Number of times a group of pages have been read.", labels, nil, ), NFSEventVFSWritePageTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_vfs_write_page_total"), "Number of pages written directly via mmap()'d files.", labels, nil, ), NFSEventVFSWritePagesTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_vfs_write_pages_total"), "Number of times a group of pages have been written.", labels, nil, ), NFSEventVFSGetdentsTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_vfs_getdents_total"), "Number of times directory entries have been read with getdents().", labels, nil, ), NFSEventVFSSetattrTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_vfs_setattr_total"), "Number of times directory entries have been read with getdents().", labels, nil, ), NFSEventVFSFlushTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_vfs_flush_total"), "Number of pending writes that have been forcefully flushed to the server.", labels, nil, ), NFSEventVFSFsyncTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_vfs_fsync_total"), "Number of times fsync() has been called on directories and files.", labels, nil, ), NFSEventVFSLockTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_vfs_lock_total"), "Number of times locking has been attempted on a file.", labels, nil, ), NFSEventVFSFileReleaseTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_vfs_file_release_total"), "Number of times files have been closed and released.", labels, nil, ), NFSEventTruncationTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_truncation_total"), "Number of times files have been truncated.", labels, nil, ), NFSEventWriteExtensionTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_write_extension_total"), "Number of times a file has been grown due to writes beyond its existing end.", labels, nil, ), NFSEventSillyRenameTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_silly_rename_total"), "Number of times a file was removed while still open by another process.", labels, nil, ), NFSEventShortReadTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_short_read_total"), "Number of times the NFS server gave less data than expected while reading.", labels, nil, ), NFSEventShortWriteTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_short_write_total"), "Number of times the NFS server wrote less data than expected while writing.", labels, nil, ), NFSEventJukeboxDelayTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_jukebox_delay_total"), "Number of times the NFS server indicated EJUKEBOX; retrieving data from offline storage.", labels, nil, ), NFSEventPNFSReadTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_pnfs_read_total"), "Number of NFS v4.1+ pNFS reads.", labels, nil, ), NFSEventPNFSWriteTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_pnfs_write_total"), "Number of NFS v4.1+ pNFS writes.", labels, nil, ), proc: proc, }, nil } func (c *mountStatsCollector) Update(ch chan<- prometheus.Metric) error { mounts, err := c.proc.MountStats() if err != nil { return fmt.Errorf("failed to parse mountstats: %v", err) } var deviceList []string for _, m := range mounts { // For the time being, only NFS statistics are available via this mechanism stats, ok := m.Stats.(*procfs.MountStatsNFS) if !ok { continue } sort.Strings(deviceList) i := sort.SearchStrings(deviceList, m.Device) if i < len(deviceList) && deviceList[i] == m.Device { log.Debugf("Skipping duplicate device entry %q", m.Device) } else { deviceList = append(deviceList, m.Device) c.updateNFSStats(ch, m.Device, stats) } } return nil } func (c *mountStatsCollector) updateNFSStats(ch chan<- prometheus.Metric, export string, s *procfs.MountStatsNFS) { ch <- prometheus.MustNewConstMetric( c.NFSAgeSecondsTotal, prometheus.CounterValue, s.Age.Seconds(), export, ) ch <- prometheus.MustNewConstMetric( c.NFSReadBytesTotal, prometheus.CounterValue, float64(s.Bytes.Read), export, ) ch <- prometheus.MustNewConstMetric( c.NFSWriteBytesTotal, prometheus.CounterValue, float64(s.Bytes.Write), export, ) ch <- prometheus.MustNewConstMetric( c.NFSDirectReadBytesTotal, prometheus.CounterValue, float64(s.Bytes.DirectRead), export, ) ch <- prometheus.MustNewConstMetric( c.NFSDirectWriteBytesTotal, prometheus.CounterValue, float64(s.Bytes.DirectWrite), export, ) ch <- prometheus.MustNewConstMetric( c.NFSTotalReadBytesTotal, prometheus.CounterValue, float64(s.Bytes.ReadTotal), export, ) ch <- prometheus.MustNewConstMetric( c.NFSTotalWriteBytesTotal, prometheus.CounterValue, float64(s.Bytes.WriteTotal), export, ) ch <- prometheus.MustNewConstMetric( c.NFSReadPagesTotal, prometheus.CounterValue, float64(s.Bytes.ReadPages), export, ) ch <- prometheus.MustNewConstMetric( c.NFSWritePagesTotal, prometheus.CounterValue, float64(s.Bytes.WritePages), export, ) ch <- prometheus.MustNewConstMetric( c.NFSTransportBindTotal, prometheus.CounterValue, float64(s.Transport.Bind), export, ) ch <- prometheus.MustNewConstMetric( c.NFSTransportConnectTotal, prometheus.CounterValue, float64(s.Transport.Connect), export, ) ch <- prometheus.MustNewConstMetric( c.NFSTransportIdleTimeSeconds, prometheus.GaugeValue, s.Transport.IdleTime.Seconds(), export, ) ch <- prometheus.MustNewConstMetric( c.NFSTransportSendsTotal, prometheus.CounterValue, float64(s.Transport.Sends), export, ) ch <- prometheus.MustNewConstMetric( c.NFSTransportReceivesTotal, prometheus.CounterValue, float64(s.Transport.Receives), export, ) ch <- prometheus.MustNewConstMetric( c.NFSTransportBadTransactionIDsTotal, prometheus.CounterValue, float64(s.Transport.BadTransactionIDs), export, ) ch <- prometheus.MustNewConstMetric( c.NFSTransportBacklogQueueTotal, prometheus.CounterValue, float64(s.Transport.CumulativeBacklog), export, ) ch <- prometheus.MustNewConstMetric( c.NFSTransportMaximumRPCSlots, prometheus.GaugeValue, float64(s.Transport.MaximumRPCSlotsUsed), export, ) ch <- prometheus.MustNewConstMetric( c.NFSTransportSendingQueueTotal, prometheus.CounterValue, float64(s.Transport.CumulativeSendingQueue), export, ) ch <- prometheus.MustNewConstMetric( c.NFSTransportPendingQueueTotal, prometheus.CounterValue, float64(s.Transport.CumulativePendingQueue), export, ) for _, op := range s.Operations { ch <- prometheus.MustNewConstMetric( c.NFSOperationsRequestsTotal, prometheus.CounterValue, float64(op.Requests), export, op.Operation, ) ch <- prometheus.MustNewConstMetric( c.NFSOperationsTransmissionsTotal, prometheus.CounterValue, float64(op.Transmissions), export, op.Operation, ) ch <- prometheus.MustNewConstMetric( c.NFSOperationsMajorTimeoutsTotal, prometheus.CounterValue, float64(op.MajorTimeouts), export, op.Operation, ) ch <- prometheus.MustNewConstMetric( c.NFSOperationsSentBytesTotal, prometheus.CounterValue, float64(op.BytesSent), export, op.Operation, ) ch <- prometheus.MustNewConstMetric( c.NFSOperationsReceivedBytesTotal, prometheus.CounterValue, float64(op.BytesReceived), export, op.Operation, ) ch <- prometheus.MustNewConstMetric( c.NFSOperationsQueueTimeSecondsTotal, prometheus.CounterValue, op.CumulativeQueueTime.Seconds(), export, op.Operation, ) ch <- prometheus.MustNewConstMetric( c.NFSOperationsResponseTimeSecondsTotal, prometheus.CounterValue, op.CumulativeTotalResponseTime.Seconds(), export, op.Operation, ) ch <- prometheus.MustNewConstMetric( c.NFSOperationsRequestTimeSecondsTotal, prometheus.CounterValue, op.CumulativeTotalRequestTime.Seconds(), export, op.Operation, ) } ch <- prometheus.MustNewConstMetric( c.NFSEventInodeRevalidateTotal, prometheus.CounterValue, float64(s.Events.InodeRevalidate), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventDnodeRevalidateTotal, prometheus.CounterValue, float64(s.Events.DnodeRevalidate), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventDataInvalidateTotal, prometheus.CounterValue, float64(s.Events.DataInvalidate), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventAttributeInvalidateTotal, prometheus.CounterValue, float64(s.Events.AttributeInvalidate), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSOpenTotal, prometheus.CounterValue, float64(s.Events.VFSOpen), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSLookupTotal, prometheus.CounterValue, float64(s.Events.VFSLookup), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSAccessTotal, prometheus.CounterValue, float64(s.Events.VFSAccess), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSUpdatePageTotal, prometheus.CounterValue, float64(s.Events.VFSUpdatePage), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSReadPageTotal, prometheus.CounterValue, float64(s.Events.VFSReadPage), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSReadPagesTotal, prometheus.CounterValue, float64(s.Events.VFSReadPages), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSWritePageTotal, prometheus.CounterValue, float64(s.Events.VFSWritePage), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSWritePagesTotal, prometheus.CounterValue, float64(s.Events.VFSWritePages), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSGetdentsTotal, prometheus.CounterValue, float64(s.Events.VFSGetdents), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSSetattrTotal, prometheus.CounterValue, float64(s.Events.VFSSetattr), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSFlushTotal, prometheus.CounterValue, float64(s.Events.VFSFlush), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSFsyncTotal, prometheus.CounterValue, float64(s.Events.VFSFsync), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSLockTotal, prometheus.CounterValue, float64(s.Events.VFSLock), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSFileReleaseTotal, prometheus.CounterValue, float64(s.Events.VFSFileRelease), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventTruncationTotal, prometheus.CounterValue, float64(s.Events.Truncation), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventWriteExtensionTotal, prometheus.CounterValue, float64(s.Events.WriteExtension), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventSillyRenameTotal, prometheus.CounterValue, float64(s.Events.SillyRename), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventShortReadTotal, prometheus.CounterValue, float64(s.Events.ShortRead), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventShortWriteTotal, prometheus.CounterValue, float64(s.Events.ShortWrite), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventJukeboxDelayTotal, prometheus.CounterValue, float64(s.Events.JukeboxDelay), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventPNFSReadTotal, prometheus.CounterValue, float64(s.Events.PNFSRead), export, ) ch <- prometheus.MustNewConstMetric( c.NFSEventPNFSWriteTotal, prometheus.CounterValue, float64(s.Events.PNFSWrite), export, ) } prometheus-node-exporter-0.15.2+ds/collector/netdev_bsd.go000066400000000000000000000045651321450230300236220ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nonetdev // +build freebsd dragonfly package collector import ( "errors" "regexp" "strconv" "github.com/prometheus/common/log" ) /* #cgo CFLAGS: -D_IFI_OQDROPS #include #include #include #include #include */ import "C" func getNetDevStats(ignore *regexp.Regexp) (map[string]map[string]string, error) { netDev := map[string]map[string]string{} var ifap, ifa *C.struct_ifaddrs if C.getifaddrs(&ifap) == -1 { return nil, errors.New("getifaddrs() failed") } defer C.freeifaddrs(ifap) for ifa = ifap; ifa != nil; ifa = ifa.ifa_next { if ifa.ifa_addr.sa_family == C.AF_LINK { dev := C.GoString(ifa.ifa_name) if ignore.MatchString(dev) { log.Debugf("Ignoring device: %s", dev) continue } devStats := map[string]string{} data := (*C.struct_if_data)(ifa.ifa_data) devStats["receive_packets"] = convertFreeBSDCPUTime(uint64(data.ifi_ipackets)) devStats["transmit_packets"] = convertFreeBSDCPUTime(uint64(data.ifi_opackets)) devStats["receive_errs"] = convertFreeBSDCPUTime(uint64(data.ifi_ierrors)) devStats["transmit_errs"] = convertFreeBSDCPUTime(uint64(data.ifi_oerrors)) devStats["receive_bytes"] = convertFreeBSDCPUTime(uint64(data.ifi_ibytes)) devStats["transmit_bytes"] = convertFreeBSDCPUTime(uint64(data.ifi_obytes)) devStats["receive_multicast"] = convertFreeBSDCPUTime(uint64(data.ifi_imcasts)) devStats["transmit_multicast"] = convertFreeBSDCPUTime(uint64(data.ifi_omcasts)) devStats["receive_drop"] = convertFreeBSDCPUTime(uint64(data.ifi_iqdrops)) devStats["transmit_drop"] = convertFreeBSDCPUTime(uint64(data.ifi_oqdrops)) netDev[dev] = devStats } } return netDev, nil } func convertFreeBSDCPUTime(counter uint64) string { return strconv.FormatUint(counter, 10) } prometheus-node-exporter-0.15.2+ds/collector/netdev_bsd_test.go000066400000000000000000000026741321450230300246600ustar00rootroot00000000000000// Copyright 2016 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nonetdev // +build freebsd dragonfly package collector import "testing" type uintToStringTest struct { in uint64 out string } var uinttostringtests = []uintToStringTest{ // Copied base10 values from strconv's tests: {0, "0"}, {1, "1"}, {12345678, "12345678"}, {1<<31 - 1, "2147483647"}, {1 << 31, "2147483648"}, {1<<31 + 1, "2147483649"}, {1<<32 - 1, "4294967295"}, {1 << 32, "4294967296"}, {1<<32 + 1, "4294967297"}, {1 << 50, "1125899906842624"}, {1<<63 - 1, "9223372036854775807"}, // Some values that convert correctly on amd64, but not on i386. {0x1bf0c640a, "7500227594"}, {0xbee5df75, "3202735989"}, } func TestUintToString(t *testing.T) { for _, test := range uinttostringtests { is := convertFreeBSDCPUTime(test.in) if is != test.out { t.Errorf("convertFreeBSDCPUTime(%v) = %v want %v", test.in, is, test.out) } } } prometheus-node-exporter-0.15.2+ds/collector/netdev_common.go000066400000000000000000000044161321450230300243350ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nonetdev // +build linux freebsd openbsd dragonfly darwin package collector import ( "fmt" "regexp" "strconv" "github.com/prometheus/client_golang/prometheus" "gopkg.in/alecthomas/kingpin.v2" ) var ( netdevIgnoredDevices = kingpin.Flag("collector.netdev.ignored-devices", "Regexp of net devices to ignore for netdev collector.").Default("^$").String() ) type netDevCollector struct { subsystem string ignoredDevicesPattern *regexp.Regexp metricDescs map[string]*prometheus.Desc } func init() { registerCollector("netdev", defaultEnabled, NewNetDevCollector) } // NewNetDevCollector returns a new Collector exposing network device stats. func NewNetDevCollector() (Collector, error) { pattern := regexp.MustCompile(*netdevIgnoredDevices) return &netDevCollector{ subsystem: "network", ignoredDevicesPattern: pattern, metricDescs: map[string]*prometheus.Desc{}, }, nil } func (c *netDevCollector) Update(ch chan<- prometheus.Metric) error { netDev, err := getNetDevStats(c.ignoredDevicesPattern) if err != nil { return fmt.Errorf("couldn't get netstats: %s", err) } for dev, devStats := range netDev { for key, value := range devStats { desc, ok := c.metricDescs[key] if !ok { desc = prometheus.NewDesc( prometheus.BuildFQName(namespace, c.subsystem, key), fmt.Sprintf("Network device statistic %s.", key), []string{"device"}, nil, ) c.metricDescs[key] = desc } v, err := strconv.ParseFloat(value, 64) if err != nil { return fmt.Errorf("invalid value %s in netstats: %s", value, err) } ch <- prometheus.MustNewConstMetric(desc, prometheus.GaugeValue, v, dev) } } return nil } prometheus-node-exporter-0.15.2+ds/collector/netdev_darwin.go000066400000000000000000000041101321450230300243200ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nonetdev package collector import ( "errors" "regexp" "strconv" "github.com/prometheus/common/log" ) /* #include #include #include #include #include */ import "C" func getNetDevStats(ignore *regexp.Regexp) (map[string]map[string]string, error) { netDev := map[string]map[string]string{} var ifap, ifa *C.struct_ifaddrs if C.getifaddrs(&ifap) == -1 { return nil, errors.New("getifaddrs() failed") } defer C.freeifaddrs(ifap) for ifa = ifap; ifa != nil; ifa = ifa.ifa_next { if ifa.ifa_addr.sa_family == C.AF_LINK { dev := C.GoString(ifa.ifa_name) if ignore.MatchString(dev) { log.Debugf("Ignoring device: %s", dev) continue } devStats := map[string]string{} data := (*C.struct_if_data)(ifa.ifa_data) devStats["receive_packets"] = strconv.FormatUint(uint64(data.ifi_ipackets), 10) devStats["transmit_packets"] = strconv.FormatUint(uint64(data.ifi_opackets), 10) devStats["receive_errs"] = strconv.FormatUint(uint64(data.ifi_ierrors), 10) devStats["transmit_errs"] = strconv.FormatUint(uint64(data.ifi_oerrors), 10) devStats["receive_bytes"] = strconv.FormatUint(uint64(data.ifi_ibytes), 10) devStats["transmit_bytes"] = strconv.FormatUint(uint64(data.ifi_obytes), 10) devStats["receive_multicast"] = strconv.FormatUint(uint64(data.ifi_imcasts), 10) devStats["transmit_multicast"] = strconv.FormatUint(uint64(data.ifi_omcasts), 10) netDev[dev] = devStats } } return netDev, nil } prometheus-node-exporter-0.15.2+ds/collector/netdev_linux.go000066400000000000000000000037511321450230300242050ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nonetdev package collector import ( "bufio" "fmt" "io" "os" "regexp" "strings" "github.com/prometheus/common/log" ) var ( procNetDevFieldSep = regexp.MustCompile("[ :] *") ) func getNetDevStats(ignore *regexp.Regexp) (map[string]map[string]string, error) { file, err := os.Open(procFilePath("net/dev")) if err != nil { return nil, err } defer file.Close() return parseNetDevStats(file, ignore) } func parseNetDevStats(r io.Reader, ignore *regexp.Regexp) (map[string]map[string]string, error) { scanner := bufio.NewScanner(r) scanner.Scan() // skip first header scanner.Scan() parts := strings.Split(scanner.Text(), "|") if len(parts) != 3 { // interface + receive + transmit return nil, fmt.Errorf("invalid header line in net/dev: %s", scanner.Text()) } header := strings.Fields(parts[1]) netDev := map[string]map[string]string{} for scanner.Scan() { line := strings.TrimLeft(scanner.Text(), " ") parts := procNetDevFieldSep.Split(line, -1) if len(parts) != 2*len(header)+1 { return nil, fmt.Errorf("invalid line in net/dev: %s", scanner.Text()) } dev := parts[0][:len(parts[0])] if ignore.MatchString(dev) { log.Debugf("Ignoring device: %s", dev) continue } netDev[dev] = map[string]string{} for i, v := range header { netDev[dev]["receive_"+v] = parts[i+1] netDev[dev]["transmit_"+v] = parts[i+1+len(header)] } } return netDev, scanner.Err() } prometheus-node-exporter-0.15.2+ds/collector/netdev_linux_test.go000066400000000000000000000030621321450230300252370ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "os" "regexp" "testing" ) func TestNetDevStats(t *testing.T) { file, err := os.Open("fixtures/proc/net/dev") if err != nil { t.Fatal(err) } defer file.Close() netStats, err := parseNetDevStats(file, regexp.MustCompile("^veth")) if err != nil { t.Fatal(err) } if want, got := "10437182923", netStats["wlan0"]["receive_bytes"]; want != got { t.Errorf("want netstat wlan0 bytes %s, got %s", want, got) } if want, got := "68210035552", netStats["eth0"]["receive_bytes"]; want != got { t.Errorf("want netstat eth0 bytes %s, got %s", want, got) } if want, got := "934", netStats["tun0"]["transmit_packets"]; want != got { t.Errorf("want netstat tun0 packets %s, got %s", want, got) } if want, got := 6, len(netStats); want != got { t.Errorf("want count of devices to be %d, got %d", want, got) } if _, ok := netStats["veth4B09XN"]["transmit_bytes"]; ok { t.Error("want fixture interface veth4B09XN to not exist, but it does") } } prometheus-node-exporter-0.15.2+ds/collector/netdev_openbsd.go000066400000000000000000000040201321450230300244660ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nonetdev package collector import ( "errors" "regexp" "strconv" "github.com/prometheus/common/log" ) /* #include #include #include #include */ import "C" func getNetDevStats(ignore *regexp.Regexp) (map[string]map[string]string, error) { netDev := map[string]map[string]string{} var ifap, ifa *C.struct_ifaddrs if C.getifaddrs(&ifap) == -1 { return nil, errors.New("getifaddrs() failed") } defer C.freeifaddrs(ifap) for ifa = ifap; ifa != nil; ifa = ifa.ifa_next { if ifa.ifa_addr.sa_family == C.AF_LINK { dev := C.GoString(ifa.ifa_name) if ignore.MatchString(dev) { log.Debugf("Ignoring device: %s", dev) continue } devStats := map[string]string{} data := (*C.struct_if_data)(ifa.ifa_data) devStats["receive_packets"] = strconv.Itoa(int(data.ifi_ipackets)) devStats["transmit_packets"] = strconv.Itoa(int(data.ifi_opackets)) devStats["receive_errs"] = strconv.Itoa(int(data.ifi_ierrors)) devStats["transmit_errs"] = strconv.Itoa(int(data.ifi_oerrors)) devStats["receive_bytes"] = strconv.Itoa(int(data.ifi_ibytes)) devStats["transmit_bytes"] = strconv.Itoa(int(data.ifi_obytes)) devStats["receive_multicast"] = strconv.Itoa(int(data.ifi_imcasts)) devStats["transmit_multicast"] = strconv.Itoa(int(data.ifi_omcasts)) devStats["receive_drop"] = strconv.Itoa(int(data.ifi_iqdrops)) netDev[dev] = devStats } } return netDev, nil } prometheus-node-exporter-0.15.2+ds/collector/netstat_linux.go000066400000000000000000000101411321450230300243710ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nonetstat package collector import ( "bufio" "fmt" "io" "os" "strconv" "strings" "github.com/prometheus/client_golang/prometheus" ) const ( netStatsSubsystem = "netstat" ) type netStatCollector struct{} func init() { registerCollector("netstat", defaultEnabled, NewNetStatCollector) } // NewNetStatCollector takes and returns // a new Collector exposing network stats. func NewNetStatCollector() (Collector, error) { return &netStatCollector{}, nil } func (c *netStatCollector) Update(ch chan<- prometheus.Metric) error { netStats, err := getNetStats(procFilePath("net/netstat")) if err != nil { return fmt.Errorf("couldn't get netstats: %s", err) } snmpStats, err := getNetStats(procFilePath("net/snmp")) if err != nil { return fmt.Errorf("couldn't get SNMP stats: %s", err) } snmp6Stats, err := getSNMP6Stats(procFilePath("net/snmp6")) if err != nil { return fmt.Errorf("couldn't get SNMP6 stats: %s", err) } // Merge the results of snmpStats into netStats (collisions are possible, but // we know that the keys are always unique for the given use case). for k, v := range snmpStats { netStats[k] = v } for k, v := range snmp6Stats { netStats[k] = v } for protocol, protocolStats := range netStats { for name, value := range protocolStats { key := protocol + "_" + name v, err := strconv.ParseFloat(value, 64) if err != nil { return fmt.Errorf("invalid value %s in netstats: %s", value, err) } ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, netStatsSubsystem, key), fmt.Sprintf("Statistic %s.", protocol+name), nil, nil, ), prometheus.UntypedValue, v, ) } } return nil } func getNetStats(fileName string) (map[string]map[string]string, error) { file, err := os.Open(fileName) if err != nil { return nil, err } defer file.Close() return parseNetStats(file, fileName) } func parseNetStats(r io.Reader, fileName string) (map[string]map[string]string, error) { var ( netStats = map[string]map[string]string{} scanner = bufio.NewScanner(r) ) for scanner.Scan() { nameParts := strings.Split(scanner.Text(), " ") scanner.Scan() valueParts := strings.Split(scanner.Text(), " ") // Remove trailing :. protocol := nameParts[0][:len(nameParts[0])-1] netStats[protocol] = map[string]string{} if len(nameParts) != len(valueParts) { return nil, fmt.Errorf("mismatch field count mismatch in %s: %s", fileName, protocol) } for i := 1; i < len(nameParts); i++ { netStats[protocol][nameParts[i]] = valueParts[i] } } return netStats, scanner.Err() } func getSNMP6Stats(fileName string) (map[string]map[string]string, error) { file, err := os.Open(fileName) if err != nil { // On systems with IPv6 disabled, this file won't exist. // Do nothing. if os.IsNotExist(err) { return nil, nil } return nil, err } defer file.Close() return parseSNMP6Stats(file) } func parseSNMP6Stats(r io.Reader) (map[string]map[string]string, error) { var ( netStats = map[string]map[string]string{} scanner = bufio.NewScanner(r) ) for scanner.Scan() { stat := strings.Fields(scanner.Text()) if len(stat) < 2 { continue } // Expect to have "6" in metric name, skip line otherwise if sixIndex := strings.Index(stat[0], "6"); sixIndex != -1 { protocol := stat[0][:sixIndex+1] name := stat[0][sixIndex+1:] if _, present := netStats[protocol]; !present { netStats[protocol] = map[string]string{} } netStats[protocol][name] = stat[1] } } return netStats, scanner.Err() } prometheus-node-exporter-0.15.2+ds/collector/netstat_linux_test.go000066400000000000000000000033561321450230300254420ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "os" "testing" ) func TestNetStats(t *testing.T) { testNetStats(t, "fixtures/proc/net/netstat") testSNMP6Stats(t, "fixtures/proc/net/snmp6") } func testNetStats(t *testing.T, fileName string) { file, err := os.Open(fileName) if err != nil { t.Fatal(err) } defer file.Close() netStats, err := parseNetStats(file, fileName) if err != nil { t.Fatal(err) } if want, got := "102471", netStats["TcpExt"]["DelayedACKs"]; want != got { t.Errorf("want netstat TCP DelayedACKs %s, got %s", want, got) } if want, got := "2786264347", netStats["IpExt"]["OutOctets"]; want != got { t.Errorf("want netstat IP OutOctets %s, got %s", want, got) } } func testSNMP6Stats(t *testing.T, fileName string) { file, err := os.Open(fileName) if err != nil { t.Fatal(err) } defer file.Close() snmp6Stats, err := parseSNMP6Stats(file) if err != nil { t.Fatal(err) } if want, got := "460", snmp6Stats["Ip6"]["InOctets"]; want != got { t.Errorf("want netstat IPv6 InOctets %s, got %s", want, got) } if want, got := "8", snmp6Stats["Icmp6"]["OutMsgs"]; want != got { t.Errorf("want netstat ICPM6 OutMsgs %s, got %s", want, got) } } prometheus-node-exporter-0.15.2+ds/collector/nfs_linux.go000066400000000000000000000127221321450230300235040ustar00rootroot00000000000000// Copyright 2016 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "errors" "io/ioutil" "os" "regexp" "strconv" "strings" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" ) var ( netLineRE = regexp.MustCompile(`^net \d+ (\d+) (\d+) (\d+)$`) rpcLineRE = regexp.MustCompile(`^rpc (\d+) (\d+) (\d+)$`) procLineRE = regexp.MustCompile(`^proc(\d+) \d+ (\d+( \d+)*)$`) nfsProcedures = map[string][]string{ "2": { "null", "getattr", "setattr", "root", "lookup", "readlink", "read", "writecache", "write", "create", "remove", "rename", "link", "symlink", "mkdir", "rmdir", "readdir", "statfs", }, "3": { "null", "getattr", "setattr", "lookup", "access", "readlink", "read", "write", "create", "mkdir", "symlink", "mknod", "remove", "rmdir", "rename", "link", "readdir", "readdirplus", "fsstat", "fsinfo", "pathconf", "commit", }, "4": { "null", "read", "write", "commit", "open", "open_confirm", "open_noattr", "open_downgrade", "close", "setattr", "fsinfo", "renew", "setclientid", "setclientid_confirm", "lock", "lockt", "locku", "access", "getattr", "lookup", "lookup_root", "remove", "rename", "link", "symlink", "create", "pathconf", "statfs", "readlink", "readdir", "server_caps", "delegreturn", "getacl", "setacl", "fs_locations", "release_lockowner", "secinfo", "fsid_present", "exchange_id", "create_session", "destroy_session", "sequence", "get_lease_time", "reclaim_complete", "layoutget", "getdeviceinfo", "layoutcommit", "layoutreturn", "secinfo_no_name", "test_stateid", "free_stateid", "getdevicelist", "bind_conn_to_session", "destroy_clientid", "seek", "allocate", "deallocate", "layoutstats", "clone", "copy", }, } nfsNetReadsDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, "nfs", "net_reads"), "Number of reads at the network layer.", []string{"protocol"}, nil, ) nfsNetConnectionsDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, "nfs", "net_connections"), "Number of connections at the network layer.", []string{"protocol"}, nil, ) nfsRPCOperationsDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, "nfs", "rpc_operations"), "Number of RPCs performed.", nil, nil, ) nfsRPCRetransmissionsDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, "nfs", "rpc_retransmissions"), "Number of RPC transmissions performed.", nil, nil, ) nfsRPCAuthenticationRefreshesDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, "nfs", "rpc_authentication_refreshes"), "Number of RPC authentication refreshes performed.", nil, nil, ) nfsProceduresDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, "nfs", "procedures"), "Number of NFS procedures invoked.", []string{"version", "procedure"}, nil, ) ) type nfsCollector struct{} func init() { registerCollector("nfs", defaultDisabled, NewNfsCollector) } // NewNfsCollector returns a new Collector exposing NFS statistics. func NewNfsCollector() (Collector, error) { return &nfsCollector{}, nil } func (c *nfsCollector) Update(ch chan<- prometheus.Metric) error { statsFile := procFilePath("net/rpc/nfs") content, err := ioutil.ReadFile(statsFile) if err != nil { if os.IsNotExist(err) { log.Debugf("Not collecting NFS statistics, as %q does not exist", statsFile) return nil } return err } for _, line := range strings.Split(string(content), "\n") { if fields := netLineRE.FindStringSubmatch(line); fields != nil { value, _ := strconv.ParseFloat(fields[1], 64) ch <- prometheus.MustNewConstMetric( nfsNetReadsDesc, prometheus.CounterValue, value, "udp") value, _ = strconv.ParseFloat(fields[2], 64) ch <- prometheus.MustNewConstMetric( nfsNetReadsDesc, prometheus.CounterValue, value, "tcp") value, _ = strconv.ParseFloat(fields[3], 64) ch <- prometheus.MustNewConstMetric( nfsNetConnectionsDesc, prometheus.CounterValue, value, "tcp") } else if fields := rpcLineRE.FindStringSubmatch(line); fields != nil { value, _ := strconv.ParseFloat(fields[1], 64) ch <- prometheus.MustNewConstMetric( nfsRPCOperationsDesc, prometheus.CounterValue, value) value, _ = strconv.ParseFloat(fields[2], 64) ch <- prometheus.MustNewConstMetric( nfsRPCRetransmissionsDesc, prometheus.CounterValue, value) value, _ = strconv.ParseFloat(fields[3], 64) ch <- prometheus.MustNewConstMetric( nfsRPCAuthenticationRefreshesDesc, prometheus.CounterValue, value) } else if fields := procLineRE.FindStringSubmatch(line); fields != nil { version := fields[1] for procedure, count := range strings.Split(fields[2], " ") { value, _ := strconv.ParseFloat(count, 64) ch <- prometheus.MustNewConstMetric( nfsProceduresDesc, prometheus.CounterValue, value, version, nfsProcedures[version][procedure]) } } else if line != "" { return errors.New("Failed to parse line: " + line) } } return nil } prometheus-node-exporter-0.15.2+ds/collector/ntp.go000066400000000000000000000141241321450230300222760ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nontp package collector import ( "fmt" "net" "time" "github.com/beevik/ntp" "github.com/prometheus/client_golang/prometheus" "gopkg.in/alecthomas/kingpin.v2" ) const ( hour24 = 24 * time.Hour // `time` does not export `Day` as Day != 24h because of DST ntpSubsystem = "ntp" ) var ( ntpServer = kingpin.Flag("collector.ntp.server", "NTP server to use for ntp collector").Default("127.0.0.1").String() ntpProtocolVersion = kingpin.Flag("collector.ntp.protocol-version", "NTP protocol version").Default("4").Int() ntpServerIsLocal = kingpin.Flag("collector.ntp.server-is-local", "Certify that collector.ntp.server address is the same local host as this collector.").Default("false").Bool() ntpIPTTL = kingpin.Flag("collector.ntp.ip-ttl", "IP TTL to use while sending NTP query").Default("1").Int() // 3.46608s ~ 1.5s + PHI * (1 << maxPoll), where 1.5s is MAXDIST from ntp.org, it is 1.0 in RFC5905 // max-distance option is used as-is without phi*(1< 4 { return nil, fmt.Errorf("invalid NTP protocol version %d; must be 2, 3, or 4", *ntpProtocolVersion) } if *ntpOffsetTolerance < 0 { return nil, fmt.Errorf("Offset tolerance must be non-negative") } return &ntpCollector{ stratum: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, ntpSubsystem, "stratum"), "NTPD stratum.", nil, nil, ), prometheus.GaugeValue}, leap: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, ntpSubsystem, "leap"), "NTPD leap second indicator, 2 bits.", nil, nil, ), prometheus.GaugeValue}, rtt: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, ntpSubsystem, "rtt_seconds"), "RTT to NTPD.", nil, nil, ), prometheus.GaugeValue}, offset: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, ntpSubsystem, "offset_seconds"), "ClockOffset between NTP and local clock.", nil, nil, ), prometheus.GaugeValue}, reftime: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, ntpSubsystem, "reference_timestamp_seconds"), "NTPD ReferenceTime, UNIX timestamp.", nil, nil, ), prometheus.GaugeValue}, rootDelay: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, ntpSubsystem, "root_delay_seconds"), "NTPD RootDelay.", nil, nil, ), prometheus.GaugeValue}, rootDispersion: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, ntpSubsystem, "root_dispersion_seconds"), "NTPD RootDispersion.", nil, nil, ), prometheus.GaugeValue}, sanity: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, ntpSubsystem, "sanity"), "NTPD sanity according to RFC5905 heuristics and configured limits.", nil, nil, ), prometheus.GaugeValue}, }, nil } func (c *ntpCollector) Update(ch chan<- prometheus.Metric) error { resp, err := ntp.QueryWithOptions(*ntpServer, ntp.QueryOptions{ Version: *ntpProtocolVersion, TTL: *ntpIPTTL, Timeout: time.Second, // default `ntpdate` timeout }) if err != nil { return fmt.Errorf("couldn't get SNTP reply: %s", err) } ch <- c.stratum.mustNewConstMetric(float64(resp.Stratum)) ch <- c.leap.mustNewConstMetric(float64(resp.Leap)) ch <- c.rtt.mustNewConstMetric(resp.RTT.Seconds()) ch <- c.offset.mustNewConstMetric(resp.ClockOffset.Seconds()) if resp.ReferenceTime.Unix() > 0 { // Go Zero is 0001-01-01 00:00:00 UTC // NTP Zero is 1900-01-01 00:00:00 UTC // UNIX Zero is 1970-01-01 00:00:00 UTC // so let's keep ALL ancient `reftime` values as zero ch <- c.reftime.mustNewConstMetric(float64(resp.ReferenceTime.UnixNano()) / 1e9) } else { ch <- c.reftime.mustNewConstMetric(0) } ch <- c.rootDelay.mustNewConstMetric(resp.RootDelay.Seconds()) ch <- c.rootDispersion.mustNewConstMetric(resp.RootDispersion.Seconds()) // Here is SNTP packet sanity check that is exposed to move burden of // configuration from node_exporter user to the developer. maxerr := *ntpOffsetTolerance if resp.Leap == ntp.LeapAddSecond || resp.Leap == ntp.LeapDelSecond { // state of leapMidnight is cached as leap flag is dropped right after midnight leapMidnight = resp.Time.Truncate(hour24).Add(hour24) } if leapMidnight.Add(-hour24).Before(resp.Time) && resp.Time.Before(leapMidnight.Add(hour24)) { // tolerate leap smearing maxerr += time.Second } if resp.Validate() == nil && resp.RootDistance <= *ntpMaxDistance && resp.MinError <= maxerr { ch <- c.sanity.mustNewConstMetric(1) } else { ch <- c.sanity.mustNewConstMetric(0) } return nil } prometheus-node-exporter-0.15.2+ds/collector/paths.go000066400000000000000000000021001321450230300226030ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "path" "github.com/prometheus/procfs" "gopkg.in/alecthomas/kingpin.v2" ) var ( // The path of the proc filesystem. procPath = kingpin.Flag("path.procfs", "procfs mountpoint.").Default(procfs.DefaultMountPoint).String() sysPath = kingpin.Flag("path.sysfs", "sysfs mountpoint.").Default("/sys").String() ) func procFilePath(name string) string { return path.Join(*procPath, name) } func sysFilePath(name string) string { return path.Join(*sysPath, name) } prometheus-node-exporter-0.15.2+ds/collector/paths_test.go000066400000000000000000000045231321450230300236550ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "testing" "github.com/prometheus/procfs" "gopkg.in/alecthomas/kingpin.v2" ) func TestDefaultProcPath(t *testing.T) { if _, err := kingpin.CommandLine.Parse([]string{"--path.procfs", procfs.DefaultMountPoint}); err != nil { t.Fatal(err) } if got, want := procFilePath("somefile"), "/proc/somefile"; got != want { t.Errorf("Expected: %s, Got: %s", want, got) } if got, want := procFilePath("some/file"), "/proc/some/file"; got != want { t.Errorf("Expected: %s, Got: %s", want, got) } } func TestCustomProcPath(t *testing.T) { if _, err := kingpin.CommandLine.Parse([]string{"--path.procfs", "./../some/./place/"}); err != nil { t.Fatal(err) } if got, want := procFilePath("somefile"), "../some/place/somefile"; got != want { t.Errorf("Expected: %s, Got: %s", want, got) } if got, want := procFilePath("some/file"), "../some/place/some/file"; got != want { t.Errorf("Expected: %s, Got: %s", want, got) } } func TestDefaultSysPath(t *testing.T) { if _, err := kingpin.CommandLine.Parse([]string{"--path.sysfs", "/sys"}); err != nil { t.Fatal(err) } if got, want := sysFilePath("somefile"), "/sys/somefile"; got != want { t.Errorf("Expected: %s, Got: %s", want, got) } if got, want := sysFilePath("some/file"), "/sys/some/file"; got != want { t.Errorf("Expected: %s, Got: %s", want, got) } } func TestCustomSysPath(t *testing.T) { if _, err := kingpin.CommandLine.Parse([]string{"--path.sysfs", "./../some/./place/"}); err != nil { t.Fatal(err) } if got, want := sysFilePath("somefile"), "../some/place/somefile"; got != want { t.Errorf("Expected: %s, Got: %s", want, got) } if got, want := sysFilePath("some/file"), "../some/place/some/file"; got != want { t.Errorf("Expected: %s, Got: %s", want, got) } } prometheus-node-exporter-0.15.2+ds/collector/qdisc_linux.go000066400000000000000000000065101321450230300240170ustar00rootroot00000000000000// Copyright 2017 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !noqdisc package collector import ( "encoding/json" "io/ioutil" "path/filepath" "github.com/ema/qdisc" "github.com/prometheus/client_golang/prometheus" "gopkg.in/alecthomas/kingpin.v2" ) type qdiscStatCollector struct { bytes typedDesc packets typedDesc drops typedDesc requeues typedDesc overlimits typedDesc } var ( collectorQdisc = kingpin.Flag("collector.qdisc.fixtures", "test fixtures to use for qdisc collector end-to-end testing").Default("").String() ) func init() { registerCollector("qdisc", defaultDisabled, NewQdiscStatCollector) } func NewQdiscStatCollector() (Collector, error) { return &qdiscStatCollector{ bytes: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, "qdisc", "bytes_total"), "Number of bytes sent.", []string{"device", "kind"}, nil, ), prometheus.CounterValue}, packets: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, "qdisc", "packets_total"), "Number of packets sent.", []string{"device", "kind"}, nil, ), prometheus.CounterValue}, drops: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, "qdisc", "drops_total"), "Number of packets dropped.", []string{"device", "kind"}, nil, ), prometheus.CounterValue}, requeues: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, "qdisc", "requeues_total"), "Number of packets dequeued, not transmitted, and requeued.", []string{"device", "kind"}, nil, ), prometheus.CounterValue}, overlimits: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, "qdisc", "overlimits_total"), "Number of overlimit packets.", []string{"device", "kind"}, nil, ), prometheus.CounterValue}, }, nil } func testQdiscGet(fixtures string) ([]qdisc.QdiscInfo, error) { var res []qdisc.QdiscInfo b, err := ioutil.ReadFile(filepath.Join(fixtures, "results.json")) if err != nil { return res, err } err = json.Unmarshal(b, &res) return res, err } func (c *qdiscStatCollector) Update(ch chan<- prometheus.Metric) error { var msgs []qdisc.QdiscInfo var err error fixtures := *collectorQdisc if fixtures == "" { msgs, err = qdisc.Get() } else { msgs, err = testQdiscGet(fixtures) } if err != nil { return err } for _, msg := range msgs { // Only report root qdisc information. if msg.Parent != 0 { continue } ch <- c.bytes.mustNewConstMetric(float64(msg.Bytes), msg.IfaceName, msg.Kind) ch <- c.packets.mustNewConstMetric(float64(msg.Packets), msg.IfaceName, msg.Kind) ch <- c.drops.mustNewConstMetric(float64(msg.Drops), msg.IfaceName, msg.Kind) ch <- c.requeues.mustNewConstMetric(float64(msg.Requeues), msg.IfaceName, msg.Kind) ch <- c.overlimits.mustNewConstMetric(float64(msg.Overlimits), msg.IfaceName, msg.Kind) } return nil } prometheus-node-exporter-0.15.2+ds/collector/runit.go000066400000000000000000000060471321450230300226430ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !norunit package collector import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" "github.com/soundcloud/go-runit/runit" "gopkg.in/alecthomas/kingpin.v2" ) var runitServiceDir = kingpin.Flag("collector.runit.servicedir", "Path to runit service directory.").Default("/etc/service").String() type runitCollector struct { state, stateDesired, stateNormal, stateTimestamp typedDesc } func init() { registerCollector("runit", defaultDisabled, NewRunitCollector) } // NewRunitCollector returns a new Collector exposing runit statistics. func NewRunitCollector() (Collector, error) { var ( subsystem = "service" constLabels = prometheus.Labels{"supervisor": "runit"} labelNames = []string{"service"} ) return &runitCollector{ state: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "state"), "State of runit service.", labelNames, constLabels, ), prometheus.GaugeValue}, stateDesired: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "desired_state"), "Desired state of runit service.", labelNames, constLabels, ), prometheus.GaugeValue}, stateNormal: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "normal_state"), "Normal state of runit service.", labelNames, constLabels, ), prometheus.GaugeValue}, stateTimestamp: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "state_last_change_timestamp_seconds"), "Unix timestamp of the last runit service state change.", labelNames, constLabels, ), prometheus.GaugeValue}, }, nil } func (c *runitCollector) Update(ch chan<- prometheus.Metric) error { services, err := runit.GetServices(*runitServiceDir) if err != nil { return err } for _, service := range services { status, err := service.Status() if err != nil { log.Debugf("Couldn't get status for %s: %s, skipping...", service.Name, err) continue } log.Debugf("%s is %d on pid %d for %d seconds", service.Name, status.State, status.Pid, status.Duration) ch <- c.state.mustNewConstMetric(float64(status.State), service.Name) ch <- c.stateDesired.mustNewConstMetric(float64(status.Want), service.Name) ch <- c.stateTimestamp.mustNewConstMetric(float64(status.Timestamp.Unix()), service.Name) if status.NormallyUp { ch <- c.stateNormal.mustNewConstMetric(1, service.Name) } else { ch <- c.stateNormal.mustNewConstMetric(0, service.Name) } } return nil } prometheus-node-exporter-0.15.2+ds/collector/sockstat_linux.go000066400000000000000000000065331321450230300245540ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nosockstat package collector import ( "bufio" "fmt" "io" "os" "strconv" "strings" "github.com/prometheus/client_golang/prometheus" ) const ( sockStatSubsystem = "sockstat" ) // Used for calculating the total memory bytes on TCP and UDP. var pageSize = os.Getpagesize() type sockStatCollector struct{} func init() { registerCollector(sockStatSubsystem, defaultEnabled, NewSockStatCollector) } // NewSockStatCollector returns a new Collector exposing socket stats. func NewSockStatCollector() (Collector, error) { return &sockStatCollector{}, nil } func (c *sockStatCollector) Update(ch chan<- prometheus.Metric) error { sockStats, err := getSockStats(procFilePath("net/sockstat")) if err != nil { return fmt.Errorf("couldn't get sockstats: %s", err) } for protocol, protocolStats := range sockStats { for name, value := range protocolStats { v, err := strconv.ParseFloat(value, 64) if err != nil { return fmt.Errorf("invalid value %s in sockstats: %s", value, err) } ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, sockStatSubsystem, protocol+"_"+name), fmt.Sprintf("Number of %s sockets in state %s.", protocol, name), nil, nil, ), prometheus.GaugeValue, v, ) } } return err } func getSockStats(fileName string) (map[string]map[string]string, error) { file, err := os.Open(fileName) if err != nil { return nil, err } defer file.Close() return parseSockStats(file, fileName) } func parseSockStats(r io.Reader, fileName string) (map[string]map[string]string, error) { var ( sockStat = map[string]map[string]string{} scanner = bufio.NewScanner(r) ) for scanner.Scan() { line := strings.Split(scanner.Text(), " ") // Remove trailing ':'. protocol := line[0][:len(line[0])-1] sockStat[protocol] = map[string]string{} for i := 1; i < len(line) && i+1 < len(line); i++ { sockStat[protocol][line[i]] = line[i+1] i++ } } if err := scanner.Err(); err != nil { return nil, err } // The mem metrics is the count of pages used. Multiply the mem metrics by // the page size from the kernel to get the number of bytes used. // // Update the TCP mem from page count to bytes. pageCount, err := strconv.Atoi(sockStat["TCP"]["mem"]) if err != nil { return nil, fmt.Errorf("invalid value %s in sockstats: %s", sockStat["TCP"]["mem"], err) } sockStat["TCP"]["mem_bytes"] = strconv.Itoa(pageCount * pageSize) // Update the UDP mem from page count to bytes. if udpMem := sockStat["UDP"]["mem"]; udpMem != "" { pageCount, err = strconv.Atoi(udpMem) if err != nil { return nil, fmt.Errorf("invalid value %s in sockstats: %s", sockStat["UDP"]["mem"], err) } sockStat["UDP"]["mem_bytes"] = strconv.Itoa(pageCount * pageSize) } return sockStat, nil } prometheus-node-exporter-0.15.2+ds/collector/sockstat_linux_test.go000066400000000000000000000034561321450230300256140ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "os" "strconv" "testing" ) func TestSockStats(t *testing.T) { testSockStats(t, "fixtures/proc/net/sockstat") testSockStats(t, "fixtures/proc/net/sockstat_rhe4") } func testSockStats(t *testing.T, fixture string) { file, err := os.Open(fixture) if err != nil { t.Fatal(err) } defer file.Close() sockStats, err := parseSockStats(file, fixture) if err != nil { t.Fatal(err) } if want, got := "229", sockStats["sockets"]["used"]; want != got { t.Errorf("want sockstat sockets used %s, got %s", want, got) } if want, got := "4", sockStats["TCP"]["tw"]; want != got { t.Errorf("want sockstat TCP tw %s, got %s", want, got) } if want, got := "17", sockStats["TCP"]["alloc"]; want != got { t.Errorf("want sockstat TCP alloc %s, got %s", want, got) } // The test file has 1 for TCP mem, which is one page. So we should get the // page size in bytes back from sockstat_linux. We get the page size from // os here because this value can change from system to system. The value is // 4096 by default from linux 2.4 onward. if want, got := strconv.Itoa(os.Getpagesize()), sockStats["TCP"]["mem_bytes"]; want != got { t.Errorf("want sockstat TCP mem_bytes %s, got %s", want, got) } } prometheus-node-exporter-0.15.2+ds/collector/stat_linux.go000066400000000000000000000062021321450230300236650ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nostat package collector import ( "fmt" "github.com/prometheus/procfs" "github.com/prometheus/client_golang/prometheus" ) type statCollector struct { cpu *prometheus.Desc intr *prometheus.Desc ctxt *prometheus.Desc forks *prometheus.Desc btime *prometheus.Desc procsRunning *prometheus.Desc procsBlocked *prometheus.Desc } func init() { registerCollector("stat", defaultEnabled, NewStatCollector) } // NewStatCollector returns a new Collector exposing kernel/system statistics. func NewStatCollector() (Collector, error) { return &statCollector{ cpu: prometheus.NewDesc( prometheus.BuildFQName(namespace, "", "cpu"), "Seconds the cpus spent in each mode.", []string{"cpu", "mode"}, nil, ), intr: prometheus.NewDesc( prometheus.BuildFQName(namespace, "", "intr"), "Total number of interrupts serviced.", nil, nil, ), ctxt: prometheus.NewDesc( prometheus.BuildFQName(namespace, "", "context_switches"), "Total number of context switches.", nil, nil, ), forks: prometheus.NewDesc( prometheus.BuildFQName(namespace, "", "forks"), "Total number of forks.", nil, nil, ), btime: prometheus.NewDesc( prometheus.BuildFQName(namespace, "", "boot_time"), "Node boot time, in unixtime.", nil, nil, ), procsRunning: prometheus.NewDesc( prometheus.BuildFQName(namespace, "", "procs_running"), "Number of processes in runnable state.", nil, nil, ), procsBlocked: prometheus.NewDesc( prometheus.BuildFQName(namespace, "", "procs_blocked"), "Number of processes blocked waiting for I/O to complete.", nil, nil, ), }, nil } // Update implements Collector and exposes kernel and system statistics. func (c *statCollector) Update(ch chan<- prometheus.Metric) error { fs, err := procfs.NewFS(*procPath) if err != nil { return fmt.Errorf("failed to open procfs: %v", err) } stats, err := fs.NewStat() if err != nil { return err } ch <- prometheus.MustNewConstMetric(c.intr, prometheus.CounterValue, float64(stats.IRQTotal)) ch <- prometheus.MustNewConstMetric(c.ctxt, prometheus.CounterValue, float64(stats.ContextSwitches)) ch <- prometheus.MustNewConstMetric(c.forks, prometheus.CounterValue, float64(stats.ProcessCreated)) ch <- prometheus.MustNewConstMetric(c.btime, prometheus.GaugeValue, float64(stats.BootTime)) ch <- prometheus.MustNewConstMetric(c.procsRunning, prometheus.GaugeValue, float64(stats.ProcessesRunning)) ch <- prometheus.MustNewConstMetric(c.procsBlocked, prometheus.GaugeValue, float64(stats.ProcessesBlocked)) return nil } prometheus-node-exporter-0.15.2+ds/collector/supervisord.go000066400000000000000000000077141321450230300240710ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nosupervisord package collector import ( "github.com/kolo/xmlrpc" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" "gopkg.in/alecthomas/kingpin.v2" ) var ( supervisordURL = kingpin.Flag("collector.supervisord.url", "XML RPC endpoint.").Default("http://localhost:9001/RPC2").String() ) type supervisordCollector struct { client *xmlrpc.Client upDesc *prometheus.Desc stateDesc *prometheus.Desc exitStatusDesc *prometheus.Desc uptimeDesc *prometheus.Desc } func init() { registerCollector("supervisord", defaultDisabled, NewSupervisordCollector) } // NewSupervisordCollector returns a new Collector exposing supervisord statistics. func NewSupervisordCollector() (Collector, error) { client, err := xmlrpc.NewClient(*supervisordURL, nil) if err != nil { return nil, err } var ( subsystem = "supervisord" labelNames = []string{"name", "group"} ) return &supervisordCollector{ client: client, upDesc: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "up"), "Process Up", labelNames, nil, ), stateDesc: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "state"), "Process State", labelNames, nil, ), exitStatusDesc: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "exit_status"), "Process Exit Status", labelNames, nil, ), uptimeDesc: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "uptime"), "Process Uptime", labelNames, nil, ), }, nil } func (c *supervisordCollector) isRunning(state int) bool { // http://supervisord.org/subprocess.html#process-states const ( STOPPED = 0 STARTING = 10 RUNNING = 20 BACKOFF = 30 STOPPING = 40 EXITED = 100 FATAL = 200 UNKNOWN = 1000 ) switch state { case STARTING, RUNNING, STOPPING: return true } return false } func (c *supervisordCollector) Update(ch chan<- prometheus.Metric) error { var infos []struct { Name string `xmlrpc:"name"` Group string `xmlrpc:"group"` Start int `xmlrpc:"start"` Stop int `xmlrpc:"stop"` Now int `xmlrpc:"now"` State int `xmlrpc:"state"` StateName string `xmlrpc:"statename"` SpawnErr string `xmlrpc:"spanerr"` ExitStatus int `xmlrpc:"exitstatus"` StdoutLogfile string `xmlrcp:"stdout_logfile"` StderrLogfile string `xmlrcp:"stderr_logfile"` PID int `xmlrpc:"pid"` } if err := c.client.Call("supervisor.getAllProcessInfo", nil, &infos); err != nil { return err } for _, info := range infos { lables := []string{info.Name, info.Group} ch <- prometheus.MustNewConstMetric(c.stateDesc, prometheus.GaugeValue, float64(info.State), lables...) ch <- prometheus.MustNewConstMetric(c.exitStatusDesc, prometheus.GaugeValue, float64(info.ExitStatus), lables...) if c.isRunning(info.State) { ch <- prometheus.MustNewConstMetric(c.upDesc, prometheus.GaugeValue, 1, lables...) ch <- prometheus.MustNewConstMetric(c.uptimeDesc, prometheus.CounterValue, float64(info.Now-info.Start), lables...) } else { ch <- prometheus.MustNewConstMetric(c.upDesc, prometheus.GaugeValue, 0, lables...) ch <- prometheus.MustNewConstMetric(c.uptimeDesc, prometheus.CounterValue, 0, lables...) } log.Debugf("%s:%s is %s on pid %d", info.Group, info.Name, info.StateName, info.PID) } return nil } prometheus-node-exporter-0.15.2+ds/collector/sysctl_bsd.go000066400000000000000000000075241321450230300236540ustar00rootroot00000000000000// Copyright 2017 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build freebsd dragonfly // +build !nomeminfo package collector import ( "fmt" "github.com/prometheus/client_golang/prometheus" "golang.org/x/sys/unix" "unsafe" ) // #include import "C" type bsdSysctlType uint8 // BSD-specific sysctl value types. There is an impedience mismatch between // native C types, e.g. int vs long, and the golang unix.Sysctl variables const ( // Default to uint32. bsdSysctlTypeUint32 bsdSysctlType = iota bsdSysctlTypeUint64 bsdSysctlTypeStructTimeval bsdSysctlTypeCLong ) // Contains all the info needed to map a single bsd-sysctl to a prometheus // value. type bsdSysctl struct { // Prometheus name name string // Simple prometheus description description string // Prometheus type valueType prometheus.ValueType // Sysctl name mib string // Sysctl data-type dataType bsdSysctlType // Post-retrieval conversion hooks conversion func(float64) float64 } func (b bsdSysctl) Value() (float64, error) { var tmp32 uint32 var tmp64 uint64 var tmpf64 float64 var err error switch b.dataType { case bsdSysctlTypeUint32: tmp32, err = unix.SysctlUint32(b.mib) tmpf64 = float64(tmp32) case bsdSysctlTypeUint64: tmp64, err = unix.SysctlUint64(b.mib) tmpf64 = float64(tmp64) case bsdSysctlTypeStructTimeval: tmpf64, err = b.getStructTimeval() case bsdSysctlTypeCLong: tmpf64, err = b.getCLong() } if err != nil { return 0, err } if b.conversion != nil { return b.conversion(tmpf64), nil } return tmpf64, nil } func (b bsdSysctl) getStructTimeval() (float64, error) { raw, err := unix.SysctlRaw(b.mib) if err != nil { return 0, err } /* * From 10.3-RELEASE sources: * * /usr/include/sys/_timeval.h:47 * time_t tv_sec * suseconds_t tv_usec * * /usr/include/sys/_types.h:60 * long __suseconds_t * * ... architecture dependent, via #ifdef: * typedef __int64_t __time_t; * typedef __int32_t __time_t; */ if len(raw) != (C.sizeof_time_t + C.sizeof_suseconds_t) { // Shouldn't get here, unless the ABI changes... return 0, fmt.Errorf( "length of bytes received from sysctl (%d) does not match expected bytes (%d)", len(raw), C.sizeof_time_t+C.sizeof_suseconds_t, ) } secondsUp := unsafe.Pointer(&raw[0]) susecondsUp := uintptr(secondsUp) + C.sizeof_time_t unix := float64(*(*C.time_t)(secondsUp)) usec := float64(*(*C.suseconds_t)(unsafe.Pointer(susecondsUp))) // This conversion maintains the usec precision. Using the time // package did not. return (unix + (usec / float64(1000*1000))), nil } func (b bsdSysctl) getCLong() (float64, error) { raw, err := unix.SysctlRaw(b.mib) if err != nil { return 0, err } if len(raw) == C.sizeof_long { return float64(*(*C.long)(unsafe.Pointer(&raw[0]))), nil } if len(raw) == C.sizeof_int { // This is valid for at least vfs.bufspace, and the default // long handler - which can clamp longs to 32-bits: // https://github.com/freebsd/freebsd/blob/releng/10.3/sys/kern/vfs_bio.c#L338 // https://github.com/freebsd/freebsd/blob/releng/10.3/sys/kern/kern_sysctl.c#L1062 return float64(*(*C.int)(unsafe.Pointer(&raw[0]))), nil } return 0, fmt.Errorf( "length of bytes received from sysctl (%d) does not match expected bytes (long: %d), (int: %d)", len(raw), C.sizeof_long, C.sizeof_int, ) } prometheus-node-exporter-0.15.2+ds/collector/systemd_linux.go000066400000000000000000000114331321450230300244040ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nosystemd package collector import ( "fmt" "regexp" "github.com/coreos/go-systemd/dbus" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" "gopkg.in/alecthomas/kingpin.v2" ) var ( unitWhitelist = kingpin.Flag("collector.systemd.unit-whitelist", "Regexp of systemd units to whitelist. Units must both match whitelist and not match blacklist to be included.").Default(".+").String() unitBlacklist = kingpin.Flag("collector.systemd.unit-blacklist", "Regexp of systemd units to blacklist. Units must both match whitelist and not match blacklist to be included.").Default(".+\\.scope").String() systemdPrivate = kingpin.Flag("collector.systemd.private", "Establish a private, direct connection to systemd without dbus.").Bool() ) type systemdCollector struct { unitDesc *prometheus.Desc systemRunningDesc *prometheus.Desc unitWhitelistPattern *regexp.Regexp unitBlacklistPattern *regexp.Regexp } var unitStatesName = []string{"active", "activating", "deactivating", "inactive", "failed"} func init() { registerCollector("systemd", defaultDisabled, NewSystemdCollector) } // NewSystemdCollector returns a new Collector exposing systemd statistics. func NewSystemdCollector() (Collector, error) { const subsystem = "systemd" unitDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "unit_state"), "Systemd unit", []string{"name", "state"}, nil, ) systemRunningDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "system_running"), "Whether the system is operational (see 'systemctl is-system-running')", nil, nil, ) unitWhitelistPattern := regexp.MustCompile(fmt.Sprintf("^(?:%s)$", *unitWhitelist)) unitBlacklistPattern := regexp.MustCompile(fmt.Sprintf("^(?:%s)$", *unitBlacklist)) return &systemdCollector{ unitDesc: unitDesc, systemRunningDesc: systemRunningDesc, unitWhitelistPattern: unitWhitelistPattern, unitBlacklistPattern: unitBlacklistPattern, }, nil } func (c *systemdCollector) Update(ch chan<- prometheus.Metric) error { units, err := c.listUnits() if err != nil { return fmt.Errorf("couldn't get units states: %s", err) } c.collectUnitStatusMetrics(ch, units) systemState, err := c.getSystemState() if err != nil { return fmt.Errorf("couldn't get system state: %s", err) } c.collectSystemState(ch, systemState) return nil } func (c *systemdCollector) collectUnitStatusMetrics(ch chan<- prometheus.Metric, units []dbus.UnitStatus) { for _, unit := range units { for _, stateName := range unitStatesName { isActive := 0.0 if stateName == unit.ActiveState { isActive = 1.0 } ch <- prometheus.MustNewConstMetric( c.unitDesc, prometheus.GaugeValue, isActive, unit.Name, stateName) } } } func (c *systemdCollector) collectSystemState(ch chan<- prometheus.Metric, systemState string) { isSystemRunning := 0.0 if systemState == `"running"` { isSystemRunning = 1.0 } ch <- prometheus.MustNewConstMetric(c.systemRunningDesc, prometheus.GaugeValue, isSystemRunning) } func (c *systemdCollector) newDbus() (*dbus.Conn, error) { if *systemdPrivate { return dbus.NewSystemdConnection() } return dbus.New() } func (c *systemdCollector) listUnits() ([]dbus.UnitStatus, error) { conn, err := c.newDbus() if err != nil { return nil, fmt.Errorf("couldn't get dbus connection: %s", err) } allUnits, err := conn.ListUnits() conn.Close() if err != nil { return []dbus.UnitStatus{}, err } units := filterUnits(allUnits, c.unitWhitelistPattern, c.unitBlacklistPattern) return units, nil } func filterUnits(units []dbus.UnitStatus, whitelistPattern, blacklistPattern *regexp.Regexp) []dbus.UnitStatus { filtered := make([]dbus.UnitStatus, 0, len(units)) for _, unit := range units { if whitelistPattern.MatchString(unit.Name) && !blacklistPattern.MatchString(unit.Name) { filtered = append(filtered, unit) } else { log.Debugf("Ignoring unit: %s", unit.Name) } } return filtered } func (c *systemdCollector) getSystemState() (state string, err error) { conn, err := c.newDbus() if err != nil { return "", fmt.Errorf("couldn't get dbus connection: %s", err) } state, err = conn.GetManagerProperty("SystemState") conn.Close() return state, err } prometheus-node-exporter-0.15.2+ds/collector/systemd_linux_test.go000066400000000000000000000062271321450230300254500ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "regexp" "testing" "github.com/coreos/go-systemd/dbus" "github.com/prometheus/client_golang/prometheus" ) // Creates mock UnitLists func getUnitListFixtures() [][]dbus.UnitStatus { fixture1 := []dbus.UnitStatus{ { Name: "foo", Description: "foo desc", LoadState: "loaded", ActiveState: "active", SubState: "running", Followed: "", Path: "/org/freedesktop/systemd1/unit/foo", JobId: 0, JobType: "", JobPath: "/", }, { Name: "bar", Description: "bar desc", LoadState: "not-found", ActiveState: "inactive", SubState: "dead", Followed: "", Path: "/org/freedesktop/systemd1/unit/bar", JobId: 0, JobType: "", JobPath: "/", }, { Name: "foobar", Description: "bar desc", LoadState: "not-found", ActiveState: "inactive", SubState: "dead", Followed: "", Path: "/org/freedesktop/systemd1/unit/bar", JobId: 0, JobType: "", JobPath: "/", }, { Name: "baz", Description: "bar desc", LoadState: "not-found", ActiveState: "inactive", SubState: "dead", Followed: "", Path: "/org/freedesktop/systemd1/unit/bar", JobId: 0, JobType: "", JobPath: "/", }, } fixture2 := []dbus.UnitStatus{} return [][]dbus.UnitStatus{fixture1, fixture2} } func TestSystemdCollectorDoesntCrash(t *testing.T) { c, err := NewSystemdCollector() if err != nil { t.Fatal(err) } sink := make(chan prometheus.Metric) go func() { for { <-sink } }() fixtures := getUnitListFixtures() collector := (c).(*systemdCollector) for _, units := range fixtures { collector.collectUnitStatusMetrics(sink, units) } } func TestSystemdIgnoreFilter(t *testing.T) { fixtures := getUnitListFixtures() whitelistPattern := regexp.MustCompile("foo") blacklistPattern := regexp.MustCompile("bar") filtered := filterUnits(fixtures[0], whitelistPattern, blacklistPattern) for _, unit := range filtered { if blacklistPattern.MatchString(unit.Name) || !whitelistPattern.MatchString(unit.Name) { t.Error(unit.Name, "should not be in the filtered list") } } } func TestSystemdIgnoreFilterDefaultKeepsAll(t *testing.T) { c, err := NewSystemdCollector() if err != nil { t.Fatal(err) } fixtures := getUnitListFixtures() collector := c.(*systemdCollector) filtered := filterUnits(fixtures[0], collector.unitWhitelistPattern, collector.unitBlacklistPattern) if len(filtered) != len(fixtures[0]) { t.Error("Default filters removed units") } } prometheus-node-exporter-0.15.2+ds/collector/tcpstat_linux.go000066400000000000000000000066021321450230300244000ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !notcpstat package collector import ( "bufio" "fmt" "io" "os" "strconv" "strings" "github.com/prometheus/client_golang/prometheus" ) type tcpConnectionState int const ( // TCP_ESTABLISHED tcpEstablished tcpConnectionState = iota + 1 // TCP_SYN_SENT tcpSynSent // TCP_SYN_RECV tcpSynRecv // TCP_FIN_WAIT1 tcpFinWait1 // TCP_FIN_WAIT2 tcpFinWait2 // TCP_TIME_WAIT tcpTimeWait // TCP_CLOSE tcpClose // TCP_CLOSE_WAIT tcpCloseWait // TCP_LAST_ACK tcpLastAck // TCP_LISTEN tcpListen // TCP_CLOSING tcpClosing ) type tcpStatCollector struct { desc typedDesc } func init() { registerCollector("tcpstat", defaultDisabled, NewTCPStatCollector) } // NewTCPStatCollector returns a new Collector exposing network stats. func NewTCPStatCollector() (Collector, error) { return &tcpStatCollector{ desc: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, "tcp", "connection_states"), "Number of connection states.", []string{"state"}, nil, ), prometheus.GaugeValue}, }, nil } func (c *tcpStatCollector) Update(ch chan<- prometheus.Metric) error { tcpStats, err := getTCPStats(procFilePath("net/tcp")) if err != nil { return fmt.Errorf("couldn't get tcpstats: %s", err) } // if enabled ipv6 system tcp6File := procFilePath("net/tcp6") if _, hasIPv6 := os.Stat(tcp6File); hasIPv6 == nil { tcp6Stats, err := getTCPStats(tcp6File) if err != nil { return fmt.Errorf("couldn't get tcp6stats: %s", err) } for st, value := range tcp6Stats { tcpStats[st] += value } } for st, value := range tcpStats { ch <- c.desc.mustNewConstMetric(value, st.String()) } return nil } func getTCPStats(statsFile string) (map[tcpConnectionState]float64, error) { file, err := os.Open(statsFile) if err != nil { return nil, err } defer file.Close() return parseTCPStats(file) } func parseTCPStats(r io.Reader) (map[tcpConnectionState]float64, error) { var ( tcpStats = map[tcpConnectionState]float64{} scanner = bufio.NewScanner(r) ) for scanner.Scan() { parts := strings.Fields(scanner.Text()) if len(parts) == 0 { continue } if strings.HasPrefix(parts[0], "sl") { continue } st, err := strconv.ParseInt(parts[3], 16, 8) if err != nil { return nil, err } tcpStats[tcpConnectionState(st)]++ } return tcpStats, scanner.Err() } func (st tcpConnectionState) String() string { switch st { case tcpEstablished: return "established" case tcpSynSent: return "syn_sent" case tcpSynRecv: return "syn_recv" case tcpFinWait1: return "fin_wait1" case tcpFinWait2: return "fin_wait2" case tcpTimeWait: return "time_wait" case tcpClose: return "close" case tcpCloseWait: return "close_wait" case tcpLastAck: return "last_ack" case tcpListen: return "listen" case tcpClosing: return "closing" default: return "unknown" } } prometheus-node-exporter-0.15.2+ds/collector/tcpstat_linux_test.go000066400000000000000000000021621321450230300254340ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "os" "testing" ) func TestTCPStat(t *testing.T) { file, err := os.Open("fixtures/proc/net/tcpstat") if err != nil { t.Fatal(err) } defer file.Close() tcpStats, err := parseTCPStats(file) if err != nil { t.Fatal(err) } if want, got := 1, int(tcpStats[tcpEstablished]); want != got { t.Errorf("want tcpstat number of established state %d, got %d", want, got) } if want, got := 1, int(tcpStats[tcpListen]); want != got { t.Errorf("want tcpstat number of listen state %d, got %d", want, got) } } prometheus-node-exporter-0.15.2+ds/collector/textfile.go000066400000000000000000000105741321450230300233260ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !notextfile package collector import ( "fmt" "io/ioutil" "os" "path/filepath" "sort" "strings" "time" "github.com/golang/protobuf/proto" "github.com/prometheus/client_golang/prometheus" dto "github.com/prometheus/client_model/go" "github.com/prometheus/common/expfmt" "github.com/prometheus/common/log" "gopkg.in/alecthomas/kingpin.v2" ) var ( textFileDirectory = kingpin.Flag("collector.textfile.directory", "Directory to read text files with metrics from.").Default("").String() ) type textFileCollector struct { path string } func init() { registerCollector("textfile", defaultEnabled, NewTextFileCollector) } // NewTextFileCollector returns a new Collector exposing metrics read from files // in the given textfile directory. func NewTextFileCollector() (Collector, error) { c := &textFileCollector{ path: *textFileDirectory, } if c.path == "" { // This collector is enabled by default, so do not fail if // the flag is not passed. log.Infof("No directory specified, see --collector.textfile.directory") } else { prometheus.DefaultGatherer = prometheus.Gatherers{ prometheus.DefaultGatherer, prometheus.GathererFunc(func() ([]*dto.MetricFamily, error) { return c.parseTextFiles(), nil }), } } return c, nil } // Update implements the Collector interface. func (c *textFileCollector) Update(ch chan<- prometheus.Metric) error { return nil } func (c *textFileCollector) parseTextFiles() []*dto.MetricFamily { error := 0.0 var metricFamilies []*dto.MetricFamily mtimes := map[string]time.Time{} // Iterate over files and accumulate their metrics. files, err := ioutil.ReadDir(c.path) if err != nil && c.path != "" { log.Errorf("Error reading textfile collector directory %s: %s", c.path, err) error = 1.0 } for _, f := range files { if !strings.HasSuffix(f.Name(), ".prom") { continue } path := filepath.Join(c.path, f.Name()) file, err := os.Open(path) if err != nil { log.Errorf("Error opening %s: %v", path, err) error = 1.0 continue } var parser expfmt.TextParser parsedFamilies, err := parser.TextToMetricFamilies(file) file.Close() if err != nil { log.Errorf("Error parsing %s: %v", path, err) error = 1.0 continue } // Only set this once it has been parsed, so that // a failure does not appear fresh. mtimes[f.Name()] = f.ModTime() for _, mf := range parsedFamilies { if mf.Help == nil { help := fmt.Sprintf("Metric read from %s", path) mf.Help = &help } metricFamilies = append(metricFamilies, mf) } } // Export the mtimes of the successful files. if len(mtimes) > 0 { mtimeMetricFamily := dto.MetricFamily{ Name: proto.String("node_textfile_mtime"), Help: proto.String("Unixtime mtime of textfiles successfully read."), Type: dto.MetricType_GAUGE.Enum(), Metric: []*dto.Metric{}, } // Sorting is needed for predictable output comparison in tests. filenames := make([]string, 0, len(mtimes)) for filename := range mtimes { filenames = append(filenames, filename) } sort.Strings(filenames) for _, filename := range filenames { mtimeMetricFamily.Metric = append(mtimeMetricFamily.Metric, &dto.Metric{ Label: []*dto.LabelPair{ { Name: proto.String("file"), Value: proto.String(filename), }, }, Gauge: &dto.Gauge{Value: proto.Float64(float64(mtimes[filename].UnixNano()) / 1e9)}, }, ) } metricFamilies = append(metricFamilies, &mtimeMetricFamily) } // Export if there were errors. metricFamilies = append(metricFamilies, &dto.MetricFamily{ Name: proto.String("node_textfile_scrape_error"), Help: proto.String("1 if there was an error opening or reading a file, 0 otherwise"), Type: dto.MetricType_GAUGE.Enum(), Metric: []*dto.Metric{ { Gauge: &dto.Gauge{Value: &error}, }, }, }) return metricFamilies } prometheus-node-exporter-0.15.2+ds/collector/textfile_test.go000066400000000000000000000041601321450230300243570ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "io/ioutil" "sort" "strings" "testing" "github.com/golang/protobuf/proto" "github.com/prometheus/common/log" "gopkg.in/alecthomas/kingpin.v2" ) func TestParseTextFiles(t *testing.T) { tests := []struct { path string out string }{ { path: "fixtures/textfile/no_metric_files", out: "fixtures/textfile/no_metric_files.out", }, { path: "fixtures/textfile/two_metric_files", out: "fixtures/textfile/two_metric_files.out", }, { path: "fixtures/textfile/nonexistent_path", out: "fixtures/textfile/nonexistent_path.out", }, } for i, test := range tests { c := textFileCollector{ path: test.path, } // Suppress a log message about `nonexistent_path` not existing, this is // expected and clutters the test output. log.AddFlags(kingpin.CommandLine) _, err := kingpin.CommandLine.Parse([]string{"--log.level", "fatal"}) if err != nil { t.Fatal(err) } mfs := c.parseTextFiles() textMFs := make([]string, 0, len(mfs)) for _, mf := range mfs { if mf.GetName() == "node_textfile_mtime" { mf.GetMetric()[0].GetGauge().Value = proto.Float64(1) mf.GetMetric()[1].GetGauge().Value = proto.Float64(2) } textMFs = append(textMFs, proto.MarshalTextString(mf)) } sort.Strings(textMFs) got := strings.Join(textMFs, "") want, err := ioutil.ReadFile(test.out) if err != nil { t.Fatalf("%d. error reading fixture file %s: %s", i, test.out, err) } if string(want) != got { t.Fatalf("%d. want:\n\n%s\n\ngot:\n\n%s", i, string(want), got) } } } prometheus-node-exporter-0.15.2+ds/collector/time.go000066400000000000000000000025771321450230300224440ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !notime package collector import ( "time" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" ) type timeCollector struct { desc *prometheus.Desc } func init() { registerCollector("time", defaultEnabled, NewTimeCollector) } // NewTimeCollector returns a new Collector exposing the current system time in // seconds since epoch. func NewTimeCollector() (Collector, error) { return &timeCollector{ desc: prometheus.NewDesc( namespace+"_time", "System time in seconds since epoch (1970).", nil, nil, ), }, nil } func (c *timeCollector) Update(ch chan<- prometheus.Metric) error { now := float64(time.Now().UnixNano()) / 1e9 log.Debugf("Return time: %f", now) ch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, now) return nil } prometheus-node-exporter-0.15.2+ds/collector/timex.go000066400000000000000000000143041321450230300226230ustar00rootroot00000000000000// Copyright 2017 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build linux // +build !notimex package collector // #include import "C" import ( "fmt" "syscall" "github.com/prometheus/client_golang/prometheus" ) const ( // The system clock is not synchronized to a reliable server. timeError = C.TIME_ERROR // The timex.Status time resolution bit, 0 = microsecond, 1 = nanoseconds. staNano = C.STA_NANO // 1 second in nanoSeconds = 1000000000 microSeconds = 1000000 ) type timexCollector struct { offset, freq, maxerror, esterror, status, constant, tick, ppsfreq, jitter, shift, stabil, jitcnt, calcnt, errcnt, stbcnt, tai, syncStatus typedDesc } func init() { registerCollector("timex", defaultEnabled, NewTimexCollector) } // NewTimexCollector returns a new Collector exposing adjtime(3) stats. func NewTimexCollector() (Collector, error) { const subsystem = "timex" return &timexCollector{ offset: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "offset_seconds"), "Time offset in between local system and reference clock.", nil, nil, ), prometheus.GaugeValue}, freq: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "frequency_adjustment"), "Local clock frequency adjustment.", nil, nil, ), prometheus.GaugeValue}, maxerror: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "maxerror_seconds"), "Maximum error in seconds.", nil, nil, ), prometheus.GaugeValue}, esterror: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "estimated_error_seconds"), "Estimated error in seconds.", nil, nil, ), prometheus.GaugeValue}, status: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "status"), "Value of the status array bits.", nil, nil, ), prometheus.GaugeValue}, constant: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "loop_time_constant"), "Phase-locked loop time constant.", nil, nil, ), prometheus.GaugeValue}, tick: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "tick_seconds"), "Seconds between clock ticks.", nil, nil, ), prometheus.GaugeValue}, ppsfreq: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "pps_frequency"), "Pulse per second frequency.", nil, nil, ), prometheus.GaugeValue}, jitter: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "pps_jitter_seconds"), "Pulse per second jitter.", nil, nil, ), prometheus.GaugeValue}, shift: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "pps_shift_seconds"), "Pulse per second interval duration.", nil, nil, ), prometheus.GaugeValue}, stabil: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "pps_stability"), "Pulse per second stability.", nil, nil, ), prometheus.CounterValue}, jitcnt: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "pps_jitter_count"), "Pulse per second count of jitter limit exceeded events.", nil, nil, ), prometheus.CounterValue}, calcnt: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "pps_calibration_count"), "Pulse per second count of calibration intervals.", nil, nil, ), prometheus.CounterValue}, errcnt: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "pps_error_count"), "Pulse per second count of calibration errors.", nil, nil, ), prometheus.CounterValue}, stbcnt: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "pps_stability_exceeded_count"), "Pulse per second count of stability limit exceeded events.", nil, nil, ), prometheus.GaugeValue}, tai: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "tai_offset"), "International Atomic Time (TAI) offset.", nil, nil, ), prometheus.GaugeValue}, syncStatus: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "sync_status"), "Is clock synchronized to a reliable server (1 = yes, 0 = no).", nil, nil, ), prometheus.GaugeValue}, }, nil } func (c *timexCollector) Update(ch chan<- prometheus.Metric) error { var syncStatus float64 var divisor float64 var timex = new(syscall.Timex) status, err := syscall.Adjtimex(timex) if err != nil { return fmt.Errorf("failed to retrieve adjtimex stats: %v", err) } if status == timeError { syncStatus = 0 } else { syncStatus = 1 } if (timex.Status & staNano) != 0 { divisor = nanoSeconds } else { divisor = microSeconds } ch <- c.syncStatus.mustNewConstMetric(syncStatus) ch <- c.offset.mustNewConstMetric(float64(timex.Offset) / divisor) ch <- c.freq.mustNewConstMetric(float64(timex.Freq)) ch <- c.maxerror.mustNewConstMetric(float64(timex.Maxerror) / microSeconds) ch <- c.esterror.mustNewConstMetric(float64(timex.Esterror) / microSeconds) ch <- c.status.mustNewConstMetric(float64(timex.Status)) ch <- c.constant.mustNewConstMetric(float64(timex.Constant)) ch <- c.tick.mustNewConstMetric(float64(timex.Tick) / microSeconds) ch <- c.ppsfreq.mustNewConstMetric(float64(timex.Ppsfreq)) ch <- c.jitter.mustNewConstMetric(float64(timex.Jitter) / divisor) ch <- c.shift.mustNewConstMetric(float64(timex.Shift)) ch <- c.stabil.mustNewConstMetric(float64(timex.Stabil)) ch <- c.jitcnt.mustNewConstMetric(float64(timex.Jitcnt)) ch <- c.calcnt.mustNewConstMetric(float64(timex.Calcnt)) ch <- c.errcnt.mustNewConstMetric(float64(timex.Errcnt)) ch <- c.stbcnt.mustNewConstMetric(float64(timex.Stbcnt)) ch <- c.tai.mustNewConstMetric(float64(timex.Tai)) return nil } prometheus-node-exporter-0.15.2+ds/collector/uname_linux.go000066400000000000000000000031671321450230300240260ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nouname package collector import ( "syscall" "github.com/prometheus/client_golang/prometheus" ) var unameDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, "uname", "info"), "Labeled system information as provided by the uname system call.", []string{ "sysname", "release", "version", "machine", "nodename", "domainname", }, nil, ) type unameCollector struct{} func init() { registerCollector("uname", defaultEnabled, newUnameCollector) } // NewUnameCollector returns new unameCollector. func newUnameCollector() (Collector, error) { return &unameCollector{}, nil } func (c unameCollector) Update(ch chan<- prometheus.Metric) error { var uname syscall.Utsname if err := syscall.Uname(&uname); err != nil { return err } ch <- prometheus.MustNewConstMetric(unameDesc, prometheus.GaugeValue, 1, unameToString(uname.Sysname), unameToString(uname.Release), unameToString(uname.Version), unameToString(uname.Machine), unameToString(uname.Nodename), unameToString(uname.Domainname), ) return nil } prometheus-node-exporter-0.15.2+ds/collector/uname_linux_int8.go000066400000000000000000000015241321450230300247630ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build 386 amd64 arm64 mips64 mips64le mips mipsle // +build linux // +build !nouname package collector func unameToString(input [65]int8) string { var str string for _, a := range input { if a == 0 { break } str += string(a) } return str } prometheus-node-exporter-0.15.2+ds/collector/uname_linux_uint8.go000066400000000000000000000015321321450230300251470ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !nouname,linux,arm !nouname,linux,ppc64 !nouname,linux,ppc64le !nouname,linux,s390x package collector func unameToString(input [65]uint8) string { var str string for _, a := range input { if a == 0 { break } str += string(a) } return str } prometheus-node-exporter-0.15.2+ds/collector/vmstat_linux.go000066400000000000000000000032131321450230300242270ustar00rootroot00000000000000// Copyright 2016 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build !novmstat package collector import ( "bufio" "fmt" "os" "strconv" "strings" "github.com/prometheus/client_golang/prometheus" ) const ( vmStatSubsystem = "vmstat" ) type vmStatCollector struct{} func init() { registerCollector("vmstat", defaultEnabled, NewvmStatCollector) } // NewvmStatCollector returns a new Collector exposing vmstat stats. func NewvmStatCollector() (Collector, error) { return &vmStatCollector{}, nil } func (c *vmStatCollector) Update(ch chan<- prometheus.Metric) error { file, err := os.Open(procFilePath("vmstat")) if err != nil { return err } defer file.Close() scanner := bufio.NewScanner(file) for scanner.Scan() { parts := strings.Fields(scanner.Text()) value, err := strconv.ParseFloat(parts[1], 64) if err != nil { return err } ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, vmStatSubsystem, parts[0]), fmt.Sprintf("/proc/vmstat information field %s.", parts[0]), nil, nil), prometheus.UntypedValue, value, ) } return scanner.Err() } prometheus-node-exporter-0.15.2+ds/collector/wifi_linux.go000066400000000000000000000225631321450230300236600ustar00rootroot00000000000000// Copyright 2017 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "encoding/json" "fmt" "io/ioutil" "os" "path/filepath" "github.com/mdlayher/wifi" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" "gopkg.in/alecthomas/kingpin.v2" ) type wifiCollector struct { interfaceFrequencyHertz *prometheus.Desc stationInfo *prometheus.Desc stationConnectedSecondsTotal *prometheus.Desc stationInactiveSeconds *prometheus.Desc stationReceiveBitsPerSecond *prometheus.Desc stationTransmitBitsPerSecond *prometheus.Desc stationSignalDBM *prometheus.Desc stationTransmitRetriesTotal *prometheus.Desc stationTransmitFailedTotal *prometheus.Desc stationBeaconLossTotal *prometheus.Desc } var ( collectorWifi = kingpin.Flag("collector.wifi.fixtures", "test fixtures to use for wifi collector metrics").Default("").String() ) func init() { registerCollector("wifi", defaultEnabled, NewWifiCollector) } var _ wifiStater = &wifi.Client{} // wifiStater is an interface used to swap out a *wifi.Client for end to end tests. type wifiStater interface { BSS(ifi *wifi.Interface) (*wifi.BSS, error) Close() error Interfaces() ([]*wifi.Interface, error) StationInfo(ifi *wifi.Interface) (*wifi.StationInfo, error) } // NewWifiCollector returns a new Collector exposing Wifi statistics. func NewWifiCollector() (Collector, error) { const ( subsystem = "wifi" ) var ( labels = []string{"device"} ) return &wifiCollector{ interfaceFrequencyHertz: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "interface_frequency_hertz"), "The current frequency a WiFi interface is operating at, in hertz.", labels, nil, ), stationInfo: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "station_info"), "Labeled WiFi interface station information as provided by the operating system.", []string{"device", "bssid", "ssid", "mode"}, nil, ), stationConnectedSecondsTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "station_connected_seconds_total"), "The total number of seconds a station has been connected to an access point.", labels, nil, ), stationInactiveSeconds: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "station_inactive_seconds"), "The number of seconds since any wireless activity has occurred on a station.", labels, nil, ), stationReceiveBitsPerSecond: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "station_receive_bits_per_second"), "The current WiFi receive bitrate of a station, in bits per second.", labels, nil, ), stationTransmitBitsPerSecond: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "station_transmit_bits_per_second"), "The current WiFi transmit bitrate of a station, in bits per second.", labels, nil, ), stationSignalDBM: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "station_signal_dbm"), "The current WiFi signal strength, in decibel-milliwatts (dBm).", labels, nil, ), stationTransmitRetriesTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "station_transmit_retries_total"), "The total number of times a station has had to retry while sending a packet.", labels, nil, ), stationTransmitFailedTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "station_transmit_failed_total"), "The total number of times a station has failed to send a packet.", labels, nil, ), stationBeaconLossTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "station_beacon_loss_total"), "The total number of times a station has detected a beacon loss.", labels, nil, ), }, nil } func (c *wifiCollector) Update(ch chan<- prometheus.Metric) error { stat, err := newWifiStater(*collectorWifi) if err != nil { // Cannot access wifi metrics, report no error. if os.IsNotExist(err) { log.Debug("wifi collector metrics are not available for this system") return nil } if os.IsPermission(err) { log.Debug("wifi collector got permission denied when accessing metrics") return nil } return fmt.Errorf("failed to access wifi data: %v", err) } defer stat.Close() ifis, err := stat.Interfaces() if err != nil { return fmt.Errorf("failed to retrieve wifi interfaces: %v", err) } for _, ifi := range ifis { // Some virtual devices have no "name" and should be skipped. if ifi.Name == "" { continue } log.Debugf("probing wifi device %q with type %q", ifi.Name, ifi.Type) ch <- prometheus.MustNewConstMetric( c.interfaceFrequencyHertz, prometheus.GaugeValue, mHzToHz(ifi.Frequency), ifi.Name, ) // When a statistic is not available for a given interface, package wifi // returns an error compatible with os.IsNotExist. We leverage this to // only export metrics which are actually valid for given interface types. bss, err := stat.BSS(ifi) switch { case err == nil: c.updateBSSStats(ch, ifi.Name, bss) case os.IsNotExist(err): log.Debugf("BSS information not found for wifi device %q", ifi.Name) default: return fmt.Errorf("failed to retrieve BSS for device %s: %v", ifi.Name, err) } info, err := stat.StationInfo(ifi) switch { case err == nil: c.updateStationStats(ch, ifi.Name, info) case os.IsNotExist(err): log.Debugf("station information not found for wifi device %q", ifi.Name) default: return fmt.Errorf("failed to retrieve station info for device %q: %v", ifi.Name, err) } } return nil } func (c *wifiCollector) updateBSSStats(ch chan<- prometheus.Metric, device string, bss *wifi.BSS) { // Synthetic metric which provides wifi station info, such as SSID, BSSID, etc. ch <- prometheus.MustNewConstMetric( c.stationInfo, prometheus.GaugeValue, 1, device, bss.BSSID.String(), bss.SSID, bssStatusMode(bss.Status), ) } func (c *wifiCollector) updateStationStats(ch chan<- prometheus.Metric, device string, info *wifi.StationInfo) { ch <- prometheus.MustNewConstMetric( c.stationConnectedSecondsTotal, prometheus.CounterValue, info.Connected.Seconds(), device, ) ch <- prometheus.MustNewConstMetric( c.stationInactiveSeconds, prometheus.GaugeValue, info.Inactive.Seconds(), device, ) ch <- prometheus.MustNewConstMetric( c.stationReceiveBitsPerSecond, prometheus.GaugeValue, float64(info.ReceiveBitrate), device, ) ch <- prometheus.MustNewConstMetric( c.stationTransmitBitsPerSecond, prometheus.GaugeValue, float64(info.TransmitBitrate), device, ) ch <- prometheus.MustNewConstMetric( c.stationSignalDBM, prometheus.GaugeValue, float64(info.Signal), device, ) ch <- prometheus.MustNewConstMetric( c.stationTransmitRetriesTotal, prometheus.CounterValue, float64(info.TransmitRetries), device, ) ch <- prometheus.MustNewConstMetric( c.stationTransmitFailedTotal, prometheus.CounterValue, float64(info.TransmitFailed), device, ) ch <- prometheus.MustNewConstMetric( c.stationBeaconLossTotal, prometheus.CounterValue, float64(info.BeaconLoss), device, ) } func mHzToHz(mHz int) float64 { return float64(mHz) * 1000 * 1000 } func bssStatusMode(status wifi.BSSStatus) string { switch status { case wifi.BSSStatusAuthenticated, wifi.BSSStatusAssociated: return "client" case wifi.BSSStatusIBSSJoined: return "ad-hoc" default: return "unknown" } } // All code below this point is used to assist with end-to-end tests for // the wifi collector, since wifi devices are not available in CI. // newWifiStater determines if mocked test fixtures from files should be used for // collecting wifi metrics, or if package wifi should be used. func newWifiStater(fixtures string) (wifiStater, error) { if fixtures != "" { return &mockWifiStater{ fixtures: fixtures, }, nil } return wifi.New() } var _ wifiStater = &mockWifiStater{} type mockWifiStater struct { fixtures string } func (s *mockWifiStater) unmarshalJSONFile(filename string, v interface{}) error { b, err := ioutil.ReadFile(filepath.Join(s.fixtures, filename)) if err != nil { return err } return json.Unmarshal(b, v) } func (s *mockWifiStater) Close() error { return nil } func (s *mockWifiStater) BSS(ifi *wifi.Interface) (*wifi.BSS, error) { p := filepath.Join(ifi.Name, "bss.json") var bss wifi.BSS if err := s.unmarshalJSONFile(p, &bss); err != nil { return nil, err } return &bss, nil } func (s *mockWifiStater) Interfaces() ([]*wifi.Interface, error) { var ifis []*wifi.Interface if err := s.unmarshalJSONFile("interfaces.json", &ifis); err != nil { return nil, err } return ifis, nil } func (s *mockWifiStater) StationInfo(ifi *wifi.Interface) (*wifi.StationInfo, error) { p := filepath.Join(ifi.Name, "stationinfo.json") var info wifi.StationInfo if err := s.unmarshalJSONFile(p, &info); err != nil { return nil, err } return &info, nil } prometheus-node-exporter-0.15.2+ds/collector/xfs_linux.go000066400000000000000000000132071321450230300235150ustar00rootroot00000000000000// Copyright 2017 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "fmt" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/procfs/sysfs" "github.com/prometheus/procfs/xfs" ) // An xfsCollector is a Collector which gathers metrics from XFS filesystems. type xfsCollector struct { fs sysfs.FS } func init() { registerCollector("xfs", defaultEnabled, NewXFSCollector) } // NewXFSCollector returns a new Collector exposing XFS statistics. func NewXFSCollector() (Collector, error) { fs, err := sysfs.NewFS(*sysPath) if err != nil { return nil, fmt.Errorf("failed to open sysfs: %v", err) } return &xfsCollector{ fs: fs, }, nil } // Update implements Collector. func (c *xfsCollector) Update(ch chan<- prometheus.Metric) error { stats, err := c.fs.XFSStats() if err != nil { return fmt.Errorf("failed to retrieve XFS stats: %v", err) } for _, s := range stats { c.updateXFSStats(ch, s) } return nil } // updateXFSStats collects statistics for a single XFS filesystem. func (c *xfsCollector) updateXFSStats(ch chan<- prometheus.Metric, s *xfs.Stats) { const ( subsystem = "xfs" ) var ( labels = []string{"device"} ) // Metric names and descriptions are sourced from: // http://xfs.org/index.php/Runtime_Stats. // // Each metric has a name that roughly follows the pattern of // "node_xfs_category_value_total", using the categories and value names // found on the XFS wiki. // // Note that statistics for more than one internal B-tree are measured, // and as such, each one must be differentiated by name. metrics := []struct { name string desc string value float64 }{ { name: "extent_allocation_extents_allocated_total", desc: "Number of extents allocated for a filesystem.", value: float64(s.ExtentAllocation.ExtentsAllocated), }, { name: "extent_allocation_blocks_allocated_total", desc: "Number of blocks allocated for a filesystem.", value: float64(s.ExtentAllocation.BlocksAllocated), }, { name: "extent_allocation_extents_freed_total", desc: "Number of extents freed for a filesystem.", value: float64(s.ExtentAllocation.ExtentsFreed), }, { name: "extent_allocation_blocks_freed_total", desc: "Number of blocks freed for a filesystem.", value: float64(s.ExtentAllocation.BlocksFreed), }, { name: "allocation_btree_lookups_total", desc: "Number of allocation B-tree lookups for a filesystem.", value: float64(s.AllocationBTree.Lookups), }, { name: "allocation_btree_compares_total", desc: "Number of allocation B-tree compares for a filesystem.", value: float64(s.AllocationBTree.Compares), }, { name: "allocation_btree_records_inserted_total", desc: "Number of allocation B-tree records inserted for a filesystem.", value: float64(s.AllocationBTree.RecordsInserted), }, { name: "allocation_btree_records_deleted_total", desc: "Number of allocation B-tree records deleted for a filesystem.", value: float64(s.AllocationBTree.RecordsDeleted), }, { name: "block_mapping_reads_total", desc: "Number of block map for read operations for a filesystem.", value: float64(s.BlockMapping.Reads), }, { name: "block_mapping_writes_total", desc: "Number of block map for write operations for a filesystem.", value: float64(s.BlockMapping.Writes), }, { name: "block_mapping_unmaps_total", desc: "Number of block unmaps (deletes) for a filesystem.", value: float64(s.BlockMapping.Unmaps), }, { name: "block_mapping_extent_list_insertions_total", desc: "Number of extent list insertions for a filesystem.", value: float64(s.BlockMapping.ExtentListInsertions), }, { name: "block_mapping_extent_list_deletions_total", desc: "Number of extent list deletions for a filesystem.", value: float64(s.BlockMapping.ExtentListDeletions), }, { name: "block_mapping_extent_list_lookups_total", desc: "Number of extent list lookups for a filesystem.", value: float64(s.BlockMapping.ExtentListLookups), }, { name: "block_mapping_extent_list_compares_total", desc: "Number of extent list compares for a filesystem.", value: float64(s.BlockMapping.ExtentListCompares), }, { name: "block_map_btree_lookups_total", desc: "Number of block map B-tree lookups for a filesystem.", value: float64(s.BlockMapBTree.Lookups), }, { name: "block_map_btree_compares_total", desc: "Number of block map B-tree compares for a filesystem.", value: float64(s.BlockMapBTree.Compares), }, { name: "block_map_btree_records_inserted_total", desc: "Number of block map B-tree records inserted for a filesystem.", value: float64(s.BlockMapBTree.RecordsInserted), }, { name: "block_map_btree_records_deleted_total", desc: "Number of block map B-tree records deleted for a filesystem.", value: float64(s.BlockMapBTree.RecordsDeleted), }, } for _, m := range metrics { desc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, m.name), m.desc, labels, nil, ) ch <- prometheus.MustNewConstMetric( desc, prometheus.CounterValue, m.value, s.Name, ) } } prometheus-node-exporter-0.15.2+ds/collector/zfs.go000066400000000000000000000052661321450230300223060ustar00rootroot00000000000000// Copyright 2016 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // +build linux // +build !nozfs package collector import ( "errors" "strings" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" ) var errZFSNotAvailable = errors.New("ZFS / ZFS statistics are not available") type zfsSysctl string func init() { registerCollector("zfs", defaultEnabled, NewZFSCollector) } type zfsCollector struct { linuxProcpathBase string linuxZpoolIoPath string linuxPathMap map[string]string } // NewZFSCollector returns a new Collector exposing ZFS statistics. func NewZFSCollector() (Collector, error) { return &zfsCollector{ linuxProcpathBase: "spl/kstat/zfs", linuxZpoolIoPath: "/*/io", linuxPathMap: map[string]string{ "zfs_arc": "arcstats", "zfs_dmu_tx": "dmu_tx", "zfs_fm": "fm", "zfs_zfetch": "zfetchstats", "zfs_vdev_cache": "vdev_cache_stats", "zfs_xuio": "xuio_stats", "zfs_zil": "zil", }, }, nil } func (c *zfsCollector) Update(ch chan<- prometheus.Metric) error { for subsystem := range c.linuxPathMap { if err := c.updateZfsStats(subsystem, ch); err != nil { if err == errZFSNotAvailable { log.Debug(err) return nil } return err } } // Pool stats return c.updatePoolStats(ch) } func (s zfsSysctl) metricName() string { parts := strings.Split(string(s), ".") return strings.Replace(parts[len(parts)-1], "-", "_", -1) } func (c *zfsCollector) constSysctlMetric(subsystem string, sysctl zfsSysctl, value int64) prometheus.Metric { metricName := sysctl.metricName() return prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, metricName), string(sysctl), nil, nil, ), prometheus.UntypedValue, float64(value), ) } func (c *zfsCollector) constPoolMetric(poolName string, sysctl zfsSysctl, value int64) prometheus.Metric { metricName := sysctl.metricName() return prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, "zfs_zpool", metricName), string(sysctl), []string{"zpool"}, nil, ), prometheus.UntypedValue, float64(value), poolName, ) } prometheus-node-exporter-0.15.2+ds/collector/zfs_linux.go000066400000000000000000000076741321450230300235320ustar00rootroot00000000000000// Copyright 2016 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "bufio" "fmt" "io" "os" "path/filepath" "strconv" "strings" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" ) func (c *zfsCollector) openProcFile(path string) (*os.File, error) { file, err := os.Open(procFilePath(path)) if err != nil { log.Debugf("Cannot open %q for reading. Is the kernel module loaded?", procFilePath(path)) return nil, errZFSNotAvailable } return file, nil } func (c *zfsCollector) updateZfsStats(subsystem string, ch chan<- prometheus.Metric) error { file, err := c.openProcFile(filepath.Join(c.linuxProcpathBase, c.linuxPathMap[subsystem])) if err != nil { return err } defer file.Close() return c.parseProcfsFile(file, c.linuxPathMap[subsystem], func(s zfsSysctl, v int64) { ch <- c.constSysctlMetric(subsystem, s, v) }) } func (c *zfsCollector) updatePoolStats(ch chan<- prometheus.Metric) error { zpoolPaths, err := filepath.Glob(procFilePath(filepath.Join(c.linuxProcpathBase, c.linuxZpoolIoPath))) if err != nil { return err } if zpoolPaths == nil { return nil } for _, zpoolPath := range zpoolPaths { file, err := os.Open(zpoolPath) if err != nil { log.Debugf("Cannot open %q for reading. Is the kernel module loaded?", zpoolPath) return errZFSNotAvailable } err = c.parsePoolProcfsFile(file, zpoolPath, func(poolName string, s zfsSysctl, v int64) { ch <- c.constPoolMetric(poolName, s, v) }) file.Close() if err != nil { return err } } return nil } func (c *zfsCollector) parseProcfsFile(reader io.Reader, fmtExt string, handler func(zfsSysctl, int64)) error { scanner := bufio.NewScanner(reader) parseLine := false for scanner.Scan() { parts := strings.Fields(scanner.Text()) if !parseLine && len(parts) == 3 && parts[0] == "name" && parts[1] == "type" && parts[2] == "data" { // Start parsing from here. parseLine = true continue } if !parseLine || len(parts) < 3 { continue } key := fmt.Sprintf("kstat.zfs.misc.%s.%s", fmtExt, parts[0]) value, err := strconv.ParseInt(parts[2], 10, 64) if err != nil { return fmt.Errorf("could not parse expected integer value for %q", key) } handler(zfsSysctl(key), value) } if !parseLine { return fmt.Errorf("did not parse a single %q metric", fmtExt) } return scanner.Err() } func (c *zfsCollector) parsePoolProcfsFile(reader io.Reader, zpoolPath string, handler func(string, zfsSysctl, int64)) error { scanner := bufio.NewScanner(reader) parseLine := false var fields []string for scanner.Scan() { line := strings.Fields(scanner.Text()) if !parseLine && len(line) >= 12 && line[0] == "nread" { //Start parsing from here. parseLine = true fields = make([]string, len(line)) copy(fields, line) continue } if !parseLine { continue } zpoolPathElements := strings.Split(zpoolPath, "/") pathLen := len(zpoolPathElements) if pathLen < 2 { return fmt.Errorf("zpool path did not return at least two elements") } zpoolName := zpoolPathElements[pathLen-2] zpoolFile := zpoolPathElements[pathLen-1] for i, field := range fields { key := fmt.Sprintf("kstat.zfs.misc.%s.%s", zpoolFile, field) value, err := strconv.ParseInt(line[i], 10, 64) if err != nil { return fmt.Errorf("could not parse expected integer value for %q: %v", key, err) } handler(zpoolName, zfsSysctl(key), value) } } return scanner.Err() } prometheus-node-exporter-0.15.2+ds/collector/zfs_linux_test.go000066400000000000000000000137501321450230300245610ustar00rootroot00000000000000// Copyright 2016 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package collector import ( "os" "path/filepath" "testing" ) func TestArcstatsParsing(t *testing.T) { arcstatsFile, err := os.Open("fixtures/proc/spl/kstat/zfs/arcstats") if err != nil { t.Fatal(err) } defer arcstatsFile.Close() c := zfsCollector{} if err != nil { t.Fatal(err) } handlerCalled := false err = c.parseProcfsFile(arcstatsFile, "arcstats", func(s zfsSysctl, v int64) { if s != zfsSysctl("kstat.zfs.misc.arcstats.hits") { return } handlerCalled = true if v != int64(8772612) { t.Fatalf("Incorrect value parsed from procfs data") } }) if err != nil { t.Fatal(err) } if !handlerCalled { t.Fatal("Arcstats parsing handler was not called for some expected sysctls") } } func TestZfetchstatsParsing(t *testing.T) { zfetchstatsFile, err := os.Open("fixtures/proc/spl/kstat/zfs/zfetchstats") if err != nil { t.Fatal(err) } defer zfetchstatsFile.Close() c := zfsCollector{} if err != nil { t.Fatal(err) } handlerCalled := false err = c.parseProcfsFile(zfetchstatsFile, "zfetchstats", func(s zfsSysctl, v int64) { if s != zfsSysctl("kstat.zfs.misc.zfetchstats.hits") { return } handlerCalled = true if v != int64(7067992) { t.Fatalf("Incorrect value parsed from procfs data") } }) if err != nil { t.Fatal(err) } if !handlerCalled { t.Fatal("Zfetchstats parsing handler was not called for some expected sysctls") } } func TestZilParsing(t *testing.T) { zilFile, err := os.Open("fixtures/proc/spl/kstat/zfs/zil") if err != nil { t.Fatal(err) } defer zilFile.Close() c := zfsCollector{} if err != nil { t.Fatal(err) } handlerCalled := false err = c.parseProcfsFile(zilFile, "zil", func(s zfsSysctl, v int64) { if s != zfsSysctl("kstat.zfs.misc.zil.zil_commit_count") { return } handlerCalled = true if v != int64(10) { t.Fatalf("Incorrect value parsed from procfs data") } }) if err != nil { t.Fatal(err) } if !handlerCalled { t.Fatal("Zil parsing handler was not called for some expected sysctls") } } func TestVdevCacheStatsParsing(t *testing.T) { vdevCacheStatsFile, err := os.Open("fixtures/proc/spl/kstat/zfs/vdev_cache_stats") if err != nil { t.Fatal(err) } defer vdevCacheStatsFile.Close() c := zfsCollector{} if err != nil { t.Fatal(err) } handlerCalled := false err = c.parseProcfsFile(vdevCacheStatsFile, "vdev_cache_stats", func(s zfsSysctl, v int64) { if s != zfsSysctl("kstat.zfs.misc.vdev_cache_stats.delegations") { return } handlerCalled = true if v != int64(40) { t.Fatalf("Incorrect value parsed from procfs data") } }) if err != nil { t.Fatal(err) } if !handlerCalled { t.Fatal("VdevCacheStats parsing handler was not called for some expected sysctls") } } func TestXuioStatsParsing(t *testing.T) { xuioStatsFile, err := os.Open("fixtures/proc/spl/kstat/zfs/xuio_stats") if err != nil { t.Fatal(err) } defer xuioStatsFile.Close() c := zfsCollector{} if err != nil { t.Fatal(err) } handlerCalled := false err = c.parseProcfsFile(xuioStatsFile, "xuio_stats", func(s zfsSysctl, v int64) { if s != zfsSysctl("kstat.zfs.misc.xuio_stats.onloan_read_buf") { return } handlerCalled = true if v != int64(32) { t.Fatalf("Incorrect value parsed from procfs data") } }) if err != nil { t.Fatal(err) } if !handlerCalled { t.Fatal("XuioStats parsing handler was not called for some expected sysctls") } } func TestFmParsing(t *testing.T) { fmFile, err := os.Open("fixtures/proc/spl/kstat/zfs/fm") if err != nil { t.Fatal(err) } defer fmFile.Close() c := zfsCollector{} if err != nil { t.Fatal(err) } handlerCalled := false err = c.parseProcfsFile(fmFile, "fm", func(s zfsSysctl, v int64) { if s != zfsSysctl("kstat.zfs.misc.fm.erpt-dropped") { return } handlerCalled = true if v != int64(18) { t.Fatalf("Incorrect value parsed from procfs data") } }) if err != nil { t.Fatal(err) } if !handlerCalled { t.Fatal("Fm parsing handler was not called for some expected sysctls") } } func TestDmuTxParsing(t *testing.T) { dmuTxFile, err := os.Open("fixtures/proc/spl/kstat/zfs/dmu_tx") if err != nil { t.Fatal(err) } defer dmuTxFile.Close() c := zfsCollector{} if err != nil { t.Fatal(err) } handlerCalled := false err = c.parseProcfsFile(dmuTxFile, "dmu_tx", func(s zfsSysctl, v int64) { if s != zfsSysctl("kstat.zfs.misc.dmu_tx.dmu_tx_assigned") { return } handlerCalled = true if v != int64(3532844) { t.Fatalf("Incorrect value parsed from procfs data") } }) if err != nil { t.Fatal(err) } if !handlerCalled { t.Fatal("DmuTx parsing handler was not called for some expected sysctls") } } func TestZpoolParsing(t *testing.T) { zpoolPaths, err := filepath.Glob("fixtures/proc/spl/kstat/zfs/*/io") if err != nil { t.Fatal(err) } c := zfsCollector{} if err != nil { t.Fatal(err) } handlerCalled := false for _, zpoolPath := range zpoolPaths { file, err := os.Open(zpoolPath) if err != nil { t.Fatal(err) } err = c.parsePoolProcfsFile(file, zpoolPath, func(poolName string, s zfsSysctl, v int64) { if s != zfsSysctl("kstat.zfs.misc.io.nread") { return } handlerCalled = true if v != int64(1884160) && v != int64(2826240) { t.Fatalf("Incorrect value parsed from procfs data %v", v) } }) file.Close() if err != nil { t.Fatal(err) } } if !handlerCalled { t.Fatal("Zpool parsing handler was not called for some expected sysctls") } } prometheus-node-exporter-0.15.2+ds/docs/000077500000000000000000000000001321450230300201065ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/docs/TIME.md000066400000000000000000000067151321450230300211770ustar00rootroot00000000000000# Monitoring time sync with node_exporter ## `ntp` collector This collector is intended for usage with local NTPD like [ntp.org](http://ntp.org/), [chrony](https://chrony.tuxfamily.org/comparison.html) or [OpenNTPD](http://www.openntpd.org/). Note, some chrony packages have `local stratum 10` configuration value making chrony a valid server when it it is unsynchronised. This configuration makes one of `node_ntp_sanity` heuristics unreliable. Note, OpenNTPD does not listen for SNTP queries by default, you should add `listen on 127.0.0.1` configuration line to use this collector with OpenNTPD. ### `node_ntp_stratum` This metric shows [stratum](https://en.wikipedia.org/wiki/Network_Time_Protocol#Clock_strata) of local NTPD. Stratum `16` means that clock are unsynchronised. See also aforementioned note about default local stratum in chrony. ### `node_ntp_leap` Raw leap flag value. 0 – OK, 1 – add leap second at UTC midnight, 2 – delete leap second at UTC midnight, 3 – unsynchronised. OpenNTPD ignores leap seconds and never sets leap flag to `1` or `2`. ### `node_ntp_rtt` RTT (round-trip time) from node_exporter collector to local NTPD. This value is used in sanity check as part of causality violation estimate. ### `node_ntp_offset` [Clock offset](https://en.wikipedia.org/wiki/Network_Time_Protocol#Clock_synchronization_algorithm) between local time and NTPD time. ntp.org always sets NTPD time to local clock instead of relaying remote NTP time, so this offset is irrelevant for this NTPD. This value is used in sanity check as part of causality violation estimate. ### `node_ntp_reference_timestamp_seconds` Reference Time. This field show time when the last adjustment was made, but implementation details vary from "**local** wall-clock time" to "Reference Time field in incoming SNTP packet". `time() - node_ntp_reference_timestamp_seconds` and `node_time - node_ntp_reference_timestamp_seconds` represent some estimate of "freshness" of synchronization. ### `node_ntp_root_delay` and `node_ntp_root_dispersion` These values are used to calculate synchronization distance that is limited by `collector.ntp.max-distance`. ntp.org adds known local offset to announced root dispersion and linearly increases dispersion in case of NTP connectivity problems, OpenNTPD does not account dispersion at all and always reports `0`. ### `node_ntp_sanity` Aggregate NTPD health including stratum, leap flag, sane freshness, root distance being less than `collector.ntp.max-distance` and causality violation being less than `collector.ntp.local-offset-tolerance`. Causality violation is lower bound estimate of clock error done using SNTP, it's calculated as positive portion of `abs(node_ntp_offset) - node_ntp_rtt / 2`. ## `timex` collector This collector exports state of kernel time synchronization flag that should be maintained by time-keeping daemon and is eventually raised by Linux kernel if time-keeping daemon does not update it regularly. Unfortunately some daemons do not handle this flag properly, e.g. chrony-1.30 from Debian/jessie clears `STA_UNSYNC` flag during daemon initialisation and does not indicate clock synchronization status using this flag. Modern chrony versions should work better. All chrony versions require `rtcsync` option to maintain this flag. OpenNTPD does not touch this flag at all till OpenNTPD-5.9p1. On the other hand combination of `sync_status` and `offset` exported by `timex` module is the way to monitor if systemd-timesyncd does its job. prometheus-node-exporter-0.15.2+ds/end-to-end-test.sh000077500000000000000000000053571321450230300224360ustar00rootroot00000000000000#!/usr/bin/env bash set -euf -o pipefail enabled_collectors=$(cat << COLLECTORS arp bcache buddyinfo conntrack cpu diskstats drbd edac entropy filefd hwmon infiniband interrupts ipvs ksmd loadavg mdadm meminfo meminfo_numa mountstats netdev netstat nfs qdisc sockstat stat textfile bonding megacli wifi xfs zfs COLLECTORS ) disabled_collectors=$(cat << COLLECTORS filesystem time timex uname vmstat COLLECTORS ) cd "$(dirname $0)" port="$((10000 + (RANDOM % 10000)))" tmpdir=$(mktemp -d /tmp/node_exporter_e2e_test.XXXXXX) skip_re="^(go_|node_exporter_build_info|node_scrape_collector_duration_seconds|process_|node_textfile_mtime)" keep=0; update=0; verbose=0 while getopts 'hkuv' opt do case "$opt" in k) keep=1 ;; u) update=1 ;; v) verbose=1 set -x ;; *) echo "Usage: $0 [-k] [-u] [-v]" echo " -k: keep temporary files and leave node_exporter running" echo " -u: update fixture" echo " -v: verbose output" exit 1 ;; esac done if [ ! -x ./node_exporter ] then echo './node_exporter not found. Consider running `go build` first.' >&2 exit 1 fi ./node_exporter \ --path.procfs="collector/fixtures/proc" \ --path.sysfs="collector/fixtures/sys" \ $(for c in ${enabled_collectors}; do echo --collector.${c} ; done) \ $(for c in ${disabled_collectors}; do echo --no-collector.${c} ; done) \ --collector.textfile.directory="collector/fixtures/textfile/two_metric_files/" \ --collector.megacli.command="collector/fixtures/megacli" \ --collector.wifi.fixtures="collector/fixtures/wifi" \ --collector.qdisc.fixtures="collector/fixtures/qdisc/" \ --web.listen-address "127.0.0.1:${port}" \ --log.level="debug" > "${tmpdir}/node_exporter.log" 2>&1 & echo $! > "${tmpdir}/node_exporter.pid" finish() { if [ $? -ne 0 -o ${verbose} -ne 0 ] then cat << EOF >&2 LOG ===================== $(cat "${tmpdir}/node_exporter.log") ========================= EOF fi if [ ${update} -ne 0 ] then cp "${tmpdir}/e2e-output.txt" "collector/fixtures/e2e-output.txt" fi if [ ${keep} -eq 0 ] then kill -9 "$(cat ${tmpdir}/node_exporter.pid)" # This silences the "Killed" message set +e wait "$(cat ${tmpdir}/node_exporter.pid)" > /dev/null 2>&1 rm -rf "${tmpdir}" fi } trap finish EXIT get() { if command -v curl > /dev/null 2>&1 then curl -s -f "$@" elif command -v wget > /dev/null 2>&1 then wget -O - "$@" else echo "Neither curl nor wget found" exit 1 fi } sleep 1 get "127.0.0.1:${port}/metrics" | grep -E -v "${skip_re}" > "${tmpdir}/e2e-output.txt" diff -u \ "collector/fixtures/e2e-output.txt" \ "${tmpdir}/e2e-output.txt" prometheus-node-exporter-0.15.2+ds/example.rules000066400000000000000000000005541321450230300216710ustar00rootroot00000000000000# The count of CPUs per node, useful for getting CPU time as a percent of total. instance:node_cpus:count = count(node_cpu{mode="idle"}) without (cpu,mode) # CPU in use by CPU. instance_cpu:node_cpu_not_idle:rate5m = sum(rate(node_cpu{mode!="idle"}[5m])) without (mode) # CPU in use by mode. instance_mode:node_cpu:rate5m = sum(rate(node_cpu[5m])) without (cpu) prometheus-node-exporter-0.15.2+ds/examples/000077500000000000000000000000001321450230300207745ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/examples/systemd/000077500000000000000000000000001321450230300224645ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/examples/systemd/README.md000066400000000000000000000006611321450230300237460ustar00rootroot00000000000000# Systemd Unit If you are using distribution packages or the copr repository, you don't need to deal with these files! The unit file in this directory is to be put into `/etc/systemd/system`. It needs a user named `node_exporter`, whose shell should be `/sbin/nologin` and should not have any special privileges. It needs a sysconfig file in `/etc/sysconfig/node_exporter`. A sample file can be found in `sysconfig.node_exporter`. prometheus-node-exporter-0.15.2+ds/examples/systemd/node_exporter.service000066400000000000000000000002751321450230300267270ustar00rootroot00000000000000[Unit] Description=Node Exporter [Service] User=node_exporter EnvironmentFile=/etc/sysconfig/node_exporter ExecStart=/usr/sbin/node_exporter $OPTIONS [Install] WantedBy=multi-user.target prometheus-node-exporter-0.15.2+ds/examples/systemd/sysconfig.node_exporter000066400000000000000000000001231321450230300272630ustar00rootroot00000000000000OPTIONS="--collector.textfile.directory /var/lib/node_exporter/textfile_collector" prometheus-node-exporter-0.15.2+ds/node_exporter.go000066400000000000000000000047651321450230300223760ustar00rootroot00000000000000// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package main import ( "net/http" _ "net/http/pprof" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/common/log" "github.com/prometheus/common/version" "github.com/prometheus/node_exporter/collector" "gopkg.in/alecthomas/kingpin.v2" ) func init() { prometheus.MustRegister(version.NewCollector("node_exporter")) } func main() { var ( listenAddress = kingpin.Flag("web.listen-address", "Address on which to expose metrics and web interface.").Default(":9100").String() metricsPath = kingpin.Flag("web.telemetry-path", "Path under which to expose metrics.").Default("/metrics").String() ) log.AddFlags(kingpin.CommandLine) kingpin.Version(version.Print("node_exporter")) kingpin.HelpFlag.Short('h') kingpin.Parse() log.Infoln("Starting node_exporter", version.Info()) log.Infoln("Build context", version.BuildContext()) nc, err := collector.NewNodeCollector() if err != nil { log.Fatalf("Couldn't create collector: %s", err) } log.Infof("Enabled collectors:") for n := range nc.Collectors { log.Infof(" - %s", n) } if err := prometheus.Register(nc); err != nil { log.Fatalf("Couldn't register collector: %s", err) } handler := promhttp.HandlerFor(prometheus.DefaultGatherer, promhttp.HandlerOpts{ ErrorLog: log.NewErrorLogger(), ErrorHandling: promhttp.ContinueOnError, }) // TODO(ts): Remove deprecated and problematic InstrumentHandler usage. http.Handle(*metricsPath, prometheus.InstrumentHandler("prometheus", handler)) http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Write([]byte(` Node Exporter

Node Exporter

Metrics

`)) }) log.Infoln("Listening on", *listenAddress) err = http.ListenAndServe(*listenAddress, nil) if err != nil { log.Fatal(err) } } prometheus-node-exporter-0.15.2+ds/node_exporter_test.go000066400000000000000000000063141321450230300234250ustar00rootroot00000000000000package main import ( "fmt" "io/ioutil" "net/http" "os" "os/exec" "path/filepath" "testing" "time" "github.com/prometheus/procfs" ) var ( binary = filepath.Join(os.Getenv("GOPATH"), "bin/node_exporter") ) const ( address = "localhost:19100" ) func TestFileDescriptorLeak(t *testing.T) { if _, err := os.Stat(binary); err != nil { t.Skipf("node_exporter binary not available, try to run `make build` first: %s", err) } if _, err := procfs.NewStat(); err != nil { t.Skipf("proc filesystem is not available, but currently required to read number of open file descriptors: %s", err) } exporter := exec.Command(binary, "--web.listen-address", address) test := func(pid int) error { if err := queryExporter(address); err != nil { return err } proc, err := procfs.NewProc(pid) if err != nil { return err } fdsBefore, err := proc.FileDescriptors() if err != nil { return err } for i := 0; i < 5; i++ { if err := queryExporter(address); err != nil { return err } } fdsAfter, err := proc.FileDescriptors() if err != nil { return err } if want, have := len(fdsBefore), len(fdsAfter); want != have { return fmt.Errorf("want %d open file descriptors after metrics scrape, have %d", want, have) } return nil } if err := runCommandAndTests(exporter, address, test); err != nil { t.Error(err) } } func TestHandlingOfDuplicatedMetrics(t *testing.T) { if _, err := os.Stat(binary); err != nil { t.Skipf("node_exporter binary not available, try to run `make build` first: %s", err) } dir, err := ioutil.TempDir("", "node-exporter") if err != nil { t.Fatal(err) } defer os.RemoveAll(dir) content := []byte("dummy_metric 1\n") if err := ioutil.WriteFile(filepath.Join(dir, "a.prom"), content, 0600); err != nil { t.Fatal(err) } if err := ioutil.WriteFile(filepath.Join(dir, "b.prom"), content, 0600); err != nil { t.Fatal(err) } exporter := exec.Command(binary, "--web.listen-address", address, "--collector.textfile.directory", dir) test := func(_ int) error { return queryExporter(address) } if err := runCommandAndTests(exporter, address, test); err != nil { t.Error(err) } } func queryExporter(address string) error { resp, err := http.Get(fmt.Sprintf("http://%s/metrics", address)) if err != nil { return err } b, err := ioutil.ReadAll(resp.Body) if err != nil { return err } if err := resp.Body.Close(); err != nil { return err } if want, have := http.StatusOK, resp.StatusCode; want != have { return fmt.Errorf("want /metrics status code %d, have %d. Body:\n%s", want, have, b) } return nil } func runCommandAndTests(cmd *exec.Cmd, address string, fn func(pid int) error) error { if err := cmd.Start(); err != nil { return fmt.Errorf("failed to start command: %s", err) } time.Sleep(50 * time.Millisecond) for i := 0; i < 10; i++ { if err := queryExporter(address); err == nil { break } time.Sleep(500 * time.Millisecond) if cmd.Process == nil || i == 9 { return fmt.Errorf("can't start command") } } errc := make(chan error) go func(pid int) { errc <- fn(pid) }(cmd.Process.Pid) select { case err := <-errc: if cmd.Process != nil { cmd.Process.Kill() } if err != nil { return err } } return nil } prometheus-node-exporter-0.15.2+ds/test_image.sh000077500000000000000000000011361321450230300216370ustar00rootroot00000000000000#!/bin/bash set -exo pipefail docker_image=$1 port=$2 container_id='' wait_start() { for in in {1..10}; do if /usr/bin/curl -s -m 5 -f "http://localhost:${port}/metrics" > /dev/null; then docker_cleanup exit 0 else sleep 1 fi done exit 1 } docker_start() { container_id=$(docker run -d -p "${port}":"${port}" "${docker_image}") } docker_cleanup() { docker kill "${container_id}" } if [[ "$#" -ne 2 ]] ; then echo "Usage: $0 quay.io/prometheus/node-exporter:v0.13.0 9100" >&2 exit 1 fi docker_start wait_start prometheus-node-exporter-0.15.2+ds/text_collector_examples/000077500000000000000000000000001321450230300241065ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/text_collector_examples/README.md000066400000000000000000000003151321450230300253640ustar00rootroot00000000000000# Text collector example scripts These scripts are examples to be used with the Node Exporter Textfile Collector. For more information see: https://github.com/prometheus/node_exporter#textfile-collector prometheus-node-exporter-0.15.2+ds/text_collector_examples/apt.sh000077500000000000000000000016121321450230300252310ustar00rootroot00000000000000#!/bin/bash # # Description: Expose metrics from apt updates. # # Author: Ben Kochie upgrades="$(/usr/bin/apt-get --just-print upgrade \ | /usr/bin/awk '/^Inst/ {print $5, $6}' \ | /usr/bin/sort \ | /usr/bin/uniq -c \ | awk '{ gsub(/\\\\/, "\\\\", $2); gsub(/\"/, "\\\"", $2); gsub(/\[/, "", $3); gsub(/\]/, "", $3); print "apt_upgrades_pending{origin=\"" $2 "\",arch=\"" $3 "\"} " $1}' )" echo '# HELP apt_upgrades_pending Apt package pending updates by origin.' echo '# TYPE apt_upgrades_pending gauge' if [[ -n "${upgrades}" ]] ; then echo "${upgrades}" else echo 'apt_upgrades_pending{origin="",arch=""} 0' fi echo '# HELP node_reboot_required Node reboot is required for software updates.' echo '# TYPE node_reboot_required gauge' if [[ -f '/run/reboot-required' ]] ; then echo 'node_reboot_required 1' else echo 'node_reboot_required 0' fi prometheus-node-exporter-0.15.2+ds/text_collector_examples/ntpd_metrics.py000077500000000000000000000066461321450230300271720ustar00rootroot00000000000000#!/usr/bin/env python3 # # Description: Extract NTPd metrics from ntpq -np. # Author: Ben Kochie import re import subprocess import sys # NTP peers status, with no DNS lookups. ntpq_cmd = ['ntpq', '-np'] ntpq_rv_cmd = ['ntpq', '-c', 'rv 0 offset,sys_jitter,rootdisp,rootdelay'] # Regex to match all of the fields in the output of ntpq -np metrics_fields = [ '^(?P.)(?P[\w\.]+)', '(?P[\w\.]+)', '(?P\d+)', '(?P\w)', '(?P\d+)', '(?P\d+)', '(?P\d+)', '(?P\d+\.\d+)', '(?P-?\d+\.\d+)', '(?P\d+\.\d+)', ] metrics_re = '\s+'.join(metrics_fields) # Remote types # http://support.ntp.org/bin/view/Support/TroubleshootingNTP remote_types = { 'l': 'local', 'u': 'unicast', 'm': 'multicast', 'b': 'broadcast', '-': 'netaddr', } # Status codes: # http://www.eecis.udel.edu/~mills/ntp/html/decode.html#peer status_types = { ' ': 0, 'x': 1, '.': 2, '-': 3, '+': 4, '#': 5, '*': 6, 'o': 7, } # Run the ntpq command. def get_output(command): try: output = subprocess.check_output(command, stderr=subprocess.DEVNULL) except subprocess.CalledProcessError as e: return None return output.decode() # Print metrics in Prometheus format. def print_prometheus(metric, values): print("# HELP ntpd_%s NTPd metric for %s" % (metric, metric)) print("# TYPE ntpd_%s gauge" % (metric)) for labels in values: if labels is None: print("ntpd_%s %f" % (metric, values[labels])) else: print("ntpd_%s{%s} %f" % (metric, labels, values[labels])) # Parse raw ntpq lines. def parse_line(line): if re.match('\s+remote\s+refid', line): return None if re.match('=+', line): return None if re.match('.+\.(LOCL|POOL)\.', line): return None if re.match('^$', line): return None return re.match(metrics_re, line) # Main function def main(argv): ntpq = get_output(ntpq_cmd) peer_status_metrics = {} delay_metrics = {} offset_metrics = {} jitter_metrics = {} for line in ntpq.split('\n'): metric_match = parse_line(line) if metric_match is None: continue remote = metric_match.group('remote') refid = metric_match.group('refid') stratum = metric_match.group('stratum') remote_type = remote_types[metric_match.group('type')] common_labels = "remote=\"%s\",reference=\"%s\"" % (remote, refid) peer_labels = "%s,stratum=\"%s\",type=\"%s\"" % (common_labels, stratum, remote_type) peer_status_metrics[peer_labels] = float(status_types[metric_match.group('status')]) delay_metrics[common_labels] = float(metric_match.group('delay')) offset_metrics[common_labels] = float(metric_match.group('offset')) jitter_metrics[common_labels] = float(metric_match.group('jitter')) print_prometheus('peer_status', peer_status_metrics) print_prometheus('delay_milliseconds', delay_metrics) print_prometheus('offset_milliseconds', offset_metrics) print_prometheus('jitter_milliseconds', jitter_metrics) ntpq_rv = get_output(ntpq_rv_cmd) for metric in ntpq_rv.split(','): metric_name, metric_value = metric.strip().split('=') print_prometheus(metric_name, {None: float(metric_value)}) # Go go go! if __name__ == "__main__": main(sys.argv[1:]) prometheus-node-exporter-0.15.2+ds/text_collector_examples/smartmon.sh000077500000000000000000000115211321450230300263050ustar00rootroot00000000000000#!/bin/bash # Script informed by the collectd monitoring script for smartmontools (using smartctl) # by Samuel B. (c) 2012 # source at: http://devel.dob.sk/collectd-scripts/ # TODO: This probably needs to be a little more complex. The raw numbers can have more # data in them than you'd think. # http://arstechnica.com/civis/viewtopic.php?p=22062211 disks="$(/usr/sbin/smartctl --scan | awk '{print $1 "|" $3}')" parse_smartctl_attributes_awk="$(cat << 'SMARTCTLAWK' $1 ~ /^[0-9]+$/ && $2 ~ /^[a-zA-Z0-9_-]+$/ { gsub(/-/, "_"); printf "%s_value{%s,smart_id=\"%s\"} %d\n", $2, labels, $1, $4 printf "%s_worst{%s,smart_id=\"%s\"} %d\n", $2, labels, $1, $5 printf "%s_threshold{%s,smart_id=\"%s\"} %d\n", $2, labels, $1, $6 printf "%s_raw_value{%s,smart_id=\"%s\"} %e\n", $2, labels, $1, $10 } SMARTCTLAWK )" smartmon_attrs="$(cat << 'SMARTMONATTRS' airflow_temperature_cel command_timeout current_pending_sector end_to_end_error erase_fail_count g_sense_error_rate hardware_ecc_recovered host_reads_mib host_reads_32mib host_writes_mib host_writes_32mib load_cycle_count media_wearout_indicator nand_writes_1gib offline_uncorrectable power_cycle_count power_on_hours program_fail_count raw_read_error_rate reallocated_sector_ct reported_uncorrect sata_downshift_count spin_retry_count spin_up_time start_stop_count temperature_celsius total_lbas_read total_lbas_written udma_crc_error_count unsafe_shutdown_count workld_host_reads_perc workld_media_wear_indic workload_minutes SMARTMONATTRS )" smartmon_attrs="$(echo ${smartmon_attrs} | xargs | tr ' ' '|')" parse_smartctl_attributes() { local disk="$1" local disk_type="$2" local labels="disk=\"${disk}\",type=\"${disk_type}\"" local vars="$(echo "${smartmon_attrs}" | xargs | tr ' ' '|')" sed 's/^ \+//g' \ | awk -v labels="${labels}" "${parse_smartctl_attributes_awk}" 2>/dev/null \ | tr A-Z a-z \ | grep -E "(${smartmon_attrs})" } parse_smartctl_info() { local -i smart_available=0 smart_enabled=0 smart_healthy=0 local disk="$1" disk_type="$2" while read line ; do info_type="$(echo "${line}" | cut -f1 -d: | tr ' ' '_')" info_value="$(echo "${line}" | cut -f2- -d: | sed 's/^ \+//g')" case "${info_type}" in Model_Family) model_family="${info_value}" ;; Device_Model) device_model="${info_value}" ;; Serial_Number) serial_number="${info_value}" ;; Firmware_Version) fw_version="${info_value}" ;; Vendor) vendor="${info_value}" ;; Product) product="${info_value}" ;; Revision) revision="${info_value}" ;; Logical_Unit_id) lun_id="${info_value}" ;; esac if [[ "${info_type}" == 'SMART_support_is' ]] ; then case "${info_value:0:7}" in Enabled) smart_enabled=1 ;; Availab) smart_available=1 ;; Unavail) smart_available=0 ;; esac fi if [[ "${info_type}" == 'SMART_overall-health_self-assessment_test_result' ]] ; then case "${info_value:0:6}" in PASSED) smart_healthy=1 ;; esac elif [[ "${info_type}" == 'SMART_Health_Status' ]] ; then case "${info_value:0:2}" in OK) smart_healthy=1 ;; esac fi done if [[ -n "${vendor}" ]] ; then echo "device_info{disk=\"${disk}\",type=\"${disk_type}\",vendor=\"${vendor}\",product=\"${product}\",revision=\"${revision}\",lun_id=\"${lun_id}\"} 1" else echo "device_info{disk=\"${disk}\",type=\"${disk_type}\",model_family=\"${model_family}\",device_model=\"${device_model}\",serial_number=\"${serial_number}\",firmware_version=\"${fw_version}\"} 1" fi echo "device_smart_available{disk=\"${disk}\",type=\"${disk_type}\"} ${smart_available}" echo "device_smart_enabled{disk=\"${disk}\",type=\"${disk_type}\"} ${smart_enabled}" echo "device_smart_healthy{disk=\"${disk}\",type=\"${disk_type}\"} ${smart_healthy}" } output_format_awk="$(cat << 'OUTPUTAWK' BEGIN { v = "" } v != $1 { print "# HELP smartmon_" $1 " SMART metric " $1; print "# TYPE smartmon_" $1 " gauge"; v = $1 } {print "smartmon_" $0} OUTPUTAWK )" format_output() { sort \ | awk -F'{' "${output_format_awk}" } smartctl_version="$(/usr/sbin/smartctl -V | head -n1 | awk '$1 == "smartctl" {print $2}')" echo "smartctl_version{version=\"${smartctl_version}\"} 1" | format_output if [[ "$(expr "${smartctl_version}" : '\([0-9]*\)\..*')" -lt 6 ]] ; then exit fi device_list="$(/usr/sbin/smartctl --scan-open | awk '{print $1 "|" $3}')" for device in ${device_list}; do disk="$(echo ${device} | cut -f1 -d'|')" type="$(echo ${device} | cut -f2 -d'|')" echo "smartctl_run{disk=\"${disk}\",type=\"${type}\"}" $(TZ=UTC date '+%s') # Get the SMART information and health /usr/sbin/smartctl -i -H -d "${type}" "${disk}" | parse_smartctl_info "${disk}" "${type}" # Get the SMART attributes /usr/sbin/smartctl -A -d "${type}" "${disk}" | parse_smartctl_attributes "${disk}" "${type}" done | format_output prometheus-node-exporter-0.15.2+ds/text_collector_examples/storcli.py000077500000000000000000000072541321450230300261520ustar00rootroot00000000000000#!/usr/bin/env python # Script to parse StorCLI's JSON output and expose # MegaRAID health as Prometheus metrics. # # Tested against StorCLI 'Ver 1.14.12 Nov 25, 2014'. # # StorCLI reference manual: # http://docs.avagotech.com/docs/12352476 # # Advanced Software Options (ASO) not exposed as metrics currently. # # JSON key abbreviations used by StorCLI are documented in the standard command # output, i.e. when you omit the trailing 'J' from the command. import argparse import json import subprocess DESCRIPTION = """Parses StorCLI's JSON output and exposes MegaRAID health as Prometheus metrics.""" VERSION = '0.0.1' METRIC_PREFIX = 'megaraid_' METRIC_CONTROLLER_LABELS = '{{controller="{}", model="{}"}}' def main(args): data = json.loads(get_storcli_json(args.storcli_path)) # It appears that the data we need will always be present in the first # item in the Controllers array status = data['Controllers'][0] metrics = { 'status_code': status['Command Status']['Status Code'], 'controllers': status['Response Data']['Number of Controllers'], } for name, value in metrics.iteritems(): print("{}{} {}".format(METRIC_PREFIX, name, value)) controller_info = [] controller_metrics = {} overview = [] try: overview = status['Response Data']['System Overview'] except KeyError: pass for controller in overview: controller_index = controller['Ctl'] model = controller['Model'] controller_info.append(METRIC_CONTROLLER_LABELS.format(controller_index, model)) controller_metrics = { # FIXME: Parse dimmer switch options # 'dimmer_switch': controller['DS'], 'battery_backup_healthy': int(controller['BBU'] == 'Opt'), 'degraded': int(controller['Hlth'] == 'Dgd'), 'drive_groups': controller['DGs'], 'emergency_hot_spare': int(controller['EHS'] == 'Y'), 'failed': int(controller['Hlth'] == 'Fld'), 'healthy': int(controller['Hlth'] == 'Opt'), 'physical_drives': controller['PDs'], 'ports': controller['Ports'], 'scheduled_patrol_read': int(controller['sPR'] == 'On'), 'virtual_drives': controller['VDs'], # Reverse StorCLI's logic to make metrics consistent 'drive_groups_optimal': int(controller['DNOpt'] == 0), 'virtual_drives_optimal': int(controller['VNOpt'] == 0), } for name, value in controller_metrics.iteritems(): print('{}{}{{controller="{}"}} {}'.format(METRIC_PREFIX, name, controller_index, value)) for labels in controller_info: print('{}{}{} {}'.format(METRIC_PREFIX, 'controller_info', labels, 1)) def get_storcli_json(storcli_path): storcli_cmd = [storcli_path, 'show', 'all', 'J'] proc = subprocess.Popen(storcli_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) return proc.communicate()[0] if __name__ == "__main__": parser = argparse.ArgumentParser(description=DESCRIPTION, formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--storcli_path', default='/opt/MegaRAID/storcli/storcli64', help='path to StorCLi binary') parser.add_argument('--version', action='version', version='%(prog)s {}'.format(VERSION)) args = parser.parse_args() main(args) prometheus-node-exporter-0.15.2+ds/ttar000077500000000000000000000150611321450230300200610ustar00rootroot00000000000000#!/usr/bin/env bash # Purpose: plain text tar format # Limitations: - only suitable for text files, directories, and symlinks # - stores only filename, content, and mode # - not designed for untrusted input # Note: must work with bash version 3.2 (macOS) set -o errexit -o nounset # Sanitize environment (for instance, standard sorting of glob matches) export LC_ALL=C path="" CMD="" ARG_STRING="$@" function usage { bname=$(basename "$0") cat << USAGE Usage: $bname [-C ] -c -f (create archive) $bname -t -f (list archive contents) $bname [-C ] -x -f (extract archive) Options: -C (change directory) Example: Change to sysfs directory, create ttar file from fixtures directory $bname -C sysfs -c -f sysfs/fixtures.ttar fixtures/ USAGE exit "$1" } function vecho { if [ "${VERBOSE:-}" == "yes" ]; then echo >&7 "$@" fi } function set_cmd { if [ -n "$CMD" ]; then echo "ERROR: more than one command given" echo usage 2 fi CMD=$1 } while getopts :cf:htxvC: opt; do case $opt in c) set_cmd "create" ;; f) ARCHIVE=$OPTARG ;; h) usage 0 ;; t) set_cmd "list" ;; x) set_cmd "extract" ;; v) VERBOSE=yes exec 7>&1 ;; C) CDIR=$OPTARG ;; *) echo >&2 "ERROR: invalid option -$OPTARG" echo usage 1 ;; esac done # Remove processed options from arguments shift $(( OPTIND - 1 )); if [ "${CMD:-}" == "" ]; then echo >&2 "ERROR: no command given" echo usage 1 elif [ "${ARCHIVE:-}" == "" ]; then echo >&2 "ERROR: no archive name given" echo usage 1 fi function list { local path="" local size=0 local line_no=0 local ttar_file=$1 if [ -n "${2:-}" ]; then echo >&2 "ERROR: too many arguments." echo usage 1 fi if [ ! -e "$ttar_file" ]; then echo >&2 "ERROR: file not found ($ttar_file)" echo usage 1 fi while read -r line; do line_no=$(( line_no + 1 )) if [ $size -gt 0 ]; then size=$(( size - 1 )) continue fi if [[ $line =~ ^Path:\ (.*)$ ]]; then path=${BASH_REMATCH[1]} elif [[ $line =~ ^Lines:\ (.*)$ ]]; then size=${BASH_REMATCH[1]} echo "$path" elif [[ $line =~ ^Directory:\ (.*)$ ]]; then path=${BASH_REMATCH[1]} echo "$path/" elif [[ $line =~ ^SymlinkTo:\ (.*)$ ]]; then echo "$path -> ${BASH_REMATCH[1]}" fi done < "$ttar_file" } function extract { local path="" local size=0 local line_no=0 local ttar_file=$1 if [ -n "${2:-}" ]; then echo >&2 "ERROR: too many arguments." echo usage 1 fi if [ ! -e "$ttar_file" ]; then echo >&2 "ERROR: file not found ($ttar_file)" echo usage 1 fi while IFS= read -r line; do line_no=$(( line_no + 1 )) if [ "$size" -gt 0 ]; then echo "$line" >> "$path" size=$(( size - 1 )) continue fi if [[ $line =~ ^Path:\ (.*)$ ]]; then path=${BASH_REMATCH[1]} if [ -e "$path" ] || [ -L "$path" ]; then rm "$path" fi elif [[ $line =~ ^Lines:\ (.*)$ ]]; then size=${BASH_REMATCH[1]} # Create file even if it is zero-length. touch "$path" vecho " $path" elif [[ $line =~ ^Mode:\ (.*)$ ]]; then mode=${BASH_REMATCH[1]} chmod "$mode" "$path" vecho "$mode" elif [[ $line =~ ^Directory:\ (.*)$ ]]; then path=${BASH_REMATCH[1]} mkdir -p "$path" vecho " $path/" elif [[ $line =~ ^SymlinkTo:\ (.*)$ ]]; then ln -s "${BASH_REMATCH[1]}" "$path" vecho " $path -> ${BASH_REMATCH[1]}" elif [[ $line =~ ^# ]]; then # Ignore comments between files continue else echo >&2 "ERROR: Unknown keyword on line $line_no: $line" exit 1 fi done < "$ttar_file" } function div { echo "# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" \ "- - - - - -" } function get_mode { local mfile=$1 if [ -z "${STAT_OPTION:-}" ]; then if stat -c '%a' "$mfile" >/dev/null 2>&1; then STAT_OPTION='-c' STAT_FORMAT='%a' else STAT_OPTION='-f' STAT_FORMAT='%A' fi fi stat "${STAT_OPTION}" "${STAT_FORMAT}" "$mfile" } function _create { shopt -s nullglob local mode while (( "$#" )); do file=$1 if [ -L "$file" ]; then echo "Path: $file" symlinkTo=$(readlink "$file") echo "SymlinkTo: $symlinkTo" vecho " $file -> $symlinkTo" div elif [ -d "$file" ]; then # Strip trailing slash (if there is one) file=${file%/} echo "Directory: $file" mode=$(get_mode "$file") echo "Mode: $mode" vecho "$mode $file/" div # Find all files and dirs, including hidden/dot files for x in "$file/"{*,.[^.]*}; do _create "$x" done elif [ -f "$file" ]; then echo "Path: $file" lines=$(wc -l "$file"|awk '{print $1}') echo "Lines: $lines" cat "$file" mode=$(get_mode "$file") echo "Mode: $mode" vecho "$mode $file" div else echo >&2 "ERROR: file not found ($file in $(pwd))" exit 2 fi shift done } function create { ttar_file=$1 shift if [ -z "${1:-}" ]; then echo >&2 "ERROR: missing arguments." echo usage 1 fi if [ -e "$ttar_file" ]; then rm "$ttar_file" fi exec > "$ttar_file" echo "# Archive created by ttar $ARG_STRING" _create "$@" } if [ -n "${CDIR:-}" ]; then if [[ "$ARCHIVE" != /* ]]; then # Relative path: preserve the archive's location before changing # directory ARCHIVE="$(pwd)/$ARCHIVE" fi cd "$CDIR" fi "$CMD" "$ARCHIVE" "$@" prometheus-node-exporter-0.15.2+ds/vendor/000077500000000000000000000000001321450230300204535ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/vendor/github.com/000077500000000000000000000000001321450230300225125ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/vendor/github.com/beevik/000077500000000000000000000000001321450230300237575ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/vendor/github.com/beevik/ntp/000077500000000000000000000000001321450230300245605ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/vendor/github.com/beevik/ntp/CONTRIBUTORS000066400000000000000000000002511321450230300264360ustar00rootroot00000000000000Brett Vickers (beevik) Mikhail Salosin (AlphaB) Anton Tolchanov (knyar) Christopher Batey (chbatey) Meng Zhuo (mengzhuo) Leonid Evdokimov (darkk) Ask Bjørn Hansen (abh)prometheus-node-exporter-0.15.2+ds/vendor/github.com/beevik/ntp/LICENSE000066400000000000000000000024101321450230300255620ustar00rootroot00000000000000Copyright 2015 Brett Vickers. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. prometheus-node-exporter-0.15.2+ds/vendor/github.com/beevik/ntp/README.md000066400000000000000000000017021321450230300260370ustar00rootroot00000000000000[![Build Status](https://travis-ci.org/beevik/ntp.svg?branch=master)](https://travis-ci.org/beevik/ntp) [![GoDoc](https://godoc.org/github.com/beevik/ntp?status.svg)](https://godoc.org/github.com/beevik/ntp) ntp === The ntp package is an implementation of a Simple NTP (SNTP) client based on [RFC5905](https://tools.ietf.org/html/rfc5905). It allows you to connect to a remote NTP server and request the current time. If all you care about is the current time according to a known remote NTP server, simply use the `Time` function: ```go time, err := ntp.Time("0.beevik-ntp.pool.ntp.org") ``` If you want the time as well as additional metadata about the time, use the `Query` function instead: ```go response, err := ntp.Query("0.beevik-ntp.pool.ntp.org") ``` To use the NTP pool in your application, please request your own [vendor zone](http://www.pool.ntp.org/en/vendors.html). Avoid using the `[number].pool.ntp.org` zone names in your applications. prometheus-node-exporter-0.15.2+ds/vendor/github.com/beevik/ntp/RELEASE_NOTES.md000066400000000000000000000043431321450230300271360ustar00rootroot00000000000000Release v0.1.1 ============== **Breaking changes** * Removed the `MaxStratum` constant. **Deprecations** * Officially deprecated the `TimeV` function. **Internal changes** * Removed `minDispersion` from the `RootDistance` calculation, since the value was arbitrary. * Moved some validation into main code path so that invalid `TransmitTime` and `mode` responses trigger an error even when `Response.Validate` is not called. Release v0.1.0 ============== This is the initial release of the `ntp` package. Currently it supports the following features: * `Time()` to query the current time according to a remote NTP server. * `Query()` to query multiple pieces of time-related information from a remote NTP server. * `QueryWithOptions()`, which is like `Query()` but with the ability to override default query options. Time-related information returned by the `Query` functions includes: * `Time`: the time the server transmitted its response, according to the server's clock. * `ClockOffset`: the estimated offset of the client's clock relative to the server's clock. You may apply this offset to any local system clock reading once the query is complete. * `RTT`: an estimate of the round-trip-time delay between the client and the server. * `Precision`: the precision of the server's clock reading. * `Stratum`: the "stratum" level of the server, where 1 indicates a server directly connected to a reference clock, and values greater than 1 indicating the number of hops from the reference clock. * `ReferenceID`: A unique identifier for the NTP server that was contacted. * `ReferenceTime`: The time at which the server last updated its local clock setting. * `RootDelay`: The server's round-trip delay to the reference clock. * `RootDispersion`: The server's total dispersion to the referenced clock. * `RootDistance`: An estimate of the root synchronization distance. * `Leap`: The leap second indicator. * `MinError`: A lower bound on the clock error between the client and the server. * `Poll`: the maximum polling interval between successive messages on the server. The `Response` structure returned by the `Query` functions also contains a `Response.Validate()` function that returns an error if any of the fields returned by the server are invalid. prometheus-node-exporter-0.15.2+ds/vendor/github.com/beevik/ntp/ntp.go000066400000000000000000000402161321450230300257130ustar00rootroot00000000000000// Copyright 2015-2017 Brett Vickers. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package ntp provides an implementation of a Simple NTP (SNTP) client // capable of querying the current time from a remote NTP server. See // RFC5905 (https://tools.ietf.org/html/rfc5905) for more details. // // This approach grew out of a go-nuts post by Michael Hofmann: // https://groups.google.com/forum/?fromgroups#!topic/golang-nuts/FlcdMU5fkLQ package ntp import ( "crypto/rand" "encoding/binary" "errors" "net" "time" "golang.org/x/net/ipv4" ) // The LeapIndicator is used to warn if a leap second should be inserted // or deleted in the last minute of the current month. type LeapIndicator uint8 const ( // LeapNoWarning indicates no impending leap second. LeapNoWarning LeapIndicator = 0 // LeapAddSecond indicates the last minute of the day has 61 seconds. LeapAddSecond = 1 // LeapDelSecond indicates the last minute of the day has 59 seconds. LeapDelSecond = 2 // LeapNotInSync indicates an unsynchronized leap second. LeapNotInSync = 3 ) // Internal constants const ( defaultNtpVersion = 4 nanoPerSec = 1000000000 maxStratum = 16 defaultTimeout = 5 * time.Second maxPollInterval = (1 << 17) * time.Second maxDispersion = 16 * time.Second ) // Internal variables var ( ntpEpoch = time.Date(1900, 1, 1, 0, 0, 0, 0, time.UTC) ) type mode uint8 // NTP modes. This package uses only client mode. const ( reserved mode = 0 + iota symmetricActive symmetricPassive client server broadcast controlMessage reservedPrivate ) // An ntpTime is a 64-bit fixed-point (Q32.32) representation of the number of // seconds elapsed. type ntpTime uint64 // Duration interprets the fixed-point ntpTime as a number of elapsed seconds // and returns the corresponding time.Duration value. func (t ntpTime) Duration() time.Duration { sec := (t >> 32) * nanoPerSec frac := (t & 0xffffffff) * nanoPerSec >> 32 return time.Duration(sec + frac) } // Time interprets the fixed-point ntpTime as an absolute time and returns // the corresponding time.Time value. func (t ntpTime) Time() time.Time { return ntpEpoch.Add(t.Duration()) } // toNtpTime converts the time.Time value t into its 64-bit fixed-point // ntpTime representation. func toNtpTime(t time.Time) ntpTime { nsec := uint64(t.Sub(ntpEpoch)) sec := nsec / nanoPerSec // Round up the fractional component so that repeated conversions // between time.Time and ntpTime do not yield continually decreasing // results. frac := (((nsec - sec*nanoPerSec) << 32) + nanoPerSec - 1) / nanoPerSec return ntpTime(sec<<32 | frac) } // An ntpTimeShort is a 32-bit fixed-point (Q16.16) representation of the // number of seconds elapsed. type ntpTimeShort uint32 // Duration interprets the fixed-point ntpTimeShort as a number of elapsed // seconds and returns the corresponding time.Duration value. func (t ntpTimeShort) Duration() time.Duration { t64 := uint64(t) sec := (t64 >> 16) * nanoPerSec frac := (t64 & 0xffff) * nanoPerSec >> 16 return time.Duration(sec + frac) } // msg is an internal representation of an NTP packet. type msg struct { LiVnMode uint8 // Leap Indicator (2) + Version (3) + Mode (3) Stratum uint8 Poll int8 Precision int8 RootDelay ntpTimeShort RootDispersion ntpTimeShort ReferenceID uint32 ReferenceTime ntpTime OriginTime ntpTime ReceiveTime ntpTime TransmitTime ntpTime } // setVersion sets the NTP protocol version on the message. func (m *msg) setVersion(v int) { m.LiVnMode = (m.LiVnMode & 0xc7) | uint8(v)<<3 } // setMode sets the NTP protocol mode on the message. func (m *msg) setMode(md mode) { m.LiVnMode = (m.LiVnMode & 0xf8) | uint8(md) } // setLeap modifies the leap indicator on the message. func (m *msg) setLeap(li LeapIndicator) { m.LiVnMode = (m.LiVnMode & 0x3f) | uint8(li)<<6 } // getVersion returns the version value in the message. func (m *msg) getVersion() int { return int((m.LiVnMode >> 3) & 0x07) } // getMode returns the mode value in the message. func (m *msg) getMode() mode { return mode(m.LiVnMode & 0x07) } // getLeap returns the leap indicator on the message. func (m *msg) getLeap() LeapIndicator { return LeapIndicator((m.LiVnMode >> 6) & 0x03) } // QueryOptions contains the list of configurable options that may be used // with the QueryWithOptions function. type QueryOptions struct { Timeout time.Duration // defaults to 5 seconds Version int // NTP protocol version, defaults to 4 LocalAddress string // IP address to use for the client address Port int // Server port, defaults to 123 TTL int // IP TTL to use, defaults to system default } // A Response contains time data, some of which is returned by the NTP server // and some of which is calculated by the client. type Response struct { // Time is the transmit time reported by the server just before it // responded to the client's NTP query. Time time.Time // ClockOffset is the estimated offset of the client clock relative to // the server. Add this to the client's system clock time to obtain a // more accurate time. ClockOffset time.Duration // RTT is the measured round-trip-time delay estimate between the client // and the server. RTT time.Duration // Precision is the reported precision of the server's clock. Precision time.Duration // Stratum is the "stratum level" of the server. The smaller the number, // the closer the server is to the reference clock. Stratum 1 servers are // attached directly to the reference clock. A stratum value of 0 // indicates the "kiss of death," which typically occurs when the client // issues too many requests to the server in a short period of time. Stratum uint8 // ReferenceID is a 32-bit identifier identifying the server or // reference clock. ReferenceID uint32 // ReferenceTime is the time when the server's system clock was last // set or corrected. ReferenceTime time.Time // RootDelay is the server's estimated aggregate round-trip-time delay to // the stratum 1 server. RootDelay time.Duration // RootDispersion is the server's estimated maximum measurement error // relative to the stratum 1 server. RootDispersion time.Duration // RootDistance is an estimate of the total synchronization distance // between the client and the stratum 1 server. RootDistance time.Duration // Leap indicates whether a leap second should be added or removed from // the current month's last minute. Leap LeapIndicator // MinError is a lower bound on the error between the client and server // clocks. When the client and server are not synchronized to the same // clock, the reported timestamps may appear to violate the principle of // causality. In other words, the NTP server's response may indicate // that a message was received before it was sent. In such cases, the // minimum error may be useful. MinError time.Duration // Poll is the maximum interval between successive NTP polling messages. // It is not relevant for simple NTP clients like this one. Poll time.Duration } // Validate checks if the response is valid for the purposes of time // synchronization. func (r *Response) Validate() error { // Handle invalid stratum values. if r.Stratum == 0 { return errors.New("kiss of death received") } if r.Stratum >= maxStratum { return errors.New("invalid stratum in response") } // Handle invalid leap second indicator. if r.Leap == LeapNotInSync { return errors.New("invalid leap second") } // Estimate the "freshness" of the time. If it exceeds the maximum // polling interval (~36 hours), then it cannot be considered "fresh". freshness := r.Time.Sub(r.ReferenceTime) if freshness > maxPollInterval { return errors.New("server clock not fresh") } // Calculate the peer synchronization distance, lambda: // lambda := RootDelay/2 + RootDispersion // If this value exceeds MAXDISP (16s), then the time is not suitable // for synchronization purposes. // https://tools.ietf.org/html/rfc5905#appendix-A.5.1.1. lambda := r.RootDelay/2 + r.RootDispersion if lambda > maxDispersion { return errors.New("invalid dispersion") } // If the server's transmit time is before its reference time, the // response is invalid. if r.Time.Before(r.ReferenceTime) { return errors.New("invalid time reported") } // nil means the response is valid. return nil } // Query returns a response from the remote NTP server host. It contains // the time at which the server transmitted the response as well as other // useful information about the time and the remote server. func Query(host string) (*Response, error) { return QueryWithOptions(host, QueryOptions{}) } // QueryWithOptions performs the same function as Query but allows for the // customization of several query options. func QueryWithOptions(host string, opt QueryOptions) (*Response, error) { m, now, err := getTime(host, opt) if err != nil { return nil, err } return parseTime(m, now), nil } // TimeV returns the current time using information from a remote NTP server. // On error, it returns the local system time. The version may be 2, 3, or 4. // // Deprecated: TimeV is deprecated. Use QueryWithOptions instead. func TimeV(host string, version int) (time.Time, error) { m, recvTime, err := getTime(host, QueryOptions{Version: version}) if err != nil { return time.Now(), err } r := parseTime(m, recvTime) err = r.Validate() if err != nil { return time.Now(), err } // Use the clock offset to calculate the time. return time.Now().Add(r.ClockOffset), nil } // Time returns the current time using information from a remote NTP server. // It uses version 4 of the NTP protocol. On error, it returns the local // system time. func Time(host string) (time.Time, error) { return TimeV(host, defaultNtpVersion) } // getTime performs the NTP server query and returns the response message // along with the local system time it was received. func getTime(host string, opt QueryOptions) (*msg, ntpTime, error) { if opt.Version == 0 { opt.Version = defaultNtpVersion } if opt.Version < 2 || opt.Version > 4 { return nil, 0, errors.New("invalid protocol version requested") } // Resolve the remote NTP server address. raddr, err := net.ResolveUDPAddr("udp", net.JoinHostPort(host, "123")) if err != nil { return nil, 0, err } // Resolve the local address if specified as an option. var laddr *net.UDPAddr if opt.LocalAddress != "" { laddr, err = net.ResolveUDPAddr("udp", net.JoinHostPort(opt.LocalAddress, "0")) if err != nil { return nil, 0, err } } // Override the port if requested. if opt.Port != 0 { raddr.Port = opt.Port } // Prepare a "connection" to the remote server. con, err := net.DialUDP("udp", laddr, raddr) if err != nil { return nil, 0, err } defer con.Close() // Set a TTL for the packet if requested. if opt.TTL != 0 { ipcon := ipv4.NewConn(con) err = ipcon.SetTTL(opt.TTL) if err != nil { return nil, 0, err } } // Set a timeout on the connection. if opt.Timeout == 0 { opt.Timeout = defaultTimeout } con.SetDeadline(time.Now().Add(opt.Timeout)) // Allocate a message to hold the response. recvMsg := new(msg) // Allocate a message to hold the query. xmitMsg := new(msg) xmitMsg.setMode(client) xmitMsg.setVersion(opt.Version) xmitMsg.setLeap(LeapNotInSync) // To ensure privacy and prevent spoofing, try to use a random 64-bit // value for the TransmitTime. If crypto/rand couldn't generate a // random value, fall back to using the system clock. Keep track of // when the messsage was actually sent. r := make([]byte, 8) _, err = rand.Read(r) var sendTime time.Time if err == nil { xmitMsg.TransmitTime = ntpTime(binary.BigEndian.Uint64(r)) sendTime = time.Now() } else { sendTime = time.Now() xmitMsg.TransmitTime = toNtpTime(sendTime) } // Transmit the query. err = binary.Write(con, binary.BigEndian, xmitMsg) if err != nil { return nil, 0, err } // Receive the response. err = binary.Read(con, binary.BigEndian, recvMsg) if err != nil { return nil, 0, err } // Keep track of the time the response was received. delta := time.Since(sendTime) if delta < 0 { // The system clock may have been set backwards since the packet was // transmitted. In go 1.9 and later, time.Since ensures that a // monotonic clock is used, and delta can never be less than zero. // In versions before 1.9, we have to check. return nil, 0, errors.New("client clock ticked backwards") } recvTime := toNtpTime(sendTime.Add(delta)) // Check for invalid fields. if recvMsg.getMode() != server { return nil, 0, errors.New("invalid mode in response") } if recvMsg.TransmitTime == ntpTime(0) { return nil, 0, errors.New("invalid transmit time in response") } if recvMsg.OriginTime != xmitMsg.TransmitTime { return nil, 0, errors.New("server response mismatch") } if recvMsg.ReceiveTime > recvMsg.TransmitTime { return nil, 0, errors.New("server clock ticked backwards") } // Correct the received message's origin time using the actual send // time. recvMsg.OriginTime = toNtpTime(sendTime) return recvMsg, recvTime, nil } // parseTime parses the NTP packet along with the packet receive time to // generate a Response record. func parseTime(m *msg, recvTime ntpTime) *Response { r := &Response{ Time: m.TransmitTime.Time(), ClockOffset: offset(m.OriginTime, m.ReceiveTime, m.TransmitTime, recvTime), RTT: rtt(m.OriginTime, m.ReceiveTime, m.TransmitTime, recvTime), Precision: toInterval(m.Precision), Stratum: m.Stratum, ReferenceID: m.ReferenceID, ReferenceTime: m.ReferenceTime.Time(), RootDelay: m.RootDelay.Duration(), RootDispersion: m.RootDispersion.Duration(), Leap: m.getLeap(), MinError: minError(m.OriginTime, m.ReceiveTime, m.TransmitTime, recvTime), Poll: toInterval(m.Poll), } // Calculate values depending on other calculated values r.RootDistance = rootDistance(r.RTT, r.RootDelay, r.RootDispersion) return r } // The following helper functions calculate additional metadata about the // timestamps received from an NTP server. The timestamps returned by // the server are given the following variable names: // // org = Origin Timestamp (client send time) // rec = Receive Timestamp (server receive time) // xmt = Transmit Timestamp (server reply time) // dst = Destination Timestamp (client receive time) func rtt(org, rec, xmt, dst ntpTime) time.Duration { // round trip delay time // rtt = (dst-org) - (xmt-rec) a := dst.Time().Sub(org.Time()) b := xmt.Time().Sub(rec.Time()) rtt := a - b if rtt < 0 { rtt = 0 } return rtt } func offset(org, rec, xmt, dst ntpTime) time.Duration { // local clock offset // offset = ((rec-org) + (xmt-dst)) / 2 a := rec.Time().Sub(org.Time()) b := xmt.Time().Sub(dst.Time()) return (a + b) / time.Duration(2) } func minError(org, rec, xmt, dst ntpTime) time.Duration { // Each NTP response contains two pairs of send/receive timestamps. // When either pair indicates a "causality violation", we calculate the // error as the difference in time between them. The minimum error is // the greater of the two causality violations. var error0, error1 ntpTime if org >= rec { error0 = org - rec } if xmt >= dst { error1 = xmt - dst } if error0 > error1 { return error0.Duration() } return error1.Duration() } func rootDistance(rtt, rootDelay, rootDisp time.Duration) time.Duration { // The root distance is: // the maximum error due to all causes of the local clock // relative to the primary server. It is defined as half the // total delay plus total dispersion plus peer jitter. // (https://tools.ietf.org/html/rfc5905#appendix-A.5.5.2) // // In the reference implementation, it is calculated as follows: // rootDist = max(MINDISP, rootDelay + rtt)/2 + rootDisp // + peerDisp + PHI * (uptime - peerUptime) // + peerJitter // For an SNTP client which sends only a single packet, most of these // terms are irrelevant and become 0. totalDelay := rtt + rootDelay return totalDelay/2 + rootDisp } func toInterval(t int8) time.Duration { switch { case t > 0: return time.Duration(uint64(time.Second) << uint(t)) case t < 0: return time.Duration(uint64(time.Second) >> uint(-t)) default: return time.Second } } prometheus-node-exporter-0.15.2+ds/vendor/github.com/ema/000077500000000000000000000000001321450230300232545ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/vendor/github.com/ema/qdisc/000077500000000000000000000000001321450230300243575ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/vendor/github.com/ema/qdisc/LICENSE.md000066400000000000000000000020731321450230300257650ustar00rootroot00000000000000MIT License =========== Copyright (C) 2017 Emanuele Rocca Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. prometheus-node-exporter-0.15.2+ds/vendor/github.com/ema/qdisc/Makefile000066400000000000000000000002721321450230300260200ustar00rootroot00000000000000build: go fmt go build go vet staticcheck #golint -set_exit_status go test -v -race -tags=integration cover: go test -coverprofile=coverage.out go tool cover -html=coverage.out prometheus-node-exporter-0.15.2+ds/vendor/github.com/ema/qdisc/README.md000066400000000000000000000010241321450230300256330ustar00rootroot00000000000000qdisc [![Build Status](https://travis-ci.org/ema/qdisc.svg?branch=master)](https://travis-ci.org/ema/qdisc) ===== Package `qdisc` allows to get queuing discipline information via netlink, similarly to what `tc -s qdisc show` does. Example usage ------------- package main import ( "fmt" "github.com/ema/qdisc" ) func main() { info, err := qdisc.Get() if err == nil { for _, msg := range info { fmt.Printf("%+v\n", msg) } } } prometheus-node-exporter-0.15.2+ds/vendor/github.com/ema/qdisc/get.go000066400000000000000000000135521321450230300254730ustar00rootroot00000000000000package qdisc import ( "fmt" "math" "net" "github.com/mdlayher/netlink" "github.com/mdlayher/netlink/nlenc" ) const ( TCA_UNSPEC = iota TCA_KIND TCA_OPTIONS TCA_STATS TCA_XSTATS TCA_RATE TCA_FCNT TCA_STATS2 TCA_STAB __TCA_MAX ) const ( TCA_STATS_UNSPEC = iota TCA_STATS_BASIC TCA_STATS_RATE_EST TCA_STATS_QUEUE TCA_STATS_APP TCA_STATS_RATE_EST64 __TCA_STATS_MAX ) // See struct tc_stats in /usr/include/linux/pkt_sched.h type TC_Stats struct { Bytes uint64 Packets uint32 Drops uint32 Overlimits uint32 Bps uint32 Pps uint32 Qlen uint32 Backlog uint32 } // See /usr/include/linux/gen_stats.h type TC_Stats2 struct { // struct gnet_stats_basic Bytes uint64 Packets uint32 // struct gnet_stats_queue Qlen uint32 Backlog uint32 Drops uint32 Requeues uint32 Overlimits uint32 } // See struct tc_fq_qd_stats /usr/include/linux/pkt_sched.h type TC_Fq_Qd_Stats struct { GcFlows uint64 HighprioPackets uint64 TcpRetrans uint64 Throttled uint64 FlowsPlimit uint64 PktsTooLong uint64 AllocationErrors uint64 TimeNextDelayedFlow int64 Flows uint32 InactiveFlows uint32 ThrottledFlows uint32 UnthrottleLatencyNs uint32 } type QdiscInfo struct { IfaceName string Parent uint32 Handle uint32 Kind string Bytes uint64 Packets uint32 Drops uint32 Requeues uint32 Overlimits uint32 GcFlows uint64 Throttled uint64 FlowsPlimit uint64 } func parseTCAStats(attr netlink.Attribute) TC_Stats { var stats TC_Stats stats.Bytes = nlenc.Uint64(attr.Data[0:8]) stats.Packets = nlenc.Uint32(attr.Data[8:12]) stats.Drops = nlenc.Uint32(attr.Data[12:16]) stats.Overlimits = nlenc.Uint32(attr.Data[16:20]) stats.Bps = nlenc.Uint32(attr.Data[20:24]) stats.Pps = nlenc.Uint32(attr.Data[24:28]) stats.Qlen = nlenc.Uint32(attr.Data[28:32]) stats.Backlog = nlenc.Uint32(attr.Data[32:36]) return stats } func parseTCAStats2(attr netlink.Attribute) TC_Stats2 { var stats TC_Stats2 nested, _ := netlink.UnmarshalAttributes(attr.Data) for _, a := range nested { switch a.Type { case TCA_STATS_BASIC: stats.Bytes = nlenc.Uint64(a.Data[0:8]) stats.Packets = nlenc.Uint32(a.Data[8:12]) case TCA_STATS_QUEUE: stats.Qlen = nlenc.Uint32(a.Data[0:4]) stats.Backlog = nlenc.Uint32(a.Data[4:8]) stats.Drops = nlenc.Uint32(a.Data[8:12]) stats.Requeues = nlenc.Uint32(a.Data[12:16]) stats.Overlimits = nlenc.Uint32(a.Data[16:20]) default: } } return stats } func parseTC_Fq_Qd_Stats(attr netlink.Attribute) TC_Fq_Qd_Stats { var stats TC_Fq_Qd_Stats nested, _ := netlink.UnmarshalAttributes(attr.Data) for _, a := range nested { switch a.Type { case TCA_STATS_APP: stats.GcFlows = nlenc.Uint64(a.Data[0:8]) stats.HighprioPackets = nlenc.Uint64(a.Data[8:16]) stats.TcpRetrans = nlenc.Uint64(a.Data[16:24]) stats.Throttled = nlenc.Uint64(a.Data[24:32]) stats.FlowsPlimit = nlenc.Uint64(a.Data[32:40]) stats.PktsTooLong = nlenc.Uint64(a.Data[40:48]) stats.AllocationErrors = nlenc.Uint64(a.Data[48:56]) default: } } return stats } func getQdiscMsgs(c *netlink.Conn) ([]netlink.Message, error) { req := netlink.Message{ Header: netlink.Header{ Flags: netlink.HeaderFlagsRequest | netlink.HeaderFlagsDump, Type: 38, // RTM_GETQDISC }, Data: []byte{0}, } // Perform a request, receive replies, and validate the replies msgs, err := c.Execute(req) if err != nil { return nil, fmt.Errorf("failed to execute request: %v", err) } return msgs, nil } // See https://tools.ietf.org/html/rfc3549#section-3.1.3 func parseMessage(msg netlink.Message) (QdiscInfo, error) { var m QdiscInfo var s TC_Stats var s2 TC_Stats2 var s_fq TC_Fq_Qd_Stats /* struct tcmsg { unsigned char tcm_family; unsigned char tcm__pad1; unsigned short tcm__pad2; int tcm_ifindex; __u32 tcm_handle; __u32 tcm_parent; __u32 tcm_info; }; */ if len(msg.Data) < 20 { return m, fmt.Errorf("Short message, len=%d", len(msg.Data)) } ifaceIdx := nlenc.Uint32(msg.Data[4:8]) m.Handle = nlenc.Uint32(msg.Data[8:12]) m.Parent = nlenc.Uint32(msg.Data[12:16]) if m.Parent == math.MaxUint32 { m.Parent = 0 } // The first 20 bytes are taken by tcmsg attrs, err := netlink.UnmarshalAttributes(msg.Data[20:]) if err != nil { return m, fmt.Errorf("failed to unmarshal attributes: %v", err) } for _, attr := range attrs { switch attr.Type { case TCA_KIND: m.Kind = nlenc.String(attr.Data) case TCA_STATS2: s2 = parseTCAStats2(attr) s_fq = parseTC_Fq_Qd_Stats(attr) if s_fq.GcFlows > 0 { m.GcFlows = s_fq.GcFlows } if s_fq.Throttled > 0 { m.Throttled = s_fq.Throttled } if s_fq.FlowsPlimit > 0 { m.FlowsPlimit = s_fq.FlowsPlimit } m.Bytes = s2.Bytes m.Packets = s2.Packets m.Drops = s2.Drops // requeues only available in TCA_STATS2, not in TCA_STATS m.Requeues = s2.Requeues m.Overlimits = s2.Overlimits case TCA_STATS: // Legacy s = parseTCAStats(attr) m.Bytes = s.Bytes m.Packets = s.Packets m.Drops = s.Drops m.Overlimits = s.Overlimits default: // TODO: TCA_OPTIONS and TCA_XSTATS } } iface, err := net.InterfaceByIndex(int(ifaceIdx)) if err == nil { m.IfaceName = iface.Name } return m, err } func getAndParse(c *netlink.Conn) ([]QdiscInfo, error) { var res []QdiscInfo msgs, err := getQdiscMsgs(c) if err != nil { return nil, err } for _, msg := range msgs { m, err := parseMessage(msg) if err != nil { return nil, err } res = append(res, m) } return res, nil } func Get() ([]QdiscInfo, error) { const familyRoute = 0 c, err := netlink.Dial(familyRoute, nil) if err != nil { return nil, fmt.Errorf("failed to dial netlink: %v", err) } defer c.Close() return getAndParse(c) } prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/000077500000000000000000000000001321450230300243175ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/netlink/000077500000000000000000000000001321450230300257635ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/netlink/LICENSE.md000066400000000000000000000020701321450230300273660ustar00rootroot00000000000000MIT License =========== Copyright (C) 2016 Matt Layher Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/netlink/README.md000066400000000000000000000016021321450230300272410ustar00rootroot00000000000000netlink [![Build Status](https://travis-ci.org/mdlayher/netlink.svg?branch=master)](https://travis-ci.org/mdlayher/netlink) [![GoDoc](https://godoc.org/github.com/mdlayher/netlink?status.svg)](https://godoc.org/github.com/mdlayher/netlink) [![Go Report Card](https://goreportcard.com/badge/github.com/mdlayher/netlink)](https://goreportcard.com/report/github.com/mdlayher/netlink) ======= Package `netlink` provides low-level access to Linux netlink sockets. MIT Licensed. Why? ---- A [number of netlink packages](https://godoc.org/?q=netlink) are already available for Go, but I wasn't able to find one that aligned with what I wanted in a netlink package: - Simple, idiomatic API - Well tested - Well documented - Makes use of Go best practices - Doesn't need root to work My goal for this package is to use it as a building block for the creation of other netlink protocol family packages. prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/netlink/align.go000066400000000000000000000022041321450230300274020ustar00rootroot00000000000000package netlink import ( "unsafe" ) // Functions and values used to properly align netlink messages, headers, // and attributes. Definitions taken from Linux kernel source. // #define NLMSG_ALIGNTO 4U const nlmsgAlignTo = 4 // #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) ) func nlmsgAlign(len int) int { return ((len) + nlmsgAlignTo - 1) & ^(nlmsgAlignTo - 1) } // #define NLMSG_LENGTH(len) ((len) + NLMSG_HDRLEN) func nlmsgLength(len int) int { return len + nlmsgHeaderLen } // #define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr))) var nlmsgHeaderLen = nlmsgAlign(int(unsafe.Sizeof(Header{}))) // #define NLA_ALIGNTO 4 const nlaAlignTo = 4 // #define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1)) func nlaAlign(len int) int { return ((len) + nlaAlignTo - 1) & ^(nlaAlignTo - 1) } // Because this package's Attribute type contains a byte slice, unsafe.Sizeof // can't be used to determine the correct length. const sizeofAttribute = 4 // #define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr))) var nlaHeaderLen = nlaAlign(sizeofAttribute) prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/netlink/attribute.go000066400000000000000000000051451321450230300303220ustar00rootroot00000000000000package netlink import ( "errors" "github.com/mdlayher/netlink/nlenc" ) var ( // errInvalidAttribute specifies if an Attribute's length is incorrect. errInvalidAttribute = errors.New("invalid attribute; length too short or too large") ) // An Attribute is a netlink attribute. Attributes are packed and unpacked // to and from the Data field of Message for some netlink protocol families. type Attribute struct { // Length of an Attribute, including this field and Type. Length uint16 // The type of this Attribute, typically matched to a constant. Type uint16 // An arbitrary payload which is specified by Type. Data []byte } // MarshalBinary marshals an Attribute into a byte slice. func (a Attribute) MarshalBinary() ([]byte, error) { if int(a.Length) < nlaHeaderLen { return nil, errInvalidAttribute } b := make([]byte, nlaAlign(int(a.Length))) nlenc.PutUint16(b[0:2], a.Length) nlenc.PutUint16(b[2:4], a.Type) copy(b[4:], a.Data) return b, nil } // UnmarshalBinary unmarshals the contents of a byte slice into an Attribute. func (a *Attribute) UnmarshalBinary(b []byte) error { if len(b) < nlaHeaderLen { return errInvalidAttribute } a.Length = nlenc.Uint16(b[0:2]) a.Type = nlenc.Uint16(b[2:4]) if nlaAlign(int(a.Length)) > len(b) { return errInvalidAttribute } switch { // No length, no data case a.Length == 0: a.Data = make([]byte, 0) // Not enough length for any data case a.Length < 4: return errInvalidAttribute // Data present case a.Length >= 4: a.Data = make([]byte, len(b[4:a.Length])) copy(a.Data, b[4:a.Length]) } return nil } // MarshalAttributes packs a slice of Attributes into a single byte slice. // In most cases, the Length field of each Attribute should be set to 0, so it // can be calculated and populated automatically for each Attribute. func MarshalAttributes(attrs []Attribute) ([]byte, error) { var c int for _, a := range attrs { c += nlaAlign(len(a.Data)) } b := make([]byte, 0, c) for _, a := range attrs { if a.Length == 0 { a.Length = uint16(nlaHeaderLen + len(a.Data)) } ab, err := a.MarshalBinary() if err != nil { return nil, err } b = append(b, ab...) } return b, nil } // UnmarshalAttributes unpacks a slice of Attributes from a single byte slice. func UnmarshalAttributes(b []byte) ([]Attribute, error) { var attrs []Attribute var i int for { if len(b[i:]) == 0 { break } var a Attribute if err := (&a).UnmarshalBinary(b[i:]); err != nil { return nil, err } if a.Length == 0 { i += nlaHeaderLen continue } i += nlaAlign(int(a.Length)) attrs = append(attrs, a) } return attrs, nil } prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/netlink/conn.go000066400000000000000000000147061321450230300272570ustar00rootroot00000000000000package netlink import ( "errors" "math/rand" "sync/atomic" "golang.org/x/net/bpf" ) // Error messages which can be returned by Validate. var ( errMismatchedSequence = errors.New("mismatched sequence in netlink reply") errMismatchedPID = errors.New("mismatched PID in netlink reply") errShortErrorMessage = errors.New("not enough data for netlink error code") ) // A Conn is a connection to netlink. A Conn can be used to send and // receives messages to and from netlink. type Conn struct { // osConn is the operating system-specific implementation of // a netlink sockets connection. c osConn // seq is an atomically incremented integer used to provide sequence // numbers when Conn.Send is called. seq *uint32 // pid is the PID assigned by netlink. pid uint32 } // An osConn is an operating-system specific implementation of netlink // sockets used by Conn. type osConn interface { Close() error Send(m Message) error Receive() ([]Message, error) JoinGroup(group uint32) error LeaveGroup(group uint32) error SetBPF(filter []bpf.RawInstruction) error } // Dial dials a connection to netlink, using the specified protocol number. // Config specifies optional configuration for Conn. If config is nil, a default // configuration will be used. func Dial(proto int, config *Config) (*Conn, error) { // Use OS-specific dial() to create osConn c, pid, err := dial(proto, config) if err != nil { return nil, err } return newConn(c, pid), nil } // newConn is the internal constructor for Conn, used in tests. func newConn(c osConn, pid uint32) *Conn { seq := rand.Uint32() return &Conn{ c: c, seq: &seq, pid: pid, } } // Close closes the connection. func (c *Conn) Close() error { return c.c.Close() } // Execute sends a single Message to netlink using Conn.Send, receives one or more // replies using Conn.Receive, and then checks the validity of the replies against // the request using Validate. // // See the documentation of Conn.Send, Conn.Receive, and Validate for details about // each function. func (c *Conn) Execute(m Message) ([]Message, error) { req, err := c.Send(m) if err != nil { return nil, err } replies, err := c.Receive() if err != nil { return nil, err } if err := Validate(req, replies); err != nil { return nil, err } return replies, nil } // Send sends a single Message to netlink. In most cases, m.Header's Length, // Sequence, and PID fields should be set to 0, so they can be populated // automatically before the Message is sent. On success, Send returns a copy // of the Message with all parameters populated, for later validation. // // If m.Header.Length is 0, it will be automatically populated using the // correct length for the Message, including its payload. // // If m.Header.Sequence is 0, it will be automatically populated using the // next sequence number for this connection. // // If m.Header.PID is 0, it will be automatically populated using a PID // assigned by netlink. func (c *Conn) Send(m Message) (Message, error) { ml := nlmsgLength(len(m.Data)) // TODO(mdlayher): fine-tune this limit. if ml > (1024 * 32) { return Message{}, errors.New("netlink message data too large") } if m.Header.Length == 0 { m.Header.Length = uint32(nlmsgAlign(ml)) } if m.Header.Sequence == 0 { m.Header.Sequence = c.nextSequence() } if m.Header.PID == 0 { m.Header.PID = c.pid } if err := c.c.Send(m); err != nil { return Message{}, err } return m, nil } // Receive receives one or more messages from netlink. Multi-part messages are // handled transparently and returned as a single slice of Messages, with the // final empty "multi-part done" message removed. // // If any of the messages indicate a netlink error, that error will be returned. func (c *Conn) Receive() ([]Message, error) { msgs, err := c.receive() if err != nil { return nil, err } // Trim the final message with multi-part done indicator if // present if m := msgs[len(msgs)-1]; m.Header.Flags&HeaderFlagsMulti != 0 && m.Header.Type == HeaderTypeDone { return msgs[:len(msgs)-1], nil } return msgs, nil } // receive is the internal implementation of Conn.Receive, which can be called // recursively to handle multi-part messages. func (c *Conn) receive() ([]Message, error) { msgs, err := c.c.Receive() if err != nil { return nil, err } // If this message is multi-part, we will need to perform an recursive call // to continue draining the socket var multi bool for _, m := range msgs { // Is this a multi-part message and is it not done yet? if m.Header.Flags&HeaderFlagsMulti != 0 && m.Header.Type != HeaderTypeDone { multi = true } if err := checkMessage(m); err != nil { return nil, err } } if !multi { return msgs, nil } // More messages waiting mmsgs, err := c.receive() if err != nil { return nil, err } return append(msgs, mmsgs...), nil } // JoinGroup joins a netlink multicast group by its ID. func (c *Conn) JoinGroup(group uint32) error { return c.c.JoinGroup(group) } // LeaveGroup leaves a netlink multicast group by its ID. func (c *Conn) LeaveGroup(group uint32) error { return c.c.LeaveGroup(group) } // SetBPF attaches an assembled BPF program to a Conn. func (c *Conn) SetBPF(filter []bpf.RawInstruction) error { return c.c.SetBPF(filter) } // nextSequence atomically increments Conn's sequence number and returns // the incremented value. func (c *Conn) nextSequence() uint32 { return atomic.AddUint32(c.seq, 1) } // Validate validates one or more reply Messages against a request Message, // ensuring that they contain matching sequence numbers and PIDs. func Validate(request Message, replies []Message) error { for _, m := range replies { // Check for mismatched sequence, unless: // - request had no sequence, meaning we are probably validating // a multicast reply if m.Header.Sequence != request.Header.Sequence && request.Header.Sequence != 0 { return errMismatchedSequence } // Check for mismatched PID, unless: // - request had no PID, meaning we are either: // - validating a multicast reply // - netlink has not yet assigned us a PID // - response had no PID, meaning it's from the kernel as a multicast reply if m.Header.PID != request.Header.PID && request.Header.PID != 0 && m.Header.PID != 0 { return errMismatchedPID } } return nil } // Config contains options for a Conn. type Config struct { // Groups is a bitmask which specifies multicast groups. If set to 0, // no multicast group subscriptions will be made. Groups uint32 } prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/netlink/conn_linux.go000066400000000000000000000122201321450230300304630ustar00rootroot00000000000000//+build linux package netlink import ( "errors" "os" "syscall" "unsafe" "golang.org/x/net/bpf" "golang.org/x/sys/unix" ) var ( errInvalidSockaddr = errors.New("expected unix.SockaddrNetlink but received different unix.Sockaddr") errInvalidFamily = errors.New("received invalid netlink family") ) var _ osConn = &conn{} // A conn is the Linux implementation of a netlink sockets connection. type conn struct { s socket sa *unix.SockaddrNetlink } // A socket is an interface over socket system calls. type socket interface { Bind(sa unix.Sockaddr) error Close() error Getsockname() (unix.Sockaddr, error) Recvmsg(p, oob []byte, flags int) (n int, oobn int, recvflags int, from unix.Sockaddr, err error) Sendmsg(p, oob []byte, to unix.Sockaddr, flags int) error SetSockopt(level, name int, v unsafe.Pointer, l uint32) error } // dial is the entry point for Dial. dial opens a netlink socket using // system calls, and returns its PID. func dial(family int, config *Config) (*conn, uint32, error) { fd, err := unix.Socket( unix.AF_NETLINK, unix.SOCK_RAW, family, ) if err != nil { return nil, 0, err } return bind(&sysSocket{fd: fd}, config) } // bind binds a connection to netlink using the input socket, which may be // a system call implementation or a mocked one for tests. func bind(s socket, config *Config) (*conn, uint32, error) { if config == nil { config = &Config{} } addr := &unix.SockaddrNetlink{ Family: unix.AF_NETLINK, Groups: config.Groups, } // Socket must be closed in the event of any system call errors, to avoid // leaking file descriptors. if err := s.Bind(addr); err != nil { _ = s.Close() return nil, 0, err } sa, err := s.Getsockname() if err != nil { _ = s.Close() return nil, 0, err } pid := sa.(*unix.SockaddrNetlink).Pid return &conn{ s: s, sa: addr, }, pid, nil } // Send sends a single Message to netlink. func (c *conn) Send(m Message) error { b, err := m.MarshalBinary() if err != nil { return err } addr := &unix.SockaddrNetlink{ Family: unix.AF_NETLINK, } return c.s.Sendmsg(b, nil, addr, 0) } // Receive receives one or more Messages from netlink. func (c *conn) Receive() ([]Message, error) { b := make([]byte, os.Getpagesize()) for { // Peek at the buffer to see how many bytes are available n, _, _, _, err := c.s.Recvmsg(b, nil, unix.MSG_PEEK) if err != nil { return nil, err } // Break when we can read all messages if n < len(b) { break } // Double in size if not enough bytes b = make([]byte, len(b)*2) } // Read out all available messages n, _, _, from, err := c.s.Recvmsg(b, nil, 0) if err != nil { return nil, err } addr, ok := from.(*unix.SockaddrNetlink) if !ok { return nil, errInvalidSockaddr } if addr.Family != unix.AF_NETLINK { return nil, errInvalidFamily } raw, err := syscall.ParseNetlinkMessage(b[:n]) if err != nil { return nil, err } msgs := make([]Message, 0, len(raw)) for _, r := range raw { m := Message{ Header: sysToHeader(r.Header), Data: r.Data, } msgs = append(msgs, m) } return msgs, nil } // Close closes the connection. func (c *conn) Close() error { return c.s.Close() } // JoinGroup joins a multicast group by ID. func (c *conn) JoinGroup(group uint32) error { return c.s.SetSockopt( unix.SOL_NETLINK, unix.NETLINK_ADD_MEMBERSHIP, unsafe.Pointer(&group), uint32(unsafe.Sizeof(group)), ) } // LeaveGroup leaves a multicast group by ID. func (c *conn) LeaveGroup(group uint32) error { return c.s.SetSockopt( unix.SOL_NETLINK, unix.NETLINK_DROP_MEMBERSHIP, unsafe.Pointer(&group), uint32(unsafe.Sizeof(group)), ) } // SetBPF attaches an assembled BPF program to a conn. func (c *conn) SetBPF(filter []bpf.RawInstruction) error { prog := unix.SockFprog{ Len: uint16(len(filter)), Filter: (*unix.SockFilter)(unsafe.Pointer(&filter[0])), } return c.s.SetSockopt( unix.SOL_SOCKET, unix.SO_ATTACH_FILTER, unsafe.Pointer(&prog), uint32(unsafe.Sizeof(prog)), ) } // sysToHeader converts a syscall.NlMsghdr to a Header. func sysToHeader(r syscall.NlMsghdr) Header { // NB: the memory layout of Header and syscall.NlMsgHdr must be // exactly the same for this unsafe cast to work return *(*Header)(unsafe.Pointer(&r)) } // newError converts an error number from netlink into the appropriate // system call error for Linux. func newError(errno int) error { return syscall.Errno(errno) } var _ socket = &sysSocket{} // A sysSocket is a socket which uses system calls for socket operations. type sysSocket struct { fd int } func (s *sysSocket) Bind(sa unix.Sockaddr) error { return unix.Bind(s.fd, sa) } func (s *sysSocket) Close() error { return unix.Close(s.fd) } func (s *sysSocket) Getsockname() (unix.Sockaddr, error) { return unix.Getsockname(s.fd) } func (s *sysSocket) Recvmsg(p, oob []byte, flags int) (int, int, int, unix.Sockaddr, error) { return unix.Recvmsg(s.fd, p, oob, flags) } func (s *sysSocket) Sendmsg(p, oob []byte, to unix.Sockaddr, flags int) error { return unix.Sendmsg(s.fd, p, oob, to, flags) } func (s *sysSocket) SetSockopt(level, name int, v unsafe.Pointer, l uint32) error { return setsockopt(s.fd, level, name, v, l) } prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/netlink/conn_others.go000066400000000000000000000024731321450230300306410ustar00rootroot00000000000000//+build !linux package netlink import ( "fmt" "runtime" "golang.org/x/net/bpf" ) var ( // errUnimplemented is returned by all functions on platforms that // cannot make use of netlink sockets. errUnimplemented = fmt.Errorf("netlink sockets not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) ) var _ osConn = &conn{} // A conn is the no-op implementation of a netlink sockets connection. type conn struct{} // dial is the entry point for Dial. dial always returns an error. func dial(family int, config *Config) (*conn, error) { return nil, errUnimplemented } // Send always returns an error. func (c *conn) Send(m Message) error { return errUnimplemented } // Receive always returns an error. func (c *conn) Receive() ([]Message, error) { return nil, errUnimplemented } // Close always returns an error. func (c *conn) Close() error { return errUnimplemented } // JoinGroup always returns an error. func (c *conn) JoinGroup(group uint32) error { return errUnimplemented } // LeaveGroup always returns an error. func (c *conn) LeaveGroup(group uint32) error { return errUnimplemented } // SetBPF always returns an error. func (c *conn) SetBPF(filter []bpf.RawInstruction) error { return errUnimplemented } // newError always returns an error. func newError(errno int) error { return errUnimplemented } prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/netlink/doc.go000066400000000000000000000001271321450230300270570ustar00rootroot00000000000000// Package netlink provides low-level access to Linux netlink sockets. package netlink prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/netlink/fuzz.go000066400000000000000000000007771321450230300273230ustar00rootroot00000000000000//+build gofuzz package netlink func Fuzz(data []byte) int { return fuzzAttributes(data) //return fuzzMessage(data) } func fuzzAttributes(data []byte) int { attrs, err := UnmarshalAttributes(data) if err != nil { return 0 } if _, err := MarshalAttributes(attrs); err != nil { panic(err) } return 1 } func fuzzMessage(data []byte) int { var m Message if err := (&m).UnmarshalBinary(data); err != nil { return 0 } if _, err := m.MarshalBinary(); err != nil { panic(err) } return 1 } prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/netlink/genetlink/000077500000000000000000000000001321450230300277435ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/netlink/genetlink/conn.go000066400000000000000000000067301321450230300312350ustar00rootroot00000000000000package genetlink import "github.com/mdlayher/netlink" // Controller is the generic netlink controller family ID, used to issue // requests to the controller. const Controller = 0x10 // Protocol is the netlink protocol constant used to specify generic netlink. const Protocol = 0x10 // A Conn is a generic netlink connection. A Conn can be used to send and // receive generic netlink messages to and from netlink. type Conn struct { // Family provides functions to help retrieve generic netlink families. Family *FamilyService c conn } var _ conn = &netlink.Conn{} // A conn is a netlink connection, which can be swapped for tests. type conn interface { Close() error JoinGroup(group uint32) error LeaveGroup(group uint32) error Send(m netlink.Message) (netlink.Message, error) Receive() ([]netlink.Message, error) } // Dial dials a generic netlink connection. Config specifies optional // configuration for the underlying netlink connection. If config is // nil, a default configuration will be used. func Dial(config *netlink.Config) (*Conn, error) { c, err := netlink.Dial(Protocol, config) if err != nil { return nil, err } return newConn(c), nil } // newConn is the internal constructor for Conn, used in tests. func newConn(c conn) *Conn { gc := &Conn{ c: c, } gc.Family = &FamilyService{c: gc} return gc } // Close closes the connection. func (c *Conn) Close() error { return c.c.Close() } // JoinGroup joins a netlink multicast group by its ID. func (c *Conn) JoinGroup(group uint32) error { return c.c.JoinGroup(group) } // LeaveGroup leaves a netlink multicast group by its ID. func (c *Conn) LeaveGroup(group uint32) error { return c.c.LeaveGroup(group) } // Send sends a single Message to netlink, wrapping it in a netlink.Message // using the specified generic netlink family and flags. On success, Send // returns a copy of the netlink.Message with all parameters populated, for // later validation. func (c *Conn) Send(m Message, family uint16, flags netlink.HeaderFlags) (netlink.Message, error) { nm := netlink.Message{ Header: netlink.Header{ Type: netlink.HeaderType(family), Flags: flags, }, } mb, err := m.MarshalBinary() if err != nil { return netlink.Message{}, err } nm.Data = mb reqnm, err := c.c.Send(nm) if err != nil { return netlink.Message{}, err } return reqnm, nil } // Receive receives one or more Messages from netlink. The netlink.Messages // used to wrap each Message are available for later validation. func (c *Conn) Receive() ([]Message, []netlink.Message, error) { msgs, err := c.c.Receive() if err != nil { return nil, nil, err } gmsgs := make([]Message, 0, len(msgs)) for _, nm := range msgs { var gm Message if err := (&gm).UnmarshalBinary(nm.Data); err != nil { return nil, nil, err } gmsgs = append(gmsgs, gm) } return gmsgs, msgs, nil } // Execute sends a single Message to netlink using Conn.Send, receives one or // more replies using Conn.Receive, and then checks the validity of the replies // against the request using netlink.Validate. // // See the documentation of Conn.Send, Conn.Receive, and netlink.Validate for // details about each function. func (c *Conn) Execute(m Message, family uint16, flags netlink.HeaderFlags) ([]Message, error) { req, err := c.Send(m, family, flags) if err != nil { return nil, err } msgs, replies, err := c.Receive() if err != nil { return nil, err } if err := netlink.Validate(req, replies); err != nil { return nil, err } return msgs, nil } prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/netlink/genetlink/doc.go000066400000000000000000000001371321450230300310400ustar00rootroot00000000000000// Package genetlink implements generic netlink interactions and data types. package genetlink prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/netlink/genetlink/family.go000066400000000000000000000113631321450230300315570ustar00rootroot00000000000000package genetlink import ( "errors" "fmt" "math" "github.com/mdlayher/netlink" "github.com/mdlayher/netlink/nlenc" ) // Constants used to request information from generic netlink controller. // Reference: http://lxr.free-electrons.com/source/include/linux/genetlink.h?v=3.3#L35 const ( ctrlVersion = 1 ctrlCommandGetFamily = 3 ) var ( // errInvalidFamilyVersion is returned when a family's version is greater // than an 8-bit integer. errInvalidFamilyVersion = errors.New("invalid family version attribute") // errInvalidMulticastGroupArray is returned when a multicast group array // of attributes is malformed. errInvalidMulticastGroupArray = errors.New("invalid multicast group attribute array") ) // A Family is a generic netlink family. type Family struct { ID uint16 Version uint8 Name string Groups []MulticastGroup } // A MulticastGroup is a generic netlink multicast group, which can be joined // for notifications from generic netlink families when specific events take // place. type MulticastGroup struct { ID uint32 Name string } // A FamilyService is used to retrieve generic netlink family information. type FamilyService struct { c *Conn } // Get retrieves a generic netlink family with the specified name. If the // family does not exist, the error value can be checked using os.IsNotExist. func (s *FamilyService) Get(name string) (Family, error) { b, err := netlink.MarshalAttributes([]netlink.Attribute{{ Type: attrFamilyName, Data: nlenc.Bytes(name), }}) if err != nil { return Family{}, err } req := Message{ Header: Header{ Command: ctrlCommandGetFamily, Version: ctrlVersion, }, Data: b, } msgs, err := s.c.Execute(req, Controller, netlink.HeaderFlagsRequest) if err != nil { return Family{}, err } // TODO(mdlayher): consider interpreting generic netlink header values families, err := buildFamilies(msgs) if err != nil { return Family{}, err } if len(families) != 1 { // If this were to ever happen, netlink must be in a state where // its answers cannot be trusted panic(fmt.Sprintf("netlink returned multiple families for name: %q", name)) } return families[0], nil } // List retrieves all registered generic netlink families. func (s *FamilyService) List() ([]Family, error) { req := Message{ Header: Header{ Command: ctrlCommandGetFamily, Version: ctrlVersion, }, } flags := netlink.HeaderFlagsRequest | netlink.HeaderFlagsDump msgs, err := s.c.Execute(req, Controller, flags) if err != nil { return nil, err } return buildFamilies(msgs) } // buildFamilies builds a slice of Families by parsing attributes from the // input Messages. func buildFamilies(msgs []Message) ([]Family, error) { families := make([]Family, 0, len(msgs)) for _, m := range msgs { attrs, err := netlink.UnmarshalAttributes(m.Data) if err != nil { return nil, err } var f Family if err := (&f).parseAttributes(attrs); err != nil { return nil, err } families = append(families, f) } return families, nil } // Attribute IDs mapped to specific family fields. const ( // TODO(mdlayher): parse additional attributes // Family attributes attrUnspecified = 0 attrFamilyID = 1 attrFamilyName = 2 attrVersion = 3 attrMulticastGroups = 7 // Multicast group-specific attributes attrMGName = 1 attrMGID = 2 ) // parseAttributes parses netlink attributes into a Family's fields. func (f *Family) parseAttributes(attrs []netlink.Attribute) error { for _, a := range attrs { switch a.Type { case attrFamilyID: f.ID = nlenc.Uint16(a.Data) case attrFamilyName: f.Name = nlenc.String(a.Data) case attrVersion: v := nlenc.Uint32(a.Data) if v > math.MaxUint8 { return errInvalidFamilyVersion } f.Version = uint8(v) case attrMulticastGroups: groups, err := parseMulticastGroups(a.Data) if err != nil { return err } f.Groups = groups } } return nil } // parseMulticastGroups parses an array of multicast group nested attributes // into a slice of MulticastGroups. func parseMulticastGroups(b []byte) ([]MulticastGroup, error) { attrs, err := netlink.UnmarshalAttributes(b) if err != nil { return nil, err } groups := make([]MulticastGroup, 0, len(attrs)) for i, a := range attrs { // The type attribute is essentially an array index here; it starts // at 1 and should increment for each new array element if int(a.Type) != i+1 { return nil, errInvalidMulticastGroupArray } nattrs, err := netlink.UnmarshalAttributes(a.Data) if err != nil { return nil, err } var g MulticastGroup for _, na := range nattrs { switch na.Type { case attrMGName: g.Name = nlenc.String(na.Data) case attrMGID: g.ID = nlenc.Uint32(na.Data) } } groups = append(groups, g) } return groups, nil } prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/netlink/genetlink/fuzz.go000066400000000000000000000004371321450230300312740ustar00rootroot00000000000000//+build gofuzz package genetlink func Fuzz(data []byte) int { return fuzzMessage(data) } func fuzzMessage(data []byte) int { var m Message if err := (&m).UnmarshalBinary(data); err != nil { return 0 } if _, err := m.MarshalBinary(); err != nil { panic(err) } return 1 } prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/netlink/genetlink/message.go000066400000000000000000000030701321450230300317160ustar00rootroot00000000000000package genetlink import ( "errors" ) var ( // errInvalidMessage is returned when a Message is malformed. errInvalidMessage = errors.New("generic netlink message is invalid or too short") ) // A Header is a generic netlink header. A Header is sent and received with // each generic netlink message to indicate metadata regarding a Message. type Header struct { // Command specifies a command to issue to netlink. Command uint8 // Version specifies the version of a command to use. Version uint8 } // headerLen is the length of a Header. const headerLen = 4 // A Message is a generic netlink message. It contains a Header and an // arbitrary byte payload, which may be decoded using information from the // Header. // // Data is encoded using the native endianness of the host system. Use // the netlink.Uint* and netlink.PutUint* functions to encode and decode // integers. type Message struct { Header Header Data []byte } // MarshalBinary marshals a Message into a byte slice. func (m Message) MarshalBinary() ([]byte, error) { b := make([]byte, headerLen) b[0] = m.Header.Command b[1] = m.Header.Version // b[2] and b[3] are padding bytes and set to zero return append(b, m.Data...), nil } // UnmarshalBinary unmarshals the contents of a byte slice into a Message. func (m *Message) UnmarshalBinary(b []byte) error { if len(b) < headerLen { return errInvalidMessage } // Don't allow reserved pad bytes to be set if b[2] != 0 || b[3] != 0 { return errInvalidMessage } m.Header.Command = b[0] m.Header.Version = b[1] m.Data = b[4:] return nil } prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/netlink/message.go000066400000000000000000000135451321450230300277460ustar00rootroot00000000000000package netlink import ( "errors" "fmt" "github.com/mdlayher/netlink/nlenc" ) // Various errors which may occur when attempting to marshal or unmarshal // a Message to and from its binary form. var ( errIncorrectMessageLength = errors.New("netlink message header length incorrect") errShortMessage = errors.New("not enough data to create a netlink message") errUnalignedMessage = errors.New("input data is not properly aligned for netlink message") ) // HeaderFlags specify flags which may be present in a Header. type HeaderFlags uint16 const ( // General netlink communication flags. // HeaderFlagsRequest indicates a request to netlink. HeaderFlagsRequest HeaderFlags = 1 // HeaderFlagsMulti indicates a multi-part message, terminated // by HeaderTypeDone on the last message. HeaderFlagsMulti HeaderFlags = 2 // HeaderFlagsAcknowledge requests that netlink reply with // an acknowledgement using HeaderTypeError and, if needed, // an error code. HeaderFlagsAcknowledge HeaderFlags = 4 // HeaderFlagsEcho requests that netlink echo this request // back to the sender. HeaderFlagsEcho HeaderFlags = 8 // HeaderFlagsDumpInterrupted indicates that a dump was // inconsistent due to a sequence change. HeaderFlagsDumpInterrupted HeaderFlags = 16 // HeaderFlagsDumpFiltered indicates that a dump was filtered // as requested. HeaderFlagsDumpFiltered HeaderFlags = 32 // Flags used to retrieve data from netlink. // HeaderFlagsRoot requests that netlink return a complete table instead // of a single entry. HeaderFlagsRoot HeaderFlags = 0x100 // HeaderFlagsMatch requests that netlink return a list of all matching // entries. HeaderFlagsMatch HeaderFlags = 0x200 // HeaderFlagsAtomic requests that netlink send an atomic snapshot of // its entries. Requires CAP_NET_ADMIN or an effective UID of 0. HeaderFlagsAtomic HeaderFlags = 0x400 // HeaderFlagsDump requests that netlink return a complete list of // all entries. HeaderFlagsDump HeaderFlags = HeaderFlagsRoot | HeaderFlagsMatch ) // String returns the string representation of a HeaderFlags. func (f HeaderFlags) String() string { names := []string{ "request", "multi", "acknowledge", "echo", "dumpinterrupted", "dumpfiltered", "1<<6", "1<<7", "root", "match", "atomic", } var s string for i, name := range names { if f&(1< 0 { r, size := utf8.DecodeRune(b) b = b[size:] buf.WriteRune(r) } return buf.String() } var _ genl = &sysGENL{} // sysGENL is the system implementation of genl, using generic netlink. type sysGENL struct { *genetlink.Conn } // GetFamily is a small adapter to make *genetlink.Conn implement genl. func (g *sysGENL) GetFamily(name string) (genetlink.Family, error) { return g.Conn.Family.Get(name) } prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/wifi/client_others.go000066400000000000000000000013431321450230300304470ustar00rootroot00000000000000//+build !linux package wifi var _ osClient = &client{} // A conn is the no-op implementation of a netlink sockets connection. type client struct{} // newClient always returns an error. func newClient() (*client, error) { return nil, errUnimplemented } // Close always returns an error. func (c *client) Close() error { return errUnimplemented } // Interfaces always returns an error. func (c *client) Interfaces() ([]*Interface, error) { return nil, errUnimplemented } // BSS always returns an error. func (c *client) BSS(ifi *Interface) (*BSS, error) { return nil, errUnimplemented } // StationInfo always returns an error. func (c *client) StationInfo(ifi *Interface) (*StationInfo, error) { return nil, errUnimplemented } prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/wifi/doc.go000066400000000000000000000001401321450230300263440ustar00rootroot00000000000000// Package wifi provides access to IEEE 802.11 WiFi device actions and statistics. package wifi prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/wifi/internal/000077500000000000000000000000001321450230300270715ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/wifi/internal/nl80211/000077500000000000000000000000001321450230300300765ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/wifi/internal/nl80211/const.go000066400000000000000000001454721321450230300315700ustar00rootroot00000000000000// WARNING: This file has automatically been generated on Thu, 29 Dec 2016 08:53:57 EST. // By https://git.io/cgogen. DO NOT EDIT. package nl80211 const ( // GenlName as defined in nl80211/nl80211.h:44 GenlName = "nl80211" // MulticastGroupConfig as defined in nl80211/nl80211.h:46 MulticastGroupConfig = "config" // MulticastGroupScan as defined in nl80211/nl80211.h:47 MulticastGroupScan = "scan" // MulticastGroupReg as defined in nl80211/nl80211.h:48 MulticastGroupReg = "regulatory" // MulticastGroupMlme as defined in nl80211/nl80211.h:49 MulticastGroupMlme = "mlme" // MulticastGroupVendor as defined in nl80211/nl80211.h:50 MulticastGroupVendor = "vendor" // MulticastGroupNan as defined in nl80211/nl80211.h:51 MulticastGroupNan = "nan" // MulticastGroupTestmode as defined in nl80211/nl80211.h:52 MulticastGroupTestmode = "testmode" // CmdGetMeshParams as defined in nl80211/nl80211.h:1080 CmdGetMeshParams = CmdGetMeshConfig // CmdSetMeshParams as defined in nl80211/nl80211.h:1081 CmdSetMeshParams = CmdSetMeshConfig // MeshSetupVendorPathSelIe as defined in nl80211/nl80211.h:1082 MeshSetupVendorPathSelIe = MeshSetupIe // AttrScanGeneration as defined in nl80211/nl80211.h:2332 AttrScanGeneration = AttrGeneration // AttrMeshParams as defined in nl80211/nl80211.h:2333 AttrMeshParams = AttrMeshConfig // AttrIfaceSocketOwner as defined in nl80211/nl80211.h:2334 AttrIfaceSocketOwner = AttrSocketOwner // MaxSuppRates as defined in nl80211/nl80211.h:2336 MaxSuppRates = 32 // MaxSuppHtRates as defined in nl80211/nl80211.h:2337 MaxSuppHtRates = 77 // MaxSuppRegRules as defined in nl80211/nl80211.h:2338 MaxSuppRegRules = 64 // TkipDataOffsetEncrKey as defined in nl80211/nl80211.h:2339 TkipDataOffsetEncrKey = 0 // TkipDataOffsetTxMicKey as defined in nl80211/nl80211.h:2340 TkipDataOffsetTxMicKey = 16 // TkipDataOffsetRxMicKey as defined in nl80211/nl80211.h:2341 TkipDataOffsetRxMicKey = 24 // HtCapabilityLen as defined in nl80211/nl80211.h:2342 HtCapabilityLen = 26 // VhtCapabilityLen as defined in nl80211/nl80211.h:2343 VhtCapabilityLen = 12 // MaxNrCipherSuites as defined in nl80211/nl80211.h:2345 MaxNrCipherSuites = 5 // MaxNrAkmSuites as defined in nl80211/nl80211.h:2346 MaxNrAkmSuites = 2 // MinRemainOnChannelTime as defined in nl80211/nl80211.h:2348 MinRemainOnChannelTime = 10 // ScanRssiTholdOff as defined in nl80211/nl80211.h:2351 ScanRssiTholdOff = -300 // CqmTxeMaxIntvl as defined in nl80211/nl80211.h:2353 CqmTxeMaxIntvl = 1800 // StaFlagMaxOldApi as defined in nl80211/nl80211.h:2457 StaFlagMaxOldApi = StaFlagTdlsPeer // FrequencyAttrPassiveScan as defined in nl80211/nl80211.h:2858 FrequencyAttrPassiveScan = FrequencyAttrNoIr // FrequencyAttrNoIbss as defined in nl80211/nl80211.h:2859 FrequencyAttrNoIbss = FrequencyAttrNoIr // FrequencyAttrGoConcurrent as defined in nl80211/nl80211.h:2860 FrequencyAttrGoConcurrent = FrequencyAttrIrConcurrent // AttrSchedScanMatchSsid as defined in nl80211/nl80211.h:3002 AttrSchedScanMatchSsid = SchedScanMatchAttrSsid // RrfPassiveScan as defined in nl80211/nl80211.h:3044 RrfPassiveScan = RrfNoIr // RrfNoIbss as defined in nl80211/nl80211.h:3045 RrfNoIbss = RrfNoIr // RrfNoHt40 as defined in nl80211/nl80211.h:3046 RrfNoHt40 = (RrfNoHt40minus | RrfNoHt40plus) // RrfGoConcurrent as defined in nl80211/nl80211.h:3048 RrfGoConcurrent = RrfIrConcurrent // RrfNoIrAll as defined in nl80211/nl80211.h:3051 RrfNoIrAll = (RrfNoIr | __RrfNoIbss) // SurveyInfoChannelTime as defined in nl80211/nl80211.h:3137 SurveyInfoChannelTime = SurveyInfoTime // SurveyInfoChannelTimeBusy as defined in nl80211/nl80211.h:3138 SurveyInfoChannelTimeBusy = SurveyInfoTimeBusy // SurveyInfoChannelTimeExtBusy as defined in nl80211/nl80211.h:3139 SurveyInfoChannelTimeExtBusy = SurveyInfoTimeExtBusy // SurveyInfoChannelTimeRx as defined in nl80211/nl80211.h:3140 SurveyInfoChannelTimeRx = SurveyInfoTimeRx // SurveyInfoChannelTimeTx as defined in nl80211/nl80211.h:3141 SurveyInfoChannelTimeTx = SurveyInfoTimeTx // TxqAttrQueue as defined in nl80211/nl80211.h:3449 TxqAttrQueue = TxqAttrAc // TxqQVo as defined in nl80211/nl80211.h:3450 TxqQVo = AcVo // TxqQVi as defined in nl80211/nl80211.h:3451 TxqQVi = AcVi // TxqQBe as defined in nl80211/nl80211.h:3452 TxqQBe = AcBe // TxqQBk as defined in nl80211/nl80211.h:3453 TxqQBk = AcBk // TxrateMcs as defined in nl80211/nl80211.h:3748 TxrateMcs = TxrateHt // VhtNssMax as defined in nl80211/nl80211.h:3749 VhtNssMax = 8 // __WowlanPktpatInvalid as defined in nl80211/nl80211.h:3914 __WowlanPktpatInvalid = __PktpatInvalid // WowlanPktpatMask as defined in nl80211/nl80211.h:3915 WowlanPktpatMask = PktpatMask // WowlanPktpatPattern as defined in nl80211/nl80211.h:3916 WowlanPktpatPattern = PktpatPattern // WowlanPktpatOffset as defined in nl80211/nl80211.h:3917 WowlanPktpatOffset = PktpatOffset // Num_WowlanPktpat as defined in nl80211/nl80211.h:3918 Num_WowlanPktpat = Num_Pktpat // Max_WowlanPktpat as defined in nl80211/nl80211.h:3919 Max_WowlanPktpat = Max_Pktpat // WowlanPatternSupport as defined in nl80211/nl80211.h:3920 WowlanPatternSupport = 0 // KckLen as defined in nl80211/nl80211.h:4327 KckLen = 16 // KekLen as defined in nl80211/nl80211.h:4328 KekLen = 16 // ReplayCtrLen as defined in nl80211/nl80211.h:4329 ReplayCtrLen = 8 // CritProtoMaxDuration as defined in nl80211/nl80211.h:4781 CritProtoMaxDuration = 5000 // VendorIdIsLinux as defined in nl80211/nl80211.h:4799 VendorIdIsLinux = 0x80000000 // NanFuncServiceIdLen as defined in nl80211/nl80211.h:4960 NanFuncServiceIdLen = 6 // NanFuncServiceSpecInfoMaxLen as defined in nl80211/nl80211.h:4961 NanFuncServiceSpecInfoMaxLen = 0xff // NanFuncSrfMaxLen as defined in nl80211/nl80211.h:4962 NanFuncSrfMaxLen = 0xff ) // nl80211Commands as declared in nl80211/nl80211.h:880 type nl80211Commands int32 // nl80211Commands enumeration from nl80211/nl80211.h:880 const ( CmdUnspec = iota CmdGetWiphy = 1 CmdSetWiphy = 2 CmdNewWiphy = 3 CmdDelWiphy = 4 CmdGetInterface = 5 CmdSetInterface = 6 CmdNewInterface = 7 CmdDelInterface = 8 CmdGetKey = 9 CmdSetKey = 10 CmdNewKey = 11 CmdDelKey = 12 CmdGetBeacon = 13 CmdSetBeacon = 14 CmdStartAp = 15 CmdNewBeacon = CmdStartAp CmdStopAp = 16 CmdDelBeacon = CmdStopAp CmdGetStation = 17 CmdSetStation = 18 CmdNewStation = 19 CmdDelStation = 20 CmdGetMpath = 21 CmdSetMpath = 22 CmdNewMpath = 23 CmdDelMpath = 24 CmdSetBss = 25 CmdSetReg = 26 CmdReqSetReg = 27 CmdGetMeshConfig = 28 CmdSetMeshConfig = 29 CmdSetMgmtExtraIe = 30 CmdGetReg = 31 CmdGetScan = 32 CmdTriggerScan = 33 CmdNewScanResults = 34 CmdScanAborted = 35 CmdRegChange = 36 CmdAuthenticate = 37 CmdAssociate = 38 CmdDeauthenticate = 39 CmdDisassociate = 40 CmdMichaelMicFailure = 41 CmdRegBeaconHint = 42 CmdJoinIbss = 43 CmdLeaveIbss = 44 CmdTestmode = 45 CmdConnect = 46 CmdRoam = 47 CmdDisconnect = 48 CmdSetWiphyNetns = 49 CmdGetSurvey = 50 CmdNewSurveyResults = 51 CmdSetPmksa = 52 CmdDelPmksa = 53 CmdFlushPmksa = 54 CmdRemainOnChannel = 55 CmdCancelRemainOnChannel = 56 CmdSetTxBitrateMask = 57 CmdRegisterFrame = 58 CmdRegisterAction = CmdRegisterFrame CmdFrame = 59 CmdAction = CmdFrame CmdFrameTxStatus = 60 CmdActionTxStatus = CmdFrameTxStatus CmdSetPowerSave = 61 CmdGetPowerSave = 62 CmdSetCqm = 63 CmdNotifyCqm = 64 CmdSetChannel = 65 CmdSetWdsPeer = 66 CmdFrameWaitCancel = 67 CmdJoinMesh = 68 CmdLeaveMesh = 69 CmdUnprotDeauthenticate = 70 CmdUnprotDisassociate = 71 CmdNewPeerCandidate = 72 CmdGetWowlan = 73 CmdSetWowlan = 74 CmdStartSchedScan = 75 CmdStopSchedScan = 76 CmdSchedScanResults = 77 CmdSchedScanStopped = 78 CmdSetRekeyOffload = 79 CmdPmksaCandidate = 80 CmdTdlsOper = 81 CmdTdlsMgmt = 82 CmdUnexpectedFrame = 83 CmdProbeClient = 84 CmdRegisterBeacons = 85 CmdUnexpected4addrFrame = 86 CmdSetNoackMap = 87 CmdChSwitchNotify = 88 CmdStartP2pDevice = 89 CmdStopP2pDevice = 90 CmdConnFailed = 91 CmdSetMcastRate = 92 CmdSetMacAcl = 93 CmdRadarDetect = 94 CmdGetProtocolFeatures = 95 CmdUpdateFtIes = 96 CmdFtEvent = 97 CmdCritProtocolStart = 98 CmdCritProtocolStop = 99 CmdGetCoalesce = 100 CmdSetCoalesce = 101 CmdChannelSwitch = 102 CmdVendor = 103 CmdSetQosMap = 104 CmdAddTxTs = 105 CmdDelTxTs = 106 CmdGetMpp = 107 CmdJoinOcb = 108 CmdLeaveOcb = 109 CmdChSwitchStartedNotify = 110 CmdTdlsChannelSwitch = 111 CmdTdlsCancelChannelSwitch = 112 CmdWiphyRegChange = 113 CmdAbortScan = 114 CmdStartNan = 115 CmdStopNan = 116 CmdAddNanFunction = 117 CmdDelNanFunction = 118 CmdChangeNanConfig = 119 CmdNanMatch = 120 __CmdAfterLast = 121 CmdMax = __CmdAfterLast - 1 ) // nl80211Attrs as declared in nl80211/nl80211.h:1929 type nl80211Attrs int32 // nl80211Attrs enumeration from nl80211/nl80211.h:1929 const ( AttrUnspec = iota AttrWiphy = 1 AttrWiphyName = 2 AttrIfindex = 3 AttrIfname = 4 AttrIftype = 5 AttrMac = 6 AttrKeyData = 7 AttrKeyIdx = 8 AttrKeyCipher = 9 AttrKeySeq = 10 AttrKeyDefault = 11 AttrBeaconInterval = 12 AttrDtimPeriod = 13 AttrBeaconHead = 14 AttrBeaconTail = 15 AttrStaAid = 16 AttrStaFlags = 17 AttrStaListenInterval = 18 AttrStaSupportedRates = 19 AttrStaVlan = 20 AttrStaInfo = 21 AttrWiphyBands = 22 AttrMntrFlags = 23 AttrMeshId = 24 AttrStaPlinkAction = 25 AttrMpathNextHop = 26 AttrMpathInfo = 27 AttrBssCtsProt = 28 AttrBssShortPreamble = 29 AttrBssShortSlotTime = 30 AttrHtCapability = 31 AttrSupportedIftypes = 32 AttrRegAlpha2 = 33 AttrRegRules = 34 AttrMeshConfig = 35 AttrBssBasicRates = 36 AttrWiphyTxqParams = 37 AttrWiphyFreq = 38 AttrWiphyChannelType = 39 AttrKeyDefaultMgmt = 40 AttrMgmtSubtype = 41 AttrIe = 42 AttrMaxNumScanSsids = 43 AttrScanFrequencies = 44 AttrScanSsids = 45 AttrGeneration = 46 AttrBss = 47 AttrRegInitiator = 48 AttrRegType = 49 AttrSupportedCommands = 50 AttrFrame = 51 AttrSsid = 52 AttrAuthType = 53 AttrReasonCode = 54 AttrKeyType = 55 AttrMaxScanIeLen = 56 AttrCipherSuites = 57 AttrFreqBefore = 58 AttrFreqAfter = 59 AttrFreqFixed = 60 AttrWiphyRetryShort = 61 AttrWiphyRetryLong = 62 AttrWiphyFragThreshold = 63 AttrWiphyRtsThreshold = 64 AttrTimedOut = 65 AttrUseMfp = 66 AttrStaFlags2 = 67 AttrControlPort = 68 AttrTestdata = 69 AttrPrivacy = 70 AttrDisconnectedByAp = 71 AttrStatusCode = 72 AttrCipherSuitesPairwise = 73 AttrCipherSuiteGroup = 74 AttrWpaVersions = 75 AttrAkmSuites = 76 AttrReqIe = 77 AttrRespIe = 78 AttrPrevBssid = 79 AttrKey = 80 AttrKeys = 81 AttrPid = 82 Attr4addr = 83 AttrSurveyInfo = 84 AttrPmkid = 85 AttrMaxNumPmkids = 86 AttrDuration = 87 AttrCookie = 88 AttrWiphyCoverageClass = 89 AttrTxRates = 90 AttrFrameMatch = 91 AttrAck = 92 AttrPsState = 93 AttrCqm = 94 AttrLocalStateChange = 95 AttrApIsolate = 96 AttrWiphyTxPowerSetting = 97 AttrWiphyTxPowerLevel = 98 AttrTxFrameTypes = 99 AttrRxFrameTypes = 100 AttrFrameType = 101 AttrControlPortEthertype = 102 AttrControlPortNoEncrypt = 103 AttrSupportIbssRsn = 104 AttrWiphyAntennaTx = 105 AttrWiphyAntennaRx = 106 AttrMcastRate = 107 AttrOffchannelTxOk = 108 AttrBssHtOpmode = 109 AttrKeyDefaultTypes = 110 AttrMaxRemainOnChannelDuration = 111 AttrMeshSetup = 112 AttrWiphyAntennaAvailTx = 113 AttrWiphyAntennaAvailRx = 114 AttrSupportMeshAuth = 115 AttrStaPlinkState = 116 AttrWowlanTriggers = 117 AttrWowlanTriggersSupported = 118 AttrSchedScanInterval = 119 AttrInterfaceCombinations = 120 AttrSoftwareIftypes = 121 AttrRekeyData = 122 AttrMaxNumSchedScanSsids = 123 AttrMaxSchedScanIeLen = 124 AttrScanSuppRates = 125 AttrHiddenSsid = 126 AttrIeProbeResp = 127 AttrIeAssocResp = 128 AttrStaWme = 129 AttrSupportApUapsd = 130 AttrRoamSupport = 131 AttrSchedScanMatch = 132 AttrMaxMatchSets = 133 AttrPmksaCandidate = 134 AttrTxNoCckRate = 135 AttrTdlsAction = 136 AttrTdlsDialogToken = 137 AttrTdlsOperation = 138 AttrTdlsSupport = 139 AttrTdlsExternalSetup = 140 AttrDeviceApSme = 141 AttrDontWaitForAck = 142 AttrFeatureFlags = 143 AttrProbeRespOffload = 144 AttrProbeResp = 145 AttrDfsRegion = 146 AttrDisableHt = 147 AttrHtCapabilityMask = 148 AttrNoackMap = 149 AttrInactivityTimeout = 150 AttrRxSignalDbm = 151 AttrBgScanPeriod = 152 AttrWdev = 153 AttrUserRegHintType = 154 AttrConnFailedReason = 155 AttrSaeData = 156 AttrVhtCapability = 157 AttrScanFlags = 158 AttrChannelWidth = 159 AttrCenterFreq1 = 160 AttrCenterFreq2 = 161 AttrP2pCtwindow = 162 AttrP2pOppps = 163 AttrLocalMeshPowerMode = 164 AttrAclPolicy = 165 AttrMacAddrs = 166 AttrMacAclMax = 167 AttrRadarEvent = 168 AttrExtCapa = 169 AttrExtCapaMask = 170 AttrStaCapability = 171 AttrStaExtCapability = 172 AttrProtocolFeatures = 173 AttrSplitWiphyDump = 174 AttrDisableVht = 175 AttrVhtCapabilityMask = 176 AttrMdid = 177 AttrIeRic = 178 AttrCritProtId = 179 AttrMaxCritProtDuration = 180 AttrPeerAid = 181 AttrCoalesceRule = 182 AttrChSwitchCount = 183 AttrChSwitchBlockTx = 184 AttrCsaIes = 185 AttrCsaCOffBeacon = 186 AttrCsaCOffPresp = 187 AttrRxmgmtFlags = 188 AttrStaSupportedChannels = 189 AttrStaSupportedOperClasses = 190 AttrHandleDfs = 191 AttrSupport5Mhz = 192 AttrSupport10Mhz = 193 AttrOpmodeNotif = 194 AttrVendorId = 195 AttrVendorSubcmd = 196 AttrVendorData = 197 AttrVendorEvents = 198 AttrQosMap = 199 AttrMacHint = 200 AttrWiphyFreqHint = 201 AttrMaxApAssocSta = 202 AttrTdlsPeerCapability = 203 AttrSocketOwner = 204 AttrCsaCOffsetsTx = 205 AttrMaxCsaCounters = 206 AttrTdlsInitiator = 207 AttrUseRrm = 208 AttrWiphyDynAck = 209 AttrTsid = 210 AttrUserPrio = 211 AttrAdmittedTime = 212 AttrSmpsMode = 213 AttrOperClass = 214 AttrMacMask = 215 AttrWiphySelfManagedReg = 216 AttrExtFeatures = 217 AttrSurveyRadioStats = 218 AttrNetnsFd = 219 AttrSchedScanDelay = 220 AttrRegIndoor = 221 AttrMaxNumSchedScanPlans = 222 AttrMaxScanPlanInterval = 223 AttrMaxScanPlanIterations = 224 AttrSchedScanPlans = 225 AttrPbss = 226 AttrBssSelect = 227 AttrStaSupportP2pPs = 228 AttrPad = 229 AttrIftypeExtCapa = 230 AttrMuMimoGroupData = 231 AttrMuMimoFollowMacAddr = 232 AttrScanStartTimeTsf = 233 AttrScanStartTimeTsfBssid = 234 AttrMeasurementDuration = 235 AttrMeasurementDurationMandatory = 236 AttrMeshPeerAid = 237 AttrNanMasterPref = 238 AttrNanDual = 239 AttrNanFunc = 240 AttrNanMatch = 241 __AttrAfterLast = 242 Num_Attr = __AttrAfterLast AttrMax = __AttrAfterLast - 1 ) // nl80211Iftype as declared in nl80211/nl80211.h:2384 type nl80211Iftype int32 // nl80211Iftype enumeration from nl80211/nl80211.h:2384 const ( IftypeUnspecified = iota IftypeAdhoc = 1 IftypeStation = 2 IftypeAp = 3 IftypeApVlan = 4 IftypeWds = 5 IftypeMonitor = 6 IftypeMeshPoint = 7 IftypeP2pClient = 8 IftypeP2pGo = 9 IftypeP2pDevice = 10 IftypeOcb = 11 IftypeNan = 12 Num_Iftypes = 13 IftypeMax = Num_Iftypes - 1 ) // nl80211StaFlags as declared in nl80211/nl80211.h:2428 type nl80211StaFlags int32 // nl80211StaFlags enumeration from nl80211/nl80211.h:2428 const ( __StaFlagInvalid = iota StaFlagAuthorized = 1 StaFlagShortPreamble = 2 StaFlagWme = 3 StaFlagMfp = 4 StaFlagAuthenticated = 5 StaFlagTdlsPeer = 6 StaFlagAssociated = 7 __StaFlagAfterLast = 8 StaFlagMax = __StaFlagAfterLast - 1 ) // nl80211StaP2pPsStatus as declared in nl80211/nl80211.h:2450 type nl80211StaP2pPsStatus int32 // nl80211StaP2pPsStatus enumeration from nl80211/nl80211.h:2450 const ( P2pPsUnsupported = iota P2pPsSupported = 1 Num_P2pPsStatus = 2 ) // nl80211RateInfo as declared in nl80211/nl80211.h:2505 type nl80211RateInfo int32 // nl80211RateInfo enumeration from nl80211/nl80211.h:2505 const ( __RateInfoInvalid = iota RateInfoBitrate = 1 RateInfoMcs = 2 RateInfo40MhzWidth = 3 RateInfoShortGi = 4 RateInfoBitrate32 = 5 RateInfoVhtMcs = 6 RateInfoVhtNss = 7 RateInfo80MhzWidth = 8 RateInfo80p80MhzWidth = 9 RateInfo160MhzWidth = 10 RateInfo10MhzWidth = 11 RateInfo5MhzWidth = 12 __RateInfoAfterLast = 13 RateInfoMax = __RateInfoAfterLast - 1 ) // nl80211StaBssParam as declared in nl80211/nl80211.h:2542 type nl80211StaBssParam int32 // nl80211StaBssParam enumeration from nl80211/nl80211.h:2542 const ( __StaBssParamInvalid = iota StaBssParamCtsProt = 1 StaBssParamShortPreamble = 2 StaBssParamShortSlotTime = 3 StaBssParamDtimPeriod = 4 StaBssParamBeaconInterval = 5 __StaBssParamAfterLast = 6 StaBssParamMax = __StaBssParamAfterLast - 1 ) // nl80211StaInfo as declared in nl80211/nl80211.h:2620 type nl80211StaInfo int32 // nl80211StaInfo enumeration from nl80211/nl80211.h:2620 const ( __StaInfoInvalid = iota StaInfoInactiveTime = 1 StaInfoRxBytes = 2 StaInfoTxBytes = 3 StaInfoLlid = 4 StaInfoPlid = 5 StaInfoPlinkState = 6 StaInfoSignal = 7 StaInfoTxBitrate = 8 StaInfoRxPackets = 9 StaInfoTxPackets = 10 StaInfoTxRetries = 11 StaInfoTxFailed = 12 StaInfoSignalAvg = 13 StaInfoRxBitrate = 14 StaInfoBssParam = 15 StaInfoConnectedTime = 16 StaInfoStaFlags = 17 StaInfoBeaconLoss = 18 StaInfoTOffset = 19 StaInfoLocalPm = 20 StaInfoPeerPm = 21 StaInfoNonpeerPm = 22 StaInfoRxBytes64 = 23 StaInfoTxBytes64 = 24 StaInfoChainSignal = 25 StaInfoChainSignalAvg = 26 StaInfoExpectedThroughput = 27 StaInfoRxDropMisc = 28 StaInfoBeaconRx = 29 StaInfoBeaconSignalAvg = 30 StaInfoTidStats = 31 StaInfoRxDuration = 32 StaInfoPad = 33 __StaInfoAfterLast = 34 StaInfoMax = __StaInfoAfterLast - 1 ) // nl80211TidStats as declared in nl80211/nl80211.h:2675 type nl80211TidStats int32 // nl80211TidStats enumeration from nl80211/nl80211.h:2675 const ( __TidStatsInvalid = iota TidStatsRxMsdu = 1 TidStatsTxMsdu = 2 TidStatsTxMsduRetries = 3 TidStatsTxMsduFailed = 4 TidStatsPad = 5 Num_TidStats = 6 TidStatsMax = Num_TidStats - 1 ) // nl80211MpathFlags as declared in nl80211/nl80211.h:2697 type nl80211MpathFlags int32 // nl80211MpathFlags enumeration from nl80211/nl80211.h:2697 const ( MpathFlagActive = 1 << 0 MpathFlagResolving = 1 << 1 MpathFlagSnValid = 1 << 2 MpathFlagFixed = 1 << 3 MpathFlagResolved = 1 << 4 ) // nl80211MpathInfo as declared in nl80211/nl80211.h:2724 type nl80211MpathInfo int32 // nl80211MpathInfo enumeration from nl80211/nl80211.h:2724 const ( __MpathInfoInvalid = iota MpathInfoFrameQlen = 1 MpathInfoSn = 2 MpathInfoMetric = 3 MpathInfoExptime = 4 MpathInfoFlags = 5 MpathInfoDiscoveryTimeout = 6 MpathInfoDiscoveryRetries = 7 __MpathInfoAfterLast = 8 MpathInfoMax = __MpathInfoAfterLast - 1 ) // nl80211BandAttr as declared in nl80211/nl80211.h:2757 type nl80211BandAttr int32 // nl80211BandAttr enumeration from nl80211/nl80211.h:2757 const ( __BandAttrInvalid = iota BandAttrFreqs = 1 BandAttrRates = 2 BandAttrHtMcsSet = 3 BandAttrHtCapa = 4 BandAttrHtAmpduFactor = 5 BandAttrHtAmpduDensity = 6 BandAttrVhtMcsSet = 7 BandAttrVhtCapa = 8 __BandAttrAfterLast = 9 BandAttrMax = __BandAttrAfterLast - 1 ) // nl80211FrequencyAttr as declared in nl80211/nl80211.h:2833 type nl80211FrequencyAttr int32 // nl80211FrequencyAttr enumeration from nl80211/nl80211.h:2833 const ( __FrequencyAttrInvalid = iota FrequencyAttrFreq = 1 FrequencyAttrDisabled = 2 FrequencyAttrNoIr = 3 __FrequencyAttrNoIbss = 4 FrequencyAttrRadar = 5 FrequencyAttrMaxTxPower = 6 FrequencyAttrDfsState = 7 FrequencyAttrDfsTime = 8 FrequencyAttrNoHt40Minus = 9 FrequencyAttrNoHt40Plus = 10 FrequencyAttrNo80mhz = 11 FrequencyAttrNo160mhz = 12 FrequencyAttrDfsCacTime = 13 FrequencyAttrIndoorOnly = 14 FrequencyAttrIrConcurrent = 15 FrequencyAttrNo20mhz = 16 FrequencyAttrNo10mhz = 17 __FrequencyAttrAfterLast = 18 FrequencyAttrMax = __FrequencyAttrAfterLast - 1 ) // nl80211BitrateAttr as declared in nl80211/nl80211.h:2873 type nl80211BitrateAttr int32 // nl80211BitrateAttr enumeration from nl80211/nl80211.h:2873 const ( __BitrateAttrInvalid = iota BitrateAttrRate = 1 BitrateAttr2ghzShortpreamble = 2 __BitrateAttrAfterLast = 3 BitrateAttrMax = __BitrateAttrAfterLast - 1 ) // nl80211RegInitiator as declared in nl80211/nl80211.h:2899 type nl80211RegInitiator int32 // nl80211RegInitiator enumeration from nl80211/nl80211.h:2899 const ( RegdomSetByCore = iota RegdomSetByUser = 1 RegdomSetByDriver = 2 RegdomSetByCountryIe = 3 ) // nl80211RegType as declared in nl80211/nl80211.h:2922 type nl80211RegType int32 // nl80211RegType enumeration from nl80211/nl80211.h:2922 const ( RegdomTypeCountry = iota RegdomTypeWorld = 1 RegdomTypeCustomWorld = 2 RegdomTypeIntersection = 3 ) // nl80211RegRuleAttr as declared in nl80211/nl80211.h:2954 type nl80211RegRuleAttr int32 // nl80211RegRuleAttr enumeration from nl80211/nl80211.h:2954 const ( __RegRuleAttrInvalid = iota AttrRegRuleFlags = 1 AttrFreqRangeStart = 2 AttrFreqRangeEnd = 3 AttrFreqRangeMaxBw = 4 AttrPowerRuleMaxAntGain = 5 AttrPowerRuleMaxEirp = 6 AttrDfsCacTime = 7 __RegRuleAttrAfterLast = 8 RegRuleAttrMax = __RegRuleAttrAfterLast - 1 ) // nl80211SchedScanMatchAttr as declared in nl80211/nl80211.h:2989 type nl80211SchedScanMatchAttr int32 // nl80211SchedScanMatchAttr enumeration from nl80211/nl80211.h:2989 const ( __SchedScanMatchAttrInvalid = iota SchedScanMatchAttrSsid = 1 SchedScanMatchAttrRssi = 2 __SchedScanMatchAttrAfterLast = 3 SchedScanMatchAttrMax = __SchedScanMatchAttrAfterLast - 1 ) // nl80211RegRuleFlags as declared in nl80211/nl80211.h:3026 type nl80211RegRuleFlags int32 // nl80211RegRuleFlags enumeration from nl80211/nl80211.h:3026 const ( RrfNoOfdm = 1 << 0 RrfNoCck = 1 << 1 RrfNoIndoor = 1 << 2 RrfNoOutdoor = 1 << 3 RrfDfs = 1 << 4 RrfPtpOnly = 1 << 5 RrfPtmpOnly = 1 << 6 RrfNoIr = 1 << 7 __RrfNoIbss = 1 << 8 RrfAutoBw = 1 << 11 RrfIrConcurrent = 1 << 12 RrfNoHt40minus = 1 << 13 RrfNoHt40plus = 1 << 14 RrfNo80mhz = 1 << 15 RrfNo160mhz = 1 << 16 ) // nl80211DfsRegions as declared in nl80211/nl80211.h:3061 type nl80211DfsRegions int32 // nl80211DfsRegions enumeration from nl80211/nl80211.h:3061 const ( DfsUnset = iota DfsFcc = 1 DfsEtsi = 2 DfsJp = 3 ) // nl80211UserRegHintType as declared in nl80211/nl80211.h:3085 type nl80211UserRegHintType int32 // nl80211UserRegHintType enumeration from nl80211/nl80211.h:3085 const ( UserRegHintUser = iota UserRegHintCellBase = 1 UserRegHintIndoor = 2 ) // nl80211SurveyInfo as declared in nl80211/nl80211.h:3118 type nl80211SurveyInfo int32 // nl80211SurveyInfo enumeration from nl80211/nl80211.h:3118 const ( __SurveyInfoInvalid = iota SurveyInfoFrequency = 1 SurveyInfoNoise = 2 SurveyInfoInUse = 3 SurveyInfoTime = 4 SurveyInfoTimeBusy = 5 SurveyInfoTimeExtBusy = 6 SurveyInfoTimeRx = 7 SurveyInfoTimeTx = 8 SurveyInfoTimeScan = 9 SurveyInfoPad = 10 __SurveyInfoAfterLast = 11 SurveyInfoMax = __SurveyInfoAfterLast - 1 ) // nl80211MntrFlags as declared in nl80211/nl80211.h:3162 type nl80211MntrFlags int32 // nl80211MntrFlags enumeration from nl80211/nl80211.h:3162 const ( __MntrFlagInvalid = iota MntrFlagFcsfail = 1 MntrFlagPlcpfail = 2 MntrFlagControl = 3 MntrFlagOtherBss = 4 MntrFlagCookFrames = 5 MntrFlagActive = 6 __MntrFlagAfterLast = 7 MntrFlagMax = __MntrFlagAfterLast - 1 ) // nl80211MeshPowerMode as declared in nl80211/nl80211.h:3194 type nl80211MeshPowerMode int32 // nl80211MeshPowerMode enumeration from nl80211/nl80211.h:3194 const ( MeshPowerUnknown = iota MeshPowerActive = 1 MeshPowerLightSleep = 2 MeshPowerDeepSleep = 3 __MeshPowerAfterLast = 4 MeshPowerMax = __MeshPowerAfterLast - 1 ) // nl80211MeshconfParams as declared in nl80211/nl80211.h:3312 type nl80211MeshconfParams int32 // nl80211MeshconfParams enumeration from nl80211/nl80211.h:3312 const ( __MeshconfInvalid = iota MeshconfRetryTimeout = 1 MeshconfConfirmTimeout = 2 MeshconfHoldingTimeout = 3 MeshconfMaxPeerLinks = 4 MeshconfMaxRetries = 5 MeshconfTtl = 6 MeshconfAutoOpenPlinks = 7 MeshconfHwmpMaxPreqRetries = 8 MeshconfPathRefreshTime = 9 MeshconfMinDiscoveryTimeout = 10 MeshconfHwmpActivePathTimeout = 11 MeshconfHwmpPreqMinInterval = 12 MeshconfHwmpNetDiamTrvsTime = 13 MeshconfHwmpRootmode = 14 MeshconfElementTtl = 15 MeshconfHwmpRannInterval = 16 MeshconfGateAnnouncements = 17 MeshconfHwmpPerrMinInterval = 18 MeshconfForwarding = 19 MeshconfRssiThreshold = 20 MeshconfSyncOffsetMaxNeighbor = 21 MeshconfHtOpmode = 22 MeshconfHwmpPathToRootTimeout = 23 MeshconfHwmpRootInterval = 24 MeshconfHwmpConfirmationInterval = 25 MeshconfPowerMode = 26 MeshconfAwakeWindow = 27 MeshconfPlinkTimeout = 28 __MeshconfAttrAfterLast = 29 MeshconfAttrMax = __MeshconfAttrAfterLast - 1 ) // nl80211MeshSetupParams as declared in nl80211/nl80211.h:3397 type nl80211MeshSetupParams int32 // nl80211MeshSetupParams enumeration from nl80211/nl80211.h:3397 const ( __MeshSetupInvalid = iota MeshSetupEnableVendorPathSel = 1 MeshSetupEnableVendorMetric = 2 MeshSetupIe = 3 MeshSetupUserspaceAuth = 4 MeshSetupUserspaceAmpe = 5 MeshSetupEnableVendorSync = 6 MeshSetupUserspaceMpm = 7 MeshSetupAuthProtocol = 8 __MeshSetupAttrAfterLast = 9 MeshSetupAttrMax = __MeshSetupAttrAfterLast - 1 ) // nl80211TxqAttr as declared in nl80211/nl80211.h:3427 type nl80211TxqAttr int32 // nl80211TxqAttr enumeration from nl80211/nl80211.h:3427 const ( __TxqAttrInvalid = iota TxqAttrAc = 1 TxqAttrTxop = 2 TxqAttrCwmin = 3 TxqAttrCwmax = 4 TxqAttrAifs = 5 __TxqAttrAfterLast = 6 TxqAttrMax = __TxqAttrAfterLast - 1 ) // nl80211Ac as declared in nl80211/nl80211.h:3440 type nl80211Ac int32 // nl80211Ac enumeration from nl80211/nl80211.h:3440 const ( AcVo = iota AcVi = 1 AcBe = 2 AcBk = 3 NumAcs = 4 ) // nl80211ChannelType as declared in nl80211/nl80211.h:3464 type nl80211ChannelType int32 // nl80211ChannelType enumeration from nl80211/nl80211.h:3464 const ( ChanNoHt = iota ChanHt20 = 1 ChanHt40minus = 2 ChanHt40plus = 3 ) // nl80211ChanWidth as declared in nl80211/nl80211.h:3490 type nl80211ChanWidth int32 // nl80211ChanWidth enumeration from nl80211/nl80211.h:3490 const ( ChanWidth20Noht = iota ChanWidth20 = 1 ChanWidth40 = 2 ChanWidth80 = 3 ChanWidth80p80 = 4 ChanWidth160 = 5 ChanWidth5 = 6 ChanWidth10 = 7 ) // nl80211BssScanWidth as declared in nl80211/nl80211.h:3510 type nl80211BssScanWidth int32 // nl80211BssScanWidth enumeration from nl80211/nl80211.h:3510 const ( BssChanWidth20 = iota BssChanWidth10 = 1 BssChanWidth5 = 2 ) // nl80211Bss as declared in nl80211/nl80211.h:3565 type nl80211Bss int32 // nl80211Bss enumeration from nl80211/nl80211.h:3565 const ( __BssInvalid = iota BssBssid = 1 BssFrequency = 2 BssTsf = 3 BssBeaconInterval = 4 BssCapability = 5 BssInformationElements = 6 BssSignalMbm = 7 BssSignalUnspec = 8 BssStatus = 9 BssSeenMsAgo = 10 BssBeaconIes = 11 BssChanWidth = 12 BssBeaconTsf = 13 BssPrespData = 14 BssLastSeenBoottime = 15 BssPad = 16 BssParentTsf = 17 BssParentBssid = 18 __BssAfterLast = 19 BssMax = __BssAfterLast - 1 ) // nl80211BssStatus as declared in nl80211/nl80211.h:3603 type nl80211BssStatus int32 // nl80211BssStatus enumeration from nl80211/nl80211.h:3603 const ( BssStatusAuthenticated = iota BssStatusAssociated = 1 BssStatusIbssJoined = 2 ) // nl80211AuthType as declared in nl80211/nl80211.h:3623 type nl80211AuthType int32 // nl80211AuthType enumeration from nl80211/nl80211.h:3623 const ( AuthtypeOpenSystem = iota AuthtypeSharedKey = 1 AuthtypeFt = 2 AuthtypeNetworkEap = 3 AuthtypeSae = 4 __AuthtypeNum = 5 AuthtypeMax = __AuthtypeNum - 1 AuthtypeAutomatic = 5 ) // nl80211KeyType as declared in nl80211/nl80211.h:3643 type nl80211KeyType int32 // nl80211KeyType enumeration from nl80211/nl80211.h:3643 const ( KeytypeGroup = iota KeytypePairwise = 1 KeytypePeerkey = 2 Num_Keytypes = 3 ) // nl80211Mfp as declared in nl80211/nl80211.h:3656 type nl80211Mfp int32 // nl80211Mfp enumeration from nl80211/nl80211.h:3656 const ( MfpNo = iota MfpRequired = 1 ) // nl80211WpaVersions as declared in nl80211/nl80211.h:3661 type nl80211WpaVersions int32 // nl80211WpaVersions enumeration from nl80211/nl80211.h:3661 const ( WpaVersion1 = 1 << 0 WpaVersion2 = 1 << 1 ) // nl80211KeyDefaultTypes as declared in nl80211/nl80211.h:3675 type nl80211KeyDefaultTypes int32 // nl80211KeyDefaultTypes enumeration from nl80211/nl80211.h:3675 const ( __KeyDefaultTypeInvalid = iota KeyDefaultTypeUnicast = 1 KeyDefaultTypeMulticast = 2 Num_KeyDefaultTypes = 3 ) // nl80211KeyAttributes as declared in nl80211/nl80211.h:3705 type nl80211KeyAttributes int32 // nl80211KeyAttributes enumeration from nl80211/nl80211.h:3705 const ( __KeyInvalid = iota KeyData = 1 KeyIdx = 2 KeyCipher = 3 KeySeq = 4 KeyDefault = 5 KeyDefaultMgmt = 6 KeyType = 7 KeyDefaultTypes = 8 __KeyAfterLast = 9 KeyMax = __KeyAfterLast - 1 ) // nl80211TxRateAttributes as declared in nl80211/nl80211.h:3736 type nl80211TxRateAttributes int32 // nl80211TxRateAttributes enumeration from nl80211/nl80211.h:3736 const ( __TxrateInvalid = iota TxrateLegacy = 1 TxrateHt = 2 TxrateVht = 3 TxrateGi = 4 __TxrateAfterLast = 5 TxrateMax = __TxrateAfterLast - 1 ) // nl80211TxrateGi as declared in nl80211/nl80211.h:3759 type nl80211TxrateGi int32 // nl80211TxrateGi enumeration from nl80211/nl80211.h:3759 const ( TxrateDefaultGi = iota TxrateForceSgi = 1 TxrateForceLgi = 2 ) // nl80211Band as declared in nl80211/nl80211.h:3773 type nl80211Band int32 // nl80211Band enumeration from nl80211/nl80211.h:3773 const ( Band2ghz = iota Band5ghz = 1 Band60ghz = 2 Num_Bands = 3 ) // nl80211PsState as declared in nl80211/nl80211.h:3786 type nl80211PsState int32 // nl80211PsState enumeration from nl80211/nl80211.h:3786 const ( PsDisabled = iota PsEnabled = 1 ) // nl80211AttrCqm as declared in nl80211/nl80211.h:3819 type nl80211AttrCqm int32 // nl80211AttrCqm enumeration from nl80211/nl80211.h:3819 const ( __AttrCqmInvalid = iota AttrCqmRssiThold = 1 AttrCqmRssiHyst = 2 AttrCqmRssiThresholdEvent = 3 AttrCqmPktLossEvent = 4 AttrCqmTxeRate = 5 AttrCqmTxePkts = 6 AttrCqmTxeIntvl = 7 AttrCqmBeaconLossEvent = 8 __AttrCqmAfterLast = 9 AttrCqmMax = __AttrCqmAfterLast - 1 ) // nl80211CqmRssiThresholdEvent as declared in nl80211/nl80211.h:3843 type nl80211CqmRssiThresholdEvent int32 // nl80211CqmRssiThresholdEvent enumeration from nl80211/nl80211.h:3843 const ( CqmRssiThresholdEventLow = iota CqmRssiThresholdEventHigh = 1 CqmRssiBeaconLossEvent = 2 ) // nl80211TxPowerSetting as declared in nl80211/nl80211.h:3856 type nl80211TxPowerSetting int32 // nl80211TxPowerSetting enumeration from nl80211/nl80211.h:3856 const ( TxPowerAutomatic = iota TxPowerLimited = 1 TxPowerFixed = 2 ) // nl80211PacketPatternAttr as declared in nl80211/nl80211.h:3883 type nl80211PacketPatternAttr int32 // nl80211PacketPatternAttr enumeration from nl80211/nl80211.h:3883 const ( __PktpatInvalid = iota PktpatMask = 1 PktpatPattern = 2 PktpatOffset = 3 Num_Pktpat = 4 Max_Pktpat = Num_Pktpat - 1 ) // nl80211WowlanTriggers as declared in nl80211/nl80211.h:4011 type nl80211WowlanTriggers int32 // nl80211WowlanTriggers enumeration from nl80211/nl80211.h:4011 const ( __WowlanTrigInvalid = iota WowlanTrigAny = 1 WowlanTrigDisconnect = 2 WowlanTrigMagicPkt = 3 WowlanTrigPktPattern = 4 WowlanTrigGtkRekeySupported = 5 WowlanTrigGtkRekeyFailure = 6 WowlanTrigEapIdentRequest = 7 WowlanTrig4wayHandshake = 8 WowlanTrigRfkillRelease = 9 WowlanTrigWakeupPkt80211 = 10 WowlanTrigWakeupPkt80211Len = 11 WowlanTrigWakeupPkt8023 = 12 WowlanTrigWakeupPkt8023Len = 13 WowlanTrigTcpConnection = 14 WowlanTrigWakeupTcpMatch = 15 WowlanTrigWakeupTcpConnlost = 16 WowlanTrigWakeupTcpNomoretokens = 17 WowlanTrigNetDetect = 18 WowlanTrigNetDetectResults = 19 Num_WowlanTrig = 20 Max_WowlanTrig = Num_WowlanTrig - 1 ) // nl80211WowlanTcpAttrs as declared in nl80211/nl80211.h:4129 type nl80211WowlanTcpAttrs int32 // nl80211WowlanTcpAttrs enumeration from nl80211/nl80211.h:4129 const ( __WowlanTcpInvalid = iota WowlanTcpSrcIpv4 = 1 WowlanTcpDstIpv4 = 2 WowlanTcpDstMac = 3 WowlanTcpSrcPort = 4 WowlanTcpDstPort = 5 WowlanTcpDataPayload = 6 WowlanTcpDataPayloadSeq = 7 WowlanTcpDataPayloadToken = 8 WowlanTcpDataInterval = 9 WowlanTcpWakePayload = 10 WowlanTcpWakeMask = 11 Num_WowlanTcp = 12 Max_WowlanTcp = Num_WowlanTcp - 1 ) // nl80211AttrCoalesceRule as declared in nl80211/nl80211.h:4174 type nl80211AttrCoalesceRule int32 // nl80211AttrCoalesceRule enumeration from nl80211/nl80211.h:4174 const ( __CoalesceRuleInvalid = iota AttrCoalesceRuleDelay = 1 AttrCoalesceRuleCondition = 2 AttrCoalesceRulePktPattern = 3 Num_AttrCoalesceRule = 4 AttrCoalesceRuleMax = Num_AttrCoalesceRule - 1 ) // nl80211CoalesceCondition as declared in nl80211/nl80211.h:4192 type nl80211CoalesceCondition int32 // nl80211CoalesceCondition enumeration from nl80211/nl80211.h:4192 const ( CoalesceConditionMatch = iota CoalesceConditionNoMatch = 1 ) // nl80211IfaceLimitAttrs as declared in nl80211/nl80211.h:4207 type nl80211IfaceLimitAttrs int32 // nl80211IfaceLimitAttrs enumeration from nl80211/nl80211.h:4207 const ( IfaceLimitUnspec = iota IfaceLimitMax = 1 IfaceLimitTypes = 2 Num_IfaceLimit = 3 Max_IfaceLimit = Num_IfaceLimit - 1 ) // nl80211IfCombinationAttrs as declared in nl80211/nl80211.h:4263 type nl80211IfCombinationAttrs int32 // nl80211IfCombinationAttrs enumeration from nl80211/nl80211.h:4263 const ( IfaceCombUnspec = iota IfaceCombLimits = 1 IfaceCombMaxnum = 2 IfaceCombStaApBiMatch = 3 IfaceCombNumChannels = 4 IfaceCombRadarDetectWidths = 5 IfaceCombRadarDetectRegions = 6 Num_IfaceComb = 7 Max_IfaceComb = Num_IfaceComb - 1 ) // nl80211PlinkState as declared in nl80211/nl80211.h:4296 type nl80211PlinkState int32 // nl80211PlinkState enumeration from nl80211/nl80211.h:4296 const ( PlinkListen = iota PlinkOpnSnt = 1 PlinkOpnRcvd = 2 PlinkCnfRcvd = 3 PlinkEstab = 4 PlinkHolding = 5 PlinkBlocked = 6 Num_PlinkStates = 7 Max_PlinkStates = Num_PlinkStates - 1 ) // plinkActions as declared in nl80211/nl80211.h:4318 type plinkActions int32 // plinkActions enumeration from nl80211/nl80211.h:4318 const ( PlinkActionNoAction = iota PlinkActionOpen = 1 PlinkActionBlock = 2 Num_PlinkActions = 3 ) // nl80211RekeyData as declared in nl80211/nl80211.h:4340 type nl80211RekeyData int32 // nl80211RekeyData enumeration from nl80211/nl80211.h:4340 const ( __RekeyDataInvalid = iota RekeyDataKek = 1 RekeyDataKck = 2 RekeyDataReplayCtr = 3 Num_RekeyData = 4 Max_RekeyData = Num_RekeyData - 1 ) // nl80211HiddenSsid as declared in nl80211/nl80211.h:4360 type nl80211HiddenSsid int32 // nl80211HiddenSsid enumeration from nl80211/nl80211.h:4360 const ( HiddenSsidNotInUse = iota HiddenSsidZeroLen = 1 HiddenSsidZeroContents = 2 ) // nl80211StaWmeAttr as declared in nl80211/nl80211.h:4376 type nl80211StaWmeAttr int32 // nl80211StaWmeAttr enumeration from nl80211/nl80211.h:4376 const ( __StaWmeInvalid = iota StaWmeUapsdQueues = 1 StaWmeMaxSp = 2 __StaWmeAfterLast = 3 StaWmeMax = __StaWmeAfterLast - 1 ) // nl80211PmksaCandidateAttr as declared in nl80211/nl80211.h:4398 type nl80211PmksaCandidateAttr int32 // nl80211PmksaCandidateAttr enumeration from nl80211/nl80211.h:4398 const ( __PmksaCandidateInvalid = iota PmksaCandidateIndex = 1 PmksaCandidateBssid = 2 PmksaCandidatePreauth = 3 Num_PmksaCandidate = 4 Max_PmksaCandidate = Num_PmksaCandidate - 1 ) // nl80211TdlsOperation as declared in nl80211/nl80211.h:4417 type nl80211TdlsOperation int32 // nl80211TdlsOperation enumeration from nl80211/nl80211.h:4417 const ( TdlsDiscoveryReq = iota TdlsSetup = 1 TdlsTeardown = 2 TdlsEnableLink = 3 TdlsDisableLink = 4 ) // nl80211FeatureFlags as declared in nl80211/nl80211.h:4526 type nl80211FeatureFlags int32 // nl80211FeatureFlags enumeration from nl80211/nl80211.h:4526 const ( FeatureSkTxStatus = 1 << 0 FeatureHtIbss = 1 << 1 FeatureInactivityTimer = 1 << 2 FeatureCellBaseRegHints = 1 << 3 FeatureP2pDeviceNeedsChannel = 1 << 4 FeatureSae = 1 << 5 FeatureLowPriorityScan = 1 << 6 FeatureScanFlush = 1 << 7 FeatureApScan = 1 << 8 FeatureVifTxpower = 1 << 9 FeatureNeedObssScan = 1 << 10 FeatureP2pGoCtwin = 1 << 11 FeatureP2pGoOppps = 1 << 12 FeatureAdvertiseChanLimits = 1 << 14 FeatureFullApClientState = 1 << 15 FeatureUserspaceMpm = 1 << 16 FeatureActiveMonitor = 1 << 17 FeatureApModeChanWidthChange = 1 << 18 FeatureDsParamSetIeInProbes = 1 << 19 FeatureWfaTpcIeInProbes = 1 << 20 FeatureQuiet = 1 << 21 FeatureTxPowerInsertion = 1 << 22 FeatureAcktoEstimation = 1 << 23 FeatureStaticSmps = 1 << 24 FeatureDynamicSmps = 1 << 25 FeatureSupportsWmmAdmission = 1 << 26 FeatureMacOnCreate = 1 << 27 FeatureTdlsChannelSwitch = 1 << 28 FeatureScanRandomMacAddr = 1 << 29 FeatureSchedScanRandomMacAddr = 1 << 30 FeatureNdRandomMacAddr = 1 << 31 ) // nl80211ExtFeatureIndex as declared in nl80211/nl80211.h:4595 type nl80211ExtFeatureIndex int32 // nl80211ExtFeatureIndex enumeration from nl80211/nl80211.h:4595 const ( ExtFeatureVhtIbss = iota ExtFeatureRrm = 1 ExtFeatureMuMimoAirSniffer = 2 ExtFeatureScanStartTime = 3 ExtFeatureBssParentTsf = 4 ExtFeatureSetScanDwell = 5 ExtFeatureBeaconRateLegacy = 6 ExtFeatureBeaconRateHt = 7 ExtFeatureBeaconRateVht = 8 Num_ExtFeatures = 9 Max_ExtFeatures = Num_ExtFeatures - 1 ) // nl80211ProbeRespOffloadSupportAttr as declared in nl80211/nl80211.h:4625 type nl80211ProbeRespOffloadSupportAttr int32 // nl80211ProbeRespOffloadSupportAttr enumeration from nl80211/nl80211.h:4625 const ( ProbeRespOffloadSupportWps = 1 << 0 ProbeRespOffloadSupportWps2 = 1 << 1 ProbeRespOffloadSupportP2p = 1 << 2 ProbeRespOffloadSupport80211u = 1 << 3 ) // nl80211ConnectFailedReason as declared in nl80211/nl80211.h:4638 type nl80211ConnectFailedReason int32 // nl80211ConnectFailedReason enumeration from nl80211/nl80211.h:4638 const ( ConnFailMaxClients = iota ConnFailBlockedClient = 1 ) // nl80211ScanFlags as declared in nl80211/nl80211.h:4667 type nl80211ScanFlags int32 // nl80211ScanFlags enumeration from nl80211/nl80211.h:4667 const ( ScanFlagLowPriority = 1 << 0 ScanFlagFlush = 1 << 1 ScanFlagAp = 1 << 2 ScanFlagRandomAddr = 1 << 3 ) // nl80211AclPolicy as declared in nl80211/nl80211.h:4687 type nl80211AclPolicy int32 // nl80211AclPolicy enumeration from nl80211/nl80211.h:4687 const ( AclPolicyAcceptUnlessListed = iota AclPolicyDenyUnlessListed = 1 ) // nl80211SmpsMode as declared in nl80211/nl80211.h:4702 type nl80211SmpsMode int32 // nl80211SmpsMode enumeration from nl80211/nl80211.h:4702 const ( SmpsOff = iota SmpsStatic = 1 SmpsDynamic = 2 __SmpsAfterLast = 3 SmpsMax = __SmpsAfterLast - 1 ) // nl80211RadarEvent as declared in nl80211/nl80211.h:4726 type nl80211RadarEvent int32 // nl80211RadarEvent enumeration from nl80211/nl80211.h:4726 const ( RadarDetected = iota RadarCacFinished = 1 RadarCacAborted = 2 RadarNopFinished = 3 ) // nl80211DfsState as declared in nl80211/nl80211.h:4744 type nl80211DfsState int32 // nl80211DfsState enumeration from nl80211/nl80211.h:4744 const ( DfsUsable = iota DfsUnavailable = 1 DfsAvailable = 2 ) // nl80211ProtocolFeatures as declared in nl80211/nl80211.h:4758 type nl80211ProtocolFeatures int32 // nl80211ProtocolFeatures enumeration from nl80211/nl80211.h:4758 const ( ProtocolFeatureSplitWiphyDump = 1 << 0 ) // nl80211CritProtoId as declared in nl80211/nl80211.h:4771 type nl80211CritProtoId int32 // nl80211CritProtoId enumeration from nl80211/nl80211.h:4771 const ( CritProtoUnspec = iota CritProtoDhcp = 1 CritProtoEapol = 2 CritProtoApipa = 3 Num_CritProto = 4 ) // nl80211RxmgmtFlags as declared in nl80211/nl80211.h:4790 type nl80211RxmgmtFlags int32 // nl80211RxmgmtFlags enumeration from nl80211/nl80211.h:4790 const ( RxmgmtFlagAnswered = 1 << 0 ) // nl80211TdlsPeerCapability as declared in nl80211/nl80211.h:4824 type nl80211TdlsPeerCapability int32 // nl80211TdlsPeerCapability enumeration from nl80211/nl80211.h:4824 const ( TdlsPeerHt = 1 << 0 TdlsPeerVht = 1 << 1 TdlsPeerWmm = 1 << 2 ) // nl80211SchedScanPlan as declared in nl80211/nl80211.h:4843 type nl80211SchedScanPlan int32 // nl80211SchedScanPlan enumeration from nl80211/nl80211.h:4843 const ( __SchedScanPlanInvalid = iota SchedScanPlanInterval = 1 SchedScanPlanIterations = 2 __SchedScanPlanAfterLast = 3 SchedScanPlanMax = __SchedScanPlanAfterLast - 1 ) // nl80211BssSelectAttr as declared in nl80211/nl80211.h:4887 type nl80211BssSelectAttr int32 // nl80211BssSelectAttr enumeration from nl80211/nl80211.h:4887 const ( __BssSelectAttrInvalid = iota BssSelectAttrRssi = 1 BssSelectAttrBandPref = 2 BssSelectAttrRssiAdjust = 3 __BssSelectAttrAfterLast = 4 BssSelectAttrMax = __BssSelectAttrAfterLast - 1 ) // nl80211NanDualBandConf as declared in nl80211/nl80211.h:4907 type nl80211NanDualBandConf int32 // nl80211NanDualBandConf enumeration from nl80211/nl80211.h:4907 const ( NanBandDefault = 1 << 0 NanBand2ghz = 1 << 1 NanBand5ghz = 1 << 2 ) // nl80211NanFunctionType as declared in nl80211/nl80211.h:4922 type nl80211NanFunctionType int32 // nl80211NanFunctionType enumeration from nl80211/nl80211.h:4922 const ( NanFuncPublish = iota NanFuncSubscribe = 1 NanFuncFollowUp = 2 __NanFuncTypeAfterLast = 3 NanFuncMaxType = __NanFuncTypeAfterLast - 1 ) // nl80211NanPublishType as declared in nl80211/nl80211.h:4940 type nl80211NanPublishType int32 // nl80211NanPublishType enumeration from nl80211/nl80211.h:4940 const ( NanSolicitedPublish = 1 << 0 NanUnsolicitedPublish = 1 << 1 ) // nl80211NanFuncTermReason as declared in nl80211/nl80211.h:4954 type nl80211NanFuncTermReason int32 // nl80211NanFuncTermReason enumeration from nl80211/nl80211.h:4954 const ( NanFuncTermReasonUserRequest = iota NanFuncTermReasonTtlExpired = 1 NanFuncTermReasonError = 2 ) // nl80211NanFuncAttributes as declared in nl80211/nl80211.h:5006 type nl80211NanFuncAttributes int32 // nl80211NanFuncAttributes enumeration from nl80211/nl80211.h:5006 const ( __NanFuncInvalid = iota NanFuncType = 1 NanFuncServiceId = 2 NanFuncPublishType = 3 NanFuncPublishBcast = 4 NanFuncSubscribeActive = 5 NanFuncFollowUpId = 6 NanFuncFollowUpReqId = 7 NanFuncFollowUpDest = 8 NanFuncCloseRange = 9 NanFuncTtl = 10 NanFuncServiceInfo = 11 NanFuncSrf = 12 NanFuncRxMatchFilter = 13 NanFuncTxMatchFilter = 14 NanFuncInstanceId = 15 NanFuncTermReason = 16 Num_NanFuncAttr = 17 NanFuncAttrMax = Num_NanFuncAttr - 1 ) // nl80211NanSrfAttributes as declared in nl80211/nl80211.h:5045 type nl80211NanSrfAttributes int32 // nl80211NanSrfAttributes enumeration from nl80211/nl80211.h:5045 const ( __NanSrfInvalid = iota NanSrfInclude = 1 NanSrfBf = 2 NanSrfBfIdx = 3 NanSrfMacAddrs = 4 Num_NanSrfAttr = 5 NanSrfAttrMax = Num_NanSrfAttr - 1 ) // nl80211NanMatchAttributes as declared in nl80211/nl80211.h:5070 type nl80211NanMatchAttributes int32 // nl80211NanMatchAttributes enumeration from nl80211/nl80211.h:5070 const ( __NanMatchInvalid = iota NanMatchFuncLocal = 1 NanMatchFuncPeer = 2 Num_NanMatchAttr = 3 NanMatchAttrMax = Num_NanMatchAttr - 1 ) prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/wifi/internal/nl80211/doc.go000066400000000000000000000010261321450230300311710ustar00rootroot00000000000000// Package nl80211 is an auto-generated package which contains constants and // types used to access nl80211 information using generic netlink. // // Special thanks to Maxim Kupriianov for the cgogen tool, which makes the // automatic generation of Go constants possible. // // https://github.com/xlab/cgogen // // Maxim was also kind enough to provide the cgogen example configuration which // was used to create this package. // // https://github.com/xlab/nl80211 package nl80211 //go:generate cgogen -out ../ -nocgo nl80211.yml prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/wifi/internal/nl80211/nl80211.h000066400000000000000000006415571321450230300312760ustar00rootroot00000000000000#ifndef __LINUX_NL80211_H #define __LINUX_NL80211_H /* * 802.11 netlink interface public header * * Copyright 2006-2010 Johannes Berg * Copyright 2008 Michael Wu * Copyright 2008 Luis Carlos Cobo * Copyright 2008 Michael Buesch * Copyright 2008, 2009 Luis R. Rodriguez * Copyright 2008 Jouni Malinen * Copyright 2008 Colin McCabe * Copyright 2015 Intel Deutschland GmbH * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ /* * This header file defines the userspace API to the wireless stack. Please * be careful not to break things - i.e. don't move anything around or so * unless you can demonstrate that it breaks neither API nor ABI. * * Additions to the API should be accompanied by actual implementations in * an upstream driver, so that example implementations exist in case there * are ever concerns about the precise semantics of the API or changes are * needed, and to ensure that code for dead (no longer implemented) API * can actually be identified and removed. * Nonetheless, semantics should also be documented carefully in this file. */ #include #define NL80211_GENL_NAME "nl80211" #define NL80211_MULTICAST_GROUP_CONFIG "config" #define NL80211_MULTICAST_GROUP_SCAN "scan" #define NL80211_MULTICAST_GROUP_REG "regulatory" #define NL80211_MULTICAST_GROUP_MLME "mlme" #define NL80211_MULTICAST_GROUP_VENDOR "vendor" #define NL80211_MULTICAST_GROUP_NAN "nan" #define NL80211_MULTICAST_GROUP_TESTMODE "testmode" /** * DOC: Station handling * * Stations are added per interface, but a special case exists with VLAN * interfaces. When a station is bound to an AP interface, it may be moved * into a VLAN identified by a VLAN interface index (%NL80211_ATTR_STA_VLAN). * The station is still assumed to belong to the AP interface it was added * to. * * Station handling varies per interface type and depending on the driver's * capabilities. * * For drivers supporting TDLS with external setup (WIPHY_FLAG_SUPPORTS_TDLS * and WIPHY_FLAG_TDLS_EXTERNAL_SETUP), the station lifetime is as follows: * - a setup station entry is added, not yet authorized, without any rate * or capability information, this just exists to avoid race conditions * - when the TDLS setup is done, a single NL80211_CMD_SET_STATION is valid * to add rate and capability information to the station and at the same * time mark it authorized. * - %NL80211_TDLS_ENABLE_LINK is then used * - after this, the only valid operation is to remove it by tearing down * the TDLS link (%NL80211_TDLS_DISABLE_LINK) * * TODO: need more info for other interface types */ /** * DOC: Frame transmission/registration support * * Frame transmission and registration support exists to allow userspace * management entities such as wpa_supplicant react to management frames * that are not being handled by the kernel. This includes, for example, * certain classes of action frames that cannot be handled in the kernel * for various reasons. * * Frame registration is done on a per-interface basis and registrations * cannot be removed other than by closing the socket. It is possible to * specify a registration filter to register, for example, only for a * certain type of action frame. In particular with action frames, those * that userspace registers for will not be returned as unhandled by the * driver, so that the registered application has to take responsibility * for doing that. * * The type of frame that can be registered for is also dependent on the * driver and interface type. The frame types are advertised in wiphy * attributes so applications know what to expect. * * NOTE: When an interface changes type while registrations are active, * these registrations are ignored until the interface type is * changed again. This means that changing the interface type can * lead to a situation that couldn't otherwise be produced, but * any such registrations will be dormant in the sense that they * will not be serviced, i.e. they will not receive any frames. * * Frame transmission allows userspace to send for example the required * responses to action frames. It is subject to some sanity checking, * but many frames can be transmitted. When a frame was transmitted, its * status is indicated to the sending socket. * * For more technical details, see the corresponding command descriptions * below. */ /** * DOC: Virtual interface / concurrency capabilities * * Some devices are able to operate with virtual MACs, they can have * more than one virtual interface. The capability handling for this * is a bit complex though, as there may be a number of restrictions * on the types of concurrency that are supported. * * To start with, each device supports the interface types listed in * the %NL80211_ATTR_SUPPORTED_IFTYPES attribute, but by listing the * types there no concurrency is implied. * * Once concurrency is desired, more attributes must be observed: * To start with, since some interface types are purely managed in * software, like the AP-VLAN type in mac80211 for example, there's * an additional list of these, they can be added at any time and * are only restricted by some semantic restrictions (e.g. AP-VLAN * cannot be added without a corresponding AP interface). This list * is exported in the %NL80211_ATTR_SOFTWARE_IFTYPES attribute. * * Further, the list of supported combinations is exported. This is * in the %NL80211_ATTR_INTERFACE_COMBINATIONS attribute. Basically, * it exports a list of "groups", and at any point in time the * interfaces that are currently active must fall into any one of * the advertised groups. Within each group, there are restrictions * on the number of interfaces of different types that are supported * and also the number of different channels, along with potentially * some other restrictions. See &enum nl80211_if_combination_attrs. * * All together, these attributes define the concurrency of virtual * interfaces that a given device supports. */ /** * DOC: packet coalesce support * * In most cases, host that receives IPv4 and IPv6 multicast/broadcast * packets does not do anything with these packets. Therefore the * reception of these unwanted packets causes unnecessary processing * and power consumption. * * Packet coalesce feature helps to reduce number of received interrupts * to host by buffering these packets in firmware/hardware for some * predefined time. Received interrupt will be generated when one of the * following events occur. * a) Expiration of hardware timer whose expiration time is set to maximum * coalescing delay of matching coalesce rule. * b) Coalescing buffer in hardware reaches it's limit. * c) Packet doesn't match any of the configured coalesce rules. * * User needs to configure following parameters for creating a coalesce * rule. * a) Maximum coalescing delay * b) List of packet patterns which needs to be matched * c) Condition for coalescence. pattern 'match' or 'no match' * Multiple such rules can be created. */ /** * enum nl80211_commands - supported nl80211 commands * * @NL80211_CMD_UNSPEC: unspecified command to catch errors * * @NL80211_CMD_GET_WIPHY: request information about a wiphy or dump request * to get a list of all present wiphys. * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME, * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ (and the * attributes determining the channel width; this is used for setting * monitor mode channel), %NL80211_ATTR_WIPHY_RETRY_SHORT, * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD, * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD. * However, for setting the channel, see %NL80211_CMD_SET_CHANNEL * instead, the support here is for backward compatibility only. * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request * or rename notification. Has attributes %NL80211_ATTR_WIPHY and * %NL80211_ATTR_WIPHY_NAME. * @NL80211_CMD_DEL_WIPHY: Wiphy deleted. Has attributes * %NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME. * * @NL80211_CMD_GET_INTERFACE: Request an interface's configuration; * either a dump request for all interfaces or a specific get with a * single %NL80211_ATTR_IFINDEX is supported. * @NL80211_CMD_SET_INTERFACE: Set type of a virtual interface, requires * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_IFTYPE. * @NL80211_CMD_NEW_INTERFACE: Newly created virtual interface or response * to %NL80211_CMD_GET_INTERFACE. Has %NL80211_ATTR_IFINDEX, * %NL80211_ATTR_WIPHY and %NL80211_ATTR_IFTYPE attributes. Can also * be sent from userspace to request creation of a new virtual interface, * then requires attributes %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFTYPE and * %NL80211_ATTR_IFNAME. * @NL80211_CMD_DEL_INTERFACE: Virtual interface was deleted, has attributes * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_WIPHY. Can also be sent from * userspace to request deletion of a virtual interface, then requires * attribute %NL80211_ATTR_IFINDEX. * * @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified * by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC. * @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT, * %NL80211_ATTR_KEY_DEFAULT_MGMT, or %NL80211_ATTR_KEY_THRESHOLD. * @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA, * %NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC, %NL80211_ATTR_KEY_CIPHER, * and %NL80211_ATTR_KEY_SEQ attributes. * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX * or %NL80211_ATTR_MAC. * * @NL80211_CMD_GET_BEACON: (not used) * @NL80211_CMD_SET_BEACON: change the beacon on an access point interface * using the %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL * attributes. For drivers that generate the beacon and probe responses * internally, the following attributes must be provided: %NL80211_ATTR_IE, * %NL80211_ATTR_IE_PROBE_RESP and %NL80211_ATTR_IE_ASSOC_RESP. * @NL80211_CMD_START_AP: Start AP operation on an AP interface, parameters * are like for %NL80211_CMD_SET_BEACON, and additionally parameters that * do not change are used, these include %NL80211_ATTR_BEACON_INTERVAL, * %NL80211_ATTR_DTIM_PERIOD, %NL80211_ATTR_SSID, * %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE, * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, * %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_INACTIVITY_TIMEOUT, * %NL80211_ATTR_ACL_POLICY and %NL80211_ATTR_MAC_ADDRS. * The channel to use can be set on the interface or be given using the * %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width. * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP * * @NL80211_CMD_GET_STATION: Get station attributes for station identified by * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX. * @NL80211_CMD_SET_STATION: Set station attributes for station identified by * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX. * @NL80211_CMD_NEW_STATION: Add a station with given attributes to the * the interface identified by %NL80211_ATTR_IFINDEX. * @NL80211_CMD_DEL_STATION: Remove a station identified by %NL80211_ATTR_MAC * or, if no MAC address given, all stations, on the interface identified * by %NL80211_ATTR_IFINDEX. %NL80211_ATTR_MGMT_SUBTYPE and * %NL80211_ATTR_REASON_CODE can optionally be used to specify which type * of disconnection indication should be sent to the station * (Deauthentication or Disassociation frame and reason code for that * frame). * * @NL80211_CMD_GET_MPATH: Get mesh path attributes for mesh path to * destination %NL80211_ATTR_MAC on the interface identified by * %NL80211_ATTR_IFINDEX. * @NL80211_CMD_SET_MPATH: Set mesh path attributes for mesh path to * destination %NL80211_ATTR_MAC on the interface identified by * %NL80211_ATTR_IFINDEX. * @NL80211_CMD_NEW_MPATH: Create a new mesh path for the destination given by * %NL80211_ATTR_MAC via %NL80211_ATTR_MPATH_NEXT_HOP. * @NL80211_CMD_DEL_MPATH: Delete a mesh path to the destination given by * %NL80211_ATTR_MAC. * @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the * the interface identified by %NL80211_ATTR_IFINDEX. * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC * or, if no MAC address given, all mesh paths, on the interface identified * by %NL80211_ATTR_IFINDEX. * @NL80211_CMD_SET_BSS: Set BSS attributes for BSS identified by * %NL80211_ATTR_IFINDEX. * * @NL80211_CMD_GET_REG: ask the wireless core to send us its currently set * regulatory domain. If %NL80211_ATTR_WIPHY is specified and the device * has a private regulatory domain, it will be returned. Otherwise, the * global regdomain will be returned. * A device will have a private regulatory domain if it uses the * regulatory_hint() API. Even when a private regdomain is used the channel * information will still be mended according to further hints from * the regulatory core to help with compliance. A dump version of this API * is now available which will returns the global regdomain as well as * all private regdomains of present wiphys (for those that have it). * If a wiphy is self-managed (%NL80211_ATTR_WIPHY_SELF_MANAGED_REG), then * its private regdomain is the only valid one for it. The regulatory * core is not used to help with compliance in this case. * @NL80211_CMD_SET_REG: Set current regulatory domain. CRDA sends this command * after being queried by the kernel. CRDA replies by sending a regulatory * domain structure which consists of %NL80211_ATTR_REG_ALPHA set to our * current alpha2 if it found a match. It also provides * NL80211_ATTR_REG_RULE_FLAGS, and a set of regulatory rules. Each * regulatory rule is a nested set of attributes given by * %NL80211_ATTR_REG_RULE_FREQ_[START|END] and * %NL80211_ATTR_FREQ_RANGE_MAX_BW with an attached power rule given by * %NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and * %NL80211_ATTR_REG_RULE_POWER_MAX_EIRP. * @NL80211_CMD_REQ_SET_REG: ask the wireless core to set the regulatory domain * to the specified ISO/IEC 3166-1 alpha2 country code. The core will * store this as a valid request and then query userspace for it. * * @NL80211_CMD_GET_MESH_CONFIG: Get mesh networking properties for the * interface identified by %NL80211_ATTR_IFINDEX * * @NL80211_CMD_SET_MESH_CONFIG: Set mesh networking properties for the * interface identified by %NL80211_ATTR_IFINDEX * * @NL80211_CMD_SET_MGMT_EXTRA_IE: Set extra IEs for management frames. The * interface is identified with %NL80211_ATTR_IFINDEX and the management * frame subtype with %NL80211_ATTR_MGMT_SUBTYPE. The extra IE data to be * added to the end of the specified management frame is specified with * %NL80211_ATTR_IE. If the command succeeds, the requested data will be * added to all specified management frames generated by * kernel/firmware/driver. * Note: This command has been removed and it is only reserved at this * point to avoid re-using existing command number. The functionality this * command was planned for has been provided with cleaner design with the * option to specify additional IEs in NL80211_CMD_TRIGGER_SCAN, * NL80211_CMD_AUTHENTICATE, NL80211_CMD_ASSOCIATE, * NL80211_CMD_DEAUTHENTICATE, and NL80211_CMD_DISASSOCIATE. * * @NL80211_CMD_GET_SCAN: get scan results * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the * probe requests at CCK rate or not. %NL80211_ATTR_MAC can be used to * specify a BSSID to scan for; if not included, the wildcard BSSID will * be used. * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to * NL80211_CMD_GET_SCAN and on the "scan" multicast group) * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons, * partial scan results may be available * * @NL80211_CMD_START_SCHED_SCAN: start a scheduled scan at certain * intervals and certain number of cycles, as specified by * %NL80211_ATTR_SCHED_SCAN_PLANS. If %NL80211_ATTR_SCHED_SCAN_PLANS is * not specified and only %NL80211_ATTR_SCHED_SCAN_INTERVAL is specified, * scheduled scan will run in an infinite loop with the specified interval. * These attributes are mutually exculsive, * i.e. NL80211_ATTR_SCHED_SCAN_INTERVAL must not be passed if * NL80211_ATTR_SCHED_SCAN_PLANS is defined. * If for some reason scheduled scan is aborted by the driver, all scan * plans are canceled (including scan plans that did not start yet). * Like with normal scans, if SSIDs (%NL80211_ATTR_SCAN_SSIDS) * are passed, they are used in the probe requests. For * broadcast, a broadcast SSID must be passed (ie. an empty * string). If no SSID is passed, no probe requests are sent and * a passive scan is performed. %NL80211_ATTR_SCAN_FREQUENCIES, * if passed, define which channels should be scanned; if not * passed, all channels allowed for the current regulatory domain * are used. Extra IEs can also be passed from the userspace by * using the %NL80211_ATTR_IE attribute. The first cycle of the * scheduled scan can be delayed by %NL80211_ATTR_SCHED_SCAN_DELAY * is supplied. * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT if * scheduled scan is not running. The caller may assume that as soon * as the call returns, it is safe to start a new scheduled scan again. * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan * results available. * @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has * stopped. The driver may issue this event at any time during a * scheduled scan. One reason for stopping the scan is if the hardware * does not support starting an association or a normal scan while running * a scheduled scan. This event is also sent when the * %NL80211_CMD_STOP_SCHED_SCAN command is received or when the interface * is brought down while a scheduled scan was running. * * @NL80211_CMD_GET_SURVEY: get survey resuls, e.g. channel occupation * or noise level * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to * NL80211_CMD_GET_SURVEY and on the "scan" multicast group) * * @NL80211_CMD_SET_PMKSA: Add a PMKSA cache entry, using %NL80211_ATTR_MAC * (for the BSSID) and %NL80211_ATTR_PMKID. * @NL80211_CMD_DEL_PMKSA: Delete a PMKSA cache entry, using %NL80211_ATTR_MAC * (for the BSSID) and %NL80211_ATTR_PMKID. * @NL80211_CMD_FLUSH_PMKSA: Flush all PMKSA cache entries. * * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain * has been changed and provides details of the request information * that caused the change such as who initiated the regulatory request * (%NL80211_ATTR_REG_INITIATOR), the wiphy_idx * (%NL80211_ATTR_REG_ALPHA2) on which the request was made from if * the initiator was %NL80211_REGDOM_SET_BY_COUNTRY_IE or * %NL80211_REGDOM_SET_BY_DRIVER, the type of regulatory domain * set (%NL80211_ATTR_REG_TYPE), if the type of regulatory domain is * %NL80211_REG_TYPE_COUNTRY the alpha2 to which we have moved on * to (%NL80211_ATTR_REG_ALPHA2). * @NL80211_CMD_REG_BEACON_HINT: indicates to userspace that an AP beacon * has been found while world roaming thus enabling active scan or * any mode of operation that initiates TX (beacons) on a channel * where we would not have been able to do either before. As an example * if you are world roaming (regulatory domain set to world or if your * driver is using a custom world roaming regulatory domain) and while * doing a passive scan on the 5 GHz band you find an AP there (if not * on a DFS channel) you will now be able to actively scan for that AP * or use AP mode on your card on that same channel. Note that this will * never be used for channels 1-11 on the 2 GHz band as they are always * enabled world wide. This beacon hint is only sent if your device had * either disabled active scanning or beaconing on a channel. We send to * userspace the wiphy on which we removed a restriction from * (%NL80211_ATTR_WIPHY) and the channel on which this occurred * before (%NL80211_ATTR_FREQ_BEFORE) and after (%NL80211_ATTR_FREQ_AFTER) * the beacon hint was processed. * * @NL80211_CMD_AUTHENTICATE: authentication request and notification. * This command is used both as a command (request to authenticate) and * as an event on the "mlme" multicast group indicating completion of the * authentication process. * When used as a command, %NL80211_ATTR_IFINDEX is used to identify the * interface. %NL80211_ATTR_MAC is used to specify PeerSTAAddress (and * BSSID in case of station mode). %NL80211_ATTR_SSID is used to specify * the SSID (mainly for association, but is included in authentication * request, too, to help BSS selection. %NL80211_ATTR_WIPHY_FREQ is used * to specify the frequence of the channel in MHz. %NL80211_ATTR_AUTH_TYPE * is used to specify the authentication type. %NL80211_ATTR_IE is used to * define IEs (VendorSpecificInfo, but also including RSN IE and FT IEs) * to be added to the frame. * When used as an event, this reports reception of an Authentication * frame in station and IBSS modes when the local MLME processed the * frame, i.e., it was for the local STA and was received in correct * state. This is similar to MLME-AUTHENTICATE.confirm primitive in the * MLME SAP interface (kernel providing MLME, userspace SME). The * included %NL80211_ATTR_FRAME attribute contains the management frame * (including both the header and frame body, but not FCS). This event is * also used to indicate if the authentication attempt timed out. In that * case the %NL80211_ATTR_FRAME attribute is replaced with a * %NL80211_ATTR_TIMED_OUT flag (and %NL80211_ATTR_MAC to indicate which * pending authentication timed out). * @NL80211_CMD_ASSOCIATE: association request and notification; like * NL80211_CMD_AUTHENTICATE but for Association and Reassociation * (similar to MLME-ASSOCIATE.request, MLME-REASSOCIATE.request, * MLME-ASSOCIATE.confirm or MLME-REASSOCIATE.confirm primitives). The * %NL80211_ATTR_PREV_BSSID attribute is used to specify whether the * request is for the initial association to an ESS (that attribute not * included) or for reassociation within the ESS (that attribute is * included). * @NL80211_CMD_DEAUTHENTICATE: deauthentication request and notification; like * NL80211_CMD_AUTHENTICATE but for Deauthentication frames (similar to * MLME-DEAUTHENTICATION.request and MLME-DEAUTHENTICATE.indication * primitives). * @NL80211_CMD_DISASSOCIATE: disassociation request and notification; like * NL80211_CMD_AUTHENTICATE but for Disassociation frames (similar to * MLME-DISASSOCIATE.request and MLME-DISASSOCIATE.indication primitives). * * @NL80211_CMD_MICHAEL_MIC_FAILURE: notification of a locally detected Michael * MIC (part of TKIP) failure; sent on the "mlme" multicast group; the * event includes %NL80211_ATTR_MAC to describe the source MAC address of * the frame with invalid MIC, %NL80211_ATTR_KEY_TYPE to show the key * type, %NL80211_ATTR_KEY_IDX to indicate the key identifier, and * %NL80211_ATTR_KEY_SEQ to indicate the TSC value of the frame; this * event matches with MLME-MICHAELMICFAILURE.indication() primitive * * @NL80211_CMD_JOIN_IBSS: Join a new IBSS -- given at least an SSID and a * FREQ attribute (for the initial frequency if no peer can be found) * and optionally a MAC (as BSSID) and FREQ_FIXED attribute if those * should be fixed rather than automatically determined. Can only be * executed on a network interface that is UP, and fixed BSSID/FREQ * may be rejected. Another optional parameter is the beacon interval, * given in the %NL80211_ATTR_BEACON_INTERVAL attribute, which if not * given defaults to 100 TU (102.4ms). * @NL80211_CMD_LEAVE_IBSS: Leave the IBSS -- no special arguments, the IBSS is * determined by the network interface. * * @NL80211_CMD_TESTMODE: testmode command, takes a wiphy (or ifindex) attribute * to identify the device, and the TESTDATA blob attribute to pass through * to the driver. * * @NL80211_CMD_CONNECT: connection request and notification; this command * requests to connect to a specified network but without separating * auth and assoc steps. For this, you need to specify the SSID in a * %NL80211_ATTR_SSID attribute, and can optionally specify the association * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_USE_MFP, * %NL80211_ATTR_MAC, %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT, * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT, %NL80211_ATTR_MAC_HINT, and * %NL80211_ATTR_WIPHY_FREQ_HINT. * If included, %NL80211_ATTR_MAC and %NL80211_ATTR_WIPHY_FREQ are * restrictions on BSS selection, i.e., they effectively prevent roaming * within the ESS. %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT * can be included to provide a recommendation of the initial BSS while * allowing the driver to roam to other BSSes within the ESS and also to * ignore this recommendation if the indicated BSS is not ideal. Only one * set of BSSID,frequency parameters is used (i.e., either the enforcing * %NL80211_ATTR_MAC,%NL80211_ATTR_WIPHY_FREQ or the less strict * %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT). * %NL80211_ATTR_PREV_BSSID can be used to request a reassociation within * the ESS in case the device is already associated and an association with * a different BSS is desired. * Background scan period can optionally be * specified in %NL80211_ATTR_BG_SCAN_PERIOD, * if not specified default background scan configuration * in driver is used and if period value is 0, bg scan will be disabled. * This attribute is ignored if driver does not support roam scan. * It is also sent as an event, with the BSSID and response IEs when the * connection is established or failed to be established. This can be * determined by the %NL80211_ATTR_STATUS_CODE attribute (0 = success, * non-zero = failure). If %NL80211_ATTR_TIMED_OUT is included in the * event, the connection attempt failed due to not being able to initiate * authentication/association or not receiving a response from the AP. * Non-zero %NL80211_ATTR_STATUS_CODE value is indicated in that case as * well to remain backwards compatible. * @NL80211_CMD_ROAM: request that the card roam (currently not implemented), * sent as an event when the card/driver roamed by itself. * @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify * userspace that a connection was dropped by the AP or due to other * reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and * %NL80211_ATTR_REASON_CODE attributes are used. * * @NL80211_CMD_SET_WIPHY_NETNS: Set a wiphy's netns. Note that all devices * associated with this wiphy must be down and will follow. * * @NL80211_CMD_REMAIN_ON_CHANNEL: Request to remain awake on the specified * channel for the specified amount of time. This can be used to do * off-channel operations like transmit a Public Action frame and wait for * a response while being associated to an AP on another channel. * %NL80211_ATTR_IFINDEX is used to specify which interface (and thus * radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the * frequency for the operation. * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds * to remain on the channel. This command is also used as an event to * notify when the requested duration starts (it may take a while for the * driver to schedule this time due to other concurrent needs for the * radio). * When called, this operation returns a cookie (%NL80211_ATTR_COOKIE) * that will be included with any events pertaining to this request; * the cookie is also used to cancel the request. * @NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL: This command can be used to cancel a * pending remain-on-channel duration if the desired operation has been * completed prior to expiration of the originally requested duration. * %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify the * radio. The %NL80211_ATTR_COOKIE attribute must be given as well to * uniquely identify the request. * This command is also used as an event to notify when a requested * remain-on-channel duration has expired. * * @NL80211_CMD_SET_TX_BITRATE_MASK: Set the mask of rates to be used in TX * rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface * and @NL80211_ATTR_TX_RATES the set of allowed rates. * * @NL80211_CMD_REGISTER_FRAME: Register for receiving certain mgmt frames * (via @NL80211_CMD_FRAME) for processing in userspace. This command * requires an interface index, a frame type attribute (optional for * backward compatibility reasons, if not given assumes action frames) * and a match attribute containing the first few bytes of the frame * that should match, e.g. a single byte for only a category match or * four bytes for vendor frames including the OUI. The registration * cannot be dropped, but is removed automatically when the netlink * socket is closed. Multiple registrations can be made. * @NL80211_CMD_REGISTER_ACTION: Alias for @NL80211_CMD_REGISTER_FRAME for * backward compatibility * @NL80211_CMD_FRAME: Management frame TX request and RX notification. This * command is used both as a request to transmit a management frame and * as an event indicating reception of a frame that was not processed in * kernel code, but is for us (i.e., which may need to be processed in a * user space application). %NL80211_ATTR_FRAME is used to specify the * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ is used * to indicate on which channel the frame is to be transmitted or was * received. If this channel is not the current channel (remain-on-channel * or the operational channel) the device will switch to the given channel * and transmit the frame, optionally waiting for a response for the time * specified using %NL80211_ATTR_DURATION. When called, this operation * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the * TX status event pertaining to the TX request. * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the * management frames at CCK rate or not in 2GHz band. * %NL80211_ATTR_CSA_C_OFFSETS_TX is an array of offsets to CSA * counters which will be updated to the current value. This attribute * is used during CSA period. * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this * command may be used with the corresponding cookie to cancel the wait * time if it is known that it is no longer necessary. * @NL80211_CMD_ACTION: Alias for @NL80211_CMD_FRAME for backward compatibility. * @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame * transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies * the TX command and %NL80211_ATTR_FRAME includes the contents of the * frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged * the frame. * @NL80211_CMD_ACTION_TX_STATUS: Alias for @NL80211_CMD_FRAME_TX_STATUS for * backward compatibility. * * @NL80211_CMD_SET_POWER_SAVE: Set powersave, using %NL80211_ATTR_PS_STATE * @NL80211_CMD_GET_POWER_SAVE: Get powersave status in %NL80211_ATTR_PS_STATE * * @NL80211_CMD_SET_CQM: Connection quality monitor configuration. This command * is used to configure connection quality monitoring notification trigger * levels. * @NL80211_CMD_NOTIFY_CQM: Connection quality monitor notification. This * command is used as an event to indicate the that a trigger level was * reached. * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ * and the attributes determining channel width) the given interface * (identifed by %NL80211_ATTR_IFINDEX) shall operate on. * In case multiple channels are supported by the device, the mechanism * with which it switches channels is implementation-defined. * When a monitor interface is given, it can only switch channel while * no other interfaces are operating to avoid disturbing the operation * of any other interfaces, and other interfaces will again take * precedence when they are used. * * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface. * * @NL80211_CMD_JOIN_MESH: Join a mesh. The mesh ID must be given, and initial * mesh config parameters may be given. * @NL80211_CMD_LEAVE_MESH: Leave the mesh network -- no special arguments, the * network is determined by the network interface. * * @NL80211_CMD_UNPROT_DEAUTHENTICATE: Unprotected deauthentication frame * notification. This event is used to indicate that an unprotected * deauthentication frame was dropped when MFP is in use. * @NL80211_CMD_UNPROT_DISASSOCIATE: Unprotected disassociation frame * notification. This event is used to indicate that an unprotected * disassociation frame was dropped when MFP is in use. * * @NL80211_CMD_NEW_PEER_CANDIDATE: Notification on the reception of a * beacon or probe response from a compatible mesh peer. This is only * sent while no station information (sta_info) exists for the new peer * candidate and when @NL80211_MESH_SETUP_USERSPACE_AUTH, * @NL80211_MESH_SETUP_USERSPACE_AMPE, or * @NL80211_MESH_SETUP_USERSPACE_MPM is set. On reception of this * notification, userspace may decide to create a new station * (@NL80211_CMD_NEW_STATION). To stop this notification from * reoccurring, the userspace authentication daemon may want to create the * new station with the AUTHENTICATED flag unset and maybe change it later * depending on the authentication result. * * @NL80211_CMD_GET_WOWLAN: get Wake-on-Wireless-LAN (WoWLAN) settings. * @NL80211_CMD_SET_WOWLAN: set Wake-on-Wireless-LAN (WoWLAN) settings. * Since wireless is more complex than wired ethernet, it supports * various triggers. These triggers can be configured through this * command with the %NL80211_ATTR_WOWLAN_TRIGGERS attribute. For * more background information, see * http://wireless.kernel.org/en/users/Documentation/WoWLAN. * The @NL80211_CMD_SET_WOWLAN command can also be used as a notification * from the driver reporting the wakeup reason. In this case, the * @NL80211_ATTR_WOWLAN_TRIGGERS attribute will contain the reason * for the wakeup, if it was caused by wireless. If it is not present * in the wakeup notification, the wireless device didn't cause the * wakeup but reports that it was woken up. * * @NL80211_CMD_SET_REKEY_OFFLOAD: This command is used give the driver * the necessary information for supporting GTK rekey offload. This * feature is typically used during WoWLAN. The configuration data * is contained in %NL80211_ATTR_REKEY_DATA (which is nested and * contains the data in sub-attributes). After rekeying happened, * this command may also be sent by the driver as an MLME event to * inform userspace of the new replay counter. * * @NL80211_CMD_PMKSA_CANDIDATE: This is used as an event to inform userspace * of PMKSA caching dandidates. * * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup). * In addition, this can be used as an event to request userspace to take * actions on TDLS links (set up a new link or tear down an existing one). * In such events, %NL80211_ATTR_TDLS_OPERATION indicates the requested * operation, %NL80211_ATTR_MAC contains the peer MAC address, and * %NL80211_ATTR_REASON_CODE the reason code to be used (only with * %NL80211_TDLS_TEARDOWN). * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. The * %NL80211_ATTR_TDLS_ACTION attribute determines the type of frame to be * sent. Public Action codes (802.11-2012 8.1.5.1) will be sent as * 802.11 management frames, while TDLS action codes (802.11-2012 * 8.5.13.1) will be encapsulated and sent as data frames. The currently * supported Public Action code is %WLAN_PUB_ACTION_TDLS_DISCOVER_RES * and the currently supported TDLS actions codes are given in * &enum ieee80211_tdls_actioncode. * * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP * (or GO) interface (i.e. hostapd) to ask for unexpected frames to * implement sending deauth to stations that send unexpected class 3 * frames. Also used as the event sent by the kernel when such a frame * is received. * For the event, the %NL80211_ATTR_MAC attribute carries the TA and * other attributes like the interface index are present. * If used as the command it must have an interface index and you can * only unsubscribe from the event by closing the socket. Subscription * is also for %NL80211_CMD_UNEXPECTED_4ADDR_FRAME events. * * @NL80211_CMD_UNEXPECTED_4ADDR_FRAME: Sent as an event indicating that the * associated station identified by %NL80211_ATTR_MAC sent a 4addr frame * and wasn't already in a 4-addr VLAN. The event will be sent similarly * to the %NL80211_CMD_UNEXPECTED_FRAME event, to the same listener. * * @NL80211_CMD_PROBE_CLIENT: Probe an associated station on an AP interface * by sending a null data frame to it and reporting when the frame is * acknowleged. This is used to allow timing out inactive clients. Uses * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_MAC. The command returns a * direct reply with an %NL80211_ATTR_COOKIE that is later used to match * up the event with the request. The event includes the same data and * has %NL80211_ATTR_ACK set if the frame was ACKed. * * @NL80211_CMD_REGISTER_BEACONS: Register this socket to receive beacons from * other BSSes when any interfaces are in AP mode. This helps implement * OLBC handling in hostapd. Beacons are reported in %NL80211_CMD_FRAME * messages. Note that per PHY only one application may register. * * @NL80211_CMD_SET_NOACK_MAP: sets a bitmap for the individual TIDs whether * No Acknowledgement Policy should be applied. * * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels * independently of the userspace SME, send this event indicating * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ and the * attributes determining channel width. This indication may also be * sent when a remotely-initiated switch (e.g., when a STA receives a CSA * from the remote AP) is completed; * * @NL80211_CMD_CH_SWITCH_STARTED_NOTIFY: Notify that a channel switch * has been started on an interface, regardless of the initiator * (ie. whether it was requested from a remote device or * initiated on our own). It indicates that * %NL80211_ATTR_IFINDEX will be on %NL80211_ATTR_WIPHY_FREQ * after %NL80211_ATTR_CH_SWITCH_COUNT TBTT's. The userspace may * decide to react to this indication by requesting other * interfaces to change channel as well. * * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by * its %NL80211_ATTR_WDEV identifier. It must have been created with * %NL80211_CMD_NEW_INTERFACE previously. After it has been started, the * P2P Device can be used for P2P operations, e.g. remain-on-channel and * public action frame TX. * @NL80211_CMD_STOP_P2P_DEVICE: Stop the given P2P Device, identified by * its %NL80211_ATTR_WDEV identifier. * * @NL80211_CMD_CONN_FAILED: connection request to an AP failed; used to * notify userspace that AP has rejected the connection request from a * station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON * is used for this. * * @NL80211_CMD_SET_MCAST_RATE: Change the rate used to send multicast frames * for IBSS or MESH vif. * * @NL80211_CMD_SET_MAC_ACL: sets ACL for MAC address based access control. * This is to be used with the drivers advertising the support of MAC * address based access control. List of MAC addresses is passed in * %NL80211_ATTR_MAC_ADDRS and ACL policy is passed in * %NL80211_ATTR_ACL_POLICY. Driver will enable ACL with this list, if it * is not already done. The new list will replace any existing list. Driver * will clear its ACL when the list of MAC addresses passed is empty. This * command is used in AP/P2P GO mode. Driver has to make sure to clear its * ACL list during %NL80211_CMD_STOP_AP. * * @NL80211_CMD_RADAR_DETECT: Start a Channel availability check (CAC). Once * a radar is detected or the channel availability scan (CAC) has finished * or was aborted, or a radar was detected, usermode will be notified with * this event. This command is also used to notify userspace about radars * while operating on this channel. * %NL80211_ATTR_RADAR_EVENT is used to inform about the type of the * event. * * @NL80211_CMD_GET_PROTOCOL_FEATURES: Get global nl80211 protocol features, * i.e. features for the nl80211 protocol rather than device features. * Returns the features in the %NL80211_ATTR_PROTOCOL_FEATURES bitmap. * * @NL80211_CMD_UPDATE_FT_IES: Pass down the most up-to-date Fast Transition * Information Element to the WLAN driver * * @NL80211_CMD_FT_EVENT: Send a Fast transition event from the WLAN driver * to the supplicant. This will carry the target AP's MAC address along * with the relevant Information Elements. This event is used to report * received FT IEs (MDIE, FTIE, RSN IE, TIE, RICIE). * * @NL80211_CMD_CRIT_PROTOCOL_START: Indicates user-space will start running * a critical protocol that needs more reliability in the connection to * complete. * * @NL80211_CMD_CRIT_PROTOCOL_STOP: Indicates the connection reliability can * return back to normal. * * @NL80211_CMD_GET_COALESCE: Get currently supported coalesce rules. * @NL80211_CMD_SET_COALESCE: Configure coalesce rules or clear existing rules. * * @NL80211_CMD_CHANNEL_SWITCH: Perform a channel switch by announcing the * the new channel information (Channel Switch Announcement - CSA) * in the beacon for some time (as defined in the * %NL80211_ATTR_CH_SWITCH_COUNT parameter) and then change to the * new channel. Userspace provides the new channel information (using * %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel * width). %NL80211_ATTR_CH_SWITCH_BLOCK_TX may be supplied to inform * other station that transmission must be blocked until the channel * switch is complete. * * @NL80211_CMD_VENDOR: Vendor-specified command/event. The command is specified * by the %NL80211_ATTR_VENDOR_ID attribute and a sub-command in * %NL80211_ATTR_VENDOR_SUBCMD. Parameter(s) can be transported in * %NL80211_ATTR_VENDOR_DATA. * For feature advertisement, the %NL80211_ATTR_VENDOR_DATA attribute is * used in the wiphy data as a nested attribute containing descriptions * (&struct nl80211_vendor_cmd_info) of the supported vendor commands. * This may also be sent as an event with the same attributes. * * @NL80211_CMD_SET_QOS_MAP: Set Interworking QoS mapping for IP DSCP values. * The QoS mapping information is included in %NL80211_ATTR_QOS_MAP. If * that attribute is not included, QoS mapping is disabled. Since this * QoS mapping is relevant for IP packets, it is only valid during an * association. This is cleared on disassociation and AP restart. * * @NL80211_CMD_ADD_TX_TS: Ask the kernel to add a traffic stream for the given * %NL80211_ATTR_TSID and %NL80211_ATTR_MAC with %NL80211_ATTR_USER_PRIO * and %NL80211_ATTR_ADMITTED_TIME parameters. * Note that the action frame handshake with the AP shall be handled by * userspace via the normal management RX/TX framework, this only sets * up the TX TS in the driver/device. * If the admitted time attribute is not added then the request just checks * if a subsequent setup could be successful, the intent is to use this to * avoid setting up a session with the AP when local restrictions would * make that impossible. However, the subsequent "real" setup may still * fail even if the check was successful. * @NL80211_CMD_DEL_TX_TS: Remove an existing TS with the %NL80211_ATTR_TSID * and %NL80211_ATTR_MAC parameters. It isn't necessary to call this * before removing a station entry entirely, or before disassociating * or similar, cleanup will happen in the driver/device in this case. * * @NL80211_CMD_GET_MPP: Get mesh path attributes for mesh proxy path to * destination %NL80211_ATTR_MAC on the interface identified by * %NL80211_ATTR_IFINDEX. * * @NL80211_CMD_JOIN_OCB: Join the OCB network. The center frequency and * bandwidth of a channel must be given. * @NL80211_CMD_LEAVE_OCB: Leave the OCB network -- no special arguments, the * network is determined by the network interface. * * @NL80211_CMD_TDLS_CHANNEL_SWITCH: Start channel-switching with a TDLS peer, * identified by the %NL80211_ATTR_MAC parameter. A target channel is * provided via %NL80211_ATTR_WIPHY_FREQ and other attributes determining * channel width/type. The target operating class is given via * %NL80211_ATTR_OPER_CLASS. * The driver is responsible for continually initiating channel-switching * operations and returning to the base channel for communication with the * AP. * @NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH: Stop channel-switching with a TDLS * peer given by %NL80211_ATTR_MAC. Both peers must be on the base channel * when this command completes. * * @NL80211_CMD_WIPHY_REG_CHANGE: Similar to %NL80211_CMD_REG_CHANGE, but used * as an event to indicate changes for devices with wiphy-specific regdom * management. * * @NL80211_CMD_ABORT_SCAN: Stop an ongoing scan. Returns -ENOENT if a scan is * not running. The driver indicates the status of the scan through * cfg80211_scan_done(). * * @NL80211_CMD_START_NAN: Start NAN operation, identified by its * %NL80211_ATTR_WDEV interface. This interface must have been previously * created with %NL80211_CMD_NEW_INTERFACE. After it has been started, the * NAN interface will create or join a cluster. This command must have a * valid %NL80211_ATTR_NAN_MASTER_PREF attribute and optional * %NL80211_ATTR_NAN_DUAL attributes. * After this command NAN functions can be added. * @NL80211_CMD_STOP_NAN: Stop the NAN operation, identified by * its %NL80211_ATTR_WDEV interface. * @NL80211_CMD_ADD_NAN_FUNCTION: Add a NAN function. The function is defined * with %NL80211_ATTR_NAN_FUNC nested attribute. When called, this * operation returns the strictly positive and unique instance id * (%NL80211_ATTR_NAN_FUNC_INST_ID) and a cookie (%NL80211_ATTR_COOKIE) * of the function upon success. * Since instance ID's can be re-used, this cookie is the right * way to identify the function. This will avoid races when a termination * event is handled by the user space after it has already added a new * function that got the same instance id from the kernel as the one * which just terminated. * This cookie may be used in NAN events even before the command * returns, so userspace shouldn't process NAN events until it processes * the response to this command. * Look at %NL80211_ATTR_SOCKET_OWNER as well. * @NL80211_CMD_DEL_NAN_FUNCTION: Delete a NAN function by cookie. * This command is also used as a notification sent when a NAN function is * terminated. This will contain a %NL80211_ATTR_NAN_FUNC_INST_ID * and %NL80211_ATTR_COOKIE attributes. * @NL80211_CMD_CHANGE_NAN_CONFIG: Change current NAN configuration. NAN * must be operational (%NL80211_CMD_START_NAN was executed). * It must contain at least one of the following attributes: * %NL80211_ATTR_NAN_MASTER_PREF, %NL80211_ATTR_NAN_DUAL. * @NL80211_CMD_NAN_FUNC_MATCH: Notification sent when a match is reported. * This will contain a %NL80211_ATTR_NAN_MATCH nested attribute and * %NL80211_ATTR_COOKIE. * * @NL80211_CMD_MAX: highest used command number * @__NL80211_CMD_AFTER_LAST: internal use */ enum nl80211_commands { /* don't change the order or add anything between, this is ABI! */ NL80211_CMD_UNSPEC, NL80211_CMD_GET_WIPHY, /* can dump */ NL80211_CMD_SET_WIPHY, NL80211_CMD_NEW_WIPHY, NL80211_CMD_DEL_WIPHY, NL80211_CMD_GET_INTERFACE, /* can dump */ NL80211_CMD_SET_INTERFACE, NL80211_CMD_NEW_INTERFACE, NL80211_CMD_DEL_INTERFACE, NL80211_CMD_GET_KEY, NL80211_CMD_SET_KEY, NL80211_CMD_NEW_KEY, NL80211_CMD_DEL_KEY, NL80211_CMD_GET_BEACON, NL80211_CMD_SET_BEACON, NL80211_CMD_START_AP, NL80211_CMD_NEW_BEACON = NL80211_CMD_START_AP, NL80211_CMD_STOP_AP, NL80211_CMD_DEL_BEACON = NL80211_CMD_STOP_AP, NL80211_CMD_GET_STATION, NL80211_CMD_SET_STATION, NL80211_CMD_NEW_STATION, NL80211_CMD_DEL_STATION, NL80211_CMD_GET_MPATH, NL80211_CMD_SET_MPATH, NL80211_CMD_NEW_MPATH, NL80211_CMD_DEL_MPATH, NL80211_CMD_SET_BSS, NL80211_CMD_SET_REG, NL80211_CMD_REQ_SET_REG, NL80211_CMD_GET_MESH_CONFIG, NL80211_CMD_SET_MESH_CONFIG, NL80211_CMD_SET_MGMT_EXTRA_IE /* reserved; not used */, NL80211_CMD_GET_REG, NL80211_CMD_GET_SCAN, NL80211_CMD_TRIGGER_SCAN, NL80211_CMD_NEW_SCAN_RESULTS, NL80211_CMD_SCAN_ABORTED, NL80211_CMD_REG_CHANGE, NL80211_CMD_AUTHENTICATE, NL80211_CMD_ASSOCIATE, NL80211_CMD_DEAUTHENTICATE, NL80211_CMD_DISASSOCIATE, NL80211_CMD_MICHAEL_MIC_FAILURE, NL80211_CMD_REG_BEACON_HINT, NL80211_CMD_JOIN_IBSS, NL80211_CMD_LEAVE_IBSS, NL80211_CMD_TESTMODE, NL80211_CMD_CONNECT, NL80211_CMD_ROAM, NL80211_CMD_DISCONNECT, NL80211_CMD_SET_WIPHY_NETNS, NL80211_CMD_GET_SURVEY, NL80211_CMD_NEW_SURVEY_RESULTS, NL80211_CMD_SET_PMKSA, NL80211_CMD_DEL_PMKSA, NL80211_CMD_FLUSH_PMKSA, NL80211_CMD_REMAIN_ON_CHANNEL, NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL, NL80211_CMD_SET_TX_BITRATE_MASK, NL80211_CMD_REGISTER_FRAME, NL80211_CMD_REGISTER_ACTION = NL80211_CMD_REGISTER_FRAME, NL80211_CMD_FRAME, NL80211_CMD_ACTION = NL80211_CMD_FRAME, NL80211_CMD_FRAME_TX_STATUS, NL80211_CMD_ACTION_TX_STATUS = NL80211_CMD_FRAME_TX_STATUS, NL80211_CMD_SET_POWER_SAVE, NL80211_CMD_GET_POWER_SAVE, NL80211_CMD_SET_CQM, NL80211_CMD_NOTIFY_CQM, NL80211_CMD_SET_CHANNEL, NL80211_CMD_SET_WDS_PEER, NL80211_CMD_FRAME_WAIT_CANCEL, NL80211_CMD_JOIN_MESH, NL80211_CMD_LEAVE_MESH, NL80211_CMD_UNPROT_DEAUTHENTICATE, NL80211_CMD_UNPROT_DISASSOCIATE, NL80211_CMD_NEW_PEER_CANDIDATE, NL80211_CMD_GET_WOWLAN, NL80211_CMD_SET_WOWLAN, NL80211_CMD_START_SCHED_SCAN, NL80211_CMD_STOP_SCHED_SCAN, NL80211_CMD_SCHED_SCAN_RESULTS, NL80211_CMD_SCHED_SCAN_STOPPED, NL80211_CMD_SET_REKEY_OFFLOAD, NL80211_CMD_PMKSA_CANDIDATE, NL80211_CMD_TDLS_OPER, NL80211_CMD_TDLS_MGMT, NL80211_CMD_UNEXPECTED_FRAME, NL80211_CMD_PROBE_CLIENT, NL80211_CMD_REGISTER_BEACONS, NL80211_CMD_UNEXPECTED_4ADDR_FRAME, NL80211_CMD_SET_NOACK_MAP, NL80211_CMD_CH_SWITCH_NOTIFY, NL80211_CMD_START_P2P_DEVICE, NL80211_CMD_STOP_P2P_DEVICE, NL80211_CMD_CONN_FAILED, NL80211_CMD_SET_MCAST_RATE, NL80211_CMD_SET_MAC_ACL, NL80211_CMD_RADAR_DETECT, NL80211_CMD_GET_PROTOCOL_FEATURES, NL80211_CMD_UPDATE_FT_IES, NL80211_CMD_FT_EVENT, NL80211_CMD_CRIT_PROTOCOL_START, NL80211_CMD_CRIT_PROTOCOL_STOP, NL80211_CMD_GET_COALESCE, NL80211_CMD_SET_COALESCE, NL80211_CMD_CHANNEL_SWITCH, NL80211_CMD_VENDOR, NL80211_CMD_SET_QOS_MAP, NL80211_CMD_ADD_TX_TS, NL80211_CMD_DEL_TX_TS, NL80211_CMD_GET_MPP, NL80211_CMD_JOIN_OCB, NL80211_CMD_LEAVE_OCB, NL80211_CMD_CH_SWITCH_STARTED_NOTIFY, NL80211_CMD_TDLS_CHANNEL_SWITCH, NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH, NL80211_CMD_WIPHY_REG_CHANGE, NL80211_CMD_ABORT_SCAN, NL80211_CMD_START_NAN, NL80211_CMD_STOP_NAN, NL80211_CMD_ADD_NAN_FUNCTION, NL80211_CMD_DEL_NAN_FUNCTION, NL80211_CMD_CHANGE_NAN_CONFIG, NL80211_CMD_NAN_MATCH, /* add new commands above here */ /* used to define NL80211_CMD_MAX below */ __NL80211_CMD_AFTER_LAST, NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1 }; /* source-level API compatibility */ #define NL80211_CMD_GET_MESH_PARAMS NL80211_CMD_GET_MESH_CONFIG #define NL80211_CMD_SET_MESH_PARAMS NL80211_CMD_SET_MESH_CONFIG #define NL80211_MESH_SETUP_VENDOR_PATH_SEL_IE NL80211_MESH_SETUP_IE /** * enum nl80211_attrs - nl80211 netlink attributes * * @NL80211_ATTR_UNSPEC: unspecified attribute to catch errors * * @NL80211_ATTR_WIPHY: index of wiphy to operate on, cf. * /sys/class/ieee80211//index * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming) * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz, * defines the channel together with the (deprecated) * %NL80211_ATTR_WIPHY_CHANNEL_TYPE attribute or the attributes * %NL80211_ATTR_CHANNEL_WIDTH and if needed %NL80211_ATTR_CENTER_FREQ1 * and %NL80211_ATTR_CENTER_FREQ2 * @NL80211_ATTR_CHANNEL_WIDTH: u32 attribute containing one of the values * of &enum nl80211_chan_width, describing the channel width. See the * documentation of the enum for more information. * @NL80211_ATTR_CENTER_FREQ1: Center frequency of the first part of the * channel, used for anything but 20 MHz bandwidth * @NL80211_ATTR_CENTER_FREQ2: Center frequency of the second part of the * channel, used only for 80+80 MHz bandwidth * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ * if HT20 or HT40 are to be used (i.e., HT disabled if not included): * NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including * this attribute) * NL80211_CHAN_HT20 = HT20 only * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel * This attribute is now deprecated. * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is * less than or equal to the RTS threshold; allowed range: 1..255; * dot11ShortRetryLimit; u8 * @NL80211_ATTR_WIPHY_RETRY_LONG: TX retry limit for frames whose length is * greater than the RTS threshold; allowed range: 1..255; * dot11ShortLongLimit; u8 * @NL80211_ATTR_WIPHY_FRAG_THRESHOLD: fragmentation threshold, i.e., maximum * length in octets for frames; allowed range: 256..8000, disable * fragmentation with (u32)-1; dot11FragmentationThreshold; u32 * @NL80211_ATTR_WIPHY_RTS_THRESHOLD: RTS threshold (TX frames with length * larger than or equal to this use RTS/CTS handshake); allowed range: * 0..65536, disable with (u32)-1; dot11RTSThreshold; u32 * @NL80211_ATTR_WIPHY_COVERAGE_CLASS: Coverage Class as defined by IEEE 802.11 * section 7.3.2.9; dot11CoverageClass; u8 * * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on * @NL80211_ATTR_IFNAME: network interface name * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype * * @NL80211_ATTR_WDEV: wireless device identifier, used for pseudo-devices * that don't have a netdev (u64) * * @NL80211_ATTR_MAC: MAC address (various uses) * * @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of * 16 bytes encryption key followed by 8 bytes each for TX and RX MIC * keys * @NL80211_ATTR_KEY_IDX: key ID (u8, 0-3) * @NL80211_ATTR_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11 * section 7.3.2.25.1, e.g. 0x000FAC04) * @NL80211_ATTR_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and * CCMP keys, each six bytes in little endian * @NL80211_ATTR_KEY_DEFAULT: Flag attribute indicating the key is default key * @NL80211_ATTR_KEY_DEFAULT_MGMT: Flag attribute indicating the key is the * default management key * @NL80211_ATTR_CIPHER_SUITES_PAIRWISE: For crypto settings for connect or * other commands, indicates which pairwise cipher suites are used * @NL80211_ATTR_CIPHER_SUITE_GROUP: For crypto settings for connect or * other commands, indicates which group cipher suite is used * * @NL80211_ATTR_BEACON_INTERVAL: beacon interval in TU * @NL80211_ATTR_DTIM_PERIOD: DTIM period for beaconing * @NL80211_ATTR_BEACON_HEAD: portion of the beacon before the TIM IE * @NL80211_ATTR_BEACON_TAIL: portion of the beacon after the TIM IE * * @NL80211_ATTR_STA_AID: Association ID for the station (u16) * @NL80211_ATTR_STA_FLAGS: flags, nested element with NLA_FLAG attributes of * &enum nl80211_sta_flags (deprecated, use %NL80211_ATTR_STA_FLAGS2) * @NL80211_ATTR_STA_LISTEN_INTERVAL: listen interval as defined by * IEEE 802.11 7.3.1.6 (u16). * @NL80211_ATTR_STA_SUPPORTED_RATES: supported rates, array of supported * rates as defined by IEEE 802.11 7.3.2.2 but without the length * restriction (at most %NL80211_MAX_SUPP_RATES). * @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station * to, or the AP interface the station was originally added to to. * @NL80211_ATTR_STA_INFO: information about a station, part of station info * given for %NL80211_CMD_GET_STATION, nested attribute containing * info as possible, see &enum nl80211_sta_info. * * @NL80211_ATTR_WIPHY_BANDS: Information about an operating bands, * consisting of a nested array. * * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes). * @NL80211_ATTR_STA_PLINK_ACTION: action to perform on the mesh peer link * (see &enum nl80211_plink_action). * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path. * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path * info given for %NL80211_CMD_GET_MPATH, nested attribute described at * &enum nl80211_mpath_info. * * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of * &enum nl80211_mntr_flags. * * @NL80211_ATTR_REG_ALPHA2: an ISO-3166-alpha2 country code for which the * current regulatory domain should be set to or is already set to. * For example, 'CR', for Costa Rica. This attribute is used by the kernel * to query the CRDA to retrieve one regulatory domain. This attribute can * also be used by userspace to query the kernel for the currently set * regulatory domain. We chose an alpha2 as that is also used by the * IEEE-802.11 country information element to identify a country. * Users can also simply ask the wireless core to set regulatory domain * to a specific alpha2. * @NL80211_ATTR_REG_RULES: a nested array of regulatory domain regulatory * rules. * * @NL80211_ATTR_BSS_CTS_PROT: whether CTS protection is enabled (u8, 0 or 1) * @NL80211_ATTR_BSS_SHORT_PREAMBLE: whether short preamble is enabled * (u8, 0 or 1) * @NL80211_ATTR_BSS_SHORT_SLOT_TIME: whether short slot time enabled * (u8, 0 or 1) * @NL80211_ATTR_BSS_BASIC_RATES: basic rates, array of basic * rates in format defined by IEEE 802.11 7.3.2.2 but without the length * restriction (at most %NL80211_MAX_SUPP_RATES). * * @NL80211_ATTR_HT_CAPABILITY: HT Capability information element (from * association request when used with NL80211_CMD_NEW_STATION) * * @NL80211_ATTR_SUPPORTED_IFTYPES: nested attribute containing all * supported interface types, each a flag attribute with the number * of the interface mode. * * @NL80211_ATTR_MGMT_SUBTYPE: Management frame subtype for * %NL80211_CMD_SET_MGMT_EXTRA_IE. * * @NL80211_ATTR_IE: Information element(s) data (used, e.g., with * %NL80211_CMD_SET_MGMT_EXTRA_IE). * * @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with * a single scan request, a wiphy attribute. * @NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS: number of SSIDs you can * scan with a single scheduled scan request, a wiphy attribute. * @NL80211_ATTR_MAX_SCAN_IE_LEN: maximum length of information elements * that can be added to a scan request * @NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN: maximum length of information * elements that can be added to a scheduled scan request * @NL80211_ATTR_MAX_MATCH_SETS: maximum number of sets that can be * used with @NL80211_ATTR_SCHED_SCAN_MATCH, a wiphy attribute. * * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz) * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive * scanning and include a zero-length SSID (wildcard) for wildcard scan * @NL80211_ATTR_BSS: scan result BSS * * @NL80211_ATTR_REG_INITIATOR: indicates who requested the regulatory domain * currently in effect. This could be any of the %NL80211_REGDOM_SET_BY_* * @NL80211_ATTR_REG_TYPE: indicates the type of the regulatory domain currently * set. This can be one of the nl80211_reg_type (%NL80211_REGDOM_TYPE_*) * * @NL80211_ATTR_SUPPORTED_COMMANDS: wiphy attribute that specifies * an array of command numbers (i.e. a mapping index to command number) * that the driver for the given wiphy supports. * * @NL80211_ATTR_FRAME: frame data (binary attribute), including frame header * and body, but not FCS; used, e.g., with NL80211_CMD_AUTHENTICATE and * NL80211_CMD_ASSOCIATE events * @NL80211_ATTR_SSID: SSID (binary attribute, 0..32 octets) * @NL80211_ATTR_AUTH_TYPE: AuthenticationType, see &enum nl80211_auth_type, * represented as a u32 * @NL80211_ATTR_REASON_CODE: ReasonCode for %NL80211_CMD_DEAUTHENTICATE and * %NL80211_CMD_DISASSOCIATE, u16 * * @NL80211_ATTR_KEY_TYPE: Key Type, see &enum nl80211_key_type, represented as * a u32 * * @NL80211_ATTR_FREQ_BEFORE: A channel which has suffered a regulatory change * due to considerations from a beacon hint. This attribute reflects * the state of the channel _before_ the beacon hint processing. This * attributes consists of a nested attribute containing * NL80211_FREQUENCY_ATTR_* * @NL80211_ATTR_FREQ_AFTER: A channel which has suffered a regulatory change * due to considerations from a beacon hint. This attribute reflects * the state of the channel _after_ the beacon hint processing. This * attributes consists of a nested attribute containing * NL80211_FREQUENCY_ATTR_* * * @NL80211_ATTR_CIPHER_SUITES: a set of u32 values indicating the supported * cipher suites * * @NL80211_ATTR_FREQ_FIXED: a flag indicating the IBSS should not try to look * for other networks on different channels * * @NL80211_ATTR_TIMED_OUT: a flag indicating than an operation timed out; this * is used, e.g., with %NL80211_CMD_AUTHENTICATE event * * @NL80211_ATTR_USE_MFP: Whether management frame protection (IEEE 802.11w) is * used for the association (&enum nl80211_mfp, represented as a u32); * this attribute can be used * with %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests * * @NL80211_ATTR_STA_FLAGS2: Attribute containing a * &struct nl80211_sta_flag_update. * * @NL80211_ATTR_CONTROL_PORT: A flag indicating whether user space controls * IEEE 802.1X port, i.e., sets/clears %NL80211_STA_FLAG_AUTHORIZED, in * station mode. If the flag is included in %NL80211_CMD_ASSOCIATE * request, the driver will assume that the port is unauthorized until * authorized by user space. Otherwise, port is marked authorized by * default in station mode. * @NL80211_ATTR_CONTROL_PORT_ETHERTYPE: A 16-bit value indicating the * ethertype that will be used for key negotiation. It can be * specified with the associate and connect commands. If it is not * specified, the value defaults to 0x888E (PAE, 802.1X). This * attribute is also used as a flag in the wiphy information to * indicate that protocols other than PAE are supported. * @NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT: When included along with * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, indicates that the custom * ethertype frames used for key negotiation must not be encrypted. * * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver. * We recommend using nested, driver-specific attributes within this. * * @NL80211_ATTR_DISCONNECTED_BY_AP: A flag indicating that the DISCONNECT * event was due to the AP disconnecting the station, and not due to * a local disconnect request. * @NL80211_ATTR_STATUS_CODE: StatusCode for the %NL80211_CMD_CONNECT * event (u16) * @NL80211_ATTR_PRIVACY: Flag attribute, used with connect(), indicating * that protected APs should be used. This is also used with NEW_BEACON to * indicate that the BSS is to use protection. * * @NL80211_ATTR_CIPHERS_PAIRWISE: Used with CONNECT, ASSOCIATE, and NEW_BEACON * to indicate which unicast key ciphers will be used with the connection * (an array of u32). * @NL80211_ATTR_CIPHER_GROUP: Used with CONNECT, ASSOCIATE, and NEW_BEACON to * indicate which group key cipher will be used with the connection (a * u32). * @NL80211_ATTR_WPA_VERSIONS: Used with CONNECT, ASSOCIATE, and NEW_BEACON to * indicate which WPA version(s) the AP we want to associate with is using * (a u32 with flags from &enum nl80211_wpa_versions). * @NL80211_ATTR_AKM_SUITES: Used with CONNECT, ASSOCIATE, and NEW_BEACON to * indicate which key management algorithm(s) to use (an array of u32). * * @NL80211_ATTR_REQ_IE: (Re)association request information elements as * sent out by the card, for ROAM and successful CONNECT events. * @NL80211_ATTR_RESP_IE: (Re)association response information elements as * sent by peer, for ROAM and successful CONNECT events. * * @NL80211_ATTR_PREV_BSSID: previous BSSID, to be used in ASSOCIATE and CONNECT * commands to specify a request to reassociate within an ESS, i.e., to use * Reassociate Request frame (with the value of this attribute in the * Current AP address field) instead of Association Request frame which is * used for the initial association to an ESS. * * @NL80211_ATTR_KEY: key information in a nested attribute with * %NL80211_KEY_* sub-attributes * @NL80211_ATTR_KEYS: array of keys for static WEP keys for connect() * and join_ibss(), key information is in a nested attribute each * with %NL80211_KEY_* sub-attributes * * @NL80211_ATTR_PID: Process ID of a network namespace. * * @NL80211_ATTR_GENERATION: Used to indicate consistent snapshots for * dumps. This number increases whenever the object list being * dumped changes, and as such userspace can verify that it has * obtained a complete and consistent snapshot by verifying that * all dump messages contain the same generation number. If it * changed then the list changed and the dump should be repeated * completely from scratch. * * @NL80211_ATTR_4ADDR: Use 4-address frames on a virtual interface * * @NL80211_ATTR_SURVEY_INFO: survey information about a channel, part of * the survey response for %NL80211_CMD_GET_SURVEY, nested attribute * containing info as possible, see &enum survey_info. * * @NL80211_ATTR_PMKID: PMK material for PMKSA caching. * @NL80211_ATTR_MAX_NUM_PMKIDS: maximum number of PMKIDs a firmware can * cache, a wiphy attribute. * * @NL80211_ATTR_DURATION: Duration of an operation in milliseconds, u32. * @NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION: Device attribute that * specifies the maximum duration that can be requested with the * remain-on-channel operation, in milliseconds, u32. * * @NL80211_ATTR_COOKIE: Generic 64-bit cookie to identify objects. * * @NL80211_ATTR_TX_RATES: Nested set of attributes * (enum nl80211_tx_rate_attributes) describing TX rates per band. The * enum nl80211_band value is used as the index (nla_type() of the nested * data. If a band is not included, it will be configured to allow all * rates based on negotiated supported rates information. This attribute * is used with %NL80211_CMD_SET_TX_BITRATE_MASK and with starting AP, * and joining mesh networks (not IBSS yet). In the later case, it must * specify just a single bitrate, which is to be used for the beacon. * The driver must also specify support for this with the extended * features NL80211_EXT_FEATURE_BEACON_RATE_LEGACY, * NL80211_EXT_FEATURE_BEACON_RATE_HT and * NL80211_EXT_FEATURE_BEACON_RATE_VHT. * * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain * at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME. * @NL80211_ATTR_FRAME_TYPE: A u16 indicating the frame type/subtype for the * @NL80211_CMD_REGISTER_FRAME command. * @NL80211_ATTR_TX_FRAME_TYPES: wiphy capability attribute, which is a * nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing * information about which frame types can be transmitted with * %NL80211_CMD_FRAME. * @NL80211_ATTR_RX_FRAME_TYPES: wiphy capability attribute, which is a * nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing * information about which frame types can be registered for RX. * * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was * acknowledged by the recipient. * * @NL80211_ATTR_PS_STATE: powersave state, using &enum nl80211_ps_state values. * * @NL80211_ATTR_CQM: connection quality monitor configuration in a * nested attribute with %NL80211_ATTR_CQM_* sub-attributes. * * @NL80211_ATTR_LOCAL_STATE_CHANGE: Flag attribute to indicate that a command * is requesting a local authentication/association state change without * invoking actual management frame exchange. This can be used with * NL80211_CMD_AUTHENTICATE, NL80211_CMD_DEAUTHENTICATE, * NL80211_CMD_DISASSOCIATE. * * @NL80211_ATTR_AP_ISOLATE: (AP mode) Do not forward traffic between stations * connected to this BSS. * * @NL80211_ATTR_WIPHY_TX_POWER_SETTING: Transmit power setting type. See * &enum nl80211_tx_power_setting for possible values. * @NL80211_ATTR_WIPHY_TX_POWER_LEVEL: Transmit power level in signed mBm units. * This is used in association with @NL80211_ATTR_WIPHY_TX_POWER_SETTING * for non-automatic settings. * * @NL80211_ATTR_SUPPORT_IBSS_RSN: The device supports IBSS RSN, which mostly * means support for per-station GTKs. * * @NL80211_ATTR_WIPHY_ANTENNA_TX: Bitmap of allowed antennas for transmitting. * This can be used to mask out antennas which are not attached or should * not be used for transmitting. If an antenna is not selected in this * bitmap the hardware is not allowed to transmit on this antenna. * * Each bit represents one antenna, starting with antenna 1 at the first * bit. Depending on which antennas are selected in the bitmap, 802.11n * drivers can derive which chainmasks to use (if all antennas belonging to * a particular chain are disabled this chain should be disabled) and if * a chain has diversity antennas wether diversity should be used or not. * HT capabilities (STBC, TX Beamforming, Antenna selection) can be * derived from the available chains after applying the antenna mask. * Non-802.11n drivers can derive wether to use diversity or not. * Drivers may reject configurations or RX/TX mask combinations they cannot * support by returning -EINVAL. * * @NL80211_ATTR_WIPHY_ANTENNA_RX: Bitmap of allowed antennas for receiving. * This can be used to mask out antennas which are not attached or should * not be used for receiving. If an antenna is not selected in this bitmap * the hardware should not be configured to receive on this antenna. * For a more detailed description see @NL80211_ATTR_WIPHY_ANTENNA_TX. * * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX: Bitmap of antennas which are available * for configuration as TX antennas via the above parameters. * * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX: Bitmap of antennas which are available * for configuration as RX antennas via the above parameters. * * @NL80211_ATTR_MCAST_RATE: Multicast tx rate (in 100 kbps) for IBSS * * @NL80211_ATTR_OFFCHANNEL_TX_OK: For management frame TX, the frame may be * transmitted on another channel when the channel given doesn't match * the current channel. If the current channel doesn't match and this * flag isn't set, the frame will be rejected. This is also used as an * nl80211 capability flag. * * @NL80211_ATTR_BSS_HT_OPMODE: HT operation mode (u16) * * @NL80211_ATTR_KEY_DEFAULT_TYPES: A nested attribute containing flags * attributes, specifying what a key should be set as default as. * See &enum nl80211_key_default_types. * * @NL80211_ATTR_MESH_SETUP: Optional mesh setup parameters. These cannot be * changed once the mesh is active. * @NL80211_ATTR_MESH_CONFIG: Mesh configuration parameters, a nested attribute * containing attributes from &enum nl80211_meshconf_params. * @NL80211_ATTR_SUPPORT_MESH_AUTH: Currently, this means the underlying driver * allows auth frames in a mesh to be passed to userspace for processing via * the @NL80211_MESH_SETUP_USERSPACE_AUTH flag. * @NL80211_ATTR_STA_PLINK_STATE: The state of a mesh peer link as defined in * &enum nl80211_plink_state. Used when userspace is driving the peer link * management state machine. @NL80211_MESH_SETUP_USERSPACE_AMPE or * @NL80211_MESH_SETUP_USERSPACE_MPM must be enabled. * * @NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED: indicates, as part of the wiphy * capabilities, the supported WoWLAN triggers * @NL80211_ATTR_WOWLAN_TRIGGERS: used by %NL80211_CMD_SET_WOWLAN to * indicate which WoW triggers should be enabled. This is also * used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN * triggers. * * @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan * cycles, in msecs. * * @NL80211_ATTR_SCHED_SCAN_MATCH: Nested attribute with one or more * sets of attributes to match during scheduled scans. Only BSSs * that match any of the sets will be reported. These are * pass-thru filter rules. * For a match to succeed, the BSS must match all attributes of a * set. Since not every hardware supports matching all types of * attributes, there is no guarantee that the reported BSSs are * fully complying with the match sets and userspace needs to be * able to ignore them by itself. * Thus, the implementation is somewhat hardware-dependent, but * this is only an optimization and the userspace application * needs to handle all the non-filtered results anyway. * If the match attributes don't make sense when combined with * the values passed in @NL80211_ATTR_SCAN_SSIDS (eg. if an SSID * is included in the probe request, but the match attributes * will never let it go through), -EINVAL may be returned. * If ommited, no filtering is done. * * @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported * interface combinations. In each nested item, it contains attributes * defined in &enum nl80211_if_combination_attrs. * @NL80211_ATTR_SOFTWARE_IFTYPES: Nested attribute (just like * %NL80211_ATTR_SUPPORTED_IFTYPES) containing the interface types that * are managed in software: interfaces of these types aren't subject to * any restrictions in their number or combinations. * * @NL80211_ATTR_REKEY_DATA: nested attribute containing the information * necessary for GTK rekeying in the device, see &enum nl80211_rekey_data. * * @NL80211_ATTR_SCAN_SUPP_RATES: rates per to be advertised as supported in scan, * nested array attribute containing an entry for each band, with the entry * being a list of supported rates as defined by IEEE 802.11 7.3.2.2 but * without the length restriction (at most %NL80211_MAX_SUPP_RATES). * * @NL80211_ATTR_HIDDEN_SSID: indicates whether SSID is to be hidden from Beacon * and Probe Response (when response to wildcard Probe Request); see * &enum nl80211_hidden_ssid, represented as a u32 * * @NL80211_ATTR_IE_PROBE_RESP: Information element(s) for Probe Response frame. * This is used with %NL80211_CMD_NEW_BEACON and %NL80211_CMD_SET_BEACON to * provide extra IEs (e.g., WPS/P2P IE) into Probe Response frames when the * driver (or firmware) replies to Probe Request frames. * @NL80211_ATTR_IE_ASSOC_RESP: Information element(s) for (Re)Association * Response frames. This is used with %NL80211_CMD_NEW_BEACON and * %NL80211_CMD_SET_BEACON to provide extra IEs (e.g., WPS/P2P IE) into * (Re)Association Response frames when the driver (or firmware) replies to * (Re)Association Request frames. * * @NL80211_ATTR_STA_WME: Nested attribute containing the wme configuration * of the station, see &enum nl80211_sta_wme_attr. * @NL80211_ATTR_SUPPORT_AP_UAPSD: the device supports uapsd when working * as AP. * * @NL80211_ATTR_ROAM_SUPPORT: Indicates whether the firmware is capable of * roaming to another AP in the same ESS if the signal lever is low. * * @NL80211_ATTR_PMKSA_CANDIDATE: Nested attribute containing the PMKSA caching * candidate information, see &enum nl80211_pmksa_candidate_attr. * * @NL80211_ATTR_TX_NO_CCK_RATE: Indicates whether to use CCK rate or not * for management frames transmission. In order to avoid p2p probe/action * frames are being transmitted at CCK rate in 2GHz band, the user space * applications use this attribute. * This attribute is used with %NL80211_CMD_TRIGGER_SCAN and * %NL80211_CMD_FRAME commands. * * @NL80211_ATTR_TDLS_ACTION: Low level TDLS action code (e.g. link setup * request, link setup confirm, link teardown, etc.). Values are * described in the TDLS (802.11z) specification. * @NL80211_ATTR_TDLS_DIALOG_TOKEN: Non-zero token for uniquely identifying a * TDLS conversation between two devices. * @NL80211_ATTR_TDLS_OPERATION: High level TDLS operation; see * &enum nl80211_tdls_operation, represented as a u8. * @NL80211_ATTR_TDLS_SUPPORT: A flag indicating the device can operate * as a TDLS peer sta. * @NL80211_ATTR_TDLS_EXTERNAL_SETUP: The TDLS discovery/setup and teardown * procedures should be performed by sending TDLS packets via * %NL80211_CMD_TDLS_MGMT. Otherwise %NL80211_CMD_TDLS_OPER should be * used for asking the driver to perform a TDLS operation. * * @NL80211_ATTR_DEVICE_AP_SME: This u32 attribute may be listed for devices * that have AP support to indicate that they have the AP SME integrated * with support for the features listed in this attribute, see * &enum nl80211_ap_sme_features. * * @NL80211_ATTR_DONT_WAIT_FOR_ACK: Used with %NL80211_CMD_FRAME, this tells * the driver to not wait for an acknowledgement. Note that due to this, * it will also not give a status callback nor return a cookie. This is * mostly useful for probe responses to save airtime. * * @NL80211_ATTR_FEATURE_FLAGS: This u32 attribute contains flags from * &enum nl80211_feature_flags and is advertised in wiphy information. * @NL80211_ATTR_PROBE_RESP_OFFLOAD: Indicates that the HW responds to probe * requests while operating in AP-mode. * This attribute holds a bitmap of the supported protocols for * offloading (see &enum nl80211_probe_resp_offload_support_attr). * * @NL80211_ATTR_PROBE_RESP: Probe Response template data. Contains the entire * probe-response frame. The DA field in the 802.11 header is zero-ed out, * to be filled by the FW. * @NL80211_ATTR_DISABLE_HT: Force HT capable interfaces to disable * this feature. Currently, only supported in mac80211 drivers. * @NL80211_ATTR_HT_CAPABILITY_MASK: Specify which bits of the * ATTR_HT_CAPABILITY to which attention should be paid. * Currently, only mac80211 NICs support this feature. * The values that may be configured are: * MCS rates, MAX-AMSDU, HT-20-40 and HT_CAP_SGI_40 * AMPDU density and AMPDU factor. * All values are treated as suggestions and may be ignored * by the driver as required. The actual values may be seen in * the station debugfs ht_caps file. * * @NL80211_ATTR_DFS_REGION: region for regulatory rules which this country * abides to when initiating radiation on DFS channels. A country maps * to one DFS region. * * @NL80211_ATTR_NOACK_MAP: This u16 bitmap contains the No Ack Policy of * up to 16 TIDs. * * @NL80211_ATTR_INACTIVITY_TIMEOUT: timeout value in seconds, this can be * used by the drivers which has MLME in firmware and does not have support * to report per station tx/rx activity to free up the staion entry from * the list. This needs to be used when the driver advertises the * capability to timeout the stations. * * @NL80211_ATTR_RX_SIGNAL_DBM: signal strength in dBm (as a 32-bit int); * this attribute is (depending on the driver capabilities) added to * received frames indicated with %NL80211_CMD_FRAME. * * @NL80211_ATTR_BG_SCAN_PERIOD: Background scan period in seconds * or 0 to disable background scan. * * @NL80211_ATTR_USER_REG_HINT_TYPE: type of regulatory hint passed from * userspace. If unset it is assumed the hint comes directly from * a user. If set code could specify exactly what type of source * was used to provide the hint. For the different types of * allowed user regulatory hints see nl80211_user_reg_hint_type. * * @NL80211_ATTR_CONN_FAILED_REASON: The reason for which AP has rejected * the connection request from a station. nl80211_connect_failed_reason * enum has different reasons of connection failure. * * @NL80211_ATTR_SAE_DATA: SAE elements in Authentication frames. This starts * with the Authentication transaction sequence number field. * * @NL80211_ATTR_VHT_CAPABILITY: VHT Capability information element (from * association request when used with NL80211_CMD_NEW_STATION) * * @NL80211_ATTR_SCAN_FLAGS: scan request control flags (u32) * * @NL80211_ATTR_P2P_CTWINDOW: P2P GO Client Traffic Window (u8), used with * the START_AP and SET_BSS commands * @NL80211_ATTR_P2P_OPPPS: P2P GO opportunistic PS (u8), used with the * START_AP and SET_BSS commands. This can have the values 0 or 1; * if not given in START_AP 0 is assumed, if not given in SET_BSS * no change is made. * * @NL80211_ATTR_LOCAL_MESH_POWER_MODE: local mesh STA link-specific power mode * defined in &enum nl80211_mesh_power_mode. * * @NL80211_ATTR_ACL_POLICY: ACL policy, see &enum nl80211_acl_policy, * carried in a u32 attribute * * @NL80211_ATTR_MAC_ADDRS: Array of nested MAC addresses, used for * MAC ACL. * * @NL80211_ATTR_MAC_ACL_MAX: u32 attribute to advertise the maximum * number of MAC addresses that a device can support for MAC * ACL. * * @NL80211_ATTR_RADAR_EVENT: Type of radar event for notification to userspace, * contains a value of enum nl80211_radar_event (u32). * * @NL80211_ATTR_EXT_CAPA: 802.11 extended capabilities that the kernel driver * has and handles. The format is the same as the IE contents. See * 802.11-2012 8.4.2.29 for more information. * @NL80211_ATTR_EXT_CAPA_MASK: Extended capabilities that the kernel driver * has set in the %NL80211_ATTR_EXT_CAPA value, for multibit fields. * * @NL80211_ATTR_STA_CAPABILITY: Station capabilities (u16) are advertised to * the driver, e.g., to enable TDLS power save (PU-APSD). * * @NL80211_ATTR_STA_EXT_CAPABILITY: Station extended capabilities are * advertised to the driver, e.g., to enable TDLS off channel operations * and PU-APSD. * * @NL80211_ATTR_PROTOCOL_FEATURES: global nl80211 feature flags, see * &enum nl80211_protocol_features, the attribute is a u32. * * @NL80211_ATTR_SPLIT_WIPHY_DUMP: flag attribute, userspace supports * receiving the data for a single wiphy split across multiple * messages, given with wiphy dump message * * @NL80211_ATTR_MDID: Mobility Domain Identifier * * @NL80211_ATTR_IE_RIC: Resource Information Container Information * Element * * @NL80211_ATTR_CRIT_PROT_ID: critical protocol identifier requiring increased * reliability, see &enum nl80211_crit_proto_id (u16). * @NL80211_ATTR_MAX_CRIT_PROT_DURATION: duration in milliseconds in which * the connection should have increased reliability (u16). * * @NL80211_ATTR_PEER_AID: Association ID for the peer TDLS station (u16). * This is similar to @NL80211_ATTR_STA_AID but with a difference of being * allowed to be used with the first @NL80211_CMD_SET_STATION command to * update a TDLS peer STA entry. * * @NL80211_ATTR_COALESCE_RULE: Coalesce rule information. * * @NL80211_ATTR_CH_SWITCH_COUNT: u32 attribute specifying the number of TBTT's * until the channel switch event. * @NL80211_ATTR_CH_SWITCH_BLOCK_TX: flag attribute specifying that transmission * must be blocked on the current channel (before the channel switch * operation). * @NL80211_ATTR_CSA_IES: Nested set of attributes containing the IE information * for the time while performing a channel switch. * @NL80211_ATTR_CSA_C_OFF_BEACON: An array of offsets (u16) to the channel * switch counters in the beacons tail (%NL80211_ATTR_BEACON_TAIL). * @NL80211_ATTR_CSA_C_OFF_PRESP: An array of offsets (u16) to the channel * switch counters in the probe response (%NL80211_ATTR_PROBE_RESP). * * @NL80211_ATTR_RXMGMT_FLAGS: flags for nl80211_send_mgmt(), u32. * As specified in the &enum nl80211_rxmgmt_flags. * * @NL80211_ATTR_STA_SUPPORTED_CHANNELS: array of supported channels. * * @NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES: array of supported * supported operating classes. * * @NL80211_ATTR_HANDLE_DFS: A flag indicating whether user space * controls DFS operation in IBSS mode. If the flag is included in * %NL80211_CMD_JOIN_IBSS request, the driver will allow use of DFS * channels and reports radar events to userspace. Userspace is required * to react to radar events, e.g. initiate a channel switch or leave the * IBSS network. * * @NL80211_ATTR_SUPPORT_5_MHZ: A flag indicating that the device supports * 5 MHz channel bandwidth. * @NL80211_ATTR_SUPPORT_10_MHZ: A flag indicating that the device supports * 10 MHz channel bandwidth. * * @NL80211_ATTR_OPMODE_NOTIF: Operating mode field from Operating Mode * Notification Element based on association request when used with * %NL80211_CMD_NEW_STATION; u8 attribute. * * @NL80211_ATTR_VENDOR_ID: The vendor ID, either a 24-bit OUI or, if * %NL80211_VENDOR_ID_IS_LINUX is set, a special Linux ID (not used yet) * @NL80211_ATTR_VENDOR_SUBCMD: vendor sub-command * @NL80211_ATTR_VENDOR_DATA: data for the vendor command, if any; this * attribute is also used for vendor command feature advertisement * @NL80211_ATTR_VENDOR_EVENTS: used for event list advertising in the wiphy * info, containing a nested array of possible events * * @NL80211_ATTR_QOS_MAP: IP DSCP mapping for Interworking QoS mapping. This * data is in the format defined for the payload of the QoS Map Set element * in IEEE Std 802.11-2012, 8.4.2.97. * * @NL80211_ATTR_MAC_HINT: MAC address recommendation as initial BSS * @NL80211_ATTR_WIPHY_FREQ_HINT: frequency of the recommended initial BSS * * @NL80211_ATTR_MAX_AP_ASSOC_STA: Device attribute that indicates how many * associated stations are supported in AP mode (including P2P GO); u32. * Since drivers may not have a fixed limit on the maximum number (e.g., * other concurrent operations may affect this), drivers are allowed to * advertise values that cannot always be met. In such cases, an attempt * to add a new station entry with @NL80211_CMD_NEW_STATION may fail. * * @NL80211_ATTR_CSA_C_OFFSETS_TX: An array of csa counter offsets (u16) which * should be updated when the frame is transmitted. * @NL80211_ATTR_MAX_CSA_COUNTERS: U8 attribute used to advertise the maximum * supported number of csa counters. * * @NL80211_ATTR_TDLS_PEER_CAPABILITY: flags for TDLS peer capabilities, u32. * As specified in the &enum nl80211_tdls_peer_capability. * * @NL80211_ATTR_SOCKET_OWNER: Flag attribute, if set during interface * creation then the new interface will be owned by the netlink socket * that created it and will be destroyed when the socket is closed. * If set during scheduled scan start then the new scan req will be * owned by the netlink socket that created it and the scheduled scan will * be stopped when the socket is closed. * If set during configuration of regulatory indoor operation then the * regulatory indoor configuration would be owned by the netlink socket * that configured the indoor setting, and the indoor operation would be * cleared when the socket is closed. * If set during NAN interface creation, the interface will be destroyed * if the socket is closed just like any other interface. Moreover, only * the netlink socket that created the interface will be allowed to add * and remove functions. NAN notifications will be sent in unicast to that * socket. Without this attribute, any socket can add functions and the * notifications will be sent to the %NL80211_MCGRP_NAN multicast group. * * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is * the TDLS link initiator. * * @NL80211_ATTR_USE_RRM: flag for indicating whether the current connection * shall support Radio Resource Measurements (11k). This attribute can be * used with %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests. * User space applications are expected to use this flag only if the * underlying device supports these minimal RRM features: * %NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES, * %NL80211_FEATURE_QUIET, * Or, if global RRM is supported, see: * %NL80211_EXT_FEATURE_RRM * If this flag is used, driver must add the Power Capabilities IE to the * association request. In addition, it must also set the RRM capability * flag in the association request's Capability Info field. * * @NL80211_ATTR_WIPHY_DYN_ACK: flag attribute used to enable ACK timeout * estimation algorithm (dynack). In order to activate dynack * %NL80211_FEATURE_ACKTO_ESTIMATION feature flag must be set by lower * drivers to indicate dynack capability. Dynack is automatically disabled * setting valid value for coverage class. * * @NL80211_ATTR_TSID: a TSID value (u8 attribute) * @NL80211_ATTR_USER_PRIO: user priority value (u8 attribute) * @NL80211_ATTR_ADMITTED_TIME: admitted time in units of 32 microseconds * (per second) (u16 attribute) * * @NL80211_ATTR_SMPS_MODE: SMPS mode to use (ap mode). see * &enum nl80211_smps_mode. * * @NL80211_ATTR_OPER_CLASS: operating class * * @NL80211_ATTR_MAC_MASK: MAC address mask * * @NL80211_ATTR_WIPHY_SELF_MANAGED_REG: flag attribute indicating this device * is self-managing its regulatory information and any regulatory domain * obtained from it is coming from the device's wiphy and not the global * cfg80211 regdomain. * * @NL80211_ATTR_EXT_FEATURES: extended feature flags contained in a byte * array. The feature flags are identified by their bit index (see &enum * nl80211_ext_feature_index). The bit index is ordered starting at the * least-significant bit of the first byte in the array, ie. bit index 0 * is located at bit 0 of byte 0. bit index 25 would be located at bit 1 * of byte 3 (u8 array). * * @NL80211_ATTR_SURVEY_RADIO_STATS: Request overall radio statistics to be * returned along with other survey data. If set, @NL80211_CMD_GET_SURVEY * may return a survey entry without a channel indicating global radio * statistics (only some values are valid and make sense.) * For devices that don't return such an entry even then, the information * should be contained in the result as the sum of the respective counters * over all channels. * * @NL80211_ATTR_SCHED_SCAN_DELAY: delay before the first cycle of a * scheduled scan is started. Or the delay before a WoWLAN * net-detect scan is started, counting from the moment the * system is suspended. This value is a u32, in seconds. * @NL80211_ATTR_REG_INDOOR: flag attribute, if set indicates that the device * is operating in an indoor environment. * * @NL80211_ATTR_MAX_NUM_SCHED_SCAN_PLANS: maximum number of scan plans for * scheduled scan supported by the device (u32), a wiphy attribute. * @NL80211_ATTR_MAX_SCAN_PLAN_INTERVAL: maximum interval (in seconds) for * a scan plan (u32), a wiphy attribute. * @NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS: maximum number of iterations in * a scan plan (u32), a wiphy attribute. * @NL80211_ATTR_SCHED_SCAN_PLANS: a list of scan plans for scheduled scan. * Each scan plan defines the number of scan iterations and the interval * between scans. The last scan plan will always run infinitely, * thus it must not specify the number of iterations, only the interval * between scans. The scan plans are executed sequentially. * Each scan plan is a nested attribute of &enum nl80211_sched_scan_plan. * @NL80211_ATTR_PBSS: flag attribute. If set it means operate * in a PBSS. Specified in %NL80211_CMD_CONNECT to request * connecting to a PCP, and in %NL80211_CMD_START_AP to start * a PCP instead of AP. Relevant for DMG networks only. * @NL80211_ATTR_BSS_SELECT: nested attribute for driver supporting the * BSS selection feature. When used with %NL80211_CMD_GET_WIPHY it contains * attributes according &enum nl80211_bss_select_attr to indicate what * BSS selection behaviours are supported. When used with %NL80211_CMD_CONNECT * it contains the behaviour-specific attribute containing the parameters for * BSS selection to be done by driver and/or firmware. * * @NL80211_ATTR_STA_SUPPORT_P2P_PS: whether P2P PS mechanism supported * or not. u8, one of the values of &enum nl80211_sta_p2p_ps_status * * @NL80211_ATTR_PAD: attribute used for padding for 64-bit alignment * * @NL80211_ATTR_IFTYPE_EXT_CAPA: Nested attribute of the following attributes: * %NL80211_ATTR_IFTYPE, %NL80211_ATTR_EXT_CAPA, * %NL80211_ATTR_EXT_CAPA_MASK, to specify the extended capabilities per * interface type. * * @NL80211_ATTR_MU_MIMO_GROUP_DATA: array of 24 bytes that defines a MU-MIMO * groupID for monitor mode. * The first 8 bytes are a mask that defines the membership in each * group (there are 64 groups, group 0 and 63 are reserved), * each bit represents a group and set to 1 for being a member in * that group and 0 for not being a member. * The remaining 16 bytes define the position in each group: 2 bits for * each group. * (smaller group numbers represented on most significant bits and bigger * group numbers on least significant bits.) * This attribute is used only if all interfaces are in monitor mode. * Set this attribute in order to monitor packets using the given MU-MIMO * groupID data. * to turn off that feature set all the bits of the groupID to zero. * @NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR: mac address for the sniffer to follow * when using MU-MIMO air sniffer. * to turn that feature off set an invalid mac address * (e.g. FF:FF:FF:FF:FF:FF) * * @NL80211_ATTR_SCAN_START_TIME_TSF: The time at which the scan was actually * started (u64). The time is the TSF of the BSS the interface that * requested the scan is connected to (if available, otherwise this * attribute must not be included). * @NL80211_ATTR_SCAN_START_TIME_TSF_BSSID: The BSS according to which * %NL80211_ATTR_SCAN_START_TIME_TSF is set. * @NL80211_ATTR_MEASUREMENT_DURATION: measurement duration in TUs (u16). If * %NL80211_ATTR_MEASUREMENT_DURATION_MANDATORY is not set, this is the * maximum measurement duration allowed. This attribute is used with * measurement requests. It can also be used with %NL80211_CMD_TRIGGER_SCAN * if the scan is used for beacon report radio measurement. * @NL80211_ATTR_MEASUREMENT_DURATION_MANDATORY: flag attribute that indicates * that the duration specified with %NL80211_ATTR_MEASUREMENT_DURATION is * mandatory. If this flag is not set, the duration is the maximum duration * and the actual measurement duration may be shorter. * * @NL80211_ATTR_MESH_PEER_AID: Association ID for the mesh peer (u16). This is * used to pull the stored data for mesh peer in power save state. * * @NL80211_ATTR_NAN_MASTER_PREF: the master preference to be used by * %NL80211_CMD_START_NAN and optionally with * %NL80211_CMD_CHANGE_NAN_CONFIG. Its type is u8 and it can't be 0. * Also, values 1 and 255 are reserved for certification purposes and * should not be used during a normal device operation. * @NL80211_ATTR_NAN_DUAL: NAN dual band operation config (see * &enum nl80211_nan_dual_band_conf). This attribute is used with * %NL80211_CMD_START_NAN and optionally with * %NL80211_CMD_CHANGE_NAN_CONFIG. * @NL80211_ATTR_NAN_FUNC: a function that can be added to NAN. See * &enum nl80211_nan_func_attributes for description of this nested * attribute. * @NL80211_ATTR_NAN_MATCH: used to report a match. This is a nested attribute. * See &enum nl80211_nan_match_attributes. * * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use */ enum nl80211_attrs { /* don't change the order or add anything between, this is ABI! */ NL80211_ATTR_UNSPEC, NL80211_ATTR_WIPHY, NL80211_ATTR_WIPHY_NAME, NL80211_ATTR_IFINDEX, NL80211_ATTR_IFNAME, NL80211_ATTR_IFTYPE, NL80211_ATTR_MAC, NL80211_ATTR_KEY_DATA, NL80211_ATTR_KEY_IDX, NL80211_ATTR_KEY_CIPHER, NL80211_ATTR_KEY_SEQ, NL80211_ATTR_KEY_DEFAULT, NL80211_ATTR_BEACON_INTERVAL, NL80211_ATTR_DTIM_PERIOD, NL80211_ATTR_BEACON_HEAD, NL80211_ATTR_BEACON_TAIL, NL80211_ATTR_STA_AID, NL80211_ATTR_STA_FLAGS, NL80211_ATTR_STA_LISTEN_INTERVAL, NL80211_ATTR_STA_SUPPORTED_RATES, NL80211_ATTR_STA_VLAN, NL80211_ATTR_STA_INFO, NL80211_ATTR_WIPHY_BANDS, NL80211_ATTR_MNTR_FLAGS, NL80211_ATTR_MESH_ID, NL80211_ATTR_STA_PLINK_ACTION, NL80211_ATTR_MPATH_NEXT_HOP, NL80211_ATTR_MPATH_INFO, NL80211_ATTR_BSS_CTS_PROT, NL80211_ATTR_BSS_SHORT_PREAMBLE, NL80211_ATTR_BSS_SHORT_SLOT_TIME, NL80211_ATTR_HT_CAPABILITY, NL80211_ATTR_SUPPORTED_IFTYPES, NL80211_ATTR_REG_ALPHA2, NL80211_ATTR_REG_RULES, NL80211_ATTR_MESH_CONFIG, NL80211_ATTR_BSS_BASIC_RATES, NL80211_ATTR_WIPHY_TXQ_PARAMS, NL80211_ATTR_WIPHY_FREQ, NL80211_ATTR_WIPHY_CHANNEL_TYPE, NL80211_ATTR_KEY_DEFAULT_MGMT, NL80211_ATTR_MGMT_SUBTYPE, NL80211_ATTR_IE, NL80211_ATTR_MAX_NUM_SCAN_SSIDS, NL80211_ATTR_SCAN_FREQUENCIES, NL80211_ATTR_SCAN_SSIDS, NL80211_ATTR_GENERATION, /* replaces old SCAN_GENERATION */ NL80211_ATTR_BSS, NL80211_ATTR_REG_INITIATOR, NL80211_ATTR_REG_TYPE, NL80211_ATTR_SUPPORTED_COMMANDS, NL80211_ATTR_FRAME, NL80211_ATTR_SSID, NL80211_ATTR_AUTH_TYPE, NL80211_ATTR_REASON_CODE, NL80211_ATTR_KEY_TYPE, NL80211_ATTR_MAX_SCAN_IE_LEN, NL80211_ATTR_CIPHER_SUITES, NL80211_ATTR_FREQ_BEFORE, NL80211_ATTR_FREQ_AFTER, NL80211_ATTR_FREQ_FIXED, NL80211_ATTR_WIPHY_RETRY_SHORT, NL80211_ATTR_WIPHY_RETRY_LONG, NL80211_ATTR_WIPHY_FRAG_THRESHOLD, NL80211_ATTR_WIPHY_RTS_THRESHOLD, NL80211_ATTR_TIMED_OUT, NL80211_ATTR_USE_MFP, NL80211_ATTR_STA_FLAGS2, NL80211_ATTR_CONTROL_PORT, NL80211_ATTR_TESTDATA, NL80211_ATTR_PRIVACY, NL80211_ATTR_DISCONNECTED_BY_AP, NL80211_ATTR_STATUS_CODE, NL80211_ATTR_CIPHER_SUITES_PAIRWISE, NL80211_ATTR_CIPHER_SUITE_GROUP, NL80211_ATTR_WPA_VERSIONS, NL80211_ATTR_AKM_SUITES, NL80211_ATTR_REQ_IE, NL80211_ATTR_RESP_IE, NL80211_ATTR_PREV_BSSID, NL80211_ATTR_KEY, NL80211_ATTR_KEYS, NL80211_ATTR_PID, NL80211_ATTR_4ADDR, NL80211_ATTR_SURVEY_INFO, NL80211_ATTR_PMKID, NL80211_ATTR_MAX_NUM_PMKIDS, NL80211_ATTR_DURATION, NL80211_ATTR_COOKIE, NL80211_ATTR_WIPHY_COVERAGE_CLASS, NL80211_ATTR_TX_RATES, NL80211_ATTR_FRAME_MATCH, NL80211_ATTR_ACK, NL80211_ATTR_PS_STATE, NL80211_ATTR_CQM, NL80211_ATTR_LOCAL_STATE_CHANGE, NL80211_ATTR_AP_ISOLATE, NL80211_ATTR_WIPHY_TX_POWER_SETTING, NL80211_ATTR_WIPHY_TX_POWER_LEVEL, NL80211_ATTR_TX_FRAME_TYPES, NL80211_ATTR_RX_FRAME_TYPES, NL80211_ATTR_FRAME_TYPE, NL80211_ATTR_CONTROL_PORT_ETHERTYPE, NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT, NL80211_ATTR_SUPPORT_IBSS_RSN, NL80211_ATTR_WIPHY_ANTENNA_TX, NL80211_ATTR_WIPHY_ANTENNA_RX, NL80211_ATTR_MCAST_RATE, NL80211_ATTR_OFFCHANNEL_TX_OK, NL80211_ATTR_BSS_HT_OPMODE, NL80211_ATTR_KEY_DEFAULT_TYPES, NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION, NL80211_ATTR_MESH_SETUP, NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX, NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX, NL80211_ATTR_SUPPORT_MESH_AUTH, NL80211_ATTR_STA_PLINK_STATE, NL80211_ATTR_WOWLAN_TRIGGERS, NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, NL80211_ATTR_SCHED_SCAN_INTERVAL, NL80211_ATTR_INTERFACE_COMBINATIONS, NL80211_ATTR_SOFTWARE_IFTYPES, NL80211_ATTR_REKEY_DATA, NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS, NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN, NL80211_ATTR_SCAN_SUPP_RATES, NL80211_ATTR_HIDDEN_SSID, NL80211_ATTR_IE_PROBE_RESP, NL80211_ATTR_IE_ASSOC_RESP, NL80211_ATTR_STA_WME, NL80211_ATTR_SUPPORT_AP_UAPSD, NL80211_ATTR_ROAM_SUPPORT, NL80211_ATTR_SCHED_SCAN_MATCH, NL80211_ATTR_MAX_MATCH_SETS, NL80211_ATTR_PMKSA_CANDIDATE, NL80211_ATTR_TX_NO_CCK_RATE, NL80211_ATTR_TDLS_ACTION, NL80211_ATTR_TDLS_DIALOG_TOKEN, NL80211_ATTR_TDLS_OPERATION, NL80211_ATTR_TDLS_SUPPORT, NL80211_ATTR_TDLS_EXTERNAL_SETUP, NL80211_ATTR_DEVICE_AP_SME, NL80211_ATTR_DONT_WAIT_FOR_ACK, NL80211_ATTR_FEATURE_FLAGS, NL80211_ATTR_PROBE_RESP_OFFLOAD, NL80211_ATTR_PROBE_RESP, NL80211_ATTR_DFS_REGION, NL80211_ATTR_DISABLE_HT, NL80211_ATTR_HT_CAPABILITY_MASK, NL80211_ATTR_NOACK_MAP, NL80211_ATTR_INACTIVITY_TIMEOUT, NL80211_ATTR_RX_SIGNAL_DBM, NL80211_ATTR_BG_SCAN_PERIOD, NL80211_ATTR_WDEV, NL80211_ATTR_USER_REG_HINT_TYPE, NL80211_ATTR_CONN_FAILED_REASON, NL80211_ATTR_SAE_DATA, NL80211_ATTR_VHT_CAPABILITY, NL80211_ATTR_SCAN_FLAGS, NL80211_ATTR_CHANNEL_WIDTH, NL80211_ATTR_CENTER_FREQ1, NL80211_ATTR_CENTER_FREQ2, NL80211_ATTR_P2P_CTWINDOW, NL80211_ATTR_P2P_OPPPS, NL80211_ATTR_LOCAL_MESH_POWER_MODE, NL80211_ATTR_ACL_POLICY, NL80211_ATTR_MAC_ADDRS, NL80211_ATTR_MAC_ACL_MAX, NL80211_ATTR_RADAR_EVENT, NL80211_ATTR_EXT_CAPA, NL80211_ATTR_EXT_CAPA_MASK, NL80211_ATTR_STA_CAPABILITY, NL80211_ATTR_STA_EXT_CAPABILITY, NL80211_ATTR_PROTOCOL_FEATURES, NL80211_ATTR_SPLIT_WIPHY_DUMP, NL80211_ATTR_DISABLE_VHT, NL80211_ATTR_VHT_CAPABILITY_MASK, NL80211_ATTR_MDID, NL80211_ATTR_IE_RIC, NL80211_ATTR_CRIT_PROT_ID, NL80211_ATTR_MAX_CRIT_PROT_DURATION, NL80211_ATTR_PEER_AID, NL80211_ATTR_COALESCE_RULE, NL80211_ATTR_CH_SWITCH_COUNT, NL80211_ATTR_CH_SWITCH_BLOCK_TX, NL80211_ATTR_CSA_IES, NL80211_ATTR_CSA_C_OFF_BEACON, NL80211_ATTR_CSA_C_OFF_PRESP, NL80211_ATTR_RXMGMT_FLAGS, NL80211_ATTR_STA_SUPPORTED_CHANNELS, NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES, NL80211_ATTR_HANDLE_DFS, NL80211_ATTR_SUPPORT_5_MHZ, NL80211_ATTR_SUPPORT_10_MHZ, NL80211_ATTR_OPMODE_NOTIF, NL80211_ATTR_VENDOR_ID, NL80211_ATTR_VENDOR_SUBCMD, NL80211_ATTR_VENDOR_DATA, NL80211_ATTR_VENDOR_EVENTS, NL80211_ATTR_QOS_MAP, NL80211_ATTR_MAC_HINT, NL80211_ATTR_WIPHY_FREQ_HINT, NL80211_ATTR_MAX_AP_ASSOC_STA, NL80211_ATTR_TDLS_PEER_CAPABILITY, NL80211_ATTR_SOCKET_OWNER, NL80211_ATTR_CSA_C_OFFSETS_TX, NL80211_ATTR_MAX_CSA_COUNTERS, NL80211_ATTR_TDLS_INITIATOR, NL80211_ATTR_USE_RRM, NL80211_ATTR_WIPHY_DYN_ACK, NL80211_ATTR_TSID, NL80211_ATTR_USER_PRIO, NL80211_ATTR_ADMITTED_TIME, NL80211_ATTR_SMPS_MODE, NL80211_ATTR_OPER_CLASS, NL80211_ATTR_MAC_MASK, NL80211_ATTR_WIPHY_SELF_MANAGED_REG, NL80211_ATTR_EXT_FEATURES, NL80211_ATTR_SURVEY_RADIO_STATS, NL80211_ATTR_NETNS_FD, NL80211_ATTR_SCHED_SCAN_DELAY, NL80211_ATTR_REG_INDOOR, NL80211_ATTR_MAX_NUM_SCHED_SCAN_PLANS, NL80211_ATTR_MAX_SCAN_PLAN_INTERVAL, NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS, NL80211_ATTR_SCHED_SCAN_PLANS, NL80211_ATTR_PBSS, NL80211_ATTR_BSS_SELECT, NL80211_ATTR_STA_SUPPORT_P2P_PS, NL80211_ATTR_PAD, NL80211_ATTR_IFTYPE_EXT_CAPA, NL80211_ATTR_MU_MIMO_GROUP_DATA, NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR, NL80211_ATTR_SCAN_START_TIME_TSF, NL80211_ATTR_SCAN_START_TIME_TSF_BSSID, NL80211_ATTR_MEASUREMENT_DURATION, NL80211_ATTR_MEASUREMENT_DURATION_MANDATORY, NL80211_ATTR_MESH_PEER_AID, NL80211_ATTR_NAN_MASTER_PREF, NL80211_ATTR_NAN_DUAL, NL80211_ATTR_NAN_FUNC, NL80211_ATTR_NAN_MATCH, /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, NUM_NL80211_ATTR = __NL80211_ATTR_AFTER_LAST, NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 }; /* source-level API compatibility */ #define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION #define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG #define NL80211_ATTR_IFACE_SOCKET_OWNER NL80211_ATTR_SOCKET_OWNER #define NL80211_MAX_SUPP_RATES 32 #define NL80211_MAX_SUPP_HT_RATES 77 #define NL80211_MAX_SUPP_REG_RULES 64 #define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0 #define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 #define NL80211_HT_CAPABILITY_LEN 26 #define NL80211_VHT_CAPABILITY_LEN 12 #define NL80211_MAX_NR_CIPHER_SUITES 5 #define NL80211_MAX_NR_AKM_SUITES 2 #define NL80211_MIN_REMAIN_ON_CHANNEL_TIME 10 /* default RSSI threshold for scan results if none specified. */ #define NL80211_SCAN_RSSI_THOLD_OFF -300 #define NL80211_CQM_TXE_MAX_INTVL 1800 /** * enum nl80211_iftype - (virtual) interface types * * @NL80211_IFTYPE_UNSPECIFIED: unspecified type, driver decides * @NL80211_IFTYPE_ADHOC: independent BSS member * @NL80211_IFTYPE_STATION: managed BSS member * @NL80211_IFTYPE_AP: access point * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points; VLAN interfaces * are a bit special in that they must always be tied to a pre-existing * AP type interface. * @NL80211_IFTYPE_WDS: wireless distribution interface * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames * @NL80211_IFTYPE_MESH_POINT: mesh point * @NL80211_IFTYPE_P2P_CLIENT: P2P client * @NL80211_IFTYPE_P2P_GO: P2P group owner * @NL80211_IFTYPE_P2P_DEVICE: P2P device interface type, this is not a netdev * and therefore can't be created in the normal ways, use the * %NL80211_CMD_START_P2P_DEVICE and %NL80211_CMD_STOP_P2P_DEVICE * commands to create and destroy one * @NL80211_IF_TYPE_OCB: Outside Context of a BSS * This mode corresponds to the MIB variable dot11OCBActivated=true * @NL80211_IFTYPE_NAN: NAN device interface type (not a netdev) * @NL80211_IFTYPE_MAX: highest interface type number currently defined * @NUM_NL80211_IFTYPES: number of defined interface types * * These values are used with the %NL80211_ATTR_IFTYPE * to set the type of an interface. * */ enum nl80211_iftype { NL80211_IFTYPE_UNSPECIFIED, NL80211_IFTYPE_ADHOC, NL80211_IFTYPE_STATION, NL80211_IFTYPE_AP, NL80211_IFTYPE_AP_VLAN, NL80211_IFTYPE_WDS, NL80211_IFTYPE_MONITOR, NL80211_IFTYPE_MESH_POINT, NL80211_IFTYPE_P2P_CLIENT, NL80211_IFTYPE_P2P_GO, NL80211_IFTYPE_P2P_DEVICE, NL80211_IFTYPE_OCB, NL80211_IFTYPE_NAN, /* keep last */ NUM_NL80211_IFTYPES, NL80211_IFTYPE_MAX = NUM_NL80211_IFTYPES - 1 }; /** * enum nl80211_sta_flags - station flags * * Station flags. When a station is added to an AP interface, it is * assumed to be already associated (and hence authenticated.) * * @__NL80211_STA_FLAG_INVALID: attribute number 0 is reserved * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X) * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames * with short barker preamble * @NL80211_STA_FLAG_WME: station is WME/QoS capable * @NL80211_STA_FLAG_MFP: station uses management frame protection * @NL80211_STA_FLAG_AUTHENTICATED: station is authenticated * @NL80211_STA_FLAG_TDLS_PEER: station is a TDLS peer -- this flag should * only be used in managed mode (even in the flags mask). Note that the * flag can't be changed, it is only valid while adding a station, and * attempts to change it will silently be ignored (rather than rejected * as errors.) * @NL80211_STA_FLAG_ASSOCIATED: station is associated; used with drivers * that support %NL80211_FEATURE_FULL_AP_CLIENT_STATE to transition a * previously added station into associated state * @NL80211_STA_FLAG_MAX: highest station flag number currently defined * @__NL80211_STA_FLAG_AFTER_LAST: internal use */ enum nl80211_sta_flags { __NL80211_STA_FLAG_INVALID, NL80211_STA_FLAG_AUTHORIZED, NL80211_STA_FLAG_SHORT_PREAMBLE, NL80211_STA_FLAG_WME, NL80211_STA_FLAG_MFP, NL80211_STA_FLAG_AUTHENTICATED, NL80211_STA_FLAG_TDLS_PEER, NL80211_STA_FLAG_ASSOCIATED, /* keep last */ __NL80211_STA_FLAG_AFTER_LAST, NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1 }; /** * enum nl80211_sta_p2p_ps_status - station support of P2P PS * * @NL80211_P2P_PS_UNSUPPORTED: station doesn't support P2P PS mechanism * @@NL80211_P2P_PS_SUPPORTED: station supports P2P PS mechanism * @NUM_NL80211_P2P_PS_STATUS: number of values */ enum nl80211_sta_p2p_ps_status { NL80211_P2P_PS_UNSUPPORTED = 0, NL80211_P2P_PS_SUPPORTED, NUM_NL80211_P2P_PS_STATUS, }; #define NL80211_STA_FLAG_MAX_OLD_API NL80211_STA_FLAG_TDLS_PEER /** * struct nl80211_sta_flag_update - station flags mask/set * @mask: mask of station flags to set * @set: which values to set them to * * Both mask and set contain bits as per &enum nl80211_sta_flags. */ struct nl80211_sta_flag_update { __u32 mask; __u32 set; } __attribute__((packed)); /** * enum nl80211_rate_info - bitrate information * * These attribute types are used with %NL80211_STA_INFO_TXRATE * when getting information about the bitrate of a station. * There are 2 attributes for bitrate, a legacy one that represents * a 16-bit value, and new one that represents a 32-bit value. * If the rate value fits into 16 bit, both attributes are reported * with the same value. If the rate is too high to fit into 16 bits * (>6.5535Gbps) only 32-bit attribute is included. * User space tools encouraged to use the 32-bit attribute and fall * back to the 16-bit one for compatibility with older kernels. * * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s) * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8) * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 MHz dualchannel bitrate * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s) * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined * @NL80211_RATE_INFO_VHT_MCS: MCS index for VHT (u8) * @NL80211_RATE_INFO_VHT_NSS: number of streams in VHT (u8) * @NL80211_RATE_INFO_80_MHZ_WIDTH: 80 MHz VHT rate * @NL80211_RATE_INFO_80P80_MHZ_WIDTH: unused - 80+80 is treated the * same as 160 for purposes of the bitrates * @NL80211_RATE_INFO_160_MHZ_WIDTH: 160 MHz VHT rate * @NL80211_RATE_INFO_10_MHZ_WIDTH: 10 MHz width - note that this is * a legacy rate and will be reported as the actual bitrate, i.e. * half the base (20 MHz) rate * @NL80211_RATE_INFO_5_MHZ_WIDTH: 5 MHz width - note that this is * a legacy rate and will be reported as the actual bitrate, i.e. * a quarter of the base (20 MHz) rate * @__NL80211_RATE_INFO_AFTER_LAST: internal use */ enum nl80211_rate_info { __NL80211_RATE_INFO_INVALID, NL80211_RATE_INFO_BITRATE, NL80211_RATE_INFO_MCS, NL80211_RATE_INFO_40_MHZ_WIDTH, NL80211_RATE_INFO_SHORT_GI, NL80211_RATE_INFO_BITRATE32, NL80211_RATE_INFO_VHT_MCS, NL80211_RATE_INFO_VHT_NSS, NL80211_RATE_INFO_80_MHZ_WIDTH, NL80211_RATE_INFO_80P80_MHZ_WIDTH, NL80211_RATE_INFO_160_MHZ_WIDTH, NL80211_RATE_INFO_10_MHZ_WIDTH, NL80211_RATE_INFO_5_MHZ_WIDTH, /* keep last */ __NL80211_RATE_INFO_AFTER_LAST, NL80211_RATE_INFO_MAX = __NL80211_RATE_INFO_AFTER_LAST - 1 }; /** * enum nl80211_sta_bss_param - BSS information collected by STA * * These attribute types are used with %NL80211_STA_INFO_BSS_PARAM * when getting information about the bitrate of a station. * * @__NL80211_STA_BSS_PARAM_INVALID: attribute number 0 is reserved * @NL80211_STA_BSS_PARAM_CTS_PROT: whether CTS protection is enabled (flag) * @NL80211_STA_BSS_PARAM_SHORT_PREAMBLE: whether short preamble is enabled * (flag) * @NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME: whether short slot time is enabled * (flag) * @NL80211_STA_BSS_PARAM_DTIM_PERIOD: DTIM period for beaconing (u8) * @NL80211_STA_BSS_PARAM_BEACON_INTERVAL: Beacon interval (u16) * @NL80211_STA_BSS_PARAM_MAX: highest sta_bss_param number currently defined * @__NL80211_STA_BSS_PARAM_AFTER_LAST: internal use */ enum nl80211_sta_bss_param { __NL80211_STA_BSS_PARAM_INVALID, NL80211_STA_BSS_PARAM_CTS_PROT, NL80211_STA_BSS_PARAM_SHORT_PREAMBLE, NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME, NL80211_STA_BSS_PARAM_DTIM_PERIOD, NL80211_STA_BSS_PARAM_BEACON_INTERVAL, /* keep last */ __NL80211_STA_BSS_PARAM_AFTER_LAST, NL80211_STA_BSS_PARAM_MAX = __NL80211_STA_BSS_PARAM_AFTER_LAST - 1 }; /** * enum nl80211_sta_info - station information * * These attribute types are used with %NL80211_ATTR_STA_INFO * when getting information about a station. * * @__NL80211_STA_INFO_INVALID: attribute number 0 is reserved * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs) * @NL80211_STA_INFO_RX_BYTES: total received bytes (MPDU length) * (u32, from this station) * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (MPDU length) * (u32, to this station) * @NL80211_STA_INFO_RX_BYTES64: total received bytes (MPDU length) * (u64, from this station) * @NL80211_STA_INFO_TX_BYTES64: total transmitted bytes (MPDU length) * (u64, to this station) * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm) * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute * containing info as possible, see &enum nl80211_rate_info * @NL80211_STA_INFO_RX_PACKETS: total received packet (MSDUs and MMPDUs) * (u32, from this station) * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (MSDUs and MMPDUs) * (u32, to this station) * @NL80211_STA_INFO_TX_RETRIES: total retries (MPDUs) (u32, to this station) * @NL80211_STA_INFO_TX_FAILED: total failed packets (MPDUs) * (u32, to this station) * @NL80211_STA_INFO_SIGNAL_AVG: signal strength average (u8, dBm) * @NL80211_STA_INFO_LLID: the station's mesh LLID * @NL80211_STA_INFO_PLID: the station's mesh PLID * @NL80211_STA_INFO_PLINK_STATE: peer link state for the station * (see %enum nl80211_plink_state) * @NL80211_STA_INFO_RX_BITRATE: last unicast data frame rx rate, nested * attribute, like NL80211_STA_INFO_TX_BITRATE. * @NL80211_STA_INFO_BSS_PARAM: current station's view of BSS, nested attribute * containing info as possible, see &enum nl80211_sta_bss_param * @NL80211_STA_INFO_CONNECTED_TIME: time since the station is last connected * @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update. * @NL80211_STA_INFO_BEACON_LOSS: count of times beacon loss was detected (u32) * @NL80211_STA_INFO_T_OFFSET: timing offset with respect to this STA (s64) * @NL80211_STA_INFO_LOCAL_PM: local mesh STA link-specific power mode * @NL80211_STA_INFO_PEER_PM: peer mesh STA link-specific power mode * @NL80211_STA_INFO_NONPEER_PM: neighbor mesh STA power save mode towards * non-peer STA * @NL80211_STA_INFO_CHAIN_SIGNAL: per-chain signal strength of last PPDU * Contains a nested array of signal strength attributes (u8, dBm) * @NL80211_STA_INFO_CHAIN_SIGNAL_AVG: per-chain signal strength average * Same format as NL80211_STA_INFO_CHAIN_SIGNAL. * @NL80211_STA_EXPECTED_THROUGHPUT: expected throughput considering also the * 802.11 header (u32, kbps) * @NL80211_STA_INFO_RX_DROP_MISC: RX packets dropped for unspecified reasons * (u64) * @NL80211_STA_INFO_BEACON_RX: number of beacons received from this peer (u64) * @NL80211_STA_INFO_BEACON_SIGNAL_AVG: signal strength average * for beacons only (u8, dBm) * @NL80211_STA_INFO_TID_STATS: per-TID statistics (see &enum nl80211_tid_stats) * This is a nested attribute where each the inner attribute number is the * TID+1 and the special TID 16 (i.e. value 17) is used for non-QoS frames; * each one of those is again nested with &enum nl80211_tid_stats * attributes carrying the actual values. * @NL80211_STA_INFO_RX_DURATION: aggregate PPDU duration for all frames * received from the station (u64, usec) * @NL80211_STA_INFO_PAD: attribute used for padding for 64-bit alignment * @__NL80211_STA_INFO_AFTER_LAST: internal * @NL80211_STA_INFO_MAX: highest possible station info attribute */ enum nl80211_sta_info { __NL80211_STA_INFO_INVALID, NL80211_STA_INFO_INACTIVE_TIME, NL80211_STA_INFO_RX_BYTES, NL80211_STA_INFO_TX_BYTES, NL80211_STA_INFO_LLID, NL80211_STA_INFO_PLID, NL80211_STA_INFO_PLINK_STATE, NL80211_STA_INFO_SIGNAL, NL80211_STA_INFO_TX_BITRATE, NL80211_STA_INFO_RX_PACKETS, NL80211_STA_INFO_TX_PACKETS, NL80211_STA_INFO_TX_RETRIES, NL80211_STA_INFO_TX_FAILED, NL80211_STA_INFO_SIGNAL_AVG, NL80211_STA_INFO_RX_BITRATE, NL80211_STA_INFO_BSS_PARAM, NL80211_STA_INFO_CONNECTED_TIME, NL80211_STA_INFO_STA_FLAGS, NL80211_STA_INFO_BEACON_LOSS, NL80211_STA_INFO_T_OFFSET, NL80211_STA_INFO_LOCAL_PM, NL80211_STA_INFO_PEER_PM, NL80211_STA_INFO_NONPEER_PM, NL80211_STA_INFO_RX_BYTES64, NL80211_STA_INFO_TX_BYTES64, NL80211_STA_INFO_CHAIN_SIGNAL, NL80211_STA_INFO_CHAIN_SIGNAL_AVG, NL80211_STA_INFO_EXPECTED_THROUGHPUT, NL80211_STA_INFO_RX_DROP_MISC, NL80211_STA_INFO_BEACON_RX, NL80211_STA_INFO_BEACON_SIGNAL_AVG, NL80211_STA_INFO_TID_STATS, NL80211_STA_INFO_RX_DURATION, NL80211_STA_INFO_PAD, /* keep last */ __NL80211_STA_INFO_AFTER_LAST, NL80211_STA_INFO_MAX = __NL80211_STA_INFO_AFTER_LAST - 1 }; /** * enum nl80211_tid_stats - per TID statistics attributes * @__NL80211_TID_STATS_INVALID: attribute number 0 is reserved * @NL80211_TID_STATS_RX_MSDU: number of MSDUs received (u64) * @NL80211_TID_STATS_TX_MSDU: number of MSDUs transmitted (or * attempted to transmit; u64) * @NL80211_TID_STATS_TX_MSDU_RETRIES: number of retries for * transmitted MSDUs (not counting the first attempt; u64) * @NL80211_TID_STATS_TX_MSDU_FAILED: number of failed transmitted * MSDUs (u64) * @NL80211_TID_STATS_PAD: attribute used for padding for 64-bit alignment * @NUM_NL80211_TID_STATS: number of attributes here * @NL80211_TID_STATS_MAX: highest numbered attribute here */ enum nl80211_tid_stats { __NL80211_TID_STATS_INVALID, NL80211_TID_STATS_RX_MSDU, NL80211_TID_STATS_TX_MSDU, NL80211_TID_STATS_TX_MSDU_RETRIES, NL80211_TID_STATS_TX_MSDU_FAILED, NL80211_TID_STATS_PAD, /* keep last */ NUM_NL80211_TID_STATS, NL80211_TID_STATS_MAX = NUM_NL80211_TID_STATS - 1 }; /** * enum nl80211_mpath_flags - nl80211 mesh path flags * * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active * @NL80211_MPATH_FLAG_RESOLVING: the mesh path discovery process is running * @NL80211_MPATH_FLAG_SN_VALID: the mesh path contains a valid SN * @NL80211_MPATH_FLAG_FIXED: the mesh path has been manually set * @NL80211_MPATH_FLAG_RESOLVED: the mesh path discovery process succeeded */ enum nl80211_mpath_flags { NL80211_MPATH_FLAG_ACTIVE = 1<<0, NL80211_MPATH_FLAG_RESOLVING = 1<<1, NL80211_MPATH_FLAG_SN_VALID = 1<<2, NL80211_MPATH_FLAG_FIXED = 1<<3, NL80211_MPATH_FLAG_RESOLVED = 1<<4, }; /** * enum nl80211_mpath_info - mesh path information * * These attribute types are used with %NL80211_ATTR_MPATH_INFO when getting * information about a mesh path. * * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved * @NL80211_MPATH_INFO_FRAME_QLEN: number of queued frames for this destination * @NL80211_MPATH_INFO_SN: destination sequence number * @NL80211_MPATH_INFO_METRIC: metric (cost) of this mesh path * @NL80211_MPATH_INFO_EXPTIME: expiration time for the path, in msec from now * @NL80211_MPATH_INFO_FLAGS: mesh path flags, enumerated in * &enum nl80211_mpath_flags; * @NL80211_MPATH_INFO_DISCOVERY_TIMEOUT: total path discovery timeout, in msec * @NL80211_MPATH_INFO_DISCOVERY_RETRIES: mesh path discovery retries * @NL80211_MPATH_INFO_MAX: highest mesh path information attribute number * currently defind * @__NL80211_MPATH_INFO_AFTER_LAST: internal use */ enum nl80211_mpath_info { __NL80211_MPATH_INFO_INVALID, NL80211_MPATH_INFO_FRAME_QLEN, NL80211_MPATH_INFO_SN, NL80211_MPATH_INFO_METRIC, NL80211_MPATH_INFO_EXPTIME, NL80211_MPATH_INFO_FLAGS, NL80211_MPATH_INFO_DISCOVERY_TIMEOUT, NL80211_MPATH_INFO_DISCOVERY_RETRIES, /* keep last */ __NL80211_MPATH_INFO_AFTER_LAST, NL80211_MPATH_INFO_MAX = __NL80211_MPATH_INFO_AFTER_LAST - 1 }; /** * enum nl80211_band_attr - band attributes * @__NL80211_BAND_ATTR_INVALID: attribute number 0 is reserved * @NL80211_BAND_ATTR_FREQS: supported frequencies in this band, * an array of nested frequency attributes * @NL80211_BAND_ATTR_RATES: supported bitrates in this band, * an array of nested bitrate attributes * @NL80211_BAND_ATTR_HT_MCS_SET: 16-byte attribute containing the MCS set as * defined in 802.11n * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n * @NL80211_BAND_ATTR_VHT_MCS_SET: 32-byte attribute containing the MCS set as * defined in 802.11ac * @NL80211_BAND_ATTR_VHT_CAPA: VHT capabilities, as in the HT information IE * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined * @__NL80211_BAND_ATTR_AFTER_LAST: internal use */ enum nl80211_band_attr { __NL80211_BAND_ATTR_INVALID, NL80211_BAND_ATTR_FREQS, NL80211_BAND_ATTR_RATES, NL80211_BAND_ATTR_HT_MCS_SET, NL80211_BAND_ATTR_HT_CAPA, NL80211_BAND_ATTR_HT_AMPDU_FACTOR, NL80211_BAND_ATTR_HT_AMPDU_DENSITY, NL80211_BAND_ATTR_VHT_MCS_SET, NL80211_BAND_ATTR_VHT_CAPA, /* keep last */ __NL80211_BAND_ATTR_AFTER_LAST, NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1 }; /** * enum nl80211_frequency_attr - frequency attributes * @__NL80211_FREQUENCY_ATTR_INVALID: attribute number 0 is reserved * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current * regulatory domain. * @NL80211_FREQUENCY_ATTR_NO_IR: no mechanisms that initiate radiation * are permitted on this channel, this includes sending probe * requests, or modes of operation that require beaconing. * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory * on this channel in current regulatory domain. * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm * (100 * dBm). * @NL80211_FREQUENCY_ATTR_DFS_STATE: current state for DFS * (enum nl80211_dfs_state) * @NL80211_FREQUENCY_ATTR_DFS_TIME: time in miliseconds for how long * this channel is in this DFS state. * @NL80211_FREQUENCY_ATTR_NO_HT40_MINUS: HT40- isn't possible with this * channel as the control channel * @NL80211_FREQUENCY_ATTR_NO_HT40_PLUS: HT40+ isn't possible with this * channel as the control channel * @NL80211_FREQUENCY_ATTR_NO_80MHZ: any 80 MHz channel using this channel * as the primary or any of the secondary channels isn't possible, * this includes 80+80 channels * @NL80211_FREQUENCY_ATTR_NO_160MHZ: any 160 MHz (but not 80+80) channel * using this channel as the primary or any of the secondary channels * isn't possible * @NL80211_FREQUENCY_ATTR_DFS_CAC_TIME: DFS CAC time in milliseconds. * @NL80211_FREQUENCY_ATTR_INDOOR_ONLY: Only indoor use is permitted on this * channel. A channel that has the INDOOR_ONLY attribute can only be * used when there is a clear assessment that the device is operating in * an indoor surroundings, i.e., it is connected to AC power (and not * through portable DC inverters) or is under the control of a master * that is acting as an AP and is connected to AC power. * @NL80211_FREQUENCY_ATTR_IR_CONCURRENT: IR operation is allowed on this * channel if it's connected concurrently to a BSS on the same channel on * the 2 GHz band or to a channel in the same UNII band (on the 5 GHz * band), and IEEE80211_CHAN_RADAR is not set. Instantiating a GO or TDLS * off-channel on a channel that has the IR_CONCURRENT attribute set can be * done when there is a clear assessment that the device is operating under * the guidance of an authorized master, i.e., setting up a GO or TDLS * off-channel while the device is also connected to an AP with DFS and * radar detection on the UNII band (it is up to user-space, i.e., * wpa_supplicant to perform the required verifications). Using this * attribute for IR is disallowed for master interfaces (IBSS, AP). * @NL80211_FREQUENCY_ATTR_NO_20MHZ: 20 MHz operation is not allowed * on this channel in current regulatory domain. * @NL80211_FREQUENCY_ATTR_NO_10MHZ: 10 MHz operation is not allowed * on this channel in current regulatory domain. * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number * currently defined * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use * * See https://apps.fcc.gov/eas/comments/GetPublishedDocument.html?id=327&tn=528122 * for more information on the FCC description of the relaxations allowed * by NL80211_FREQUENCY_ATTR_INDOOR_ONLY and * NL80211_FREQUENCY_ATTR_IR_CONCURRENT. */ enum nl80211_frequency_attr { __NL80211_FREQUENCY_ATTR_INVALID, NL80211_FREQUENCY_ATTR_FREQ, NL80211_FREQUENCY_ATTR_DISABLED, NL80211_FREQUENCY_ATTR_NO_IR, __NL80211_FREQUENCY_ATTR_NO_IBSS, NL80211_FREQUENCY_ATTR_RADAR, NL80211_FREQUENCY_ATTR_MAX_TX_POWER, NL80211_FREQUENCY_ATTR_DFS_STATE, NL80211_FREQUENCY_ATTR_DFS_TIME, NL80211_FREQUENCY_ATTR_NO_HT40_MINUS, NL80211_FREQUENCY_ATTR_NO_HT40_PLUS, NL80211_FREQUENCY_ATTR_NO_80MHZ, NL80211_FREQUENCY_ATTR_NO_160MHZ, NL80211_FREQUENCY_ATTR_DFS_CAC_TIME, NL80211_FREQUENCY_ATTR_INDOOR_ONLY, NL80211_FREQUENCY_ATTR_IR_CONCURRENT, NL80211_FREQUENCY_ATTR_NO_20MHZ, NL80211_FREQUENCY_ATTR_NO_10MHZ, /* keep last */ __NL80211_FREQUENCY_ATTR_AFTER_LAST, NL80211_FREQUENCY_ATTR_MAX = __NL80211_FREQUENCY_ATTR_AFTER_LAST - 1 }; #define NL80211_FREQUENCY_ATTR_PASSIVE_SCAN NL80211_FREQUENCY_ATTR_NO_IR #define NL80211_FREQUENCY_ATTR_NO_IBSS NL80211_FREQUENCY_ATTR_NO_IR #define NL80211_FREQUENCY_ATTR_GO_CONCURRENT \ NL80211_FREQUENCY_ATTR_IR_CONCURRENT /** * enum nl80211_bitrate_attr - bitrate attributes * @__NL80211_BITRATE_ATTR_INVALID: attribute number 0 is reserved * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported * in 2.4 GHz band. * @NL80211_BITRATE_ATTR_MAX: highest bitrate attribute number * currently defined * @__NL80211_BITRATE_ATTR_AFTER_LAST: internal use */ enum nl80211_bitrate_attr { __NL80211_BITRATE_ATTR_INVALID, NL80211_BITRATE_ATTR_RATE, NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE, /* keep last */ __NL80211_BITRATE_ATTR_AFTER_LAST, NL80211_BITRATE_ATTR_MAX = __NL80211_BITRATE_ATTR_AFTER_LAST - 1 }; /** * enum nl80211_initiator - Indicates the initiator of a reg domain request * @NL80211_REGDOM_SET_BY_CORE: Core queried CRDA for a dynamic world * regulatory domain. * @NL80211_REGDOM_SET_BY_USER: User asked the wireless core to set the * regulatory domain. * @NL80211_REGDOM_SET_BY_DRIVER: a wireless drivers has hinted to the * wireless core it thinks its knows the regulatory domain we should be in. * @NL80211_REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an * 802.11 country information element with regulatory information it * thinks we should consider. cfg80211 only processes the country * code from the IE, and relies on the regulatory domain information * structure passed by userspace (CRDA) from our wireless-regdb. * If a channel is enabled but the country code indicates it should * be disabled we disable the channel and re-enable it upon disassociation. */ enum nl80211_reg_initiator { NL80211_REGDOM_SET_BY_CORE, NL80211_REGDOM_SET_BY_USER, NL80211_REGDOM_SET_BY_DRIVER, NL80211_REGDOM_SET_BY_COUNTRY_IE, }; /** * enum nl80211_reg_type - specifies the type of regulatory domain * @NL80211_REGDOM_TYPE_COUNTRY: the regulatory domain set is one that pertains * to a specific country. When this is set you can count on the * ISO / IEC 3166 alpha2 country code being valid. * @NL80211_REGDOM_TYPE_WORLD: the regulatory set domain is the world regulatory * domain. * @NL80211_REGDOM_TYPE_CUSTOM_WORLD: the regulatory domain set is a custom * driver specific world regulatory domain. These do not apply system-wide * and are only applicable to the individual devices which have requested * them to be applied. * @NL80211_REGDOM_TYPE_INTERSECTION: the regulatory domain set is the product * of an intersection between two regulatory domains -- the previously * set regulatory domain on the system and the last accepted regulatory * domain request to be processed. */ enum nl80211_reg_type { NL80211_REGDOM_TYPE_COUNTRY, NL80211_REGDOM_TYPE_WORLD, NL80211_REGDOM_TYPE_CUSTOM_WORLD, NL80211_REGDOM_TYPE_INTERSECTION, }; /** * enum nl80211_reg_rule_attr - regulatory rule attributes * @__NL80211_REG_RULE_ATTR_INVALID: attribute number 0 is reserved * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional * considerations for a given frequency range. These are the * &enum nl80211_reg_rule_flags. * @NL80211_ATTR_FREQ_RANGE_START: starting frequencry for the regulatory * rule in KHz. This is not a center of frequency but an actual regulatory * band edge. * @NL80211_ATTR_FREQ_RANGE_END: ending frequency for the regulatory rule * in KHz. This is not a center a frequency but an actual regulatory * band edge. * @NL80211_ATTR_FREQ_RANGE_MAX_BW: maximum allowed bandwidth for this * frequency range, in KHz. * @NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN: the maximum allowed antenna gain * for a given frequency range. The value is in mBi (100 * dBi). * If you don't have one then don't send this. * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for * a given frequency range. The value is in mBm (100 * dBm). * @NL80211_ATTR_DFS_CAC_TIME: DFS CAC time in milliseconds. * If not present or 0 default CAC time will be used. * @NL80211_REG_RULE_ATTR_MAX: highest regulatory rule attribute number * currently defined * @__NL80211_REG_RULE_ATTR_AFTER_LAST: internal use */ enum nl80211_reg_rule_attr { __NL80211_REG_RULE_ATTR_INVALID, NL80211_ATTR_REG_RULE_FLAGS, NL80211_ATTR_FREQ_RANGE_START, NL80211_ATTR_FREQ_RANGE_END, NL80211_ATTR_FREQ_RANGE_MAX_BW, NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN, NL80211_ATTR_POWER_RULE_MAX_EIRP, NL80211_ATTR_DFS_CAC_TIME, /* keep last */ __NL80211_REG_RULE_ATTR_AFTER_LAST, NL80211_REG_RULE_ATTR_MAX = __NL80211_REG_RULE_ATTR_AFTER_LAST - 1 }; /** * enum nl80211_sched_scan_match_attr - scheduled scan match attributes * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching, * only report BSS with matching SSID. * @NL80211_SCHED_SCAN_MATCH_ATTR_RSSI: RSSI threshold (in dBm) for reporting a * BSS in scan results. Filtering is turned off if not specified. Note that * if this attribute is in a match set of its own, then it is treated as * the default value for all matchsets with an SSID, rather than being a * matchset of its own without an RSSI filter. This is due to problems with * how this API was implemented in the past. Also, due to the same problem, * the only way to create a matchset with only an RSSI filter (with this * attribute) is if there's only a single matchset with the RSSI attribute. * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter * attribute number currently defined * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use */ enum nl80211_sched_scan_match_attr { __NL80211_SCHED_SCAN_MATCH_ATTR_INVALID, NL80211_SCHED_SCAN_MATCH_ATTR_SSID, NL80211_SCHED_SCAN_MATCH_ATTR_RSSI, /* keep last */ __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST, NL80211_SCHED_SCAN_MATCH_ATTR_MAX = __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST - 1 }; /* only for backward compatibility */ #define NL80211_ATTR_SCHED_SCAN_MATCH_SSID NL80211_SCHED_SCAN_MATCH_ATTR_SSID /** * enum nl80211_reg_rule_flags - regulatory rule flags * * @NL80211_RRF_NO_OFDM: OFDM modulation not allowed * @NL80211_RRF_NO_CCK: CCK modulation not allowed * @NL80211_RRF_NO_INDOOR: indoor operation not allowed * @NL80211_RRF_NO_OUTDOOR: outdoor operation not allowed * @NL80211_RRF_DFS: DFS support is required to be used * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links * @NL80211_RRF_NO_IR: no mechanisms that initiate radiation are allowed, * this includes probe requests or modes of operation that require * beaconing. * @NL80211_RRF_AUTO_BW: maximum available bandwidth should be calculated * base on contiguous rules and wider channels will be allowed to cross * multiple contiguous/overlapping frequency ranges. * @NL80211_RRF_IR_CONCURRENT: See &NL80211_FREQUENCY_ATTR_IR_CONCURRENT * @NL80211_RRF_NO_HT40MINUS: channels can't be used in HT40- operation * @NL80211_RRF_NO_HT40PLUS: channels can't be used in HT40+ operation * @NL80211_RRF_NO_80MHZ: 80MHz operation not allowed * @NL80211_RRF_NO_160MHZ: 160MHz operation not allowed */ enum nl80211_reg_rule_flags { NL80211_RRF_NO_OFDM = 1<<0, NL80211_RRF_NO_CCK = 1<<1, NL80211_RRF_NO_INDOOR = 1<<2, NL80211_RRF_NO_OUTDOOR = 1<<3, NL80211_RRF_DFS = 1<<4, NL80211_RRF_PTP_ONLY = 1<<5, NL80211_RRF_PTMP_ONLY = 1<<6, NL80211_RRF_NO_IR = 1<<7, __NL80211_RRF_NO_IBSS = 1<<8, NL80211_RRF_AUTO_BW = 1<<11, NL80211_RRF_IR_CONCURRENT = 1<<12, NL80211_RRF_NO_HT40MINUS = 1<<13, NL80211_RRF_NO_HT40PLUS = 1<<14, NL80211_RRF_NO_80MHZ = 1<<15, NL80211_RRF_NO_160MHZ = 1<<16, }; #define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR #define NL80211_RRF_NO_IBSS NL80211_RRF_NO_IR #define NL80211_RRF_NO_HT40 (NL80211_RRF_NO_HT40MINUS |\ NL80211_RRF_NO_HT40PLUS) #define NL80211_RRF_GO_CONCURRENT NL80211_RRF_IR_CONCURRENT /* For backport compatibility with older userspace */ #define NL80211_RRF_NO_IR_ALL (NL80211_RRF_NO_IR | __NL80211_RRF_NO_IBSS) /** * enum nl80211_dfs_regions - regulatory DFS regions * * @NL80211_DFS_UNSET: Country has no DFS master region specified * @NL80211_DFS_FCC: Country follows DFS master rules from FCC * @NL80211_DFS_ETSI: Country follows DFS master rules from ETSI * @NL80211_DFS_JP: Country follows DFS master rules from JP/MKK/Telec */ enum nl80211_dfs_regions { NL80211_DFS_UNSET = 0, NL80211_DFS_FCC = 1, NL80211_DFS_ETSI = 2, NL80211_DFS_JP = 3, }; /** * enum nl80211_user_reg_hint_type - type of user regulatory hint * * @NL80211_USER_REG_HINT_USER: a user sent the hint. This is always * assumed if the attribute is not set. * @NL80211_USER_REG_HINT_CELL_BASE: the hint comes from a cellular * base station. Device drivers that have been tested to work * properly to support this type of hint can enable these hints * by setting the NL80211_FEATURE_CELL_BASE_REG_HINTS feature * capability on the struct wiphy. The wireless core will * ignore all cell base station hints until at least one device * present has been registered with the wireless core that * has listed NL80211_FEATURE_CELL_BASE_REG_HINTS as a * supported feature. * @NL80211_USER_REG_HINT_INDOOR: a user sent an hint indicating that the * platform is operating in an indoor environment. */ enum nl80211_user_reg_hint_type { NL80211_USER_REG_HINT_USER = 0, NL80211_USER_REG_HINT_CELL_BASE = 1, NL80211_USER_REG_HINT_INDOOR = 2, }; /** * enum nl80211_survey_info - survey information * * These attribute types are used with %NL80211_ATTR_SURVEY_INFO * when getting information about a survey. * * @__NL80211_SURVEY_INFO_INVALID: attribute number 0 is reserved * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm) * @NL80211_SURVEY_INFO_IN_USE: channel is currently being used * @NL80211_SURVEY_INFO_TIME: amount of time (in ms) that the radio * was turned on (on channel or globally) * @NL80211_SURVEY_INFO_TIME_BUSY: amount of the time the primary * channel was sensed busy (either due to activity or energy detect) * @NL80211_SURVEY_INFO_TIME_EXT_BUSY: amount of time the extension * channel was sensed busy * @NL80211_SURVEY_INFO_TIME_RX: amount of time the radio spent * receiving data (on channel or globally) * @NL80211_SURVEY_INFO_TIME_TX: amount of time the radio spent * transmitting data (on channel or globally) * @NL80211_SURVEY_INFO_TIME_SCAN: time the radio spent for scan * (on this channel or globally) * @NL80211_SURVEY_INFO_PAD: attribute used for padding for 64-bit alignment * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number * currently defined * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use */ enum nl80211_survey_info { __NL80211_SURVEY_INFO_INVALID, NL80211_SURVEY_INFO_FREQUENCY, NL80211_SURVEY_INFO_NOISE, NL80211_SURVEY_INFO_IN_USE, NL80211_SURVEY_INFO_TIME, NL80211_SURVEY_INFO_TIME_BUSY, NL80211_SURVEY_INFO_TIME_EXT_BUSY, NL80211_SURVEY_INFO_TIME_RX, NL80211_SURVEY_INFO_TIME_TX, NL80211_SURVEY_INFO_TIME_SCAN, NL80211_SURVEY_INFO_PAD, /* keep last */ __NL80211_SURVEY_INFO_AFTER_LAST, NL80211_SURVEY_INFO_MAX = __NL80211_SURVEY_INFO_AFTER_LAST - 1 }; /* keep old names for compatibility */ #define NL80211_SURVEY_INFO_CHANNEL_TIME NL80211_SURVEY_INFO_TIME #define NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY NL80211_SURVEY_INFO_TIME_BUSY #define NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY NL80211_SURVEY_INFO_TIME_EXT_BUSY #define NL80211_SURVEY_INFO_CHANNEL_TIME_RX NL80211_SURVEY_INFO_TIME_RX #define NL80211_SURVEY_INFO_CHANNEL_TIME_TX NL80211_SURVEY_INFO_TIME_TX /** * enum nl80211_mntr_flags - monitor configuration flags * * Monitor configuration flags. * * @__NL80211_MNTR_FLAG_INVALID: reserved * * @NL80211_MNTR_FLAG_FCSFAIL: pass frames with bad FCS * @NL80211_MNTR_FLAG_PLCPFAIL: pass frames with bad PLCP * @NL80211_MNTR_FLAG_CONTROL: pass control frames * @NL80211_MNTR_FLAG_OTHER_BSS: disable BSSID filtering * @NL80211_MNTR_FLAG_COOK_FRAMES: report frames after processing. * overrides all other flags. * @NL80211_MNTR_FLAG_ACTIVE: use the configured MAC address * and ACK incoming unicast packets. * * @__NL80211_MNTR_FLAG_AFTER_LAST: internal use * @NL80211_MNTR_FLAG_MAX: highest possible monitor flag */ enum nl80211_mntr_flags { __NL80211_MNTR_FLAG_INVALID, NL80211_MNTR_FLAG_FCSFAIL, NL80211_MNTR_FLAG_PLCPFAIL, NL80211_MNTR_FLAG_CONTROL, NL80211_MNTR_FLAG_OTHER_BSS, NL80211_MNTR_FLAG_COOK_FRAMES, NL80211_MNTR_FLAG_ACTIVE, /* keep last */ __NL80211_MNTR_FLAG_AFTER_LAST, NL80211_MNTR_FLAG_MAX = __NL80211_MNTR_FLAG_AFTER_LAST - 1 }; /** * enum nl80211_mesh_power_mode - mesh power save modes * * @NL80211_MESH_POWER_UNKNOWN: The mesh power mode of the mesh STA is * not known or has not been set yet. * @NL80211_MESH_POWER_ACTIVE: Active mesh power mode. The mesh STA is * in Awake state all the time. * @NL80211_MESH_POWER_LIGHT_SLEEP: Light sleep mode. The mesh STA will * alternate between Active and Doze states, but will wake up for * neighbor's beacons. * @NL80211_MESH_POWER_DEEP_SLEEP: Deep sleep mode. The mesh STA will * alternate between Active and Doze states, but may not wake up * for neighbor's beacons. * * @__NL80211_MESH_POWER_AFTER_LAST - internal use * @NL80211_MESH_POWER_MAX - highest possible power save level */ enum nl80211_mesh_power_mode { NL80211_MESH_POWER_UNKNOWN, NL80211_MESH_POWER_ACTIVE, NL80211_MESH_POWER_LIGHT_SLEEP, NL80211_MESH_POWER_DEEP_SLEEP, __NL80211_MESH_POWER_AFTER_LAST, NL80211_MESH_POWER_MAX = __NL80211_MESH_POWER_AFTER_LAST - 1 }; /** * enum nl80211_meshconf_params - mesh configuration parameters * * Mesh configuration parameters. These can be changed while the mesh is * active. * * @__NL80211_MESHCONF_INVALID: internal use * * @NL80211_MESHCONF_RETRY_TIMEOUT: specifies the initial retry timeout in * millisecond units, used by the Peer Link Open message * * @NL80211_MESHCONF_CONFIRM_TIMEOUT: specifies the initial confirm timeout, in * millisecond units, used by the peer link management to close a peer link * * @NL80211_MESHCONF_HOLDING_TIMEOUT: specifies the holding timeout, in * millisecond units * * @NL80211_MESHCONF_MAX_PEER_LINKS: maximum number of peer links allowed * on this mesh interface * * @NL80211_MESHCONF_MAX_RETRIES: specifies the maximum number of peer link * open retries that can be sent to establish a new peer link instance in a * mesh * * @NL80211_MESHCONF_TTL: specifies the value of TTL field set at a source mesh * point. * * @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically open * peer links when we detect compatible mesh peers. Disabled if * @NL80211_MESH_SETUP_USERSPACE_MPM or @NL80211_MESH_SETUP_USERSPACE_AMPE are * set. * * @NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES: the number of action frames * containing a PREQ that an MP can send to a particular destination (path * target) * * @NL80211_MESHCONF_PATH_REFRESH_TIME: how frequently to refresh mesh paths * (in milliseconds) * * @NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT: minimum length of time to wait * until giving up on a path discovery (in milliseconds) * * @NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT: The time (in TUs) for which mesh * points receiving a PREQ shall consider the forwarding information from * the root to be valid. (TU = time unit) * * @NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL: The minimum interval of time (in * TUs) during which an MP can send only one action frame containing a PREQ * reference element * * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs) * that it takes for an HWMP information element to propagate across the * mesh * * @NL80211_MESHCONF_HWMP_ROOTMODE: whether root mode is enabled or not * * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a * source mesh point for path selection elements. * * @NL80211_MESHCONF_HWMP_RANN_INTERVAL: The interval of time (in TUs) between * root announcements are transmitted. * * @NL80211_MESHCONF_GATE_ANNOUNCEMENTS: Advertise that this mesh station has * access to a broader network beyond the MBSS. This is done via Root * Announcement frames. * * @NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL: The minimum interval of time (in * TUs) during which a mesh STA can send only one Action frame containing a * PERR element. * * @NL80211_MESHCONF_FORWARDING: set Mesh STA as forwarding or non-forwarding * or forwarding entity (default is TRUE - forwarding entity) * * @NL80211_MESHCONF_RSSI_THRESHOLD: RSSI threshold in dBm. This specifies the * threshold for average signal strength of candidate station to establish * a peer link. * * @NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR: maximum number of neighbors * to synchronize to for 11s default synchronization method * (see 11C.12.2.2) * * @NL80211_MESHCONF_HT_OPMODE: set mesh HT protection mode. * * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute * * @NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT: The time (in TUs) for * which mesh STAs receiving a proactive PREQ shall consider the forwarding * information to the root mesh STA to be valid. * * @NL80211_MESHCONF_HWMP_ROOT_INTERVAL: The interval of time (in TUs) between * proactive PREQs are transmitted. * * @NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL: The minimum interval of time * (in TUs) during which a mesh STA can send only one Action frame * containing a PREQ element for root path confirmation. * * @NL80211_MESHCONF_POWER_MODE: Default mesh power mode for new peer links. * type &enum nl80211_mesh_power_mode (u32) * * @NL80211_MESHCONF_AWAKE_WINDOW: awake window duration (in TUs) * * @NL80211_MESHCONF_PLINK_TIMEOUT: If no tx activity is seen from a STA we've * established peering with for longer than this time (in seconds), then * remove it from the STA's list of peers. You may set this to 0 to disable * the removal of the STA. Default is 30 minutes. * * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use */ enum nl80211_meshconf_params { __NL80211_MESHCONF_INVALID, NL80211_MESHCONF_RETRY_TIMEOUT, NL80211_MESHCONF_CONFIRM_TIMEOUT, NL80211_MESHCONF_HOLDING_TIMEOUT, NL80211_MESHCONF_MAX_PEER_LINKS, NL80211_MESHCONF_MAX_RETRIES, NL80211_MESHCONF_TTL, NL80211_MESHCONF_AUTO_OPEN_PLINKS, NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES, NL80211_MESHCONF_PATH_REFRESH_TIME, NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT, NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT, NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL, NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME, NL80211_MESHCONF_HWMP_ROOTMODE, NL80211_MESHCONF_ELEMENT_TTL, NL80211_MESHCONF_HWMP_RANN_INTERVAL, NL80211_MESHCONF_GATE_ANNOUNCEMENTS, NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL, NL80211_MESHCONF_FORWARDING, NL80211_MESHCONF_RSSI_THRESHOLD, NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR, NL80211_MESHCONF_HT_OPMODE, NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT, NL80211_MESHCONF_HWMP_ROOT_INTERVAL, NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, NL80211_MESHCONF_POWER_MODE, NL80211_MESHCONF_AWAKE_WINDOW, NL80211_MESHCONF_PLINK_TIMEOUT, /* keep last */ __NL80211_MESHCONF_ATTR_AFTER_LAST, NL80211_MESHCONF_ATTR_MAX = __NL80211_MESHCONF_ATTR_AFTER_LAST - 1 }; /** * enum nl80211_mesh_setup_params - mesh setup parameters * * Mesh setup parameters. These are used to start/join a mesh and cannot be * changed while the mesh is active. * * @__NL80211_MESH_SETUP_INVALID: Internal use * * @NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL: Enable this option to use a * vendor specific path selection algorithm or disable it to use the * default HWMP. * * @NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC: Enable this option to use a * vendor specific path metric or disable it to use the default Airtime * metric. * * @NL80211_MESH_SETUP_IE: Information elements for this mesh, for instance, a * robust security network ie, or a vendor specific information element * that vendors will use to identify the path selection methods and * metrics in use. * * @NL80211_MESH_SETUP_USERSPACE_AUTH: Enable this option if an authentication * daemon will be authenticating mesh candidates. * * @NL80211_MESH_SETUP_USERSPACE_AMPE: Enable this option if an authentication * daemon will be securing peer link frames. AMPE is a secured version of * Mesh Peering Management (MPM) and is implemented with the assistance of * a userspace daemon. When this flag is set, the kernel will send peer * management frames to a userspace daemon that will implement AMPE * functionality (security capabilities selection, key confirmation, and * key management). When the flag is unset (default), the kernel can * autonomously complete (unsecured) mesh peering without the need of a * userspace daemon. * * @NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC: Enable this option to use a * vendor specific synchronization method or disable it to use the default * neighbor offset synchronization * * @NL80211_MESH_SETUP_USERSPACE_MPM: Enable this option if userspace will * implement an MPM which handles peer allocation and state. * * @NL80211_MESH_SETUP_AUTH_PROTOCOL: Inform the kernel of the authentication * method (u8, as defined in IEEE 8.4.2.100.6, e.g. 0x1 for SAE). * Default is no authentication method required. * * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number * * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use */ enum nl80211_mesh_setup_params { __NL80211_MESH_SETUP_INVALID, NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL, NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC, NL80211_MESH_SETUP_IE, NL80211_MESH_SETUP_USERSPACE_AUTH, NL80211_MESH_SETUP_USERSPACE_AMPE, NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC, NL80211_MESH_SETUP_USERSPACE_MPM, NL80211_MESH_SETUP_AUTH_PROTOCOL, /* keep last */ __NL80211_MESH_SETUP_ATTR_AFTER_LAST, NL80211_MESH_SETUP_ATTR_MAX = __NL80211_MESH_SETUP_ATTR_AFTER_LAST - 1 }; /** * enum nl80211_txq_attr - TX queue parameter attributes * @__NL80211_TXQ_ATTR_INVALID: Attribute number 0 is reserved * @NL80211_TXQ_ATTR_AC: AC identifier (NL80211_AC_*) * @NL80211_TXQ_ATTR_TXOP: Maximum burst time in units of 32 usecs, 0 meaning * disabled * @NL80211_TXQ_ATTR_CWMIN: Minimum contention window [a value of the form * 2^n-1 in the range 1..32767] * @NL80211_TXQ_ATTR_CWMAX: Maximum contention window [a value of the form * 2^n-1 in the range 1..32767] * @NL80211_TXQ_ATTR_AIFS: Arbitration interframe space [0..255] * @__NL80211_TXQ_ATTR_AFTER_LAST: Internal * @NL80211_TXQ_ATTR_MAX: Maximum TXQ attribute number */ enum nl80211_txq_attr { __NL80211_TXQ_ATTR_INVALID, NL80211_TXQ_ATTR_AC, NL80211_TXQ_ATTR_TXOP, NL80211_TXQ_ATTR_CWMIN, NL80211_TXQ_ATTR_CWMAX, NL80211_TXQ_ATTR_AIFS, /* keep last */ __NL80211_TXQ_ATTR_AFTER_LAST, NL80211_TXQ_ATTR_MAX = __NL80211_TXQ_ATTR_AFTER_LAST - 1 }; enum nl80211_ac { NL80211_AC_VO, NL80211_AC_VI, NL80211_AC_BE, NL80211_AC_BK, NL80211_NUM_ACS }; /* backward compat */ #define NL80211_TXQ_ATTR_QUEUE NL80211_TXQ_ATTR_AC #define NL80211_TXQ_Q_VO NL80211_AC_VO #define NL80211_TXQ_Q_VI NL80211_AC_VI #define NL80211_TXQ_Q_BE NL80211_AC_BE #define NL80211_TXQ_Q_BK NL80211_AC_BK /** * enum nl80211_channel_type - channel type * @NL80211_CHAN_NO_HT: 20 MHz, non-HT channel * @NL80211_CHAN_HT20: 20 MHz HT channel * @NL80211_CHAN_HT40MINUS: HT40 channel, secondary channel * below the control channel * @NL80211_CHAN_HT40PLUS: HT40 channel, secondary channel * above the control channel */ enum nl80211_channel_type { NL80211_CHAN_NO_HT, NL80211_CHAN_HT20, NL80211_CHAN_HT40MINUS, NL80211_CHAN_HT40PLUS }; /** * enum nl80211_chan_width - channel width definitions * * These values are used with the %NL80211_ATTR_CHANNEL_WIDTH * attribute. * * @NL80211_CHAN_WIDTH_20_NOHT: 20 MHz, non-HT channel * @NL80211_CHAN_WIDTH_20: 20 MHz HT channel * @NL80211_CHAN_WIDTH_40: 40 MHz channel, the %NL80211_ATTR_CENTER_FREQ1 * attribute must be provided as well * @NL80211_CHAN_WIDTH_80: 80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1 * attribute must be provided as well * @NL80211_CHAN_WIDTH_80P80: 80+80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1 * and %NL80211_ATTR_CENTER_FREQ2 attributes must be provided as well * @NL80211_CHAN_WIDTH_160: 160 MHz channel, the %NL80211_ATTR_CENTER_FREQ1 * attribute must be provided as well * @NL80211_CHAN_WIDTH_5: 5 MHz OFDM channel * @NL80211_CHAN_WIDTH_10: 10 MHz OFDM channel */ enum nl80211_chan_width { NL80211_CHAN_WIDTH_20_NOHT, NL80211_CHAN_WIDTH_20, NL80211_CHAN_WIDTH_40, NL80211_CHAN_WIDTH_80, NL80211_CHAN_WIDTH_80P80, NL80211_CHAN_WIDTH_160, NL80211_CHAN_WIDTH_5, NL80211_CHAN_WIDTH_10, }; /** * enum nl80211_bss_scan_width - control channel width for a BSS * * These values are used with the %NL80211_BSS_CHAN_WIDTH attribute. * * @NL80211_BSS_CHAN_WIDTH_20: control channel is 20 MHz wide or compatible * @NL80211_BSS_CHAN_WIDTH_10: control channel is 10 MHz wide * @NL80211_BSS_CHAN_WIDTH_5: control channel is 5 MHz wide */ enum nl80211_bss_scan_width { NL80211_BSS_CHAN_WIDTH_20, NL80211_BSS_CHAN_WIDTH_10, NL80211_BSS_CHAN_WIDTH_5, }; /** * enum nl80211_bss - netlink attributes for a BSS * * @__NL80211_BSS_INVALID: invalid * @NL80211_BSS_BSSID: BSSID of the BSS (6 octets) * @NL80211_BSS_FREQUENCY: frequency in MHz (u32) * @NL80211_BSS_TSF: TSF of the received probe response/beacon (u64) * (if @NL80211_BSS_PRESP_DATA is present then this is known to be * from a probe response, otherwise it may be from the same beacon * that the NL80211_BSS_BEACON_TSF will be from) * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16) * @NL80211_BSS_CAPABILITY: capability field (CPU order, u16) * @NL80211_BSS_INFORMATION_ELEMENTS: binary attribute containing the * raw information elements from the probe response/beacon (bin); * if the %NL80211_BSS_BEACON_IES attribute is present and the data is * different then the IEs here are from a Probe Response frame; otherwise * they are from a Beacon frame. * However, if the driver does not indicate the source of the IEs, these * IEs may be from either frame subtype. * If present, the @NL80211_BSS_PRESP_DATA attribute indicates that the * data here is known to be from a probe response, without any heuristics. * @NL80211_BSS_SIGNAL_MBM: signal strength of probe response/beacon * in mBm (100 * dBm) (s32) * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon * in unspecified units, scaled to 0..100 (u8) * @NL80211_BSS_STATUS: status, if this BSS is "used" * @NL80211_BSS_SEEN_MS_AGO: age of this BSS entry in ms * @NL80211_BSS_BEACON_IES: binary attribute containing the raw information * elements from a Beacon frame (bin); not present if no Beacon frame has * yet been received * @NL80211_BSS_CHAN_WIDTH: channel width of the control channel * (u32, enum nl80211_bss_scan_width) * @NL80211_BSS_BEACON_TSF: TSF of the last received beacon (u64) * (not present if no beacon frame has been received yet) * @NL80211_BSS_PRESP_DATA: the data in @NL80211_BSS_INFORMATION_ELEMENTS and * @NL80211_BSS_TSF is known to be from a probe response (flag attribute) * @NL80211_BSS_LAST_SEEN_BOOTTIME: CLOCK_BOOTTIME timestamp when this entry * was last updated by a received frame. The value is expected to be * accurate to about 10ms. (u64, nanoseconds) * @NL80211_BSS_PAD: attribute used for padding for 64-bit alignment * @NL80211_BSS_PARENT_TSF: the time at the start of reception of the first * octet of the timestamp field of the last beacon/probe received for * this BSS. The time is the TSF of the BSS specified by * @NL80211_BSS_PARENT_BSSID. (u64). * @NL80211_BSS_PARENT_BSSID: the BSS according to which @NL80211_BSS_PARENT_TSF * is set. * @__NL80211_BSS_AFTER_LAST: internal * @NL80211_BSS_MAX: highest BSS attribute */ enum nl80211_bss { __NL80211_BSS_INVALID, NL80211_BSS_BSSID, NL80211_BSS_FREQUENCY, NL80211_BSS_TSF, NL80211_BSS_BEACON_INTERVAL, NL80211_BSS_CAPABILITY, NL80211_BSS_INFORMATION_ELEMENTS, NL80211_BSS_SIGNAL_MBM, NL80211_BSS_SIGNAL_UNSPEC, NL80211_BSS_STATUS, NL80211_BSS_SEEN_MS_AGO, NL80211_BSS_BEACON_IES, NL80211_BSS_CHAN_WIDTH, NL80211_BSS_BEACON_TSF, NL80211_BSS_PRESP_DATA, NL80211_BSS_LAST_SEEN_BOOTTIME, NL80211_BSS_PAD, NL80211_BSS_PARENT_TSF, NL80211_BSS_PARENT_BSSID, /* keep last */ __NL80211_BSS_AFTER_LAST, NL80211_BSS_MAX = __NL80211_BSS_AFTER_LAST - 1 }; /** * enum nl80211_bss_status - BSS "status" * @NL80211_BSS_STATUS_AUTHENTICATED: Authenticated with this BSS. * Note that this is no longer used since cfg80211 no longer * keeps track of whether or not authentication was done with * a given BSS. * @NL80211_BSS_STATUS_ASSOCIATED: Associated with this BSS. * @NL80211_BSS_STATUS_IBSS_JOINED: Joined to this IBSS. * * The BSS status is a BSS attribute in scan dumps, which * indicates the status the interface has wrt. this BSS. */ enum nl80211_bss_status { NL80211_BSS_STATUS_AUTHENTICATED, NL80211_BSS_STATUS_ASSOCIATED, NL80211_BSS_STATUS_IBSS_JOINED, }; /** * enum nl80211_auth_type - AuthenticationType * * @NL80211_AUTHTYPE_OPEN_SYSTEM: Open System authentication * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only) * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r) * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP) * @NL80211_AUTHTYPE_SAE: Simultaneous authentication of equals * @__NL80211_AUTHTYPE_NUM: internal * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by * trying multiple times); this is invalid in netlink -- leave out * the attribute for this on CONNECT commands. */ enum nl80211_auth_type { NL80211_AUTHTYPE_OPEN_SYSTEM, NL80211_AUTHTYPE_SHARED_KEY, NL80211_AUTHTYPE_FT, NL80211_AUTHTYPE_NETWORK_EAP, NL80211_AUTHTYPE_SAE, /* keep last */ __NL80211_AUTHTYPE_NUM, NL80211_AUTHTYPE_MAX = __NL80211_AUTHTYPE_NUM - 1, NL80211_AUTHTYPE_AUTOMATIC }; /** * enum nl80211_key_type - Key Type * @NL80211_KEYTYPE_GROUP: Group (broadcast/multicast) key * @NL80211_KEYTYPE_PAIRWISE: Pairwise (unicast/individual) key * @NL80211_KEYTYPE_PEERKEY: PeerKey (DLS) * @NUM_NL80211_KEYTYPES: number of defined key types */ enum nl80211_key_type { NL80211_KEYTYPE_GROUP, NL80211_KEYTYPE_PAIRWISE, NL80211_KEYTYPE_PEERKEY, NUM_NL80211_KEYTYPES }; /** * enum nl80211_mfp - Management frame protection state * @NL80211_MFP_NO: Management frame protection not used * @NL80211_MFP_REQUIRED: Management frame protection required */ enum nl80211_mfp { NL80211_MFP_NO, NL80211_MFP_REQUIRED, }; enum nl80211_wpa_versions { NL80211_WPA_VERSION_1 = 1 << 0, NL80211_WPA_VERSION_2 = 1 << 1, }; /** * enum nl80211_key_default_types - key default types * @__NL80211_KEY_DEFAULT_TYPE_INVALID: invalid * @NL80211_KEY_DEFAULT_TYPE_UNICAST: key should be used as default * unicast key * @NL80211_KEY_DEFAULT_TYPE_MULTICAST: key should be used as default * multicast key * @NUM_NL80211_KEY_DEFAULT_TYPES: number of default types */ enum nl80211_key_default_types { __NL80211_KEY_DEFAULT_TYPE_INVALID, NL80211_KEY_DEFAULT_TYPE_UNICAST, NL80211_KEY_DEFAULT_TYPE_MULTICAST, NUM_NL80211_KEY_DEFAULT_TYPES }; /** * enum nl80211_key_attributes - key attributes * @__NL80211_KEY_INVALID: invalid * @NL80211_KEY_DATA: (temporal) key data; for TKIP this consists of * 16 bytes encryption key followed by 8 bytes each for TX and RX MIC * keys * @NL80211_KEY_IDX: key ID (u8, 0-3) * @NL80211_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11 * section 7.3.2.25.1, e.g. 0x000FAC04) * @NL80211_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and * CCMP keys, each six bytes in little endian * @NL80211_KEY_DEFAULT: flag indicating default key * @NL80211_KEY_DEFAULT_MGMT: flag indicating default management key * @NL80211_KEY_TYPE: the key type from enum nl80211_key_type, if not * specified the default depends on whether a MAC address was * given with the command using the key or not (u32) * @NL80211_KEY_DEFAULT_TYPES: A nested attribute containing flags * attributes, specifying what a key should be set as default as. * See &enum nl80211_key_default_types. * @__NL80211_KEY_AFTER_LAST: internal * @NL80211_KEY_MAX: highest key attribute */ enum nl80211_key_attributes { __NL80211_KEY_INVALID, NL80211_KEY_DATA, NL80211_KEY_IDX, NL80211_KEY_CIPHER, NL80211_KEY_SEQ, NL80211_KEY_DEFAULT, NL80211_KEY_DEFAULT_MGMT, NL80211_KEY_TYPE, NL80211_KEY_DEFAULT_TYPES, /* keep last */ __NL80211_KEY_AFTER_LAST, NL80211_KEY_MAX = __NL80211_KEY_AFTER_LAST - 1 }; /** * enum nl80211_tx_rate_attributes - TX rate set attributes * @__NL80211_TXRATE_INVALID: invalid * @NL80211_TXRATE_LEGACY: Legacy (non-MCS) rates allowed for TX rate selection * in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with * 1 = 500 kbps) but without the IE length restriction (at most * %NL80211_MAX_SUPP_RATES in a single array). * @NL80211_TXRATE_HT: HT (MCS) rates allowed for TX rate selection * in an array of MCS numbers. * @NL80211_TXRATE_VHT: VHT rates allowed for TX rate selection, * see &struct nl80211_txrate_vht * @NL80211_TXRATE_GI: configure GI, see &enum nl80211_txrate_gi * @__NL80211_TXRATE_AFTER_LAST: internal * @NL80211_TXRATE_MAX: highest TX rate attribute */ enum nl80211_tx_rate_attributes { __NL80211_TXRATE_INVALID, NL80211_TXRATE_LEGACY, NL80211_TXRATE_HT, NL80211_TXRATE_VHT, NL80211_TXRATE_GI, /* keep last */ __NL80211_TXRATE_AFTER_LAST, NL80211_TXRATE_MAX = __NL80211_TXRATE_AFTER_LAST - 1 }; #define NL80211_TXRATE_MCS NL80211_TXRATE_HT #define NL80211_VHT_NSS_MAX 8 /** * struct nl80211_txrate_vht - VHT MCS/NSS txrate bitmap * @mcs: MCS bitmap table for each NSS (array index 0 for 1 stream, etc.) */ struct nl80211_txrate_vht { __u16 mcs[NL80211_VHT_NSS_MAX]; }; enum nl80211_txrate_gi { NL80211_TXRATE_DEFAULT_GI, NL80211_TXRATE_FORCE_SGI, NL80211_TXRATE_FORCE_LGI, }; /** * enum nl80211_band - Frequency band * @NL80211_BAND_2GHZ: 2.4 GHz ISM band * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz) * @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 64.80 GHz) * @NUM_NL80211_BANDS: number of bands, avoid using this in userspace * since newer kernel versions may support more bands */ enum nl80211_band { NL80211_BAND_2GHZ, NL80211_BAND_5GHZ, NL80211_BAND_60GHZ, NUM_NL80211_BANDS, }; /** * enum nl80211_ps_state - powersave state * @NL80211_PS_DISABLED: powersave is disabled * @NL80211_PS_ENABLED: powersave is enabled */ enum nl80211_ps_state { NL80211_PS_DISABLED, NL80211_PS_ENABLED, }; /** * enum nl80211_attr_cqm - connection quality monitor attributes * @__NL80211_ATTR_CQM_INVALID: invalid * @NL80211_ATTR_CQM_RSSI_THOLD: RSSI threshold in dBm. This value specifies * the threshold for the RSSI level at which an event will be sent. Zero * to disable. * @NL80211_ATTR_CQM_RSSI_HYST: RSSI hysteresis in dBm. This value specifies * the minimum amount the RSSI level must change after an event before a * new event may be issued (to reduce effects of RSSI oscillation). * @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event * @NL80211_ATTR_CQM_PKT_LOSS_EVENT: a u32 value indicating that this many * consecutive packets were not acknowledged by the peer * @NL80211_ATTR_CQM_TXE_RATE: TX error rate in %. Minimum % of TX failures * during the given %NL80211_ATTR_CQM_TXE_INTVL before an * %NL80211_CMD_NOTIFY_CQM with reported %NL80211_ATTR_CQM_TXE_RATE and * %NL80211_ATTR_CQM_TXE_PKTS is generated. * @NL80211_ATTR_CQM_TXE_PKTS: number of attempted packets in a given * %NL80211_ATTR_CQM_TXE_INTVL before %NL80211_ATTR_CQM_TXE_RATE is * checked. * @NL80211_ATTR_CQM_TXE_INTVL: interval in seconds. Specifies the periodic * interval in which %NL80211_ATTR_CQM_TXE_PKTS and * %NL80211_ATTR_CQM_TXE_RATE must be satisfied before generating an * %NL80211_CMD_NOTIFY_CQM. Set to 0 to turn off TX error reporting. * @NL80211_ATTR_CQM_BEACON_LOSS_EVENT: flag attribute that's set in a beacon * loss event * @__NL80211_ATTR_CQM_AFTER_LAST: internal * @NL80211_ATTR_CQM_MAX: highest key attribute */ enum nl80211_attr_cqm { __NL80211_ATTR_CQM_INVALID, NL80211_ATTR_CQM_RSSI_THOLD, NL80211_ATTR_CQM_RSSI_HYST, NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT, NL80211_ATTR_CQM_PKT_LOSS_EVENT, NL80211_ATTR_CQM_TXE_RATE, NL80211_ATTR_CQM_TXE_PKTS, NL80211_ATTR_CQM_TXE_INTVL, NL80211_ATTR_CQM_BEACON_LOSS_EVENT, /* keep last */ __NL80211_ATTR_CQM_AFTER_LAST, NL80211_ATTR_CQM_MAX = __NL80211_ATTR_CQM_AFTER_LAST - 1 }; /** * enum nl80211_cqm_rssi_threshold_event - RSSI threshold event * @NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW: The RSSI level is lower than the * configured threshold * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the * configured threshold * @NL80211_CQM_RSSI_BEACON_LOSS_EVENT: (reserved, never sent) */ enum nl80211_cqm_rssi_threshold_event { NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW, NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH, NL80211_CQM_RSSI_BEACON_LOSS_EVENT, }; /** * enum nl80211_tx_power_setting - TX power adjustment * @NL80211_TX_POWER_AUTOMATIC: automatically determine transmit power * @NL80211_TX_POWER_LIMITED: limit TX power by the mBm parameter * @NL80211_TX_POWER_FIXED: fix TX power to the mBm parameter */ enum nl80211_tx_power_setting { NL80211_TX_POWER_AUTOMATIC, NL80211_TX_POWER_LIMITED, NL80211_TX_POWER_FIXED, }; /** * enum nl80211_packet_pattern_attr - packet pattern attribute * @__NL80211_PKTPAT_INVALID: invalid number for nested attribute * @NL80211_PKTPAT_PATTERN: the pattern, values where the mask has * a zero bit are ignored * @NL80211_PKTPAT_MASK: pattern mask, must be long enough to have * a bit for each byte in the pattern. The lowest-order bit corresponds * to the first byte of the pattern, but the bytes of the pattern are * in a little-endian-like format, i.e. the 9th byte of the pattern * corresponds to the lowest-order bit in the second byte of the mask. * For example: The match 00:xx:00:00:xx:00:00:00:00:xx:xx:xx (where * xx indicates "don't care") would be represented by a pattern of * twelve zero bytes, and a mask of "0xed,0x01". * Note that the pattern matching is done as though frames were not * 802.11 frames but 802.3 frames, i.e. the frame is fully unpacked * first (including SNAP header unpacking) and then matched. * @NL80211_PKTPAT_OFFSET: packet offset, pattern is matched after * these fixed number of bytes of received packet * @NUM_NL80211_PKTPAT: number of attributes * @MAX_NL80211_PKTPAT: max attribute number */ enum nl80211_packet_pattern_attr { __NL80211_PKTPAT_INVALID, NL80211_PKTPAT_MASK, NL80211_PKTPAT_PATTERN, NL80211_PKTPAT_OFFSET, NUM_NL80211_PKTPAT, MAX_NL80211_PKTPAT = NUM_NL80211_PKTPAT - 1, }; /** * struct nl80211_pattern_support - packet pattern support information * @max_patterns: maximum number of patterns supported * @min_pattern_len: minimum length of each pattern * @max_pattern_len: maximum length of each pattern * @max_pkt_offset: maximum Rx packet offset * * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED or in * %NL80211_ATTR_COALESCE_RULE_PKT_PATTERN when that is part of * %NL80211_ATTR_COALESCE_RULE in the capability information given * by the kernel to userspace. */ struct nl80211_pattern_support { __u32 max_patterns; __u32 min_pattern_len; __u32 max_pattern_len; __u32 max_pkt_offset; } __attribute__((packed)); /* only for backward compatibility */ #define __NL80211_WOWLAN_PKTPAT_INVALID __NL80211_PKTPAT_INVALID #define NL80211_WOWLAN_PKTPAT_MASK NL80211_PKTPAT_MASK #define NL80211_WOWLAN_PKTPAT_PATTERN NL80211_PKTPAT_PATTERN #define NL80211_WOWLAN_PKTPAT_OFFSET NL80211_PKTPAT_OFFSET #define NUM_NL80211_WOWLAN_PKTPAT NUM_NL80211_PKTPAT #define MAX_NL80211_WOWLAN_PKTPAT MAX_NL80211_PKTPAT #define nl80211_wowlan_pattern_support nl80211_pattern_support /** * enum nl80211_wowlan_triggers - WoWLAN trigger definitions * @__NL80211_WOWLAN_TRIG_INVALID: invalid number for nested attributes * @NL80211_WOWLAN_TRIG_ANY: wake up on any activity, do not really put * the chip into a special state -- works best with chips that have * support for low-power operation already (flag) * Note that this mode is incompatible with all of the others, if * any others are even supported by the device. * @NL80211_WOWLAN_TRIG_DISCONNECT: wake up on disconnect, the way disconnect * is detected is implementation-specific (flag) * @NL80211_WOWLAN_TRIG_MAGIC_PKT: wake up on magic packet (6x 0xff, followed * by 16 repetitions of MAC addr, anywhere in payload) (flag) * @NL80211_WOWLAN_TRIG_PKT_PATTERN: wake up on the specified packet patterns * which are passed in an array of nested attributes, each nested attribute * defining a with attributes from &struct nl80211_wowlan_trig_pkt_pattern. * Each pattern defines a wakeup packet. Packet offset is associated with * each pattern which is used while matching the pattern. The matching is * done on the MSDU, i.e. as though the packet was an 802.3 packet, so the * pattern matching is done after the packet is converted to the MSDU. * * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute * carrying a &struct nl80211_pattern_support. * * When reporting wakeup. it is a u32 attribute containing the 0-based * index of the pattern that caused the wakeup, in the patterns passed * to the kernel when configuring. * @NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED: Not a real trigger, and cannot be * used when setting, used only to indicate that GTK rekeying is supported * by the device (flag) * @NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE: wake up on GTK rekey failure (if * done by the device) (flag) * @NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST: wake up on EAP Identity Request * packet (flag) * @NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE: wake up on 4-way handshake (flag) * @NL80211_WOWLAN_TRIG_RFKILL_RELEASE: wake up when rfkill is released * (on devices that have rfkill in the device) (flag) * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211: For wakeup reporting only, contains * the 802.11 packet that caused the wakeup, e.g. a deauth frame. The frame * may be truncated, the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN * attribute contains the original length. * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN: Original length of the 802.11 * packet, may be bigger than the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211 * attribute if the packet was truncated somewhere. * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023: For wakeup reporting only, contains the * 802.11 packet that caused the wakeup, e.g. a magic packet. The frame may * be truncated, the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN attribute * contains the original length. * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN: Original length of the 802.3 * packet, may be bigger than the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023 * attribute if the packet was truncated somewhere. * @NL80211_WOWLAN_TRIG_TCP_CONNECTION: TCP connection wake, see DOC section * "TCP connection wakeup" for more details. This is a nested attribute * containing the exact information for establishing and keeping alive * the TCP connection. * @NL80211_WOWLAN_TRIG_TCP_WAKEUP_MATCH: For wakeup reporting only, the * wakeup packet was received on the TCP connection * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST: For wakeup reporting only, the * TCP connection was lost or failed to be established * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS: For wakeup reporting only, * the TCP connection ran out of tokens to use for data to send to the * service * @NL80211_WOWLAN_TRIG_NET_DETECT: wake up when a configured network * is detected. This is a nested attribute that contains the * same attributes used with @NL80211_CMD_START_SCHED_SCAN. It * specifies how the scan is performed (e.g. the interval, the * channels to scan and the initial delay) as well as the scan * results that will trigger a wake (i.e. the matchsets). This * attribute is also sent in a response to * @NL80211_CMD_GET_WIPHY, indicating the number of match sets * supported by the driver (u32). * @NL80211_WOWLAN_TRIG_NET_DETECT_RESULTS: nested attribute * containing an array with information about what triggered the * wake up. If no elements are present in the array, it means * that the information is not available. If more than one * element is present, it means that more than one match * occurred. * Each element in the array is a nested attribute that contains * one optional %NL80211_ATTR_SSID attribute and one optional * %NL80211_ATTR_SCAN_FREQUENCIES attribute. At least one of * these attributes must be present. If * %NL80211_ATTR_SCAN_FREQUENCIES contains more than one * frequency, it means that the match occurred in more than one * channel. * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number * * These nested attributes are used to configure the wakeup triggers and * to report the wakeup reason(s). */ enum nl80211_wowlan_triggers { __NL80211_WOWLAN_TRIG_INVALID, NL80211_WOWLAN_TRIG_ANY, NL80211_WOWLAN_TRIG_DISCONNECT, NL80211_WOWLAN_TRIG_MAGIC_PKT, NL80211_WOWLAN_TRIG_PKT_PATTERN, NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED, NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE, NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST, NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE, NL80211_WOWLAN_TRIG_RFKILL_RELEASE, NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211, NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN, NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023, NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN, NL80211_WOWLAN_TRIG_TCP_CONNECTION, NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH, NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST, NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS, NL80211_WOWLAN_TRIG_NET_DETECT, NL80211_WOWLAN_TRIG_NET_DETECT_RESULTS, /* keep last */ NUM_NL80211_WOWLAN_TRIG, MAX_NL80211_WOWLAN_TRIG = NUM_NL80211_WOWLAN_TRIG - 1 }; /** * DOC: TCP connection wakeup * * Some devices can establish a TCP connection in order to be woken up by a * packet coming in from outside their network segment, or behind NAT. If * configured, the device will establish a TCP connection to the given * service, and periodically send data to that service. The first data * packet is usually transmitted after SYN/ACK, also ACKing the SYN/ACK. * The data packets can optionally include a (little endian) sequence * number (in the TCP payload!) that is generated by the device, and, also * optionally, a token from a list of tokens. This serves as a keep-alive * with the service, and for NATed connections, etc. * * During this keep-alive period, the server doesn't send any data to the * client. When receiving data, it is compared against the wakeup pattern * (and mask) and if it matches, the host is woken up. Similarly, if the * connection breaks or cannot be established to start with, the host is * also woken up. * * Developer's note: ARP offload is required for this, otherwise TCP * response packets might not go through correctly. */ /** * struct nl80211_wowlan_tcp_data_seq - WoWLAN TCP data sequence * @start: starting value * @offset: offset of sequence number in packet * @len: length of the sequence value to write, 1 through 4 * * Note: don't confuse with the TCP sequence number(s), this is for the * keepalive packet payload. The actual value is written into the packet * in little endian. */ struct nl80211_wowlan_tcp_data_seq { __u32 start, offset, len; }; /** * struct nl80211_wowlan_tcp_data_token - WoWLAN TCP data token config * @offset: offset of token in packet * @len: length of each token * @token_stream: stream of data to be used for the tokens, the length must * be a multiple of @len for this to make sense */ struct nl80211_wowlan_tcp_data_token { __u32 offset, len; __u8 token_stream[]; }; /** * struct nl80211_wowlan_tcp_data_token_feature - data token features * @min_len: minimum token length * @max_len: maximum token length * @bufsize: total available token buffer size (max size of @token_stream) */ struct nl80211_wowlan_tcp_data_token_feature { __u32 min_len, max_len, bufsize; }; /** * enum nl80211_wowlan_tcp_attrs - WoWLAN TCP connection parameters * @__NL80211_WOWLAN_TCP_INVALID: invalid number for nested attributes * @NL80211_WOWLAN_TCP_SRC_IPV4: source IPv4 address (in network byte order) * @NL80211_WOWLAN_TCP_DST_IPV4: destination IPv4 address * (in network byte order) * @NL80211_WOWLAN_TCP_DST_MAC: destination MAC address, this is given because * route lookup when configured might be invalid by the time we suspend, * and doing a route lookup when suspending is no longer possible as it * might require ARP querying. * @NL80211_WOWLAN_TCP_SRC_PORT: source port (u16); optional, if not given a * socket and port will be allocated * @NL80211_WOWLAN_TCP_DST_PORT: destination port (u16) * @NL80211_WOWLAN_TCP_DATA_PAYLOAD: data packet payload, at least one byte. * For feature advertising, a u32 attribute holding the maximum length * of the data payload. * @NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ: data packet sequence configuration * (if desired), a &struct nl80211_wowlan_tcp_data_seq. For feature * advertising it is just a flag * @NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN: data packet token configuration, * see &struct nl80211_wowlan_tcp_data_token and for advertising see * &struct nl80211_wowlan_tcp_data_token_feature. * @NL80211_WOWLAN_TCP_DATA_INTERVAL: data interval in seconds, maximum * interval in feature advertising (u32) * @NL80211_WOWLAN_TCP_WAKE_PAYLOAD: wake packet payload, for advertising a * u32 attribute holding the maximum length * @NL80211_WOWLAN_TCP_WAKE_MASK: Wake packet payload mask, not used for * feature advertising. The mask works like @NL80211_PKTPAT_MASK * but on the TCP payload only. * @NUM_NL80211_WOWLAN_TCP: number of TCP attributes * @MAX_NL80211_WOWLAN_TCP: highest attribute number */ enum nl80211_wowlan_tcp_attrs { __NL80211_WOWLAN_TCP_INVALID, NL80211_WOWLAN_TCP_SRC_IPV4, NL80211_WOWLAN_TCP_DST_IPV4, NL80211_WOWLAN_TCP_DST_MAC, NL80211_WOWLAN_TCP_SRC_PORT, NL80211_WOWLAN_TCP_DST_PORT, NL80211_WOWLAN_TCP_DATA_PAYLOAD, NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ, NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN, NL80211_WOWLAN_TCP_DATA_INTERVAL, NL80211_WOWLAN_TCP_WAKE_PAYLOAD, NL80211_WOWLAN_TCP_WAKE_MASK, /* keep last */ NUM_NL80211_WOWLAN_TCP, MAX_NL80211_WOWLAN_TCP = NUM_NL80211_WOWLAN_TCP - 1 }; /** * struct nl80211_coalesce_rule_support - coalesce rule support information * @max_rules: maximum number of rules supported * @pat: packet pattern support information * @max_delay: maximum supported coalescing delay in msecs * * This struct is carried in %NL80211_ATTR_COALESCE_RULE in the * capability information given by the kernel to userspace. */ struct nl80211_coalesce_rule_support { __u32 max_rules; struct nl80211_pattern_support pat; __u32 max_delay; } __attribute__((packed)); /** * enum nl80211_attr_coalesce_rule - coalesce rule attribute * @__NL80211_COALESCE_RULE_INVALID: invalid number for nested attribute * @NL80211_ATTR_COALESCE_RULE_DELAY: delay in msecs used for packet coalescing * @NL80211_ATTR_COALESCE_RULE_CONDITION: condition for packet coalescence, * see &enum nl80211_coalesce_condition. * @NL80211_ATTR_COALESCE_RULE_PKT_PATTERN: packet offset, pattern is matched * after these fixed number of bytes of received packet * @NUM_NL80211_ATTR_COALESCE_RULE: number of attributes * @NL80211_ATTR_COALESCE_RULE_MAX: max attribute number */ enum nl80211_attr_coalesce_rule { __NL80211_COALESCE_RULE_INVALID, NL80211_ATTR_COALESCE_RULE_DELAY, NL80211_ATTR_COALESCE_RULE_CONDITION, NL80211_ATTR_COALESCE_RULE_PKT_PATTERN, /* keep last */ NUM_NL80211_ATTR_COALESCE_RULE, NL80211_ATTR_COALESCE_RULE_MAX = NUM_NL80211_ATTR_COALESCE_RULE - 1 }; /** * enum nl80211_coalesce_condition - coalesce rule conditions * @NL80211_COALESCE_CONDITION_MATCH: coalaesce Rx packets when patterns * in a rule are matched. * @NL80211_COALESCE_CONDITION_NO_MATCH: coalesce Rx packets when patterns * in a rule are not matched. */ enum nl80211_coalesce_condition { NL80211_COALESCE_CONDITION_MATCH, NL80211_COALESCE_CONDITION_NO_MATCH }; /** * enum nl80211_iface_limit_attrs - limit attributes * @NL80211_IFACE_LIMIT_UNSPEC: (reserved) * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that * can be chosen from this set of interface types (u32) * @NL80211_IFACE_LIMIT_TYPES: nested attribute containing a * flag attribute for each interface type in this set * @NUM_NL80211_IFACE_LIMIT: number of attributes * @MAX_NL80211_IFACE_LIMIT: highest attribute number */ enum nl80211_iface_limit_attrs { NL80211_IFACE_LIMIT_UNSPEC, NL80211_IFACE_LIMIT_MAX, NL80211_IFACE_LIMIT_TYPES, /* keep last */ NUM_NL80211_IFACE_LIMIT, MAX_NL80211_IFACE_LIMIT = NUM_NL80211_IFACE_LIMIT - 1 }; /** * enum nl80211_if_combination_attrs -- interface combination attributes * * @NL80211_IFACE_COMB_UNSPEC: (reserved) * @NL80211_IFACE_COMB_LIMITS: Nested attributes containing the limits * for given interface types, see &enum nl80211_iface_limit_attrs. * @NL80211_IFACE_COMB_MAXNUM: u32 attribute giving the total number of * interfaces that can be created in this group. This number doesn't * apply to interfaces purely managed in software, which are listed * in a separate attribute %NL80211_ATTR_INTERFACES_SOFTWARE. * @NL80211_IFACE_COMB_STA_AP_BI_MATCH: flag attribute specifying that * beacon intervals within this group must be all the same even for * infrastructure and AP/GO combinations, i.e. the GO(s) must adopt * the infrastructure network's beacon interval. * @NL80211_IFACE_COMB_NUM_CHANNELS: u32 attribute specifying how many * different channels may be used within this group. * @NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS: u32 attribute containing the bitmap * of supported channel widths for radar detection. * @NL80211_IFACE_COMB_RADAR_DETECT_REGIONS: u32 attribute containing the bitmap * of supported regulatory regions for radar detection. * @NUM_NL80211_IFACE_COMB: number of attributes * @MAX_NL80211_IFACE_COMB: highest attribute number * * Examples: * limits = [ #{STA} <= 1, #{AP} <= 1 ], matching BI, channels = 1, max = 2 * => allows an AP and a STA that must match BIs * * numbers = [ #{AP, P2P-GO} <= 8 ], channels = 1, max = 8 * => allows 8 of AP/GO * * numbers = [ #{STA} <= 2 ], channels = 2, max = 2 * => allows two STAs on different channels * * numbers = [ #{STA} <= 1, #{P2P-client,P2P-GO} <= 3 ], max = 4 * => allows a STA plus three P2P interfaces * * The list of these four possiblities could completely be contained * within the %NL80211_ATTR_INTERFACE_COMBINATIONS attribute to indicate * that any of these groups must match. * * "Combinations" of just a single interface will not be listed here, * a single interface of any valid interface type is assumed to always * be possible by itself. This means that implicitly, for each valid * interface type, the following group always exists: * numbers = [ #{} <= 1 ], channels = 1, max = 1 */ enum nl80211_if_combination_attrs { NL80211_IFACE_COMB_UNSPEC, NL80211_IFACE_COMB_LIMITS, NL80211_IFACE_COMB_MAXNUM, NL80211_IFACE_COMB_STA_AP_BI_MATCH, NL80211_IFACE_COMB_NUM_CHANNELS, NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS, NL80211_IFACE_COMB_RADAR_DETECT_REGIONS, /* keep last */ NUM_NL80211_IFACE_COMB, MAX_NL80211_IFACE_COMB = NUM_NL80211_IFACE_COMB - 1 }; /** * enum nl80211_plink_state - state of a mesh peer link finite state machine * * @NL80211_PLINK_LISTEN: initial state, considered the implicit * state of non existant mesh peer links * @NL80211_PLINK_OPN_SNT: mesh plink open frame has been sent to * this mesh peer * @NL80211_PLINK_OPN_RCVD: mesh plink open frame has been received * from this mesh peer * @NL80211_PLINK_CNF_RCVD: mesh plink confirm frame has been * received from this mesh peer * @NL80211_PLINK_ESTAB: mesh peer link is established * @NL80211_PLINK_HOLDING: mesh peer link is being closed or cancelled * @NL80211_PLINK_BLOCKED: all frames transmitted from this mesh * plink are discarded * @NUM_NL80211_PLINK_STATES: number of peer link states * @MAX_NL80211_PLINK_STATES: highest numerical value of plink states */ enum nl80211_plink_state { NL80211_PLINK_LISTEN, NL80211_PLINK_OPN_SNT, NL80211_PLINK_OPN_RCVD, NL80211_PLINK_CNF_RCVD, NL80211_PLINK_ESTAB, NL80211_PLINK_HOLDING, NL80211_PLINK_BLOCKED, /* keep last */ NUM_NL80211_PLINK_STATES, MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1 }; /** * enum nl80211_plink_action - actions to perform in mesh peers * * @NL80211_PLINK_ACTION_NO_ACTION: perform no action * @NL80211_PLINK_ACTION_OPEN: start mesh peer link establishment * @NL80211_PLINK_ACTION_BLOCK: block traffic from this mesh peer * @NUM_NL80211_PLINK_ACTIONS: number of possible actions */ enum plink_actions { NL80211_PLINK_ACTION_NO_ACTION, NL80211_PLINK_ACTION_OPEN, NL80211_PLINK_ACTION_BLOCK, NUM_NL80211_PLINK_ACTIONS, }; #define NL80211_KCK_LEN 16 #define NL80211_KEK_LEN 16 #define NL80211_REPLAY_CTR_LEN 8 /** * enum nl80211_rekey_data - attributes for GTK rekey offload * @__NL80211_REKEY_DATA_INVALID: invalid number for nested attributes * @NL80211_REKEY_DATA_KEK: key encryption key (binary) * @NL80211_REKEY_DATA_KCK: key confirmation key (binary) * @NL80211_REKEY_DATA_REPLAY_CTR: replay counter (binary) * @NUM_NL80211_REKEY_DATA: number of rekey attributes (internal) * @MAX_NL80211_REKEY_DATA: highest rekey attribute (internal) */ enum nl80211_rekey_data { __NL80211_REKEY_DATA_INVALID, NL80211_REKEY_DATA_KEK, NL80211_REKEY_DATA_KCK, NL80211_REKEY_DATA_REPLAY_CTR, /* keep last */ NUM_NL80211_REKEY_DATA, MAX_NL80211_REKEY_DATA = NUM_NL80211_REKEY_DATA - 1 }; /** * enum nl80211_hidden_ssid - values for %NL80211_ATTR_HIDDEN_SSID * @NL80211_HIDDEN_SSID_NOT_IN_USE: do not hide SSID (i.e., broadcast it in * Beacon frames) * @NL80211_HIDDEN_SSID_ZERO_LEN: hide SSID by using zero-length SSID element * in Beacon frames * @NL80211_HIDDEN_SSID_ZERO_CONTENTS: hide SSID by using correct length of SSID * element in Beacon frames but zero out each byte in the SSID */ enum nl80211_hidden_ssid { NL80211_HIDDEN_SSID_NOT_IN_USE, NL80211_HIDDEN_SSID_ZERO_LEN, NL80211_HIDDEN_SSID_ZERO_CONTENTS }; /** * enum nl80211_sta_wme_attr - station WME attributes * @__NL80211_STA_WME_INVALID: invalid number for nested attribute * @NL80211_STA_WME_UAPSD_QUEUES: bitmap of uapsd queues. the format * is the same as the AC bitmap in the QoS info field. * @NL80211_STA_WME_MAX_SP: max service period. the format is the same * as the MAX_SP field in the QoS info field (but already shifted down). * @__NL80211_STA_WME_AFTER_LAST: internal * @NL80211_STA_WME_MAX: highest station WME attribute */ enum nl80211_sta_wme_attr { __NL80211_STA_WME_INVALID, NL80211_STA_WME_UAPSD_QUEUES, NL80211_STA_WME_MAX_SP, /* keep last */ __NL80211_STA_WME_AFTER_LAST, NL80211_STA_WME_MAX = __NL80211_STA_WME_AFTER_LAST - 1 }; /** * enum nl80211_pmksa_candidate_attr - attributes for PMKSA caching candidates * @__NL80211_PMKSA_CANDIDATE_INVALID: invalid number for nested attributes * @NL80211_PMKSA_CANDIDATE_INDEX: candidate index (u32; the smaller, the higher * priority) * @NL80211_PMKSA_CANDIDATE_BSSID: candidate BSSID (6 octets) * @NL80211_PMKSA_CANDIDATE_PREAUTH: RSN pre-authentication supported (flag) * @NUM_NL80211_PMKSA_CANDIDATE: number of PMKSA caching candidate attributes * (internal) * @MAX_NL80211_PMKSA_CANDIDATE: highest PMKSA caching candidate attribute * (internal) */ enum nl80211_pmksa_candidate_attr { __NL80211_PMKSA_CANDIDATE_INVALID, NL80211_PMKSA_CANDIDATE_INDEX, NL80211_PMKSA_CANDIDATE_BSSID, NL80211_PMKSA_CANDIDATE_PREAUTH, /* keep last */ NUM_NL80211_PMKSA_CANDIDATE, MAX_NL80211_PMKSA_CANDIDATE = NUM_NL80211_PMKSA_CANDIDATE - 1 }; /** * enum nl80211_tdls_operation - values for %NL80211_ATTR_TDLS_OPERATION * @NL80211_TDLS_DISCOVERY_REQ: Send a TDLS discovery request * @NL80211_TDLS_SETUP: Setup TDLS link * @NL80211_TDLS_TEARDOWN: Teardown a TDLS link which is already established * @NL80211_TDLS_ENABLE_LINK: Enable TDLS link * @NL80211_TDLS_DISABLE_LINK: Disable TDLS link */ enum nl80211_tdls_operation { NL80211_TDLS_DISCOVERY_REQ, NL80211_TDLS_SETUP, NL80211_TDLS_TEARDOWN, NL80211_TDLS_ENABLE_LINK, NL80211_TDLS_DISABLE_LINK, }; /* * enum nl80211_ap_sme_features - device-integrated AP features * Reserved for future use, no bits are defined in * NL80211_ATTR_DEVICE_AP_SME yet. enum nl80211_ap_sme_features { }; */ /** * enum nl80211_feature_flags - device/driver features * @NL80211_FEATURE_SK_TX_STATUS: This driver supports reflecting back * TX status to the socket error queue when requested with the * socket option. * @NL80211_FEATURE_HT_IBSS: This driver supports IBSS with HT datarates. * @NL80211_FEATURE_INACTIVITY_TIMER: This driver takes care of freeing up * the connected inactive stations in AP mode. * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested * to work properly to suppport receiving regulatory hints from * cellular base stations. * @NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL: (no longer available, only * here to reserve the value for API/ABI compatibility) * @NL80211_FEATURE_SAE: This driver supports simultaneous authentication of * equals (SAE) with user space SME (NL80211_CMD_AUTHENTICATE) in station * mode * @NL80211_FEATURE_LOW_PRIORITY_SCAN: This driver supports low priority scan * @NL80211_FEATURE_SCAN_FLUSH: Scan flush is supported * @NL80211_FEATURE_AP_SCAN: Support scanning using an AP vif * @NL80211_FEATURE_VIF_TXPOWER: The driver supports per-vif TX power setting * @NL80211_FEATURE_NEED_OBSS_SCAN: The driver expects userspace to perform * OBSS scans and generate 20/40 BSS coex reports. This flag is used only * for drivers implementing the CONNECT API, for AUTH/ASSOC it is implied. * @NL80211_FEATURE_P2P_GO_CTWIN: P2P GO implementation supports CT Window * setting * @NL80211_FEATURE_P2P_GO_OPPPS: P2P GO implementation supports opportunistic * powersave * @NL80211_FEATURE_FULL_AP_CLIENT_STATE: The driver supports full state * transitions for AP clients. Without this flag (and if the driver * doesn't have the AP SME in the device) the driver supports adding * stations only when they're associated and adds them in associated * state (to later be transitioned into authorized), with this flag * they should be added before even sending the authentication reply * and then transitioned into authenticated, associated and authorized * states using station flags. * Note that even for drivers that support this, the default is to add * stations in authenticated/associated state, so to add unauthenticated * stations the authenticated/associated bits have to be set in the mask. * @NL80211_FEATURE_ADVERTISE_CHAN_LIMITS: cfg80211 advertises channel limits * (HT40, VHT 80/160 MHz) if this flag is set * @NL80211_FEATURE_USERSPACE_MPM: This driver supports a userspace Mesh * Peering Management entity which may be implemented by registering for * beacons or NL80211_CMD_NEW_PEER_CANDIDATE events. The mesh beacon is * still generated by the driver. * @NL80211_FEATURE_ACTIVE_MONITOR: This driver supports an active monitor * interface. An active monitor interface behaves like a normal monitor * interface, but gets added to the driver. It ensures that incoming * unicast packets directed at the configured interface address get ACKed. * @NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE: This driver supports dynamic * channel bandwidth change (e.g., HT 20 <-> 40 MHz channel) during the * lifetime of a BSS. * @NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES: This device adds a DS Parameter * Set IE to probe requests. * @NL80211_FEATURE_WFA_TPC_IE_IN_PROBES: This device adds a WFA TPC Report IE * to probe requests. * @NL80211_FEATURE_QUIET: This device, in client mode, supports Quiet Period * requests sent to it by an AP. * @NL80211_FEATURE_TX_POWER_INSERTION: This device is capable of inserting the * current tx power value into the TPC Report IE in the spectrum * management TPC Report action frame, and in the Radio Measurement Link * Measurement Report action frame. * @NL80211_FEATURE_ACKTO_ESTIMATION: This driver supports dynamic ACK timeout * estimation (dynack). %NL80211_ATTR_WIPHY_DYN_ACK flag attribute is used * to enable dynack. * @NL80211_FEATURE_STATIC_SMPS: Device supports static spatial * multiplexing powersave, ie. can turn off all but one chain * even on HT connections that should be using more chains. * @NL80211_FEATURE_DYNAMIC_SMPS: Device supports dynamic spatial * multiplexing powersave, ie. can turn off all but one chain * and then wake the rest up as required after, for example, * rts/cts handshake. * @NL80211_FEATURE_SUPPORTS_WMM_ADMISSION: the device supports setting up WMM * TSPEC sessions (TID aka TSID 0-7) with the %NL80211_CMD_ADD_TX_TS * command. Standard IEEE 802.11 TSPEC setup is not yet supported, it * needs to be able to handle Block-Ack agreements and other things. * @NL80211_FEATURE_MAC_ON_CREATE: Device supports configuring * the vif's MAC address upon creation. * See 'macaddr' field in the vif_params (cfg80211.h). * @NL80211_FEATURE_TDLS_CHANNEL_SWITCH: Driver supports channel switching when * operating as a TDLS peer. * @NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR: This device/driver supports using a * random MAC address during scan (if the device is unassociated); the * %NL80211_SCAN_FLAG_RANDOM_ADDR flag may be set for scans and the MAC * address mask/value will be used. * @NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR: This device/driver supports * using a random MAC address for every scan iteration during scheduled * scan (while not associated), the %NL80211_SCAN_FLAG_RANDOM_ADDR may * be set for scheduled scan and the MAC address mask/value will be used. * @NL80211_FEATURE_ND_RANDOM_MAC_ADDR: This device/driver supports using a * random MAC address for every scan iteration during "net detect", i.e. * scan in unassociated WoWLAN, the %NL80211_SCAN_FLAG_RANDOM_ADDR may * be set for scheduled scan and the MAC address mask/value will be used. */ enum nl80211_feature_flags { NL80211_FEATURE_SK_TX_STATUS = 1 << 0, NL80211_FEATURE_HT_IBSS = 1 << 1, NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2, NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3, NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 1 << 4, NL80211_FEATURE_SAE = 1 << 5, NL80211_FEATURE_LOW_PRIORITY_SCAN = 1 << 6, NL80211_FEATURE_SCAN_FLUSH = 1 << 7, NL80211_FEATURE_AP_SCAN = 1 << 8, NL80211_FEATURE_VIF_TXPOWER = 1 << 9, NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10, NL80211_FEATURE_P2P_GO_CTWIN = 1 << 11, NL80211_FEATURE_P2P_GO_OPPPS = 1 << 12, /* bit 13 is reserved */ NL80211_FEATURE_ADVERTISE_CHAN_LIMITS = 1 << 14, NL80211_FEATURE_FULL_AP_CLIENT_STATE = 1 << 15, NL80211_FEATURE_USERSPACE_MPM = 1 << 16, NL80211_FEATURE_ACTIVE_MONITOR = 1 << 17, NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE = 1 << 18, NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES = 1 << 19, NL80211_FEATURE_WFA_TPC_IE_IN_PROBES = 1 << 20, NL80211_FEATURE_QUIET = 1 << 21, NL80211_FEATURE_TX_POWER_INSERTION = 1 << 22, NL80211_FEATURE_ACKTO_ESTIMATION = 1 << 23, NL80211_FEATURE_STATIC_SMPS = 1 << 24, NL80211_FEATURE_DYNAMIC_SMPS = 1 << 25, NL80211_FEATURE_SUPPORTS_WMM_ADMISSION = 1 << 26, NL80211_FEATURE_MAC_ON_CREATE = 1 << 27, NL80211_FEATURE_TDLS_CHANNEL_SWITCH = 1 << 28, NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR = 1 << 29, NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR = 1 << 30, NL80211_FEATURE_ND_RANDOM_MAC_ADDR = 1 << 31, }; /** * enum nl80211_ext_feature_index - bit index of extended features. * @NL80211_EXT_FEATURE_VHT_IBSS: This driver supports IBSS with VHT datarates. * @NL80211_EXT_FEATURE_RRM: This driver supports RRM. When featured, user can * can request to use RRM (see %NL80211_ATTR_USE_RRM) with * %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests, which will set * the ASSOC_REQ_USE_RRM flag in the association request even if * NL80211_FEATURE_QUIET is not advertized. * @NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER: This device supports MU-MIMO air * sniffer which means that it can be configured to hear packets from * certain groups which can be configured by the * %NL80211_ATTR_MU_MIMO_GROUP_DATA attribute, * or can be configured to follow a station by configuring the * %NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR attribute. * @NL80211_EXT_FEATURE_SCAN_START_TIME: This driver includes the actual * time the scan started in scan results event. The time is the TSF of * the BSS that the interface that requested the scan is connected to * (if available). * @NL80211_EXT_FEATURE_BSS_PARENT_TSF: Per BSS, this driver reports the * time the last beacon/probe was received. The time is the TSF of the * BSS that the interface that requested the scan is connected to * (if available). * @NL80211_EXT_FEATURE_SET_SCAN_DWELL: This driver supports configuration of * channel dwell time. * @NL80211_EXT_FEATURE_BEACON_RATE_LEGACY: Driver supports beacon rate * configuration (AP/mesh), supporting a legacy (non HT/VHT) rate. * @NL80211_EXT_FEATURE_BEACON_RATE_HT: Driver supports beacon rate * configuration (AP/mesh) with HT rates. * @NL80211_EXT_FEATURE_BEACON_RATE_VHT: Driver supports beacon rate * configuration (AP/mesh) with VHT rates. * * @NUM_NL80211_EXT_FEATURES: number of extended features. * @MAX_NL80211_EXT_FEATURES: highest extended feature index. */ enum nl80211_ext_feature_index { NL80211_EXT_FEATURE_VHT_IBSS, NL80211_EXT_FEATURE_RRM, NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER, NL80211_EXT_FEATURE_SCAN_START_TIME, NL80211_EXT_FEATURE_BSS_PARENT_TSF, NL80211_EXT_FEATURE_SET_SCAN_DWELL, NL80211_EXT_FEATURE_BEACON_RATE_LEGACY, NL80211_EXT_FEATURE_BEACON_RATE_HT, NL80211_EXT_FEATURE_BEACON_RATE_VHT, /* add new features before the definition below */ NUM_NL80211_EXT_FEATURES, MAX_NL80211_EXT_FEATURES = NUM_NL80211_EXT_FEATURES - 1 }; /** * enum nl80211_probe_resp_offload_support_attr - optional supported * protocols for probe-response offloading by the driver/FW. * To be used with the %NL80211_ATTR_PROBE_RESP_OFFLOAD attribute. * Each enum value represents a bit in the bitmap of supported * protocols. Typically a subset of probe-requests belonging to a * supported protocol will be excluded from offload and uploaded * to the host. * * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS: Support for WPS ver. 1 * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2: Support for WPS ver. 2 * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P: Support for P2P * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U: Support for 802.11u */ enum nl80211_probe_resp_offload_support_attr { NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS = 1<<0, NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2 = 1<<1, NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P = 1<<2, NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U = 1<<3, }; /** * enum nl80211_connect_failed_reason - connection request failed reasons * @NL80211_CONN_FAIL_MAX_CLIENTS: Maximum number of clients that can be * handled by the AP is reached. * @NL80211_CONN_FAIL_BLOCKED_CLIENT: Connection request is rejected due to ACL. */ enum nl80211_connect_failed_reason { NL80211_CONN_FAIL_MAX_CLIENTS, NL80211_CONN_FAIL_BLOCKED_CLIENT, }; /** * enum nl80211_scan_flags - scan request control flags * * Scan request control flags are used to control the handling * of NL80211_CMD_TRIGGER_SCAN and NL80211_CMD_START_SCHED_SCAN * requests. * * @NL80211_SCAN_FLAG_LOW_PRIORITY: scan request has low priority * @NL80211_SCAN_FLAG_FLUSH: flush cache before scanning * @NL80211_SCAN_FLAG_AP: force a scan even if the interface is configured * as AP and the beaconing has already been configured. This attribute is * dangerous because will destroy stations performance as a lot of frames * will be lost while scanning off-channel, therefore it must be used only * when really needed * @NL80211_SCAN_FLAG_RANDOM_ADDR: use a random MAC address for this scan (or * for scheduled scan: a different one for every scan iteration). When the * flag is set, depending on device capabilities the @NL80211_ATTR_MAC and * @NL80211_ATTR_MAC_MASK attributes may also be given in which case only * the masked bits will be preserved from the MAC address and the remainder * randomised. If the attributes are not given full randomisation (46 bits, * locally administered 1, multicast 0) is assumed. * This flag must not be requested when the feature isn't supported, check * the nl80211 feature flags for the device. */ enum nl80211_scan_flags { NL80211_SCAN_FLAG_LOW_PRIORITY = 1<<0, NL80211_SCAN_FLAG_FLUSH = 1<<1, NL80211_SCAN_FLAG_AP = 1<<2, NL80211_SCAN_FLAG_RANDOM_ADDR = 1<<3, }; /** * enum nl80211_acl_policy - access control policy * * Access control policy is applied on a MAC list set by * %NL80211_CMD_START_AP and %NL80211_CMD_SET_MAC_ACL, to * be used with %NL80211_ATTR_ACL_POLICY. * * @NL80211_ACL_POLICY_ACCEPT_UNLESS_LISTED: Deny stations which are * listed in ACL, i.e. allow all the stations which are not listed * in ACL to authenticate. * @NL80211_ACL_POLICY_DENY_UNLESS_LISTED: Allow the stations which are listed * in ACL, i.e. deny all the stations which are not listed in ACL. */ enum nl80211_acl_policy { NL80211_ACL_POLICY_ACCEPT_UNLESS_LISTED, NL80211_ACL_POLICY_DENY_UNLESS_LISTED, }; /** * enum nl80211_smps_mode - SMPS mode * * Requested SMPS mode (for AP mode) * * @NL80211_SMPS_OFF: SMPS off (use all antennas). * @NL80211_SMPS_STATIC: static SMPS (use a single antenna) * @NL80211_SMPS_DYNAMIC: dynamic smps (start with a single antenna and * turn on other antennas after CTS/RTS). */ enum nl80211_smps_mode { NL80211_SMPS_OFF, NL80211_SMPS_STATIC, NL80211_SMPS_DYNAMIC, __NL80211_SMPS_AFTER_LAST, NL80211_SMPS_MAX = __NL80211_SMPS_AFTER_LAST - 1 }; /** * enum nl80211_radar_event - type of radar event for DFS operation * * Type of event to be used with NL80211_ATTR_RADAR_EVENT to inform userspace * about detected radars or success of the channel available check (CAC) * * @NL80211_RADAR_DETECTED: A radar pattern has been detected. The channel is * now unusable. * @NL80211_RADAR_CAC_FINISHED: Channel Availability Check has been finished, * the channel is now available. * @NL80211_RADAR_CAC_ABORTED: Channel Availability Check has been aborted, no * change to the channel status. * @NL80211_RADAR_NOP_FINISHED: The Non-Occupancy Period for this channel is * over, channel becomes usable. */ enum nl80211_radar_event { NL80211_RADAR_DETECTED, NL80211_RADAR_CAC_FINISHED, NL80211_RADAR_CAC_ABORTED, NL80211_RADAR_NOP_FINISHED, }; /** * enum nl80211_dfs_state - DFS states for channels * * Channel states used by the DFS code. * * @NL80211_DFS_USABLE: The channel can be used, but channel availability * check (CAC) must be performed before using it for AP or IBSS. * @NL80211_DFS_UNAVAILABLE: A radar has been detected on this channel, it * is therefore marked as not available. * @NL80211_DFS_AVAILABLE: The channel has been CAC checked and is available. */ enum nl80211_dfs_state { NL80211_DFS_USABLE, NL80211_DFS_UNAVAILABLE, NL80211_DFS_AVAILABLE, }; /** * enum enum nl80211_protocol_features - nl80211 protocol features * @NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP: nl80211 supports splitting * wiphy dumps (if requested by the application with the attribute * %NL80211_ATTR_SPLIT_WIPHY_DUMP. Also supported is filtering the * wiphy dump by %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFINDEX or * %NL80211_ATTR_WDEV. */ enum nl80211_protocol_features { NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP = 1 << 0, }; /** * enum nl80211_crit_proto_id - nl80211 critical protocol identifiers * * @NL80211_CRIT_PROTO_UNSPEC: protocol unspecified. * @NL80211_CRIT_PROTO_DHCP: BOOTP or DHCPv6 protocol. * @NL80211_CRIT_PROTO_EAPOL: EAPOL protocol. * @NL80211_CRIT_PROTO_APIPA: APIPA protocol. * @NUM_NL80211_CRIT_PROTO: must be kept last. */ enum nl80211_crit_proto_id { NL80211_CRIT_PROTO_UNSPEC, NL80211_CRIT_PROTO_DHCP, NL80211_CRIT_PROTO_EAPOL, NL80211_CRIT_PROTO_APIPA, /* add other protocols before this one */ NUM_NL80211_CRIT_PROTO }; /* maximum duration for critical protocol measures */ #define NL80211_CRIT_PROTO_MAX_DURATION 5000 /* msec */ /** * enum nl80211_rxmgmt_flags - flags for received management frame. * * Used by cfg80211_rx_mgmt() * * @NL80211_RXMGMT_FLAG_ANSWERED: frame was answered by device/driver. */ enum nl80211_rxmgmt_flags { NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0, }; /* * If this flag is unset, the lower 24 bits are an OUI, if set * a Linux nl80211 vendor ID is used (no such IDs are allocated * yet, so that's not valid so far) */ #define NL80211_VENDOR_ID_IS_LINUX 0x80000000 /** * struct nl80211_vendor_cmd_info - vendor command data * @vendor_id: If the %NL80211_VENDOR_ID_IS_LINUX flag is clear, then the * value is a 24-bit OUI; if it is set then a separately allocated ID * may be used, but no such IDs are allocated yet. New IDs should be * added to this file when needed. * @subcmd: sub-command ID for the command */ struct nl80211_vendor_cmd_info { __u32 vendor_id; __u32 subcmd; }; /** * enum nl80211_tdls_peer_capability - TDLS peer flags. * * Used by tdls_mgmt() to determine which conditional elements need * to be added to TDLS Setup frames. * * @NL80211_TDLS_PEER_HT: TDLS peer is HT capable. * @NL80211_TDLS_PEER_VHT: TDLS peer is VHT capable. * @NL80211_TDLS_PEER_WMM: TDLS peer is WMM capable. */ enum nl80211_tdls_peer_capability { NL80211_TDLS_PEER_HT = 1<<0, NL80211_TDLS_PEER_VHT = 1<<1, NL80211_TDLS_PEER_WMM = 1<<2, }; /** * enum nl80211_sched_scan_plan - scanning plan for scheduled scan * @__NL80211_SCHED_SCAN_PLAN_INVALID: attribute number 0 is reserved * @NL80211_SCHED_SCAN_PLAN_INTERVAL: interval between scan iterations. In * seconds (u32). * @NL80211_SCHED_SCAN_PLAN_ITERATIONS: number of scan iterations in this * scan plan (u32). The last scan plan must not specify this attribute * because it will run infinitely. A value of zero is invalid as it will * make the scan plan meaningless. * @NL80211_SCHED_SCAN_PLAN_MAX: highest scheduled scan plan attribute number * currently defined * @__NL80211_SCHED_SCAN_PLAN_AFTER_LAST: internal use */ enum nl80211_sched_scan_plan { __NL80211_SCHED_SCAN_PLAN_INVALID, NL80211_SCHED_SCAN_PLAN_INTERVAL, NL80211_SCHED_SCAN_PLAN_ITERATIONS, /* keep last */ __NL80211_SCHED_SCAN_PLAN_AFTER_LAST, NL80211_SCHED_SCAN_PLAN_MAX = __NL80211_SCHED_SCAN_PLAN_AFTER_LAST - 1 }; /** * struct nl80211_bss_select_rssi_adjust - RSSI adjustment parameters. * * @band: band of BSS that must match for RSSI value adjustment. * @delta: value used to adjust the RSSI value of matching BSS. */ struct nl80211_bss_select_rssi_adjust { __u8 band; __s8 delta; } __attribute__((packed)); /** * enum nl80211_bss_select_attr - attributes for bss selection. * * @__NL80211_BSS_SELECT_ATTR_INVALID: reserved. * @NL80211_BSS_SELECT_ATTR_RSSI: Flag indicating only RSSI-based BSS selection * is requested. * @NL80211_BSS_SELECT_ATTR_BAND_PREF: attribute indicating BSS * selection should be done such that the specified band is preferred. * When there are multiple BSS-es in the preferred band, the driver * shall use RSSI-based BSS selection as a second step. The value of * this attribute is according to &enum nl80211_band (u32). * @NL80211_BSS_SELECT_ATTR_RSSI_ADJUST: When present the RSSI level for * BSS-es in the specified band is to be adjusted before doing * RSSI-based BSS selection. The attribute value is a packed structure * value as specified by &struct nl80211_bss_select_rssi_adjust. * @NL80211_BSS_SELECT_ATTR_MAX: highest bss select attribute number. * @__NL80211_BSS_SELECT_ATTR_AFTER_LAST: internal use. * * One and only one of these attributes are found within %NL80211_ATTR_BSS_SELECT * for %NL80211_CMD_CONNECT. It specifies the required BSS selection behaviour * which the driver shall use. */ enum nl80211_bss_select_attr { __NL80211_BSS_SELECT_ATTR_INVALID, NL80211_BSS_SELECT_ATTR_RSSI, NL80211_BSS_SELECT_ATTR_BAND_PREF, NL80211_BSS_SELECT_ATTR_RSSI_ADJUST, /* keep last */ __NL80211_BSS_SELECT_ATTR_AFTER_LAST, NL80211_BSS_SELECT_ATTR_MAX = __NL80211_BSS_SELECT_ATTR_AFTER_LAST - 1 }; /** * enum nl80211_nan_dual_band_conf - NAN dual band configuration * * Defines the NAN dual band mode of operation * * @NL80211_NAN_BAND_DEFAULT: device default mode * @NL80211_NAN_BAND_2GHZ: 2.4GHz mode * @NL80211_NAN_BAND_5GHZ: 5GHz mode */ enum nl80211_nan_dual_band_conf { NL80211_NAN_BAND_DEFAULT = 1 << 0, NL80211_NAN_BAND_2GHZ = 1 << 1, NL80211_NAN_BAND_5GHZ = 1 << 2, }; /** * enum nl80211_nan_function_type - NAN function type * * Defines the function type of a NAN function * * @NL80211_NAN_FUNC_PUBLISH: function is publish * @NL80211_NAN_FUNC_SUBSCRIBE: function is subscribe * @NL80211_NAN_FUNC_FOLLOW_UP: function is follow-up */ enum nl80211_nan_function_type { NL80211_NAN_FUNC_PUBLISH, NL80211_NAN_FUNC_SUBSCRIBE, NL80211_NAN_FUNC_FOLLOW_UP, /* keep last */ __NL80211_NAN_FUNC_TYPE_AFTER_LAST, NL80211_NAN_FUNC_MAX_TYPE = __NL80211_NAN_FUNC_TYPE_AFTER_LAST - 1, }; /** * enum nl80211_nan_publish_type - NAN publish tx type * * Defines how to send publish Service Discovery Frames * * @NL80211_NAN_SOLICITED_PUBLISH: publish function is solicited * @NL80211_NAN_UNSOLICITED_PUBLISH: publish function is unsolicited */ enum nl80211_nan_publish_type { NL80211_NAN_SOLICITED_PUBLISH = 1 << 0, NL80211_NAN_UNSOLICITED_PUBLISH = 1 << 1, }; /** * enum nl80211_nan_func_term_reason - NAN functions termination reason * * Defines termination reasons of a NAN function * * @NL80211_NAN_FUNC_TERM_REASON_USER_REQUEST: requested by user * @NL80211_NAN_FUNC_TERM_REASON_TTL_EXPIRED: timeout * @NL80211_NAN_FUNC_TERM_REASON_ERROR: errored */ enum nl80211_nan_func_term_reason { NL80211_NAN_FUNC_TERM_REASON_USER_REQUEST, NL80211_NAN_FUNC_TERM_REASON_TTL_EXPIRED, NL80211_NAN_FUNC_TERM_REASON_ERROR, }; #define NL80211_NAN_FUNC_SERVICE_ID_LEN 6 #define NL80211_NAN_FUNC_SERVICE_SPEC_INFO_MAX_LEN 0xff #define NL80211_NAN_FUNC_SRF_MAX_LEN 0xff /** * enum nl80211_nan_func_attributes - NAN function attributes * @__NL80211_NAN_FUNC_INVALID: invalid * @NL80211_NAN_FUNC_TYPE: &enum nl80211_nan_function_type (u8). * @NL80211_NAN_FUNC_SERVICE_ID: 6 bytes of the service ID hash as * specified in NAN spec. This is a binary attribute. * @NL80211_NAN_FUNC_PUBLISH_TYPE: relevant if the function's type is * publish. Defines the transmission type for the publish Service Discovery * Frame, see &enum nl80211_nan_publish_type. Its type is u8. * @NL80211_NAN_FUNC_PUBLISH_BCAST: relevant if the function is a solicited * publish. Should the solicited publish Service Discovery Frame be sent to * the NAN Broadcast address. This is a flag. * @NL80211_NAN_FUNC_SUBSCRIBE_ACTIVE: relevant if the function's type is * subscribe. Is the subscribe active. This is a flag. * @NL80211_NAN_FUNC_FOLLOW_UP_ID: relevant if the function's type is follow up. * The instance ID for the follow up Service Discovery Frame. This is u8. * @NL80211_NAN_FUNC_FOLLOW_UP_REQ_ID: relevant if the function's type * is follow up. This is a u8. * The requestor instance ID for the follow up Service Discovery Frame. * @NL80211_NAN_FUNC_FOLLOW_UP_DEST: the MAC address of the recipient of the * follow up Service Discovery Frame. This is a binary attribute. * @NL80211_NAN_FUNC_CLOSE_RANGE: is this function limited for devices in a * close range. The range itself (RSSI) is defined by the device. * This is a flag. * @NL80211_NAN_FUNC_TTL: strictly positive number of DWs this function should * stay active. If not present infinite TTL is assumed. This is a u32. * @NL80211_NAN_FUNC_SERVICE_INFO: array of bytes describing the service * specific info. This is a binary attribute. * @NL80211_NAN_FUNC_SRF: Service Receive Filter. This is a nested attribute. * See &enum nl80211_nan_srf_attributes. * @NL80211_NAN_FUNC_RX_MATCH_FILTER: Receive Matching filter. This is a nested * attribute. It is a list of binary values. * @NL80211_NAN_FUNC_TX_MATCH_FILTER: Transmit Matching filter. This is a * nested attribute. It is a list of binary values. * @NL80211_NAN_FUNC_INSTANCE_ID: The instance ID of the function. * Its type is u8 and it cannot be 0. * @NL80211_NAN_FUNC_TERM_REASON: NAN function termination reason. * See &enum nl80211_nan_func_term_reason. * * @NUM_NL80211_NAN_FUNC_ATTR: internal * @NL80211_NAN_FUNC_ATTR_MAX: highest NAN function attribute */ enum nl80211_nan_func_attributes { __NL80211_NAN_FUNC_INVALID, NL80211_NAN_FUNC_TYPE, NL80211_NAN_FUNC_SERVICE_ID, NL80211_NAN_FUNC_PUBLISH_TYPE, NL80211_NAN_FUNC_PUBLISH_BCAST, NL80211_NAN_FUNC_SUBSCRIBE_ACTIVE, NL80211_NAN_FUNC_FOLLOW_UP_ID, NL80211_NAN_FUNC_FOLLOW_UP_REQ_ID, NL80211_NAN_FUNC_FOLLOW_UP_DEST, NL80211_NAN_FUNC_CLOSE_RANGE, NL80211_NAN_FUNC_TTL, NL80211_NAN_FUNC_SERVICE_INFO, NL80211_NAN_FUNC_SRF, NL80211_NAN_FUNC_RX_MATCH_FILTER, NL80211_NAN_FUNC_TX_MATCH_FILTER, NL80211_NAN_FUNC_INSTANCE_ID, NL80211_NAN_FUNC_TERM_REASON, /* keep last */ NUM_NL80211_NAN_FUNC_ATTR, NL80211_NAN_FUNC_ATTR_MAX = NUM_NL80211_NAN_FUNC_ATTR - 1 }; /** * enum nl80211_nan_srf_attributes - NAN Service Response filter attributes * @__NL80211_NAN_SRF_INVALID: invalid * @NL80211_NAN_SRF_INCLUDE: present if the include bit of the SRF set. * This is a flag. * @NL80211_NAN_SRF_BF: Bloom Filter. Present if and only if * &NL80211_NAN_SRF_MAC_ADDRS isn't present. This attribute is binary. * @NL80211_NAN_SRF_BF_IDX: index of the Bloom Filter. Mandatory if * &NL80211_NAN_SRF_BF is present. This is a u8. * @NL80211_NAN_SRF_MAC_ADDRS: list of MAC addresses for the SRF. Present if * and only if &NL80211_NAN_SRF_BF isn't present. This is a nested * attribute. Each nested attribute is a MAC address. * @NUM_NL80211_NAN_SRF_ATTR: internal * @NL80211_NAN_SRF_ATTR_MAX: highest NAN SRF attribute */ enum nl80211_nan_srf_attributes { __NL80211_NAN_SRF_INVALID, NL80211_NAN_SRF_INCLUDE, NL80211_NAN_SRF_BF, NL80211_NAN_SRF_BF_IDX, NL80211_NAN_SRF_MAC_ADDRS, /* keep last */ NUM_NL80211_NAN_SRF_ATTR, NL80211_NAN_SRF_ATTR_MAX = NUM_NL80211_NAN_SRF_ATTR - 1, }; /** * enum nl80211_nan_match_attributes - NAN match attributes * @__NL80211_NAN_MATCH_INVALID: invalid * @NL80211_NAN_MATCH_FUNC_LOCAL: the local function that had the * match. This is a nested attribute. * See &enum nl80211_nan_func_attributes. * @NL80211_NAN_MATCH_FUNC_PEER: the peer function * that caused the match. This is a nested attribute. * See &enum nl80211_nan_func_attributes. * * @NUM_NL80211_NAN_MATCH_ATTR: internal * @NL80211_NAN_MATCH_ATTR_MAX: highest NAN match attribute */ enum nl80211_nan_match_attributes { __NL80211_NAN_MATCH_INVALID, NL80211_NAN_MATCH_FUNC_LOCAL, NL80211_NAN_MATCH_FUNC_PEER, /* keep last */ NUM_NL80211_NAN_MATCH_ATTR, NL80211_NAN_MATCH_ATTR_MAX = NUM_NL80211_NAN_MATCH_ATTR - 1 }; #endif /* __LINUX_NL80211_H */ prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/wifi/internal/nl80211/nl80211.yml000066400000000000000000000006061321450230300316300ustar00rootroot00000000000000--- GENERATOR: PackageName: nl80211 PARSER: IncludePaths: [/usr/include] SourcesPaths: [nl80211.h] TRANSLATOR: ConstRules: defines: expand enum: expand Rules: const: - {transform: lower} - {action: accept, from: "(?i)nl80211_"} - {action: replace, from: "(?i)nl80211_", to: _} - {transform: export} post-global: - {load: snakecase} prometheus-node-exporter-0.15.2+ds/vendor/github.com/mdlayher/wifi/wifi.go000066400000000000000000000150041321450230300265420ustar00rootroot00000000000000package wifi import ( "errors" "fmt" "net" "time" ) var ( // errInvalidIE is returned when one or more IEs are malformed. errInvalidIE = errors.New("invalid 802.11 information element") ) // An InterfaceType is the operating mode of an Interface. type InterfaceType int const ( // InterfaceTypeUnspecified indicates that an interface's type is unspecified // and the driver determines its function. InterfaceTypeUnspecified InterfaceType = iota // InterfaceTypeAdHoc indicates that an interface is part of an independent // basic service set (BSS) of client devices without a controlling access // point. InterfaceTypeAdHoc // InterfaceTypeStation indicates that an interface is part of a managed // basic service set (BSS) of client devices with a controlling access point. InterfaceTypeStation // InterfaceTypeAP indicates that an interface is an access point. InterfaceTypeAP // InterfaceTypeAPVLAN indicates that an interface is a VLAN interface // associated with an access point. InterfaceTypeAPVLAN // InterfaceTypeWDS indicates that an interface is a wireless distribution // interface, used as part of a network of multiple access points. InterfaceTypeWDS // InterfaceTypeMonitor indicates that an interface is a monitor interface, // receiving all frames from all clients in a given network. InterfaceTypeMonitor // InterfaceTypeMeshPoint indicates that an interface is part of a wireless // mesh network. InterfaceTypeMeshPoint // InterfaceTypeP2PClient indicates that an interface is a client within // a peer-to-peer network. InterfaceTypeP2PClient // InterfaceTypeP2PGroupOwner indicates that an interface is the group // owner within a peer-to-peer network. InterfaceTypeP2PGroupOwner // InterfaceTypeP2PDevice indicates that an interface is a device within // a peer-to-peer client network. InterfaceTypeP2PDevice // InterfaceTypeOCB indicates that an interface is outside the context // of a basic service set (BSS). InterfaceTypeOCB // InterfaceTypeNAN indicates that an interface is part of a near-me // area network (NAN). InterfaceTypeNAN ) // String returns the string representation of an InterfaceType. func (t InterfaceType) String() string { switch t { case InterfaceTypeUnspecified: return "unspecified" case InterfaceTypeAdHoc: return "ad-hoc" case InterfaceTypeStation: return "station" case InterfaceTypeAP: return "access point" case InterfaceTypeWDS: return "wireless distribution" case InterfaceTypeMonitor: return "monitor" case InterfaceTypeMeshPoint: return "mesh point" case InterfaceTypeP2PClient: return "P2P client" case InterfaceTypeP2PGroupOwner: return "P2P group owner" case InterfaceTypeP2PDevice: return "P2P device" case InterfaceTypeOCB: return "outside context of BSS" case InterfaceTypeNAN: return "near-me area network" default: return fmt.Sprintf("unknown(%d)", t) } } // An Interface is a WiFi network interface. type Interface struct { // The index of the interface. Index int // The name of the interface. Name string // The hardware address of the interface. HardwareAddr net.HardwareAddr // The physical device that this interface belongs to. PHY int // The virtual device number of this interface within a PHY. Device int // The operating mode of the interface. Type InterfaceType // The interface's wireless frequency in MHz. Frequency int } // StationInfo contains statistics about a WiFi interface operating in // station mode. type StationInfo struct { // The time since the station last connected. Connected time.Duration // The time since wireless activity last occurred. Inactive time.Duration // The number of bytes received by this station. ReceivedBytes int // The number of bytes transmitted by this station. TransmittedBytes int // The number of packets received by this station. ReceivedPackets int // The number of packets transmitted by this station. TransmittedPackets int // The current data receive bitrate, in bits/second. ReceiveBitrate int // The current data transmit bitrate, in bits/second. TransmitBitrate int // The signal strength of this station's connection, in dBm. Signal int // The number of times the station has had to retry while sending a packet. TransmitRetries int // The number of times a packet transmission failed. TransmitFailed int // The number of times a beacon loss was detected. BeaconLoss int } // A BSS is an 802.11 basic service set. It contains information about a wireless // network associated with an Interface. type BSS struct { // The service set identifier, or "network name" of the BSS. SSID string // The BSS service set identifier. In infrastructure mode, this is the // hardware address of the wireless access point that a client is associated // with. BSSID net.HardwareAddr // The frequency used by the BSS, in MHz. Frequency int // The interval between beacon transmissions for this BSS. BeaconInterval time.Duration // The time since the client last scanned this BSS's information. LastSeen time.Duration // The status of the client within the BSS. Status BSSStatus } // A BSSStatus indicates the current status of client within a BSS. type BSSStatus int const ( // BSSStatusAuthenticated indicates that a client is authenticated with a BSS. BSSStatusAuthenticated BSSStatus = iota // BSSStatusAssociated indicates that a client is associated with a BSS. BSSStatusAssociated // BSSStatusIBSSJoined indicates that a client has joined an independent BSS. BSSStatusIBSSJoined ) // String returns the string representation of a BSSStatus. func (s BSSStatus) String() string { switch s { case BSSStatusAuthenticated: return "authenticated" case BSSStatusAssociated: return "associated" case BSSStatusIBSSJoined: return "IBSS joined" default: return fmt.Sprintf("unknown(%d)", s) } } // List of 802.11 Information Element types. const ( ieSSID = 0 ) // An ie is an 802.11 information element. type ie struct { ID uint8 // Length field implied by length of data Data []byte } // parseIEs parses zero or more ies from a byte slice. // Reference: // https://www.safaribooksonline.com/library/view/80211-wireless-networks/0596100523/ch04.html#wireless802dot112-CHP-4-FIG-31 func parseIEs(b []byte) ([]ie, error) { var ies []ie var i int for { if len(b[i:]) == 0 { break } if len(b[i:]) < 2 { return nil, errInvalidIE } id := b[i] i++ l := int(b[i]) i++ if len(b[i:]) < l { return nil, errInvalidIE } ies = append(ies, ie{ ID: id, Data: b[i : i+l], }) i += l } return ies, nil } prometheus-node-exporter-0.15.2+ds/vendor/github.com/soundcloud/000077500000000000000000000000001321450230300246715ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/vendor/github.com/soundcloud/go-runit/000077500000000000000000000000001321450230300264355ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/vendor/github.com/soundcloud/go-runit/LICENSE000066400000000000000000000020721321450230300274430ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) 2015 SoundCloud Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. prometheus-node-exporter-0.15.2+ds/vendor/github.com/soundcloud/go-runit/runit/000077500000000000000000000000001321450230300275765ustar00rootroot00000000000000prometheus-node-exporter-0.15.2+ds/vendor/github.com/soundcloud/go-runit/runit/runit.go000066400000000000000000000053431321450230300312730ustar00rootroot00000000000000package runit import ( "errors" "fmt" "io/ioutil" "os" "syscall" "time" ) const ( defaultServiceDir = "/etc/service" taiOffset = 4611686018427387914 statusLen = 20 posTimeStart = 0 posTimeEnd = 7 posPidStart = 12 posPidEnd = 15 posWant = 17 posState = 19 StateDown = 0 StateUp = 1 StateFinish = 2 ) var ( ENoRunsv = errors.New("runsv not running") StateToString = map[int]string{ StateDown: "down", StateUp: "up", StateFinish: "finish", } ) type SvStatus struct { Pid int Duration int Timestamp time.Time State int NormallyUp bool Want int } type service struct { Name string ServiceDir string } func GetServices(dir string) ([]*service, error) { if dir == "" { dir = defaultServiceDir } files, err := ioutil.ReadDir(dir) if err != nil { return nil, err } services := []*service{} for _, file := range files { if file.Mode()&os.ModeSymlink == os.ModeSymlink || file.IsDir() { services = append(services, GetService(file.Name(), dir)) } } return services, nil } func GetService(name string, dir string) *service { if dir == "" { dir = defaultServiceDir } r := service{Name: name, ServiceDir: dir} return &r } func (s *service) file(file string) string { return fmt.Sprintf("%s/%s/supervise/%s", s.ServiceDir, s.Name, file) } func (s *service) runsvRunning() (bool, error) { file, err := os.OpenFile(s.file("ok"), os.O_WRONLY, 0) if err != nil { if err == syscall.ENXIO { return false, nil } return false, err } file.Close() return true, nil } func (s *service) status() ([]byte, error) { file, err := os.Open(s.file("status")) if err != nil { return nil, err } defer file.Close() status := make([]byte, statusLen) _, err = file.Read(status) return status, err } func (s *service) NormallyUp() bool { _, err := os.Stat(s.file("down")) return err != nil } func (s *service) Status() (*SvStatus, error) { status, err := s.status() if err != nil { return nil, err } var pid int pid = int(status[posPidEnd]) for i := posPidEnd - 1; i >= posPidStart; i-- { pid <<= 8 pid += int(status[i]) } tai := int64(status[posTimeStart]) for i := posTimeStart + 1; i <= posTimeEnd; i++ { tai <<= 8 tai += int64(status[i]) } state := status[posState] // 0: down, 1: run, 2: finish tv := &syscall.Timeval{} if err := syscall.Gettimeofday(tv); err != nil { return nil, err } sS := SvStatus{ Pid: pid, Timestamp: time.Unix(tai-taiOffset, 0), // FIXME: do we just select the wrong slice? Duration: int(int64(tv.Sec) - (tai - taiOffset)), State: int(state), NormallyUp: s.NormallyUp(), } switch status[posWant] { case 'u': sS.Want = StateUp case 'd': sS.Want = StateDown } return &sS, nil } prometheus-node-exporter-0.15.2+ds/vendor/vendor.json000066400000000000000000000214241321450230300226460ustar00rootroot00000000000000{ "comment": "", "ignore": "test", "package": [ { "checksumSHA1": "KmjnydoAbofMieIWm+it5OWERaM=", "path": "github.com/alecthomas/template", "revision": "a0175ee3bccc567396460bf5acd36800cb10c49c", "revisionTime": "2016-04-05T07:15:01Z" }, { "checksumSHA1": "3wt0pTXXeS+S93unwhGoLIyGX/Q=", "path": "github.com/alecthomas/template/parse", "revision": "a0175ee3bccc567396460bf5acd36800cb10c49c", "revisionTime": "2016-04-05T07:15:01Z" }, { "checksumSHA1": "fCc3grA7vIxfBru7R3SqjcW+oLI=", "path": "github.com/alecthomas/units", "revision": "2efee857e7cfd4f3d0138cc3cbb1b4966962b93a", "revisionTime": "2015-10-22T06:55:26Z" }, { "checksumSHA1": "OXcULIfKv/Xcsa4o1By1lY0s+AI=", "path": "github.com/beevik/ntp", "revision": "802074b1b037c59dbdbee7e196ad91b51d0ec844", "revisionTime": "2017-10-03T23:10:51Z", "version": "v0.1.1", "versionExact": "v0.1.1" }, { "checksumSHA1": "spyv5/YFBjYyZLZa1U2LBfDR8PM=", "path": "github.com/beorn7/perks/quantile", "revision": "4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9", "revisionTime": "2016-08-04T10:47:26Z" }, { "checksumSHA1": "/zxxFPYjUB7Wowz33r5AhTDvoz0=", "path": "github.com/coreos/go-systemd/dbus", "revision": "d2196463941895ee908e13531a23a39feb9e1243", "revisionTime": "2017-07-31T11:19:25Z", "version": "v15", "versionExact": "v15" }, { "checksumSHA1": "TcRpPaKLcq9Pk27kBcpW5lyFUHg=", "path": "github.com/ema/qdisc", "revision": "e2e5ae489bf8b6b1796ad921b91d5ff559414b06", "revisionTime": "2017-05-24T21:03:24Z" }, { "checksumSHA1": "Qbh78KcLmLVoURsCp+f5xVeA/fI=", "path": "github.com/godbus/dbus", "revision": "a389bdde4dd695d414e47b755e95e72b7826432c", "revisionTime": "2017-09-18T23:46:06Z" }, { "checksumSHA1": "yqF125xVSkmfLpIVGrLlfE05IUk=", "path": "github.com/golang/protobuf/proto", "revision": "130e6b02ab059e7b717a096f397c5b60111cae74", "revisionTime": "2017-09-20T22:06:47Z" }, { "checksumSHA1": "tw3ocqSpa9ikzUV6qhcKBAAO6WU=", "path": "github.com/kolo/xmlrpc", "revision": "0826b98aaa29c0766956cb40d45cf7482a597671", "revisionTime": "2015-04-13T19:18:30Z" }, { "checksumSHA1": "IdBAvtVSv0sbi8sEsLovnZubims=", "path": "github.com/lufia/iostat", "revision": "9f7362b77ad333b26c01c99de52a11bdb650ded2", "revisionTime": "2017-06-05T15:08:45Z" }, { "checksumSHA1": "aodj/cITRyuaZSh84DDhrZjh76U=", "path": "github.com/matttproud/golang_protobuf_extensions/pbutil", "revision": "3247c84500bff8d9fb6d579d800f20b3e091582c", "revisionTime": "2016-04-23T17:36:17Z", "version": "v1.0.0", "versionExact": "v1.0.0" }, { "checksumSHA1": "r3t+HDvOEQVCaLjuMT8rl6opbNQ=", "path": "github.com/mdlayher/netlink", "revision": "343c07bd16ebbc714f19c528a6deb6723ace06f3", "revisionTime": "2017-03-10T17:31:27Z" }, { "checksumSHA1": "+2roeIWCAjCC58tZcs12Vqgf1Io=", "path": "github.com/mdlayher/netlink/genetlink", "revision": "1291b75abe0cc0cb335f110466bf1f02590c916d", "revisionTime": "2017-01-04T04:59:06Z" }, { "checksumSHA1": "9udZUcU9bmkXtnkyLNqJ8jKRt0c=", "path": "github.com/mdlayher/netlink/nlenc", "revision": "1291b75abe0cc0cb335f110466bf1f02590c916d", "revisionTime": "2017-01-04T04:59:06Z" }, { "checksumSHA1": "FdmT9kyPtsLxk+sgxJmKqcbOCR4=", "path": "github.com/mdlayher/wifi", "revision": "567082929344b0af8eb8a2ad6fe4725c0b3c8702", "revisionTime": "2017-03-17T19:22:46Z" }, { "checksumSHA1": "VzutdH69PUqRqhrDVv6F91ebQd4=", "path": "github.com/mdlayher/wifi/internal/nl80211", "revision": "88fd1c0ec178645c1b7d300090b5a9d4b226b8e1", "revisionTime": "2017-01-07T15:17:58Z" }, { "checksumSHA1": "N8DZCxgnkiFM2cdn0/jB6jRu1TM=", "path": "github.com/prometheus/client_golang/prometheus", "revision": "967789050ba94deca04a5e84cce8ad472ce313c1", "revisionTime": "2017-08-31T13:19:02Z", "version": "v0.9.0-pre1", "versionExact": "v0.9.0-pre1" }, { "checksumSHA1": "wsAkYlRRUNx+OAuUOIqdjO7dICM=", "path": "github.com/prometheus/client_golang/prometheus/promhttp", "revision": "967789050ba94deca04a5e84cce8ad472ce313c1", "revisionTime": "2017-08-31T13:19:02Z", "version": "v0.9.0-pre1", "versionExact": "v0.9.0-pre1" }, { "checksumSHA1": "DvwvOlPNAgRntBzt3b3OSRMS2N4=", "path": "github.com/prometheus/client_model/go", "revision": "6f3806018612930941127f2a7c6c453ba2c527d2", "revisionTime": "2017-02-16T18:52:47Z" }, { "checksumSHA1": "xfnn0THnqNwjwimeTClsxahYrIo=", "path": "github.com/prometheus/common/expfmt", "revision": "2f17f4a9d485bf34b4bfaccc273805040e4f86c8", "revisionTime": "2017-09-08T16:18:22Z" }, { "checksumSHA1": "GWlM3d2vPYyNATtTFgftS10/A9w=", "path": "github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg", "revision": "2f17f4a9d485bf34b4bfaccc273805040e4f86c8", "revisionTime": "2017-09-08T16:18:22Z" }, { "checksumSHA1": "jYpLEs+wZ5LZubvOJEDSQ8I14MI=", "path": "github.com/prometheus/common/log", "revision": "2f17f4a9d485bf34b4bfaccc273805040e4f86c8", "revisionTime": "2017-09-08T16:18:22Z" }, { "checksumSHA1": "3VoqH7TFfzA6Ds0zFzIbKCUvBmw=", "path": "github.com/prometheus/common/model", "revision": "2f17f4a9d485bf34b4bfaccc273805040e4f86c8", "revisionTime": "2017-09-08T16:18:22Z" }, { "checksumSHA1": "91KYK0SpvkaMJJA2+BcxbVnyRO0=", "path": "github.com/prometheus/common/version", "revision": "2f17f4a9d485bf34b4bfaccc273805040e4f86c8", "revisionTime": "2017-09-08T16:18:22Z" }, { "checksumSHA1": "ihxJIjxtbEYdQKwA0D0nRipj95I=", "path": "github.com/prometheus/procfs", "revision": "e645f4e5aaa8506fc71d6edbc5c4ff02c04c46f2", "revisionTime": "2017-07-03T10:12:42Z" }, { "checksumSHA1": "RAb14ZPZ6Y+AD0TnMBqLHaIw/I8=", "path": "github.com/prometheus/procfs/bcache", "revision": "e645f4e5aaa8506fc71d6edbc5c4ff02c04c46f2", "revisionTime": "2017-07-03T10:12:42Z" }, { "checksumSHA1": "wMhQkA/xQw3Q8eI+PIAjFmS94Qo=", "path": "github.com/prometheus/procfs/sysfs", "revision": "e645f4e5aaa8506fc71d6edbc5c4ff02c04c46f2", "revisionTime": "2017-07-03T10:12:42Z" }, { "checksumSHA1": "xCiFAAwVTrjsfZT1BIJQ3DgeNCY=", "path": "github.com/prometheus/procfs/xfs", "revision": "e645f4e5aaa8506fc71d6edbc5c4ff02c04c46f2", "revisionTime": "2017-07-03T10:12:42Z" }, { "checksumSHA1": "5+eS1Ticg5wkpsdNoPiST3OQcIg=", "path": "github.com/sirupsen/logrus", "revision": "f006c2ac4710855cf0f916dd6b77acf6b048dc6e", "revisionTime": "2017-08-15T20:20:55Z", "version": "v1.0.3", "versionExact": "v1.0.3" }, { "checksumSHA1": "uozMgPjB4AggpuuJkGq3FgAs4CA=", "path": "github.com/soundcloud/go-runit/runit", "revision": "06ad41a06c4a586951fb8040a697ecd39729640b", "revisionTime": "2015-06-30T19:56:10Z" }, { "checksumSHA1": "nqWNlnMmVpt628zzvyo6Yv2CX5Q=", "path": "golang.org/x/crypto/ssh/terminal", "revision": "9419663f5a44be8b34ca85f08abc5fe1be11f8a3", "revisionTime": "2017-09-30T17:45:11Z" }, { "checksumSHA1": "uX2McdP4VcQ6zkAF0Q4oyd0rFtU=", "path": "golang.org/x/net/bpf", "revision": "a04bdaca5b32abe1c069418fb7088ae607de5bd0", "revisionTime": "2017-10-03T05:09:24Z" }, { "checksumSHA1": "5JWn/wMC+EWNDKI/AYE4JifQF54=", "path": "golang.org/x/net/internal/iana", "revision": "a04bdaca5b32abe1c069418fb7088ae607de5bd0", "revisionTime": "2017-10-03T05:09:24Z" }, { "checksumSHA1": "8vmmNy/fw4JJ8OjkC4wvzCrtjOk=", "path": "golang.org/x/net/internal/socket", "revision": "a04bdaca5b32abe1c069418fb7088ae607de5bd0", "revisionTime": "2017-10-03T05:09:24Z" }, { "checksumSHA1": "zPTKyZ1C55w1fk1W+/qGE15jaek=", "path": "golang.org/x/net/ipv4", "revision": "a04bdaca5b32abe1c069418fb7088ae607de5bd0", "revisionTime": "2017-10-03T05:09:24Z" }, { "checksumSHA1": "uggjqMBFNJd11oNco2kbkAT641w=", "path": "golang.org/x/sys/unix", "revision": "314a259e304ff91bd6985da2a7149bbf91237993", "revisionTime": "2017-07-19T03:44:26Z" }, { "checksumSHA1": "pBPFzDGt3AVSRffB7ffiUnruFUk=", "path": "golang.org/x/sys/windows", "revision": "314a259e304ff91bd6985da2a7149bbf91237993", "revisionTime": "2017-07-19T03:44:26Z" }, { "checksumSHA1": "ZdFZFaXmCgEEaEhVPkyXrnhKhsg=", "path": "golang.org/x/sys/windows/registry", "revision": "314a259e304ff91bd6985da2a7149bbf91237993", "revisionTime": "2017-07-19T03:44:26Z" }, { "checksumSHA1": "uVlUSSKplihZG7N+QJ6fzDZ4Kh8=", "path": "golang.org/x/sys/windows/svc/eventlog", "revision": "314a259e304ff91bd6985da2a7149bbf91237993", "revisionTime": "2017-07-19T03:44:26Z" }, { "checksumSHA1": "3SZTatHIy9OTKc95YlVfXKnoySg=", "path": "gopkg.in/alecthomas/kingpin.v2", "revision": "1087e65c9441605df944fb12c33f0fe7072d18ca", "revisionTime": "2017-07-27T04:22:29Z" } ], "rootPath": "github.com/prometheus/node_exporter" }