pax_global_header00006660000000000000000000000064135001665470014521gustar00rootroot0000000000000052 comment=d2847a40e24bc0f6b09a071933abedd5d2af8069 prometheus-node-exporter-0.18.1+ds/000077500000000000000000000000001350016654700171765ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/.circleci/000077500000000000000000000000001350016654700210315ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/.circleci/config.yml000066400000000000000000000110471350016654700230240ustar00rootroot00000000000000--- version: 2.1 executors: # Whenever the Go version is updated here, .promu.yml should # also be updated. golang: docker: - image: circleci/golang:1.12 jobs: test: executor: golang steps: - checkout - run: make promu - run: make - store_artifacts: path: node_exporter destination: /build/node_exporter - run: rm -v node_exporter codespell: docker: - image: circleci/python steps: - checkout - run: sudo pip install codespell - run: codespell --skip=".git,./vendor,ttar,go.mod,go.sum" -L uint,packages\',uptodate build: machine: image: ubuntu-1604:201903-01 environment: DOCKER_TEST_IMAGE_NAME: quay.io/prometheus/golang-builder:1.11-base REPO_PATH: github.com/prometheus/node_exporter steps: - checkout - run: docker run --privileged linuxkit/binfmt:v0.6 - run: make promu - run: promu crossbuild - run: promu --config .promu-cgo.yml crossbuild - persist_to_workspace: root: . paths: - .build - store_artifacts: path: .build destination: /build - run: command: | if [ -n "$CIRCLE_TAG" ]; then make docker DOCKER_IMAGE_TAG=$CIRCLE_TAG else make docker fi - run: docker images - run: docker run --rm -t -v "$(pwd):/app" "${DOCKER_TEST_IMAGE_NAME}" -i "${REPO_PATH}" -T - run: command: | if [ -n "$CIRCLE_TAG" ]; then make test-docker DOCKER_IMAGE_TAG=$CIRCLE_TAG else make test-docker fi docker_hub_master: executor: golang steps: - checkout - setup_remote_docker: version: 18.06.0-ce - run: docker run --privileged linuxkit/binfmt:v0.6 - attach_workspace: at: . - run: make docker - run: make docker DOCKER_REPO=quay.io/prometheus - run: docker images - run: docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD - run: docker login -u $QUAY_LOGIN -p $QUAY_PASSWORD quay.io - run: make docker-publish - run: make docker-publish DOCKER_REPO=quay.io/prometheus - run: make docker-manifest - run: make docker-manifest DOCKER_REPO=quay.io/prometheus docker_hub_release_tags: executor: golang steps: - checkout - setup_remote_docker: version: 18.06.0-ce - run: docker run --privileged linuxkit/binfmt:v0.6 - run: mkdir -v -p ${HOME}/bin - run: curl -L 'https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2' | tar xvjf - --strip-components 3 -C ${HOME}/bin - run: echo 'export PATH=${HOME}/bin:${PATH}' >> ${BASH_ENV} - attach_workspace: at: . - run: make promu - run: promu crossbuild tarballs - run: promu checksum .tarballs - run: promu release .tarballs - store_artifacts: path: .tarballs destination: releases - run: make docker DOCKER_IMAGE_TAG=$CIRCLE_TAG - run: make docker DOCKER_IMAGE_TAG=$CIRCLE_TAG DOCKER_REPO=quay.io/prometheus - run: docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD - run: docker login -u $QUAY_LOGIN -p $QUAY_PASSWORD quay.io - run: make docker-publish DOCKER_IMAGE_TAG="$CIRCLE_TAG" - run: make docker-publish DOCKER_IMAGE_TAG="$CIRCLE_TAG" DOCKER_REPO=quay.io/prometheus - run: make docker-manifest DOCKER_IMAGE_TAG="$CIRCLE_TAG" - run: make docker-manifest DOCKER_IMAGE_TAG="$CIRCLE_TAG" DOCKER_REPO=quay.io/prometheus - run: | if [[ "$CIRCLE_TAG" =~ ^v[0-9]+(\.[0-9]+){2}$ ]]; then make docker-tag-latest DOCKER_IMAGE_TAG="$CIRCLE_TAG" make docker-tag-latest DOCKER_IMAGE_TAG="$CIRCLE_TAG" DOCKER_REPO=quay.io/prometheus make docker-publish DOCKER_IMAGE_TAG="latest" make docker-publish DOCKER_IMAGE_TAG="latest" DOCKER_REPO=quay.io/prometheus make docker-manifest DOCKER_IMAGE_TAG="latest" make docker-manifest DOCKER_IMAGE_TAG="latest" DOCKER_REPO=quay.io/prometheus fi workflows: version: 2 node_exporter: jobs: - test: filters: tags: only: /.*/ - build: filters: tags: only: /.*/ - codespell: filters: tags: only: /.*/ - docker_hub_master: requires: - test - build filters: branches: only: master - docker_hub_release_tags: requires: - test - build filters: tags: only: /^v.*/ branches: ignore: /.*/ prometheus-node-exporter-0.18.1+ds/.dockerignore000066400000000000000000000001461350016654700216530ustar00rootroot00000000000000.build/ .tarballs/ !.build/linux-amd64 !.build/linux-armv7 !.build/linux-arm64 !.build/linux-ppc64le prometheus-node-exporter-0.18.1+ds/.github/000077500000000000000000000000001350016654700205365ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/.github/ISSUE_TEMPLATE.md000066400000000000000000000022671350016654700232520ustar00rootroot00000000000000 ### 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.18.1+ds/.gitignore000066400000000000000000000006261350016654700211720ustar00rootroot00000000000000# 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.18.1+ds/.golangci.yml000066400000000000000000000002701350016654700215610ustar00rootroot00000000000000run: modules-download-mode: vendor issues: exclude-rules: - path: _test.go linters: - errcheck linters-settings: errcheck: exclude: scripts/errcheck_excludes.txt prometheus-node-exporter-0.18.1+ds/.promu-cgo.yml000066400000000000000000000013371350016654700217130ustar00rootroot00000000000000go: cgo: true repository: path: github.com/prometheus/node_exporter build: binaries: - name: node_exporter flags: -mod=vendor -a -tags 'netgo static_build' ldflags: | -X github.com/prometheus/common/version.Version={{.Version}} -X github.com/prometheus/common/version.Revision={{.Revision}} -X github.com/prometheus/common/version.Branch={{.Branch}} -X github.com/prometheus/common/version.BuildUser={{user}}@{{host}} -X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}} tarball: files: - LICENSE - NOTICE crossbuild: platforms: - darwin/amd64 - darwin/386 - netbsd/amd64 - netbsd/386 prometheus-node-exporter-0.18.1+ds/.promu.yml000066400000000000000000000017571350016654700211530ustar00rootroot00000000000000go: # Whenever the Go version is updated here, .travis.yml and # .circle/config.yml should also be updated. version: 1.12 repository: path: github.com/prometheus/node_exporter build: binaries: - name: node_exporter flags: -mod=vendor -a -tags 'netgo static_build' ldflags: | -X github.com/prometheus/common/version.Version={{.Version}} -X github.com/prometheus/common/version.Revision={{.Revision}} -X github.com/prometheus/common/version.Branch={{.Branch}} -X github.com/prometheus/common/version.BuildUser={{user}}@{{host}} -X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}} tarball: files: - LICENSE - NOTICE crossbuild: platforms: - linux/amd64 - linux/386 - linux/arm - linux/arm64 - linux/mips - linux/mipsle - linux/mips64 - linux/mips64le - linux/ppc64 - linux/ppc64le - linux/s390x prometheus-node-exporter-0.18.1+ds/CHANGELOG.md000066400000000000000000000431231350016654700210120ustar00rootroot00000000000000## master / unreleased ### **Breaking changes** ### Changes * [CHANGE] * [FEATURE] * [ENHANCEMENT] ## 0.18.1 / 2019-06-04 ### Changes * [BUGFIX] Fix incorrect sysctl call in BSD meminfo collector, resulting in broken swap metrics on FreeBSD #1345 * [BUGFIX] Fix rollover bug in mountstats collector #1364 ## 0.18.0 / 2019-05-09 ### **Breaking changes** * Renamed `interface` label to `device` in netclass collector for consistency with other network metrics #1224 * The cpufreq metrics now separate the `cpufreq` and `scaling` data based on what the driver provides. #1248 * The labels for the network_up metric have changed, see issue #1236 * Bonding collector now uses `mii_status` instead of `operstatus` #1124 * Several systemd metrics have been turned off by default to improve performance #1254 These include unit_tasks_current, unit_tasks_max, service_restart_total, and unit_start_time_seconds * The systemd collector blacklist now includes automount, device, mount, and slice units by default. #1255 ### Changes * [CHANGE] Bonding state uses mii_status #1124 * [CHANGE] Add a limit to the number of in-flight requests #1166 * [CHANGE] Renamed `interface` label to `device` in netclass collector #1224 * [CHANGE] Add separate cpufreq and scaling metrics #1248 * [CHANGE] Several systemd metrics have been turned off by default to improve performance #1254 * [CHANGE] Expand systemd collector blacklist #1255 * [CHANGE] Split cpufreq metrics into a separate collector #1253 * [FEATURE] Add a flag to disable exporter metrics #1148 * [FEATURE] Add kstat-based Solaris metrics for boottime, cpu and zfs collectors #1197 * [FEATURE] Add uname collector for FreeBSD #1239 * [FEATURE] Add diskstats collector for OpenBSD #1250 * [FEATURE] Add pressure collector exposing pressure stall information for Linux #1174 * [FEATURE] Add perf exporter for Linux #1274 * [ENHANCEMENT] Add Infiniband counters #1120 * [ENHANCEMENT] Add TCPSynRetrans to netstat default filter #1143 * [ENHANCEMENT] Move network_up labels into new metric network_info #1236 * [ENHANCEMENT] Use 64-bit counters for Darwin netstat * [BUGFIX] Add fallback for missing /proc/1/mounts #1172 * [BUGFIX] Fix node_textfile_mtime_seconds to work properly on symlinks #1326 ## 0.17.0 / 2018-11-30 Build note: Linux builds can now be built without CGO. ### **Breaking changes** supvervisord collector reports `start_time_seconds` rather than `uptime` #952 The wifi collector is disabled by default due to suspected caching issues and goroutine leaks. * https://github.com/prometheus/node_exporter/issues/870 * https://github.com/prometheus/node_exporter/issues/1008 Darwin meminfo metrics have been renamed to match Prometheus conventions. #1060 ### Changes * [CHANGE] Filter out non-installed units when collecting all systemd units #1011 * [CHANGE] `service_restart_total` and `socket_refused_connections_total` will not be reported if you're running an older version of systemd * [CHANGE] Use /proc/mounts instead of statfs(2) for ro state #1002 * [CHANGE] collector/timex: remove cgo dependency #1079 * [CHANGE] filesystem: Ignore Docker netns mounts #1047 * [CHANGE] Ignore additional virtual filesystems #1104 * [FEATURE] Add netclass collector #851 * [FEATURE] Add processes collector #950 * [FEATURE] Collect start time for systemd units #952 * [FEATURE] Add socket unit stats to systemd collector #968 * [FEATURE] Collect NRestarts property for systemd service units #992 * [FEATURE] Collect NRefused property for systemd socket units (available as of systemd v239) #995 * [FEATURE] Allow removal of rootfs prefix for run in docker #1058 * [ENHANCEMENT] Support for octal characters in mountpoints #954 * [ENHANCEMENT] Update wifi stats to support multiple stations #980 * [ENHANCEMENT] Add transmit/receive bytes total for wifi stations #1150 * [ENHANCEMENT] Handle stuck NFS mounts #997 * [ENHANCEMENT] infiniband: Handle iWARP RDMA modules N/A #974 * [ENHANCEMENT] Update diskstats for linux kernel 4.19 #1109 * [ENHANCEMENT] Collect TasksCurrent, TasksMax per systemd unit #1098 * [BUGFIX] Fix FreeBSD CPU temp #965 * [BUGFIX] Fix goroutine leak in supervisord collector #978 * [BUGFIX] Fix mdadm collector issues #985 * [BUGFIX] Fix ntp collector thread safety #1014 * [BUGFIX] Systemd units will not be ignored if you're running older versions of systemd #1039 * [BUGFIX] Handle vanishing PIDs #1043 * [BUGFIX] Correctly cast Darwin memory info #1060 * [BUGFIX] Filter systemd units in Go for compatibility with older versions #1083 * [BUGFIX] Update cpu collector for OpenBSD 6.4 #1094 * [BUGFIX] Fix typo on HELP of `read_time_seconds_total` #1057 * [BUGFIX] collector/diskstats: don't fail if there are extra stats #1125 * [BUGFIX] collector/hwmon\_linux: handle temperature sensor file #1123 * [BUGFIX] collector/filesystem: add bounds check #1133 * [BUGFIX] Fix dragonfly's CPU counting frequency #1140 * [BUGFIX] Add fallback for missing /proc/1/mounts #1172 ## 0.16.0 / 2018-05-15 **Breaking changes** This release contains major breaking changes to metric names. Many metrics have new names, labels, and label values in order to conform to current naming conventions. * Linux node_cpu metrics now break out `guest` values into separate metrics. See Issue #737 * Many counter metrics have been renamed to include `_total`. * Many metrics have been renamed/modified to include base units, for example `node_cpu` is now `node_cpu_seconds_total`. In order to help with the transition we have an [upgrade guide](docs/V0_16_UPGRADE_GUIDE.md). Other breaking changes: * The megacli collector has been removed, is now replaced by the storcli.py textfile helper. * The gmond collector has been removed. * The textfile collector will now treat timestamps as errors. * [CHANGE] Split out guest cpu metrics on Linux. #744 * [CHANGE] Exclude Linux proc from filesystem type regexp #774 * [CHANGE] Ignore more virtual filesystems #775 * [CHANGE] Remove obsolete megacli collector. #798 * [CHANGE] Ignore /var/lib/docker by default. #814 * [CHANGE] Cleanup NFS metrics #834 * [CHANGE] Only report core throttles per core, not per cpu #836 * [CHANGE] Treat custom textfile metric timestamps as errors #769 * [CHANGE] Use lowercase cpu label name in interrupts #849 * [CHANGE] Enable bonding collector by default. #872 * [CHANGE] Greatly reduce the metrics vmstat returns by default. #874 * [CHANGE] Greatly trim what netstat collector exposes by default #876 * [CHANGE] Drop `exec_` prefix and move `node_boot_time_seconds` from `exec` to new `boottime` collector and enable for Darwin/Dragonfly/FreeBSD/NetBSD/OpenBSD. #839, #901 * [CHANGE] Remove depreated gmond collector #852 * [CHANGE] align Darwin disk stat names with Linux #930 * [FEATURE] Add `collect[]` parameter #699 * [FEATURE] Add text collector conversion for ipmitool output. #746 * [FEATURE] Add openbsd meminfo #724 * [FEATURE] Add systemd summary metrics #765 * [FEATURE] Add OpenBSD CPU collector #805 * [FEATURE] Add NFS Server metrics collector. #803 * [FEATURE] add sample directory size exporter #789 * [ENHANCEMENT] added Wear_Leveling_Count attribute to smartmon.sh script #707 * [ENHANCEMENT] Simplify Utsname string conversion #716 * [ENHANCEMENT] apt.sh: handle multiple origins in apt-get output #757 * [ENHANCEMENT] Export systemd timers last trigger seconds. #807 * [ENHANCEMENT] updates for zfsonlinux 0.7.5 #779 * [BUGFIX] Fix smartmon.sh textfile script #700 * [BUGFIX] netdev: Change valueType to CounterValue #749 * [BUGFIX] textfile: fix duplicate metrics error #738 * [BUGFIX] Fix panic by updating github.com/ema/qdisc dependency #778 * [BUGFIX] Use uint64 in the ZFS collector #714 * [BUGFIX] multiply page size after float64 coercion to avoid signed integer overflow #780 * [BUGFIX] smartmon: Escape double quotes in device model family #772 * [BUGFIX] Fix log level regression in #533 #815 * [BUGFIX] Correct the ClocksPerSec scaling factor on Darwin #846 * [BUGFIX] Count core throttles per core and per package #871 * [BUGFIX] Fix netdev collector for linux #890 #910 * [BUGFIX] Fix memory corruption when number of filesystems > 16 on FreeBSD #900 * [BUGFIX] Fix parsing of interface aliases in netdev linux #904 ## 0.15.2 / 2017-12-06 * [BUGFIX] cpu: Support processor-less (memory-only) NUMA nodes #734 ## 0.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 ## 0.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 ## 0.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 ## 0.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.18.1+ds/CONTRIBUTING.md000066400000000000000000000044661350016654700214410ustar00rootroot00000000000000# 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). * Sign your work to certify that your changes were created by yourself or you have the right to submit it under our license. Read https://developercertificate.org/ for all details and append your sign-off to every commit message like this: Signed-off-by: Random J Developer ## 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.18.1+ds/Dockerfile000066400000000000000000000005151350016654700211710ustar00rootroot00000000000000ARG ARCH="amd64" ARG OS="linux" FROM quay.io/prometheus/busybox-${OS}-${ARCH}:glibc LABEL maintainer="The Prometheus Authors " ARG ARCH="amd64" ARG OS="linux" COPY .build/${OS}-${ARCH}/node_exporter /bin/node_exporter EXPOSE 9100 USER nobody ENTRYPOINT [ "/bin/node_exporter" ] prometheus-node-exporter-0.18.1+ds/LICENSE000066400000000000000000000261351350016654700202120ustar00rootroot00000000000000 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.18.1+ds/MAINTAINERS.md000066400000000000000000000001501350016654700212660ustar00rootroot00000000000000* Ben Kochie @SuperQ * Johannes 'fish' Ziemke @discordianfish prometheus-node-exporter-0.18.1+ds/Makefile000066400000000000000000000077311350016654700206460ustar00rootroot00000000000000# 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. # Ensure that 'all' is the default target otherwise it will be the first target from Makefile.common. all:: # Needs to be defined before including Makefile.common to auto-generate targets DOCKER_ARCHS ?= amd64 armv7 arm64 ppc64le include Makefile.common PROMTOOL_VERSION ?= 2.5.0 PROMTOOL_URL ?= https://github.com/prometheus/prometheus/releases/download/v$(PROMTOOL_VERSION)/prometheus-$(PROMTOOL_VERSION).$(GO_BUILD_PLATFORM).tar.gz PROMTOOL ?= $(FIRST_GOPATH)/bin/promtool DOCKER_IMAGE_NAME ?= node-exporter MACH ?= $(shell uname -m) STATICCHECK_IGNORE = ifeq ($(GOHOSTOS), linux) test-e2e := test-e2e else test-e2e := skip-test-e2e endif # Use CGO for non-Linux builds. ifeq ($(GOOS), linux) PROMU_CONF ?= .promu.yml else ifndef GOOS ifeq ($(GOHOSTOS), linux) PROMU_CONF ?= .promu.yml else PROMU_CONF ?= .promu-cgo.yml endif else PROMU_CONF ?= .promu-cgo.yml endif endif PROMU := $(FIRST_GOPATH)/bin/promu --config $(PROMU_CONF) e2e-out = collector/fixtures/e2e-output.txt ifeq ($(MACH), ppc64le) e2e-out = collector/fixtures/e2e-64k-page-output.txt endif ifeq ($(MACH), aarch64) e2e-out = collector/fixtures/e2e-64k-page-output.txt 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 ($$(GOHOSTOS),linux) ifeq ($$(GOHOSTARCH),$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,mips64,mips)) $(eval $(call goarch_pair,mips64el,mipsel)) all:: vet checkmetrics checkrules common-all $(cross-test) $(test-e2e) .PHONY: test test: collector/fixtures/sys/.unpacked @echo ">> running tests" $(GO) test -short $(test-flags) $(pkgs) .PHONY: test-32bit test-32bit: collector/fixtures/sys/.unpacked @echo ">> running tests in 32-bit mode" @env GOARCH=$(GOARCH_CROSS) $(GO) test $(pkgs) .PHONY: skip-test-32bit skip-test-32bit: @echo ">> SKIP running tests in 32-bit mode: not supported on $(GOHOSTOS)/$(GOHOSTARCH)" collector/fixtures/sys/.unpacked: collector/fixtures/sys.ttar @echo ">> extracting sysfs fixtures" if [ -d collector/fixtures/sys ] ; then rm -r collector/fixtures/sys ; fi ./ttar -C collector/fixtures -x -f collector/fixtures/sys.ttar touch $@ .PHONY: test-e2e test-e2e: build collector/fixtures/sys/.unpacked @echo ">> running end-to-end tests" ./end-to-end-test.sh .PHONY: skip-test-e2e skip-test-e2e: @echo ">> SKIP running end-to-end tests on $(GOHOSTOS)" .PHONY: checkmetrics checkmetrics: $(PROMTOOL) @echo ">> checking metrics for correctness" ./checkmetrics.sh $(PROMTOOL) $(e2e-out) .PHONY: checkrules checkrules: $(PROMTOOL) @echo ">> checking rules for correctness" find . -name "*rules*.yml" | xargs -I {} $(PROMTOOL) check rules {} .PHONY: test-docker test-docker: @echo ">> testing docker image" ./test_image.sh "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-amd64:$(DOCKER_IMAGE_TAG)" 9100 .PHONY: promtool promtool: $(PROMTOOL) $(PROMTOOL): $(eval PROMTOOL_TMP := $(shell mktemp -d)) curl -s -L $(PROMTOOL_URL) | tar -xvzf - -C $(PROMTOOL_TMP) mkdir -p $(FIRST_GOPATH)/bin cp $(PROMTOOL_TMP)/prometheus-$(PROMTOOL_VERSION).$(GO_BUILD_PLATFORM)/promtool $(FIRST_GOPATH)/bin/promtool rm -r $(PROMTOOL_TMP) prometheus-node-exporter-0.18.1+ds/Makefile.common000066400000000000000000000214761350016654700221370ustar00rootroot00000000000000# Copyright 2018 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. # A common Makefile that includes rules to be reused in different prometheus projects. # !!! Open PRs only against the prometheus/prometheus/Makefile.common repository! # Example usage : # Create the main Makefile in the root project directory. # include Makefile.common # customTarget: # @echo ">> Running customTarget" # # Ensure GOBIN is not set during build so that promu is installed to the correct path unexport GOBIN GO ?= go GOFMT ?= $(GO)fmt FIRST_GOPATH := $(firstword $(subst :, ,$(shell $(GO) env GOPATH))) GOOPTS ?= GOHOSTOS ?= $(shell $(GO) env GOHOSTOS) GOHOSTARCH ?= $(shell $(GO) env GOHOSTARCH) GO_VERSION ?= $(shell $(GO) version) GO_VERSION_NUMBER ?= $(word 3, $(GO_VERSION)) PRE_GO_111 ?= $(shell echo $(GO_VERSION_NUMBER) | grep -E 'go1\.(10|[0-9])\.') GOVENDOR := GO111MODULE := ifeq (, $(PRE_GO_111)) ifneq (,$(wildcard go.mod)) # Enforce Go modules support just in case the directory is inside GOPATH (and for Travis CI). GO111MODULE := on ifneq (,$(wildcard vendor)) # Always use the local vendor/ directory to satisfy the dependencies. GOOPTS := $(GOOPTS) -mod=vendor endif endif else ifneq (,$(wildcard go.mod)) ifneq (,$(wildcard vendor)) $(warning This repository requires Go >= 1.11 because of Go modules) $(warning Some recipes may not work as expected as the current Go runtime is '$(GO_VERSION_NUMBER)') endif else # This repository isn't using Go modules (yet). GOVENDOR := $(FIRST_GOPATH)/bin/govendor endif endif PROMU := $(FIRST_GOPATH)/bin/promu pkgs = ./... ifeq (arm, $(GOHOSTARCH)) GOHOSTARM ?= $(shell GOARM= $(GO) env GOARM) GO_BUILD_PLATFORM ?= $(GOHOSTOS)-$(GOHOSTARCH)v$(GOHOSTARM) else GO_BUILD_PLATFORM ?= $(GOHOSTOS)-$(GOHOSTARCH) endif PROMU_VERSION ?= 0.3.0 PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz GOLANGCI_LINT := GOLANGCI_LINT_OPTS ?= GOLANGCI_LINT_VERSION ?= v1.16.0 # golangci-lint only supports linux, darwin and windows platforms on i386/amd64. # windows isn't included here because of the path separator being different. ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin)) ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386)) GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint endif endif PREFIX ?= $(shell pwd) BIN_DIR ?= $(shell pwd) DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD)) DOCKER_REPO ?= prom DOCKER_ARCHS ?= amd64 BUILD_DOCKER_ARCHS = $(addprefix common-docker-,$(DOCKER_ARCHS)) PUBLISH_DOCKER_ARCHS = $(addprefix common-docker-publish-,$(DOCKER_ARCHS)) TAG_DOCKER_ARCHS = $(addprefix common-docker-tag-latest-,$(DOCKER_ARCHS)) ifeq ($(GOHOSTARCH),amd64) ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux freebsd darwin windows)) # Only supported on amd64 test-flags := -race endif endif # This rule is used to forward a target like "build" to "common-build". This # allows a new "build" target to be defined in a Makefile which includes this # one and override "common-build" without override warnings. %: common-% ; .PHONY: common-all common-all: precheck style check_license lint unused build test .PHONY: common-style common-style: @echo ">> checking code style" @fmtRes=$$($(GOFMT) -d $$(find . -path ./vendor -prune -o -name '*.go' -print)); \ if [ -n "$${fmtRes}" ]; then \ echo "gofmt checking failed!"; echo "$${fmtRes}"; echo; \ echo "Please ensure you are using $$($(GO) version) for formatting code."; \ exit 1; \ fi .PHONY: common-check_license common-check_license: @echo ">> checking license header" @licRes=$$(for file in $$(find . -type f -iname '*.go' ! -path './vendor/*') ; do \ awk 'NR<=3' $$file | grep -Eq "(Copyright|generated|GENERATED)" || echo $$file; \ done); \ if [ -n "$${licRes}" ]; then \ echo "license header checking failed:"; echo "$${licRes}"; \ exit 1; \ fi .PHONY: common-deps common-deps: @echo ">> getting dependencies" ifdef GO111MODULE GO111MODULE=$(GO111MODULE) $(GO) mod download else $(GO) get $(GOOPTS) -t ./... endif .PHONY: common-test-short common-test-short: @echo ">> running short tests" GO111MODULE=$(GO111MODULE) $(GO) test -short $(GOOPTS) $(pkgs) .PHONY: common-test common-test: @echo ">> running all tests" GO111MODULE=$(GO111MODULE) $(GO) test $(test-flags) $(GOOPTS) $(pkgs) .PHONY: common-format common-format: @echo ">> formatting code" GO111MODULE=$(GO111MODULE) $(GO) fmt $(pkgs) .PHONY: common-vet common-vet: @echo ">> vetting code" GO111MODULE=$(GO111MODULE) $(GO) vet $(GOOPTS) $(pkgs) .PHONY: common-lint common-lint: $(GOLANGCI_LINT) ifdef GOLANGCI_LINT @echo ">> running golangci-lint" ifdef GO111MODULE # 'go list' needs to be executed before staticcheck to prepopulate the modules cache. # Otherwise staticcheck might fail randomly for some reason not yet explained. GO111MODULE=$(GO111MODULE) $(GO) list -e -compiled -test=true -export=false -deps=true -find=false -tags= -- ./... > /dev/null GO111MODULE=$(GO111MODULE) $(GOLANGCI_LINT) run $(GOLANGCI_LINT_OPTS) $(pkgs) else $(GOLANGCI_LINT) run $(pkgs) endif endif # For backward-compatibility. .PHONY: common-staticcheck common-staticcheck: lint .PHONY: common-unused common-unused: $(GOVENDOR) ifdef GOVENDOR @echo ">> running check for unused packages" @$(GOVENDOR) list +unused | grep . && exit 1 || echo 'No unused packages' else ifdef GO111MODULE @echo ">> running check for unused/missing packages in go.mod" GO111MODULE=$(GO111MODULE) $(GO) mod tidy ifeq (,$(wildcard vendor)) @git diff --exit-code -- go.sum go.mod else @echo ">> running check for unused packages in vendor/" GO111MODULE=$(GO111MODULE) $(GO) mod vendor @git diff --exit-code -- go.sum go.mod vendor/ endif endif endif .PHONY: common-build common-build: promu @echo ">> building binaries" GO111MODULE=$(GO111MODULE) $(PROMU) build --prefix $(PREFIX) .PHONY: common-tarball common-tarball: promu @echo ">> building release tarball" $(PROMU) tarball --prefix $(PREFIX) $(BIN_DIR) .PHONY: common-docker $(BUILD_DOCKER_ARCHS) common-docker: $(BUILD_DOCKER_ARCHS) $(BUILD_DOCKER_ARCHS): common-docker-%: docker build -t "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" \ --build-arg ARCH="$*" \ --build-arg OS="linux" \ . .PHONY: common-docker-publish $(PUBLISH_DOCKER_ARCHS) common-docker-publish: $(PUBLISH_DOCKER_ARCHS) $(PUBLISH_DOCKER_ARCHS): common-docker-publish-%: docker push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" .PHONY: common-docker-tag-latest $(TAG_DOCKER_ARCHS) common-docker-tag-latest: $(TAG_DOCKER_ARCHS) $(TAG_DOCKER_ARCHS): common-docker-tag-latest-%: docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:latest" .PHONY: common-docker-manifest common-docker-manifest: DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create -a "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" $(foreach ARCH,$(DOCKER_ARCHS),$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$(ARCH):$(DOCKER_IMAGE_TAG)) DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" .PHONY: promu promu: $(PROMU) $(PROMU): $(eval PROMU_TMP := $(shell mktemp -d)) curl -s -L $(PROMU_URL) | tar -xvzf - -C $(PROMU_TMP) mkdir -p $(FIRST_GOPATH)/bin cp $(PROMU_TMP)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM)/promu $(FIRST_GOPATH)/bin/promu rm -r $(PROMU_TMP) .PHONY: proto proto: @echo ">> generating code from proto files" @./scripts/genproto.sh ifdef GOLANGCI_LINT $(GOLANGCI_LINT): mkdir -p $(FIRST_GOPATH)/bin curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(FIRST_GOPATH)/bin $(GOLANGCI_LINT_VERSION) endif ifdef GOVENDOR .PHONY: $(GOVENDOR) $(GOVENDOR): GOOS= GOARCH= $(GO) get -u github.com/kardianos/govendor endif .PHONY: precheck precheck:: define PRECHECK_COMMAND_template = precheck:: $(1)_precheck PRECHECK_COMMAND_$(1) ?= $(1) $$(strip $$(PRECHECK_OPTIONS_$(1))) .PHONY: $(1)_precheck $(1)_precheck: @if ! $$(PRECHECK_COMMAND_$(1)) 1>/dev/null 2>&1; then \ echo "Execution of '$$(PRECHECK_COMMAND_$(1))' command failed. Is $(1) installed?"; \ exit 1; \ fi endef prometheus-node-exporter-0.18.1+ds/NOTICE000066400000000000000000000007171350016654700201070ustar00rootroot00000000000000Configurable 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.18.1+ds/README.md000066400000000000000000000241371350016654700204640ustar00rootroot00000000000000# Node exporter [![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. To expose NVIDIA GPU metrics, [prometheus-dcgm ](https://github.com/NVIDIA/gpu-monitoring-tools/tree/master/exporters/prometheus-dcgm) can be used. ## 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 bonding | Exposes the number of configured and active slaves of Linux bonding interfaces. | Linux boottime | Exposes system boot time derived from the `kern.boottime` sysctl. | Darwin, Dragonfly, FreeBSD, NetBSD, OpenBSD, Solaris conntrack | Shows conntrack statistics (does nothing if no `/proc/sys/net/netfilter/` present). | Linux cpu | Exposes CPU statistics | Darwin, Dragonfly, FreeBSD, Linux, Solaris cpufreq | Exposes CPU frequency statistics | Linux, Solaris diskstats | Exposes disk I/O statistics. | Darwin, Linux, OpenBSD 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, OpenBSD netclass | Exposes network interface info from `/sys/class/net/` | 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 nfs | Exposes NFS client statistics from `/proc/net/rpc/nfs`. This is the same information as `nfsstat -c`. | Linux nfsd | Exposes NFS kernel server statistics from `/proc/net/rpc/nfsd`. This is the same information as `nfsstat -s`. | Linux pressure | Exposes pressure stall statistics from `/proc/pressure/`. | Linux (kernel 4.20+ and/or [CONFIG\_PSI](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/accounting/psi.txt)) 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. | FreeBSD, Linux vmstat | Exposes statistics from `/proc/vmstat`. | Linux xfs | Exposes XFS runtime statistics. | Linux (kernel 4.4+) zfs | Exposes [ZFS](http://open-zfs.org/) performance statistics. | [Linux](http://zfsonlinux.org/), Solaris ### Disabled by default The perf collector may not work by default on all Linux systems due to kernel configuration and security settings. To allow access, set the following sysctl parameter: ``` sysctl -w kernel.perf_event_paranoid=X ``` - 2 allow only user-space measurements (default since Linux 4.6). - 1 allow both kernel and user measurements (default before Linux 4.6). - 0 allow access to CPU-specific data but not raw tracepoint samples. - -1 no restrictions. Depending on the configured value different metrics will be available, for most cases `0` will provide the most complete set. For more information see [`man 2 perf_event_open`](http://man7.org/linux/man-pages/man2/perf_event_open.2.html). Name | Description | OS ---------|-------------|---- 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 ntp | Exposes local NTP daemon health to check [time](./docs/TIME.md) | _any_ processes | Exposes aggregate process statistics from `/proc`. | Linux 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 wifi | Exposes WiFi device and station statistics. | Linux perf | Exposes perf based metrics (Warning: Metrics are dependent on kernel configuration and settings). | 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/). **Note:** Timestamps are not supported. 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 ``` ### Filtering enabled collectors The `node_exporter` will expose all metrics from enabled collectors by default. This is the recommended way to collect metrics to avoid errors when comparing metrics of different families. For advanced use the `node_exporter` can be passed an optional list of collectors to filter metrics. The `collect[]` parameter may be used multiple times. In Prometheus configuration you can use this syntax under the [scrape config](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#). ``` params: collect[]: - foo - bar ``` This can be useful for having different Prometheus servers collect specific metrics from nodes. ## Building and running Prerequisites: * [Go compiler](https://golang.org/dl/) * RHEL/CentOS: `glibc-static` package. Building: 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 a Docker container because it requires access to the host system. Be aware that any non-root mount points you want to monitor will need to be bind-mounted into the container. If you start container for host monitoring, specify `path.rootfs` argument. This argument must match path in bind-mount of host root. The node\_exporter will use `path.rootfs` as prefix to access host filesystem. ```bash docker run -d \ --net="host" \ --pid="host" \ -v "/:/host:ro,rslave" \ quay.io/prometheus/node-exporter \ --path.rootfs /host ``` On some systems, the `timex` collector requires an additional Docker flag, `--cap-add=SYS_TIME`, in order to access the required syscalls. ## Using a third-party repository for RHEL/CentOS/Fedora There is a [community-supplied COPR repository](https://copr.fedorainfracloud.org/coprs/ibotty/prometheus-exporters/) which 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.18.1+ds/VERSION000066400000000000000000000000071350016654700202430ustar00rootroot000000000000000.18.1 prometheus-node-exporter-0.18.1+ds/checkmetrics.sh000077500000000000000000000007541350016654700222070ustar00rootroot00000000000000#!/usr/bin/env bash if [[ ( -z "$1" ) || ( -z "$2" ) ]]; then echo "usage: ./checkmetrics.sh /usr/bin/promtool e2e-output.txt" exit 1 fi # Only check node_exporter's metrics, as the Prometheus Go client currently # exposes a metric with a unit of microseconds. Once that is fixed, remove # this filter. lint=$($1 check metrics < $2 2>&1 | grep "node_") if [[ ! -z $lint ]]; then echo -e "Some Prometheus metrics do not follow best practices:\n" echo "$lint" exit 1 fiprometheus-node-exporter-0.18.1+ds/collector/000077500000000000000000000000001350016654700211645ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/arp_linux.go000066400000000000000000000047511350016654700235230ustar00rootroot00000000000000// 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.18.1+ds/collector/bcache_linux.go000066400000000000000000000224171350016654700241450ustar00rootroot00000000000000// 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" ) func init() { registerCollector("bcache", defaultEnabled, NewBcacheCollector) } // A bcacheCollector is a Collector which gathers metrics from Linux bcache. type bcacheCollector struct { fs bcache.FS } // NewBcacheCollector returns a newly allocated bcacheCollector. // It exposes a number of Linux bcache statistics. func NewBcacheCollector() (Collector, error) { fs, err := bcache.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.Stats() 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, usable 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_total", 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.18.1+ds/collector/bonding_linux.go000066400000000000000000000061731350016654700243610ustar00rootroot00000000000000// 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/filepath" "strings" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" ) type bondingCollector struct { slaves, active typedDesc } func init() { registerCollector("bonding", defaultEnabled, 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(filepath.Join(root, "bonding_masters")) if err != nil { return nil, err } for _, master := range strings.Fields(string(masters)) { slaves, err := ioutil.ReadFile(filepath.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(filepath.Join(root, master, fmt.Sprintf("lower_%s", slave), "bonding_slave", "mii_status")) if os.IsNotExist(err) { // some older? kernels use slave_ prefix state, err = ioutil.ReadFile(filepath.Join(root, master, fmt.Sprintf("slave_%s", slave), "bonding_slave", "mii_status")) } 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.18.1+ds/collector/bonding_linux_test.go000066400000000000000000000021051350016654700254070ustar00rootroot00000000000000// 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.18.1+ds/collector/boot_time_bsd.go000066400000000000000000000031611350016654700243250ustar00rootroot00000000000000// Copyright 2018 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 openbsd netbsd darwin // +build !noboottime package collector import ( "github.com/prometheus/client_golang/prometheus" ) type bootTimeCollector struct{ boottime bsdSysctl } func init() { registerCollector("boottime", defaultEnabled, newBootTimeCollector) } // newBootTimeCollector returns a new Collector exposing system boot time on BSD systems. func newBootTimeCollector() (Collector, error) { return &bootTimeCollector{ boottime: bsdSysctl{ name: "boot_time_seconds", description: "Unix time of last boot, including microseconds.", mib: "kern.boottime", dataType: bsdSysctlTypeStructTimeval, }, }, nil } // Update pushes boot time onto ch func (c *bootTimeCollector) Update(ch chan<- prometheus.Metric) error { v, err := c.boottime.Value() if err != nil { return err } ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, "", c.boottime.name), c.boottime.description, nil, nil, ), prometheus.GaugeValue, v) return nil } prometheus-node-exporter-0.18.1+ds/collector/boot_time_solaris.go000066400000000000000000000032351350016654700252330ustar00rootroot00000000000000// Copyright 2018 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 solaris // +build !noboottime package collector import ( "github.com/prometheus/client_golang/prometheus" "github.com/siebenmann/go-kstat" ) type bootTimeCollector struct { boottime typedDesc } func init() { registerCollector("boottime", defaultEnabled, newBootTimeCollector) } func newBootTimeCollector() (Collector, error) { return &bootTimeCollector{ boottime: typedDesc{ prometheus.NewDesc( prometheus.BuildFQName(namespace, "", "boot_time_seconds"), "Unix time of last boot, including microseconds.", nil, nil, ), prometheus.GaugeValue}, }, nil } // newBootTimeCollector returns a new Collector exposing system boot time on Solaris systems. // Update pushes boot time onto ch func (c *bootTimeCollector) Update(ch chan<- prometheus.Metric) error { tok, err := kstat.Open() if err != nil { return err } defer tok.Close() ks, err := tok.Lookup("unix", 0, "system_misc") if err != nil { return err } v, err := ks.GetNamed("boot_time") if err != nil { return err } ch <- c.boottime.mustNewConstMetric(float64(v.UintVal)) return nil } prometheus-node-exporter-0.18.1+ds/collector/buddyinfo.go000066400000000000000000000040071350016654700234770ustar00rootroot00000000000000// 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 { fs procfs.FS 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, "blocks"), "Count of free blocks according to size.", []string{"node", "zone", "size"}, nil, ) fs, err := procfs.NewFS(*procPath) if err != nil { return nil, fmt.Errorf("failed to open procfs: %v", err) } return &buddyinfoCollector{fs, desc}, nil } // Update calls (*buddyinfoCollector).getBuddyInfo to get the platform specific // buddyinfo metrics. func (c *buddyinfoCollector) Update(ch chan<- prometheus.Metric) error { buddyInfo, err := c.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.18.1+ds/collector/collector.go000066400000000000000000000106061350016654700235040ustar00rootroot00000000000000// 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, ) ) 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(filters ...string) (*NodeCollector, error) { f := make(map[string]bool) for _, filter := range filters { enabled, exist := collectorState[filter] if !exist { return nil, fmt.Errorf("missing collector: %s", filter) } if !*enabled { return nil, fmt.Errorf("disabled collector: %s", filter) } f[filter] = true } collectors := make(map[string]Collector) for key, enabled := range collectorState { if *enabled { collector, err := factories[key]() if err != nil { return nil, err } if len(f) == 0 || f[key] { 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.18.1+ds/collector/conntrack_linux.go000066400000000000000000000036361350016654700247240ustar00rootroot00000000000000// 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.18.1+ds/collector/cpu_common.go000066400000000000000000000016521350016654700236560ustar00rootroot00000000000000// 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 ( "github.com/prometheus/client_golang/prometheus" ) const ( cpuCollectorSubsystem = "cpu" ) var ( nodeCPUSecondsDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "seconds_total"), "Seconds the cpus spent in each mode.", []string{"cpu", "mode"}, nil, ) ) prometheus-node-exporter-0.18.1+ds/collector/cpu_darwin.go000066400000000000000000000060321350016654700236470ustar00rootroot00000000000000// 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 #include #if TARGET_OS_MAC #include #endif #include #include */ import "C" // ClocksPerSec default value. from time.h const ClocksPerSec = float64(C.CLK_TCK) 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: nodeCPUSecondsDesc, }, 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, strconv.Itoa(i), k) } } return nil } prometheus-node-exporter-0.18.1+ds/collector/cpu_dragonfly.go000066400000000000000000000065041350016654700243540ustar00rootroot00000000000000// 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) { 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; } // 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: nodeCPUSecondsDesc, }, 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 in microseconds // // Look into sys/kern/kern_clock.c for details. var ( cpuTimesC *C.uint64_t cpuTimesLength C.size_t ) if C.getCPUTimes(&cpuTimesC, &cpuTimesLength) == -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(1000000) } 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("%d", i/fieldsCount) ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, value, cpux, cpuFields[i%fieldsCount]) } return nil } prometheus-node-exporter-0.18.1+ds/collector/cpu_dragonfly_test.go000066400000000000000000000017731350016654700254160ustar00rootroot00000000000000// 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.18.1+ds/collector/cpu_freebsd.go000066400000000000000000000106351350016654700240010ustar00rootroot00000000000000// 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{nodeCPUSecondsDesc, prometheus.CounterValue}, temp: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "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 } // Temp is a signed integer in deci-degrees Kelvin. // Cast uint32 to int32 and convert to float64 degrees Celsius. // // 2732 is used as the conversion constant for deci-degrees // Kelvin, in multiple places in the kernel that feed into this // sysctl, so we want to maintain consistency: // // sys/dev/amdtemp/amdtemp.c // #define AMDTEMP_ZERO_C_TO_K 2732 // // sys/dev/acpica/acpi_thermal.c // #define TZ_ZEROC 2732 // // sys/dev/coretemp/coretemp.c // #define TZ_ZEROC 2732 ch <- c.temp.mustNewConstMetric(float64(int32(temp)-2732)/10, lcpu) } return err } prometheus-node-exporter-0.18.1+ds/collector/cpu_linux.go000066400000000000000000000152141350016654700235240ustar00rootroot00000000000000// 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" "path/filepath" "strconv" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" "github.com/prometheus/procfs" ) type cpuCollector struct { fs procfs.FS cpu *prometheus.Desc cpuGuest *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) { fs, err := procfs.NewFS(*procPath) if err != nil { return nil, fmt.Errorf("failed to open procfs: %v", err) } return &cpuCollector{ fs: fs, cpu: nodeCPUSecondsDesc, cpuGuest: prometheus.NewDesc( prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "guest_seconds_total"), "Seconds the cpus spent in guests (VMs) for each mode.", []string{"cpu", "mode"}, nil, ), cpuCoreThrottle: prometheus.NewDesc( prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "core_throttles_total"), "Number of times this cpu core has been throttled.", []string{"package", "core"}, nil, ), cpuPackageThrottle: prometheus.NewDesc( prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "package_throttles_total"), "Number of times this cpu package has been throttled.", []string{"package"}, 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.updateThermalThrottle(ch); err != nil { return err } return nil } // updateThermalThrottle reads /sys/devices/system/cpu/cpu* and expose thermal throttle statistics. func (c *cpuCollector) updateThermalThrottle(ch chan<- prometheus.Metric) error { cpus, err := filepath.Glob(sysFilePath("devices/system/cpu/cpu[0-9]*")) if err != nil { return err } packageThrottles := make(map[uint64]uint64) packageCoreThrottles := make(map[uint64]map[uint64]uint64) // cpu loop for _, cpu := range cpus { // See // https://www.kernel.org/doc/Documentation/x86/topology.txt // https://www.kernel.org/doc/Documentation/cputopology.txt // https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-devices-system-cpu var err error var physicalPackageID, coreID uint64 // topology/physical_package_id if physicalPackageID, err = readUintFromFile(filepath.Join(cpu, "topology", "physical_package_id")); err != nil { log.Debugf("CPU %v is missing physical_package_id", cpu) continue } // topology/core_id if coreID, err = readUintFromFile(filepath.Join(cpu, "topology", "core_id")); err != nil { log.Debugf("CPU %v is missing core_id", cpu) continue } // metric node_cpu_core_throttles_total // // We process this metric before the package throttles as there // are cpu+kernel combinations that only present core throttles // but no package throttles. // Seen e.g. on an Intel Xeon E5472 system with RHEL 6.9 kernel. if _, present := packageCoreThrottles[physicalPackageID]; !present { packageCoreThrottles[physicalPackageID] = make(map[uint64]uint64) } if _, present := packageCoreThrottles[physicalPackageID][coreID]; !present { // Read thermal_throttle/core_throttle_count only once if coreThrottleCount, err := readUintFromFile(filepath.Join(cpu, "thermal_throttle", "core_throttle_count")); err == nil { packageCoreThrottles[physicalPackageID][coreID] = coreThrottleCount } else { log.Debugf("CPU %v is missing core_throttle_count", cpu) } } // metric node_cpu_package_throttles_total if _, present := packageThrottles[physicalPackageID]; !present { // Read thermal_throttle/package_throttle_count only once if packageThrottleCount, err := readUintFromFile(filepath.Join(cpu, "thermal_throttle", "package_throttle_count")); err == nil { packageThrottles[physicalPackageID] = packageThrottleCount } else { log.Debugf("CPU %v is missing package_throttle_count", cpu) } } } for physicalPackageID, packageThrottleCount := range packageThrottles { ch <- prometheus.MustNewConstMetric(c.cpuPackageThrottle, prometheus.CounterValue, float64(packageThrottleCount), strconv.FormatUint(physicalPackageID, 10)) } for physicalPackageID, coreMap := range packageCoreThrottles { for coreID, coreThrottleCount := range coreMap { ch <- prometheus.MustNewConstMetric(c.cpuCoreThrottle, prometheus.CounterValue, float64(coreThrottleCount), strconv.FormatUint(physicalPackageID, 10), strconv.FormatUint(coreID, 10)) } } return nil } // updateStat reads /proc/stat through procfs and exports cpu related metrics. func (c *cpuCollector) updateStat(ch chan<- prometheus.Metric) error { stats, err := c.fs.NewStat() if err != nil { return err } for cpuID, cpuStat := range stats.CPU { cpuNum := fmt.Sprintf("%d", cpuID) ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.User, cpuNum, "user") ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.Nice, cpuNum, "nice") ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.System, cpuNum, "system") ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.Idle, cpuNum, "idle") ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.Iowait, cpuNum, "iowait") ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.IRQ, cpuNum, "irq") ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.SoftIRQ, cpuNum, "softirq") ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.Steal, cpuNum, "steal") // Guest CPU is also accounted for in cpuStat.User and cpuStat.Nice, expose these as separate metrics. ch <- prometheus.MustNewConstMetric(c.cpuGuest, prometheus.CounterValue, cpuStat.Guest, cpuNum, "user") ch <- prometheus.MustNewConstMetric(c.cpuGuest, prometheus.CounterValue, cpuStat.GuestNice, cpuNum, "nice") } return nil } prometheus-node-exporter-0.18.1+ds/collector/cpu_openbsd.go000066400000000000000000000041421350016654700240150ustar00rootroot00000000000000// Copyright 2018 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 ( "strconv" "unsafe" "github.com/prometheus/client_golang/prometheus" "golang.org/x/sys/unix" ) /* #include #include */ import "C" type cpuCollector struct { cpu typedDesc } func init() { registerCollector("cpu", defaultEnabled, NewCPUCollector) } func NewCPUCollector() (Collector, error) { return &cpuCollector{ cpu: typedDesc{nodeCPUSecondsDesc, prometheus.CounterValue}, }, nil } func (c *cpuCollector) Update(ch chan<- prometheus.Metric) (err error) { clockb, err := unix.SysctlRaw("kern.clockrate") if err != nil { return err } clock := *(*C.struct_clockinfo)(unsafe.Pointer(&clockb[0])) hz := float64(clock.stathz) ncpus, err := unix.SysctlUint32("hw.ncpu") if err != nil { return err } var cpTime [][C.CPUSTATES]C.int64_t for i := 0; i < int(ncpus); i++ { cpb, err := unix.SysctlRaw("kern.cp_time2", i) if err != nil && err != unix.ENODEV { return err } if err != unix.ENODEV { cpTime = append(cpTime, *(*[C.CPUSTATES]C.int64_t)(unsafe.Pointer(&cpb[0]))) } } for cpu, time := range cpTime { lcpu := strconv.Itoa(cpu) ch <- c.cpu.mustNewConstMetric(float64(time[C.CP_USER])/hz, lcpu, "user") ch <- c.cpu.mustNewConstMetric(float64(time[C.CP_NICE])/hz, lcpu, "nice") ch <- c.cpu.mustNewConstMetric(float64(time[C.CP_SYS])/hz, lcpu, "system") ch <- c.cpu.mustNewConstMetric(float64(time[C.CP_INTR])/hz, lcpu, "interrupt") ch <- c.cpu.mustNewConstMetric(float64(time[C.CP_IDLE])/hz, lcpu, "idle") } return err } prometheus-node-exporter-0.18.1+ds/collector/cpu_solaris.go000066400000000000000000000033041350016654700240360ustar00rootroot00000000000000// Copyright 2018 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 solaris // +build !nocpu package collector import ( "strconv" "github.com/prometheus/client_golang/prometheus" kstat "github.com/siebenmann/go-kstat" ) // #include import "C" type cpuCollector struct { cpu typedDesc } func init() { registerCollector("cpu", defaultEnabled, NewCpuCollector) } func NewCpuCollector() (Collector, error) { return &cpuCollector{ cpu: typedDesc{nodeCPUSecondsDesc, prometheus.CounterValue}, }, nil } func (c *cpuCollector) Update(ch chan<- prometheus.Metric) error { ncpus := C.sysconf(C._SC_NPROCESSORS_ONLN) tok, err := kstat.Open() if err != nil { return err } defer tok.Close() for cpu := 0; cpu < int(ncpus); cpu++ { ksCPU, err := tok.Lookup("cpu", cpu, "sys") if err != nil { return err } for k, v := range map[string]string{ "idle": "cpu_ticks_idle", "kernel": "cpu_ticks_kernel", "user": "cpu_ticks_user", "wait": "cpu_ticks_wait", } { kstatValue, err := ksCPU.GetNamed(v) if err != nil { return err } ch <- c.cpu.mustNewConstMetric(float64(kstatValue.UintVal), strconv.Itoa(cpu), k) } } return nil } prometheus-node-exporter-0.18.1+ds/collector/cpufreq_linux.go000066400000000000000000000102471350016654700244030ustar00rootroot00000000000000// Copyright 2019 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" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/procfs/sysfs" ) type cpuFreqCollector struct { fs sysfs.FS cpuFreq *prometheus.Desc cpuFreqMin *prometheus.Desc cpuFreqMax *prometheus.Desc scalingFreq *prometheus.Desc scalingFreqMin *prometheus.Desc scalingFreqMax *prometheus.Desc } func init() { registerCollector("cpufreq", defaultEnabled, NewCPUFreqCollector) } // NewCPUFreqCollector returns a new Collector exposing kernel/system statistics. func NewCPUFreqCollector() (Collector, error) { fs, err := sysfs.NewFS(*sysPath) if err != nil { return nil, fmt.Errorf("failed to open sysfs: %v", err) } return &cpuFreqCollector{ fs: fs, 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, ), scalingFreq: prometheus.NewDesc( prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "scaling_frequency_hertz"), "Current scaled cpu thread frequency in hertz.", []string{"cpu"}, nil, ), scalingFreqMin: prometheus.NewDesc( prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "scaling_frequency_min_hrts"), "Minimum scaled cpu thread frequency in hertz.", []string{"cpu"}, nil, ), scalingFreqMax: prometheus.NewDesc( prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "scaling_frequency_max_hrts"), "Maximum scaled cpu thread frequency in hertz.", []string{"cpu"}, nil, ), }, nil } // Update implements Collector and exposes cpu related metrics from /proc/stat and /sys/.../cpu/. func (c *cpuFreqCollector) Update(ch chan<- prometheus.Metric) error { cpuFreqs, err := c.fs.NewSystemCpufreq() if err != nil { return err } // 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 for _, stats := range cpuFreqs { if stats.CpuinfoCurrentFrequency != nil { ch <- prometheus.MustNewConstMetric( c.cpuFreq, prometheus.GaugeValue, float64(*stats.CpuinfoCurrentFrequency)*1000.0, stats.Name, ) } if stats.CpuinfoMinimumFrequency != nil { ch <- prometheus.MustNewConstMetric( c.cpuFreqMin, prometheus.GaugeValue, float64(*stats.CpuinfoMinimumFrequency)*1000.0, stats.Name, ) } if stats.CpuinfoMaximumFrequency != nil { ch <- prometheus.MustNewConstMetric( c.cpuFreqMax, prometheus.GaugeValue, float64(*stats.CpuinfoMaximumFrequency)*1000.0, stats.Name, ) } if stats.ScalingCurrentFrequency != nil { ch <- prometheus.MustNewConstMetric( c.scalingFreq, prometheus.GaugeValue, float64(*stats.ScalingCurrentFrequency)*1000.0, stats.Name, ) } if stats.ScalingMinimumFrequency != nil { ch <- prometheus.MustNewConstMetric( c.scalingFreqMin, prometheus.GaugeValue, float64(*stats.ScalingMinimumFrequency)*1000.0, stats.Name, ) } if stats.ScalingMaximumFrequency != nil { ch <- prometheus.MustNewConstMetric( c.scalingFreqMax, prometheus.GaugeValue, float64(*stats.ScalingMaximumFrequency)*1000.0, stats.Name, ) } } return nil } prometheus-node-exporter-0.18.1+ds/collector/cpufreq_solaris.go000066400000000000000000000044231350016654700247170ustar00rootroot00000000000000// Copyright 2019 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 solaris // +build !nocpu package collector import ( "fmt" "strconv" "github.com/prometheus/client_golang/prometheus" kstat "github.com/siebenmann/go-kstat" ) // #include import "C" type cpuFreqCollector struct { cpuFreq *prometheus.Desc cpuFreqMax *prometheus.Desc } func init() { registerCollector("cpufreq", defaultEnabled, NewCpuFreqCollector) } func NewFreqCpuCollector() (Collector, error) { return &cpuFreqCollector{ cpuFreq: prometheus.NewDesc( prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "frequency_hertz"), "Current 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, ), }, nil } func (c *cpuCollector) Update(ch chan<- prometheus.Metric) error { ncpus := C.sysconf(C._SC_NPROCESSORS_ONLN) tok, err := kstat.Open() if err != nil { return err } defer tok.Close() for cpu := 0; cpu < int(ncpus); cpu++ { ksCPUInfo, err := tok.Lookup("cpu_info", cpu, fmt.Sprintf("cpu_info%d", cpu)) if err != nil { return err } cpuFreqV, err := ksCPUInfo.GetNamed("current_clock_Hz") if err != nil { return err } cpuFreqMaxV, err := ksCPUInfo.GetNamed("clock_MHz") if err != nil { return err } lcpu := strconv.Itoa(cpu) ch <- prometheus.MustNewConstMetric( c.cpuFreq, prometheus.GaugeValue, float64(cpuFreqV.UintVal), lcpu, ) // Multiply by 1e+6 to convert MHz to Hz. ch <- prometheus.MustNewConstMetric( c.cpuFreqMax, prometheus.GaugeValue, float64(cpuFreqMaxV.IntVal)*1e+6, lcpu, ) } return nil } prometheus-node-exporter-0.18.1+ds/collector/devstat_dragonfly.go000066400000000000000000000073161350016654700252410ustar00rootroot00000000000000// 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.18.1+ds/collector/devstat_freebsd.c000066400000000000000000000050621350016654700244770ustar00rootroot00000000000000// 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.18.1+ds/collector/devstat_freebsd.go000066400000000000000000000073661350016654700246730ustar00rootroot00000000000000// 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.18.1+ds/collector/devstat_freebsd.h000066400000000000000000000023231350016654700245010ustar00rootroot00000000000000// 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.18.1+ds/collector/diskstats_common.go000066400000000000000000000042241350016654700250760ustar00rootroot00000000000000// Copyright 2019 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 // +build openbsd linux darwin package collector import ( "github.com/prometheus/client_golang/prometheus" ) const ( diskSubsystem = "disk" ) var ( diskLabelNames = []string{"device"} readsCompletedDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "reads_completed_total"), "The total number of reads completed successfully.", diskLabelNames, nil, ) readBytesDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "read_bytes_total"), "The total number of bytes read successfully.", diskLabelNames, nil, ) writesCompletedDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "writes_completed_total"), "The total number of writes completed successfully.", diskLabelNames, nil, ) writtenBytesDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "written_bytes_total"), "The total number of bytes written successfully.", diskLabelNames, nil, ) ioTimeSecondsDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "io_time_seconds_total"), "Total seconds spent doing I/Os.", diskLabelNames, nil, ) readTimeSecondsDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "read_time_seconds_total"), "The total number of seconds spent by all reads.", diskLabelNames, nil, ) writeTimeSecondsDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "write_time_seconds_total"), "This is the total number of seconds spent by all writes.", diskLabelNames, nil, ) ) prometheus-node-exporter-0.18.1+ds/collector/diskstats_darwin.go000066400000000000000000000071451350016654700250770ustar00rootroot00000000000000// 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" ) 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: readsCompletedDesc, 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: readTimeSecondsDesc, valueType: prometheus.CounterValue, }, value: func(stat *iostat.DriveStats) float64 { return stat.TotalReadTime.Seconds() }, }, { typedDesc: typedDesc{ desc: writesCompletedDesc, 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: writeTimeSecondsDesc, valueType: prometheus.CounterValue, }, value: func(stat *iostat.DriveStats) float64 { return stat.TotalWriteTime.Seconds() }, }, { typedDesc: typedDesc{ desc: readBytesDesc, valueType: prometheus.CounterValue, }, value: func(stat *iostat.DriveStats) float64 { return float64(stat.BytesRead) }, }, { typedDesc: typedDesc{ desc: writtenBytesDesc, 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.18.1+ds/collector/diskstats_linux.go000066400000000000000000000135031350016654700247450ustar00rootroot00000000000000// 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 ( diskSectorSize = 512 diskstatsFilename = "diskstats" ) 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 typedFactorDesc struct { desc *prometheus.Desc valueType prometheus.ValueType factor float64 } func (d *typedFactorDesc) mustNewConstMetric(value float64, labels ...string) prometheus.Metric { if d.factor != 0 { value *= d.factor } return prometheus.MustNewConstMetric(d.desc, d.valueType, value, labels...) } type diskstatsCollector struct { ignoredDevicesPattern *regexp.Regexp descs []typedFactorDesc } func init() { registerCollector("diskstats", defaultEnabled, NewDiskstatsCollector) } // NewDiskstatsCollector returns a new Collector exposing disk device stats. // Docs from https://www.kernel.org/doc/Documentation/iostats.txt func NewDiskstatsCollector() (Collector, error) { var diskLabelNames = []string{"device"} return &diskstatsCollector{ ignoredDevicesPattern: regexp.MustCompile(*ignoredDevices), descs: []typedFactorDesc{ { desc: readsCompletedDesc, valueType: prometheus.CounterValue, }, { desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "reads_merged_total"), "The total number of reads merged.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, { desc: readBytesDesc, valueType: prometheus.CounterValue, factor: diskSectorSize, }, { desc: readTimeSecondsDesc, valueType: prometheus.CounterValue, factor: .001, }, { desc: writesCompletedDesc, valueType: prometheus.CounterValue, }, { desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "writes_merged_total"), "The number of writes merged.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, { desc: writtenBytesDesc, valueType: prometheus.CounterValue, factor: diskSectorSize, }, { desc: writeTimeSecondsDesc, valueType: prometheus.CounterValue, factor: .001, }, { desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "io_now"), "The number of I/Os currently in progress.", diskLabelNames, nil, ), valueType: prometheus.GaugeValue, }, { desc: ioTimeSecondsDesc, valueType: prometheus.CounterValue, factor: .001, }, { desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "io_time_weighted_seconds_total"), "The weighted # of seconds spent doing I/Os.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, factor: .001, }, { desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "discards_completed_total"), "The total number of discards completed successfully.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, { desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "discards_merged_total"), "The total number of discards merged.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, { desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "discarded_sectors_total"), "The total number of sectors discarded successfully.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, }, { desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "discard_time_seconds_total"), "This is the total number of seconds spent by all discards.", diskLabelNames, nil, ), valueType: prometheus.CounterValue, factor: .001, }, }, }, nil } func (c *diskstatsCollector) Update(ch chan<- prometheus.Metric) error { 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 } for i, value := range stats { // ignore unrecognized additional stats if i >= len(c.descs) { break } 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][]string, error) { file, err := os.Open(procFilePath(diskstatsFilename)) if err != nil { return nil, err } defer file.Close() return parseDiskStats(file) } func parseDiskStats(r io.Reader) (map[string][]string, error) { var ( diskStats = map[string][]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(diskstatsFilename), scanner.Text()) } dev := parts[2] diskStats[dev] = parts[3:] } return diskStats, scanner.Err() } prometheus-node-exporter-0.18.1+ds/collector/diskstats_linux_test.go000066400000000000000000000023221350016654700260010ustar00rootroot00000000000000// 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 := "11130", diskStats["sdb"][14]; want != got { t.Errorf("want diskstats sdb %s, got %s", want, got) } } prometheus-node-exporter-0.18.1+ds/collector/diskstats_openbsd.go000066400000000000000000000044521350016654700252430ustar00rootroot00000000000000// Copyright 2019 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 ( "unsafe" "github.com/prometheus/client_golang/prometheus" "golang.org/x/sys/unix" ) /* #include #include */ import "C" type diskstatsCollector struct { rxfer typedDesc rbytes typedDesc wxfer typedDesc wbytes typedDesc time typedDesc } func init() { registerCollector("diskstats", defaultEnabled, NewDiskstatsCollector) } // NewDiskstatsCollector returns a new Collector exposing disk device stats. func NewDiskstatsCollector() (Collector, error) { return &diskstatsCollector{ rxfer: typedDesc{readsCompletedDesc, prometheus.CounterValue}, rbytes: typedDesc{readBytesDesc, prometheus.CounterValue}, wxfer: typedDesc{writesCompletedDesc, prometheus.CounterValue}, wbytes: typedDesc{writtenBytesDesc, prometheus.CounterValue}, time: typedDesc{ioTimeSecondsDesc, prometheus.CounterValue}, }, nil } func (c *diskstatsCollector) Update(ch chan<- prometheus.Metric) (err error) { diskstatsb, err := unix.SysctlRaw("hw.diskstats") if err != nil { return err } ndisks := len(diskstatsb) / C.sizeof_struct_diskstats diskstats := *(*[]C.struct_diskstats)(unsafe.Pointer(&diskstatsb)) for i := 0; i < ndisks; i++ { diskname := C.GoString(&diskstats[i].ds_name[0]) ch <- c.rxfer.mustNewConstMetric(float64(diskstats[i].ds_rxfer), diskname) ch <- c.rbytes.mustNewConstMetric(float64(diskstats[i].ds_rbytes), diskname) ch <- c.wxfer.mustNewConstMetric(float64(diskstats[i].ds_wxfer), diskname) ch <- c.wbytes.mustNewConstMetric(float64(diskstats[i].ds_wbytes), diskname) time := float64(diskstats[i].ds_time.tv_sec) + float64(diskstats[i].ds_time.tv_usec)/1000000 ch <- c.time.mustNewConstMetric(time, diskname) } return nil } prometheus-node-exporter-0.18.1+ds/collector/drbd_linux.go000066400000000000000000000140621350016654700236500ustar00rootroot00000000000000// 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.18.1+ds/collector/edac_linux.go000066400000000000000000000115041350016654700236270ustar00rootroot00000000000000// 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/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(filepath.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(filepath.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(filepath.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(filepath.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(filepath.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(filepath.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.18.1+ds/collector/entropy_linux.go000066400000000000000000000027421350016654700244370ustar00rootroot00000000000000// 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.18.1+ds/collector/exec_bsd.go000066400000000000000000000055131350016654700232730ustar00rootroot00000000000000// 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 return &execCollector{ sysctls: []bsdSysctl{ { name: "exec_context_switches_total", description: "Context switches since system boot. Resets at architecture unsigned integer.", mib: "vm.stats.sys.v_swtch", }, { name: "exec_traps_total", description: "Traps since system boot. Resets at architecture unsigned integer.", mib: "vm.stats.sys.v_trap", }, { name: "exec_system_calls_total", description: "System calls since system boot. Resets at architecture unsigned integer.", mib: "vm.stats.sys.v_syscall", }, { name: "exec_device_interrupts_total", description: "Device interrupts since system boot. Resets at architecture unsigned integer.", mib: "vm.stats.sys.v_intr", }, { name: "exec_software_interrupts_total", description: "Software interrupts since system boot. Resets at architecture unsigned integer.", mib: "vm.stats.sys.v_soft", }, { name: "exec_forks_total", description: "Number of fork() calls since system boot. Resets at architecture unsigned integer.", mib: "vm.stats.vm.v_forks", }, }, }, 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( namespace+"_"+m.name, m.description, nil, nil, ), prometheus.CounterValue, v) } return nil } prometheus-node-exporter-0.18.1+ds/collector/filefd_linux.go000066400000000000000000000045411350016654700241670ustar00rootroot00000000000000// 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.18.1+ds/collector/filefd_linux_test.go000066400000000000000000000020031350016654700252150ustar00rootroot00000000000000// 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.18.1+ds/collector/filesystem_bsd.go000066400000000000000000000043731350016654700245360ustar00rootroot00000000000000// 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.18.1+ds/collector/filesystem_common.go000066400000000000000000000123731350016654700252550ustar00rootroot00000000000000// 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, options 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_bytes"), "Filesystem size in bytes.", filesystemLabelNames, nil, ) freeDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "free_bytes"), "Filesystem free space in bytes.", filesystemLabelNames, nil, ) availDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "avail_bytes"), "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.18.1+ds/collector/filesystem_freebsd.go000066400000000000000000000043251350016654700253750ustar00rootroot00000000000000// 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) { n, err := unix.Getfsstat(nil, noWait) if err != nil { return nil, err } buf := make([]unix.Statfs_t, n) _, err = unix.Getfsstat(buf, noWait) if err != nil { return nil, err } 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.18.1+ds/collector/filesystem_linux.go000066400000000000000000000121201350016654700251120ustar00rootroot00000000000000// 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" "fmt" "io" "os" "strings" "sync" "syscall" "time" "github.com/prometheus/common/log" ) const ( defIgnoredMountPoints = "^/(dev|proc|sys|var/lib/docker/.+)($|/)" defIgnoredFSTypes = "^(autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|mqueue|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$" mountTimeout = 30 * time.Second ) var stuckMounts = make(map[string]struct{}) var stuckMountsMtx = &sync.Mutex{} // 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 } stuckMountsMtx.Lock() if _, ok := stuckMounts[labels.mountPoint]; ok { stats = append(stats, filesystemStats{ labels: labels, deviceError: 1, }) log.Debugf("Mount point %q is in an unresponsive state", labels.mountPoint) stuckMountsMtx.Unlock() continue } stuckMountsMtx.Unlock() // The success channel is used do tell the "watcher" that the stat // finished successfully. The channel is closed on success. success := make(chan struct{}) go stuckMountWatcher(labels.mountPoint, success) buf := new(syscall.Statfs_t) err = syscall.Statfs(rootfsFilePath(labels.mountPoint), buf) stuckMountsMtx.Lock() close(success) // If the mount has been marked as stuck, unmark it and log it's recovery. if _, ok := stuckMounts[labels.mountPoint]; ok { log.Debugf("Mount point %q has recovered, monitoring will resume", labels.mountPoint) delete(stuckMounts, labels.mountPoint) } stuckMountsMtx.Unlock() if err != nil { stats = append(stats, filesystemStats{ labels: labels, deviceError: 1, }) log.Debugf("Error on statfs() system call for %q: %s", rootfsFilePath(labels.mountPoint), err) continue } var ro float64 for _, option := range strings.Split(labels.options, ",") { if option == "ro" { ro = 1 break } } 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 } // stuckMountWatcher listens on the given success channel and if the channel closes // then the watcher does nothing. If instead the timeout is reached, the // mount point that is being watched is marked as stuck. func stuckMountWatcher(mountPoint string, success chan struct{}) { select { case <-success: // Success case <-time.After(mountTimeout): // Timed out, mark mount as stuck stuckMountsMtx.Lock() select { case <-success: // Success came in just after the timeout was reached, don't label the mount as stuck default: log.Debugf("Mount point %q timed out, it is being labeled as stuck and will not be monitored", mountPoint) stuckMounts[mountPoint] = struct{}{} } stuckMountsMtx.Unlock() } } func mountPointDetails() ([]filesystemLabels, error) { file, err := os.Open(procFilePath("1/mounts")) if os.IsNotExist(err) { // Fallback to `/proc/mounts` if `/proc/1/mounts` is missing due hidepid. log.Debugf("Got %q reading root mounts, falling back to system mounts", err) file, err = os.Open(procFilePath("mounts")) } if err != nil { return nil, err } defer file.Close() return parseFilesystemLabels(file) } func parseFilesystemLabels(r io.Reader) ([]filesystemLabels, error) { var filesystems []filesystemLabels scanner := bufio.NewScanner(r) for scanner.Scan() { parts := strings.Fields(scanner.Text()) if len(parts) < 4 { return nil, fmt.Errorf("malformed mount point information: %q", scanner.Text()) } // Ensure we handle the translation of \040 and \011 // as per fstab(5). parts[1] = strings.Replace(parts[1], "\\040", " ", -1) parts[1] = strings.Replace(parts[1], "\\011", "\t", -1) filesystems = append(filesystems, filesystemLabels{ device: parts[0], mountPoint: parts[1], fsType: parts[2], options: parts[3], }) } return filesystems, scanner.Err() } prometheus-node-exporter-0.18.1+ds/collector/filesystem_linux_test.go000066400000000000000000000065771350016654700261740ustar00rootroot00000000000000// 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 ( "strings" "testing" kingpin "gopkg.in/alecthomas/kingpin.v2" ) func Test_parseFilesystemLabelsError(t *testing.T) { tests := []struct { name string in string }{ { name: "too few fields", in: "hello world", }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { if _, err := parseFilesystemLabels(strings.NewReader(tt.in)); err == nil { t.Fatal("expected an error, but none occurred") } }) } } func TestMountPointDetails(t *testing.T) { if _, err := kingpin.CommandLine.Parse([]string{"--path.procfs", "./fixtures/proc"}); err != nil { t.Fatal(err) } expected := map[string]string{ "/": "", "/sys": "", "/proc": "", "/dev": "", "/dev/pts": "", "/run": "", "/sys/kernel/security": "", "/dev/shm": "", "/run/lock": "", "/sys/fs/cgroup": "", "/sys/fs/cgroup/systemd": "", "/sys/fs/pstore": "", "/sys/fs/cgroup/cpuset": "", "/sys/fs/cgroup/cpu,cpuacct": "", "/sys/fs/cgroup/devices": "", "/sys/fs/cgroup/freezer": "", "/sys/fs/cgroup/net_cls,net_prio": "", "/sys/fs/cgroup/blkio": "", "/sys/fs/cgroup/perf_event": "", "/proc/sys/fs/binfmt_misc": "", "/dev/mqueue": "", "/sys/kernel/debug": "", "/dev/hugepages": "", "/sys/fs/fuse/connections": "", "/boot": "", "/run/rpc_pipefs": "", "/run/user/1000": "", "/run/user/1000/gvfs": "", "/var/lib/kubelet/plugins/kubernetes.io/vsphere-volume/mounts/[vsanDatastore] bafb9e5a-8856-7e6c-699c-801844e77a4a/kubernetes-dynamic-pvc-3eba5bba-48a3-11e8-89ab-005056b92113.vmdk": "", "/var/lib/kubelet/plugins/kubernetes.io/vsphere-volume/mounts/[vsanDatastore] bafb9e5a-8856-7e6c-699c-801844e77a4a/kubernetes-dynamic-pvc-3eba5bba-48a3-11e8-89ab-005056b92113.vmdk": "", } filesystems, err := mountPointDetails() if err != nil { t.Log(err) } for _, fs := range filesystems { if _, ok := expected[fs.mountPoint]; !ok { t.Errorf("Got unexpected %s", fs.mountPoint) } } } func TestMountsFallback(t *testing.T) { if _, err := kingpin.CommandLine.Parse([]string{"--path.procfs", "./fixtures_hidepid/proc"}); err != nil { t.Fatal(err) } expected := map[string]string{ "/": "", } filesystems, err := mountPointDetails() if err != nil { t.Log(err) } for _, fs := range filesystems { if _, ok := expected[fs.mountPoint]; !ok { t.Errorf("Got unexpected %s", fs.mountPoint) } } } prometheus-node-exporter-0.18.1+ds/collector/fixtures/000077500000000000000000000000001350016654700230355ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/e2e-64k-page-output.txt000066400000000000000000006354141350016654700271400ustar00rootroot00000000000000# 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 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, usable 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_total 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_total counter node_bcache_cache_read_races_total{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_seconds Node boot time, in unixtime. # TYPE node_boot_time_seconds gauge node_boot_time_seconds 1.418183276e+09 # HELP node_buddyinfo_blocks Count of free blocks according to size. # TYPE node_buddyinfo_blocks gauge node_buddyinfo_blocks{node="0",size="0",zone="DMA"} 1 node_buddyinfo_blocks{node="0",size="0",zone="DMA32"} 759 node_buddyinfo_blocks{node="0",size="0",zone="Normal"} 4381 node_buddyinfo_blocks{node="0",size="1",zone="DMA"} 0 node_buddyinfo_blocks{node="0",size="1",zone="DMA32"} 572 node_buddyinfo_blocks{node="0",size="1",zone="Normal"} 1093 node_buddyinfo_blocks{node="0",size="10",zone="DMA"} 3 node_buddyinfo_blocks{node="0",size="10",zone="DMA32"} 0 node_buddyinfo_blocks{node="0",size="10",zone="Normal"} 0 node_buddyinfo_blocks{node="0",size="2",zone="DMA"} 1 node_buddyinfo_blocks{node="0",size="2",zone="DMA32"} 791 node_buddyinfo_blocks{node="0",size="2",zone="Normal"} 185 node_buddyinfo_blocks{node="0",size="3",zone="DMA"} 0 node_buddyinfo_blocks{node="0",size="3",zone="DMA32"} 475 node_buddyinfo_blocks{node="0",size="3",zone="Normal"} 1530 node_buddyinfo_blocks{node="0",size="4",zone="DMA"} 2 node_buddyinfo_blocks{node="0",size="4",zone="DMA32"} 194 node_buddyinfo_blocks{node="0",size="4",zone="Normal"} 567 node_buddyinfo_blocks{node="0",size="5",zone="DMA"} 1 node_buddyinfo_blocks{node="0",size="5",zone="DMA32"} 45 node_buddyinfo_blocks{node="0",size="5",zone="Normal"} 102 node_buddyinfo_blocks{node="0",size="6",zone="DMA"} 1 node_buddyinfo_blocks{node="0",size="6",zone="DMA32"} 12 node_buddyinfo_blocks{node="0",size="6",zone="Normal"} 4 node_buddyinfo_blocks{node="0",size="7",zone="DMA"} 0 node_buddyinfo_blocks{node="0",size="7",zone="DMA32"} 0 node_buddyinfo_blocks{node="0",size="7",zone="Normal"} 0 node_buddyinfo_blocks{node="0",size="8",zone="DMA"} 1 node_buddyinfo_blocks{node="0",size="8",zone="DMA32"} 0 node_buddyinfo_blocks{node="0",size="8",zone="Normal"} 0 node_buddyinfo_blocks{node="0",size="9",zone="DMA"} 1 node_buddyinfo_blocks{node="0",size="9",zone="DMA32"} 0 node_buddyinfo_blocks{node="0",size="9",zone="Normal"} 0 # HELP node_context_switches_total Total number of context switches. # TYPE node_context_switches_total counter node_context_switches_total 3.8014093e+07 # 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{core="0",package="0"} 5 node_cpu_core_throttles_total{core="0",package="1"} 0 node_cpu_core_throttles_total{core="1",package="0"} 0 node_cpu_core_throttles_total{core="1",package="1"} 9 # HELP node_cpu_guest_seconds_total Seconds the cpus spent in guests (VMs) for each mode. # TYPE node_cpu_guest_seconds_total counter node_cpu_guest_seconds_total{cpu="0",mode="nice"} 0.01 node_cpu_guest_seconds_total{cpu="0",mode="user"} 0.02 node_cpu_guest_seconds_total{cpu="1",mode="nice"} 0.02 node_cpu_guest_seconds_total{cpu="1",mode="user"} 0.03 node_cpu_guest_seconds_total{cpu="2",mode="nice"} 0.03 node_cpu_guest_seconds_total{cpu="2",mode="user"} 0.04 node_cpu_guest_seconds_total{cpu="3",mode="nice"} 0.04 node_cpu_guest_seconds_total{cpu="3",mode="user"} 0.05 node_cpu_guest_seconds_total{cpu="4",mode="nice"} 0.05 node_cpu_guest_seconds_total{cpu="4",mode="user"} 0.06 node_cpu_guest_seconds_total{cpu="5",mode="nice"} 0.06 node_cpu_guest_seconds_total{cpu="5",mode="user"} 0.07 node_cpu_guest_seconds_total{cpu="6",mode="nice"} 0.07 node_cpu_guest_seconds_total{cpu="6",mode="user"} 0.08 node_cpu_guest_seconds_total{cpu="7",mode="nice"} 0.08 node_cpu_guest_seconds_total{cpu="7",mode="user"} 0.09 # 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{package="0"} 30 node_cpu_package_throttles_total{package="1"} 6 # HELP node_cpu_scaling_frequency_hertz Current scaled cpu thread frequency in hertz. # TYPE node_cpu_scaling_frequency_hertz gauge node_cpu_scaling_frequency_hertz{cpu="0"} 1.699981e+09 node_cpu_scaling_frequency_hertz{cpu="1"} 1.699981e+09 node_cpu_scaling_frequency_hertz{cpu="2"} 8e+06 node_cpu_scaling_frequency_hertz{cpu="3"} 8e+06 # HELP node_cpu_scaling_frequency_max_hrts Maximum scaled cpu thread frequency in hertz. # TYPE node_cpu_scaling_frequency_max_hrts gauge node_cpu_scaling_frequency_max_hrts{cpu="0"} 3.7e+09 node_cpu_scaling_frequency_max_hrts{cpu="1"} 3.7e+09 node_cpu_scaling_frequency_max_hrts{cpu="2"} 4.2e+09 node_cpu_scaling_frequency_max_hrts{cpu="3"} 4.2e+09 # HELP node_cpu_scaling_frequency_min_hrts Minimum scaled cpu thread frequency in hertz. # TYPE node_cpu_scaling_frequency_min_hrts gauge node_cpu_scaling_frequency_min_hrts{cpu="0"} 8e+08 node_cpu_scaling_frequency_min_hrts{cpu="1"} 8e+08 node_cpu_scaling_frequency_min_hrts{cpu="2"} 1e+06 node_cpu_scaling_frequency_min_hrts{cpu="3"} 1e+06 # HELP node_cpu_seconds_total Seconds the cpus spent in each mode. # TYPE node_cpu_seconds_total counter node_cpu_seconds_total{cpu="0",mode="idle"} 10870.69 node_cpu_seconds_total{cpu="0",mode="iowait"} 2.2 node_cpu_seconds_total{cpu="0",mode="irq"} 0.01 node_cpu_seconds_total{cpu="0",mode="nice"} 0.19 node_cpu_seconds_total{cpu="0",mode="softirq"} 34.1 node_cpu_seconds_total{cpu="0",mode="steal"} 0 node_cpu_seconds_total{cpu="0",mode="system"} 210.45 node_cpu_seconds_total{cpu="0",mode="user"} 444.9 node_cpu_seconds_total{cpu="1",mode="idle"} 11107.87 node_cpu_seconds_total{cpu="1",mode="iowait"} 5.91 node_cpu_seconds_total{cpu="1",mode="irq"} 0 node_cpu_seconds_total{cpu="1",mode="nice"} 0.23 node_cpu_seconds_total{cpu="1",mode="softirq"} 0.46 node_cpu_seconds_total{cpu="1",mode="steal"} 0 node_cpu_seconds_total{cpu="1",mode="system"} 164.74 node_cpu_seconds_total{cpu="1",mode="user"} 478.69 node_cpu_seconds_total{cpu="2",mode="idle"} 11123.21 node_cpu_seconds_total{cpu="2",mode="iowait"} 4.41 node_cpu_seconds_total{cpu="2",mode="irq"} 0 node_cpu_seconds_total{cpu="2",mode="nice"} 0.36 node_cpu_seconds_total{cpu="2",mode="softirq"} 3.26 node_cpu_seconds_total{cpu="2",mode="steal"} 0 node_cpu_seconds_total{cpu="2",mode="system"} 159.16 node_cpu_seconds_total{cpu="2",mode="user"} 465.04 node_cpu_seconds_total{cpu="3",mode="idle"} 11132.3 node_cpu_seconds_total{cpu="3",mode="iowait"} 5.33 node_cpu_seconds_total{cpu="3",mode="irq"} 0 node_cpu_seconds_total{cpu="3",mode="nice"} 1.02 node_cpu_seconds_total{cpu="3",mode="softirq"} 0.6 node_cpu_seconds_total{cpu="3",mode="steal"} 0 node_cpu_seconds_total{cpu="3",mode="system"} 156.83 node_cpu_seconds_total{cpu="3",mode="user"} 470.54 node_cpu_seconds_total{cpu="4",mode="idle"} 11403.21 node_cpu_seconds_total{cpu="4",mode="iowait"} 2.17 node_cpu_seconds_total{cpu="4",mode="irq"} 0 node_cpu_seconds_total{cpu="4",mode="nice"} 0.25 node_cpu_seconds_total{cpu="4",mode="softirq"} 0.08 node_cpu_seconds_total{cpu="4",mode="steal"} 0 node_cpu_seconds_total{cpu="4",mode="system"} 107.76 node_cpu_seconds_total{cpu="4",mode="user"} 284.13 node_cpu_seconds_total{cpu="5",mode="idle"} 11362.7 node_cpu_seconds_total{cpu="5",mode="iowait"} 6.72 node_cpu_seconds_total{cpu="5",mode="irq"} 0 node_cpu_seconds_total{cpu="5",mode="nice"} 1.01 node_cpu_seconds_total{cpu="5",mode="softirq"} 0.3 node_cpu_seconds_total{cpu="5",mode="steal"} 0 node_cpu_seconds_total{cpu="5",mode="system"} 115.86 node_cpu_seconds_total{cpu="5",mode="user"} 292.71 node_cpu_seconds_total{cpu="6",mode="idle"} 11397.21 node_cpu_seconds_total{cpu="6",mode="iowait"} 3.19 node_cpu_seconds_total{cpu="6",mode="irq"} 0 node_cpu_seconds_total{cpu="6",mode="nice"} 0.36 node_cpu_seconds_total{cpu="6",mode="softirq"} 0.29 node_cpu_seconds_total{cpu="6",mode="steal"} 0 node_cpu_seconds_total{cpu="6",mode="system"} 102.76 node_cpu_seconds_total{cpu="6",mode="user"} 291.52 node_cpu_seconds_total{cpu="7",mode="idle"} 11392.82 node_cpu_seconds_total{cpu="7",mode="iowait"} 5.55 node_cpu_seconds_total{cpu="7",mode="irq"} 0 node_cpu_seconds_total{cpu="7",mode="nice"} 2.68 node_cpu_seconds_total{cpu="7",mode="softirq"} 0.31 node_cpu_seconds_total{cpu="7",mode="steal"} 0 node_cpu_seconds_total{cpu="7",mode="system"} 101.64 node_cpu_seconds_total{cpu="7",mode="user"} 290.98 # HELP node_disk_discard_time_seconds_total This is the total number of seconds spent by all discards. # TYPE node_disk_discard_time_seconds_total counter node_disk_discard_time_seconds_total{device="sdb"} 11.13 # HELP node_disk_discarded_sectors_total The total number of sectors discarded successfully. # TYPE node_disk_discarded_sectors_total counter node_disk_discarded_sectors_total{device="sdb"} 1.925173784e+09 # HELP node_disk_discards_completed_total The total number of discards completed successfully. # TYPE node_disk_discards_completed_total counter node_disk_discards_completed_total{device="sdb"} 68851 # HELP node_disk_discards_merged_total The total number of discards merged. # TYPE node_disk_discards_merged_total counter node_disk_discards_merged_total{device="sdb"} 0 # 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="sdb"} 0 node_disk_io_now{device="sr0"} 0 node_disk_io_now{device="vda"} 0 # HELP node_disk_io_time_seconds_total Total seconds spent doing I/Os. # TYPE node_disk_io_time_seconds_total counter node_disk_io_time_seconds_total{device="dm-0"} 11325.968 node_disk_io_time_seconds_total{device="dm-1"} 0.076 node_disk_io_time_seconds_total{device="dm-2"} 65.4 node_disk_io_time_seconds_total{device="dm-3"} 0.016 node_disk_io_time_seconds_total{device="dm-4"} 0.024 node_disk_io_time_seconds_total{device="dm-5"} 58.848 node_disk_io_time_seconds_total{device="mmcblk0"} 0.136 node_disk_io_time_seconds_total{device="mmcblk0p1"} 0.024 node_disk_io_time_seconds_total{device="mmcblk0p2"} 0.068 node_disk_io_time_seconds_total{device="nvme0n1"} 222.766 node_disk_io_time_seconds_total{device="sda"} 9653.880000000001 node_disk_io_time_seconds_total{device="sdb"} 60.730000000000004 node_disk_io_time_seconds_total{device="sr0"} 0 node_disk_io_time_seconds_total{device="vda"} 41614.592000000004 # HELP node_disk_io_time_weighted_seconds_total The weighted # of seconds spent doing I/Os. # TYPE node_disk_io_time_weighted_seconds_total counter node_disk_io_time_weighted_seconds_total{device="dm-0"} 1.206301256e+06 node_disk_io_time_weighted_seconds_total{device="dm-1"} 0.084 node_disk_io_time_weighted_seconds_total{device="dm-2"} 129.416 node_disk_io_time_weighted_seconds_total{device="dm-3"} 0.10400000000000001 node_disk_io_time_weighted_seconds_total{device="dm-4"} 0.044 node_disk_io_time_weighted_seconds_total{device="dm-5"} 105.632 node_disk_io_time_weighted_seconds_total{device="mmcblk0"} 0.156 node_disk_io_time_weighted_seconds_total{device="mmcblk0p1"} 0.024 node_disk_io_time_weighted_seconds_total{device="mmcblk0p2"} 0.068 node_disk_io_time_weighted_seconds_total{device="nvme0n1"} 1032.546 node_disk_io_time_weighted_seconds_total{device="sda"} 82621.804 node_disk_io_time_weighted_seconds_total{device="sdb"} 67.07000000000001 node_disk_io_time_weighted_seconds_total{device="sr0"} 0 node_disk_io_time_weighted_seconds_total{device="vda"} 2.0778722280000001e+06 # HELP node_disk_read_bytes_total The total number of bytes read successfully. # TYPE node_disk_read_bytes_total counter node_disk_read_bytes_total{device="dm-0"} 5.13708655616e+11 node_disk_read_bytes_total{device="dm-1"} 1.589248e+06 node_disk_read_bytes_total{device="dm-2"} 1.578752e+08 node_disk_read_bytes_total{device="dm-3"} 1.98144e+06 node_disk_read_bytes_total{device="dm-4"} 529408 node_disk_read_bytes_total{device="dm-5"} 4.3150848e+07 node_disk_read_bytes_total{device="mmcblk0"} 798720 node_disk_read_bytes_total{device="mmcblk0p1"} 81920 node_disk_read_bytes_total{device="mmcblk0p2"} 389120 node_disk_read_bytes_total{device="nvme0n1"} 2.377714176e+09 node_disk_read_bytes_total{device="sda"} 5.13713216512e+11 node_disk_read_bytes_total{device="sdb"} 4.944782848e+09 node_disk_read_bytes_total{device="sr0"} 0 node_disk_read_bytes_total{device="vda"} 1.6727491584e+10 # HELP node_disk_read_time_seconds_total The total number of seconds spent by all reads. # TYPE node_disk_read_time_seconds_total counter node_disk_read_time_seconds_total{device="dm-0"} 46229.572 node_disk_read_time_seconds_total{device="dm-1"} 0.084 node_disk_read_time_seconds_total{device="dm-2"} 6.5360000000000005 node_disk_read_time_seconds_total{device="dm-3"} 0.10400000000000001 node_disk_read_time_seconds_total{device="dm-4"} 0.028 node_disk_read_time_seconds_total{device="dm-5"} 0.924 node_disk_read_time_seconds_total{device="mmcblk0"} 0.156 node_disk_read_time_seconds_total{device="mmcblk0p1"} 0.024 node_disk_read_time_seconds_total{device="mmcblk0p2"} 0.068 node_disk_read_time_seconds_total{device="nvme0n1"} 21.650000000000002 node_disk_read_time_seconds_total{device="sda"} 18492.372 node_disk_read_time_seconds_total{device="sdb"} 0.084 node_disk_read_time_seconds_total{device="sr0"} 0 node_disk_read_time_seconds_total{device="vda"} 8655.768 # HELP node_disk_reads_completed_total The total number of reads completed successfully. # TYPE node_disk_reads_completed_total counter node_disk_reads_completed_total{device="dm-0"} 5.9910002e+07 node_disk_reads_completed_total{device="dm-1"} 388 node_disk_reads_completed_total{device="dm-2"} 11571 node_disk_reads_completed_total{device="dm-3"} 3870 node_disk_reads_completed_total{device="dm-4"} 392 node_disk_reads_completed_total{device="dm-5"} 3729 node_disk_reads_completed_total{device="mmcblk0"} 192 node_disk_reads_completed_total{device="mmcblk0p1"} 17 node_disk_reads_completed_total{device="mmcblk0p2"} 95 node_disk_reads_completed_total{device="nvme0n1"} 47114 node_disk_reads_completed_total{device="sda"} 2.5354637e+07 node_disk_reads_completed_total{device="sdb"} 326552 node_disk_reads_completed_total{device="sr0"} 0 node_disk_reads_completed_total{device="vda"} 1.775784e+06 # HELP node_disk_reads_merged_total The total number of reads merged. # TYPE node_disk_reads_merged_total counter node_disk_reads_merged_total{device="dm-0"} 0 node_disk_reads_merged_total{device="dm-1"} 0 node_disk_reads_merged_total{device="dm-2"} 0 node_disk_reads_merged_total{device="dm-3"} 0 node_disk_reads_merged_total{device="dm-4"} 0 node_disk_reads_merged_total{device="dm-5"} 0 node_disk_reads_merged_total{device="mmcblk0"} 3 node_disk_reads_merged_total{device="mmcblk0p1"} 3 node_disk_reads_merged_total{device="mmcblk0p2"} 0 node_disk_reads_merged_total{device="nvme0n1"} 4 node_disk_reads_merged_total{device="sda"} 3.4367663e+07 node_disk_reads_merged_total{device="sdb"} 841 node_disk_reads_merged_total{device="sr0"} 0 node_disk_reads_merged_total{device="vda"} 15386 # HELP node_disk_write_time_seconds_total This is the total number of seconds spent by all writes. # TYPE node_disk_write_time_seconds_total counter node_disk_write_time_seconds_total{device="dm-0"} 1.1585578e+06 node_disk_write_time_seconds_total{device="dm-1"} 0 node_disk_write_time_seconds_total{device="dm-2"} 122.884 node_disk_write_time_seconds_total{device="dm-3"} 0 node_disk_write_time_seconds_total{device="dm-4"} 0.016 node_disk_write_time_seconds_total{device="dm-5"} 104.684 node_disk_write_time_seconds_total{device="mmcblk0"} 0 node_disk_write_time_seconds_total{device="mmcblk0p1"} 0 node_disk_write_time_seconds_total{device="mmcblk0p2"} 0 node_disk_write_time_seconds_total{device="nvme0n1"} 1011.053 node_disk_write_time_seconds_total{device="sda"} 63877.96 node_disk_write_time_seconds_total{device="sdb"} 5.007 node_disk_write_time_seconds_total{device="sr0"} 0 node_disk_write_time_seconds_total{device="vda"} 2.069221364e+06 # HELP node_disk_writes_completed_total The total number of writes completed successfully. # TYPE node_disk_writes_completed_total counter node_disk_writes_completed_total{device="dm-0"} 3.9231014e+07 node_disk_writes_completed_total{device="dm-1"} 74 node_disk_writes_completed_total{device="dm-2"} 153522 node_disk_writes_completed_total{device="dm-3"} 0 node_disk_writes_completed_total{device="dm-4"} 38 node_disk_writes_completed_total{device="dm-5"} 98918 node_disk_writes_completed_total{device="mmcblk0"} 0 node_disk_writes_completed_total{device="mmcblk0p1"} 0 node_disk_writes_completed_total{device="mmcblk0p2"} 0 node_disk_writes_completed_total{device="nvme0n1"} 1.07832e+06 node_disk_writes_completed_total{device="sda"} 2.8444756e+07 node_disk_writes_completed_total{device="sdb"} 41822 node_disk_writes_completed_total{device="sr0"} 0 node_disk_writes_completed_total{device="vda"} 6.038856e+06 # HELP node_disk_writes_merged_total The number of writes merged. # TYPE node_disk_writes_merged_total counter node_disk_writes_merged_total{device="dm-0"} 0 node_disk_writes_merged_total{device="dm-1"} 0 node_disk_writes_merged_total{device="dm-2"} 0 node_disk_writes_merged_total{device="dm-3"} 0 node_disk_writes_merged_total{device="dm-4"} 0 node_disk_writes_merged_total{device="dm-5"} 0 node_disk_writes_merged_total{device="mmcblk0"} 0 node_disk_writes_merged_total{device="mmcblk0p1"} 0 node_disk_writes_merged_total{device="mmcblk0p2"} 0 node_disk_writes_merged_total{device="nvme0n1"} 43950 node_disk_writes_merged_total{device="sda"} 1.1134226e+07 node_disk_writes_merged_total{device="sdb"} 2895 node_disk_writes_merged_total{device="sr0"} 0 node_disk_writes_merged_total{device="vda"} 2.0711856e+07 # HELP node_disk_written_bytes_total The total number of bytes written successfully. # TYPE node_disk_written_bytes_total counter node_disk_written_bytes_total{device="dm-0"} 2.5891680256e+11 node_disk_written_bytes_total{device="dm-1"} 303104 node_disk_written_bytes_total{device="dm-2"} 2.607828992e+09 node_disk_written_bytes_total{device="dm-3"} 0 node_disk_written_bytes_total{device="dm-4"} 70144 node_disk_written_bytes_total{device="dm-5"} 5.89664256e+08 node_disk_written_bytes_total{device="mmcblk0"} 0 node_disk_written_bytes_total{device="mmcblk0p1"} 0 node_disk_written_bytes_total{device="mmcblk0p2"} 0 node_disk_written_bytes_total{device="nvme0n1"} 2.0199236096e+10 node_disk_written_bytes_total{device="sda"} 2.58916880384e+11 node_disk_written_bytes_total{device="sdb"} 1.01012736e+09 node_disk_written_bytes_total{device="sr0"} 0 node_disk_written_bytes_total{device="vda"} 1.0938236928e+11 # 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 Total number of forks. # TYPE node_forks_total counter node_forks_total 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="i40iw0",port="1"} 0 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="i40iw0",port="1"} 0 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_constraint_errors_received_total Number of packets received on the switch physical port that are discarded # TYPE node_infiniband_port_constraint_errors_received_total counter node_infiniband_port_constraint_errors_received_total{device="i40iw0",port="1"} 0 node_infiniband_port_constraint_errors_received_total{device="mlx4_0",port="1"} 0 # HELP node_infiniband_port_constraint_errors_transmitted_total Number of packets not transmitted from the switch physical port # TYPE node_infiniband_port_constraint_errors_transmitted_total counter node_infiniband_port_constraint_errors_transmitted_total{device="i40iw0",port="1"} 0 node_infiniband_port_constraint_errors_transmitted_total{device="mlx4_0",port="1"} 0 # HELP node_infiniband_port_data_received_bytes_total Number of data octets received on all links # TYPE node_infiniband_port_data_received_bytes_total counter node_infiniband_port_data_received_bytes_total{device="i40iw0",port="1"} 0 node_infiniband_port_data_received_bytes_total{device="mlx4_0",port="1"} 1.8527668e+07 node_infiniband_port_data_received_bytes_total{device="mlx4_0",port="2"} 0 # HELP node_infiniband_port_data_transmitted_bytes_total Number of data octets transmitted on all links # TYPE node_infiniband_port_data_transmitted_bytes_total counter node_infiniband_port_data_transmitted_bytes_total{device="i40iw0",port="1"} 0 node_infiniband_port_data_transmitted_bytes_total{device="mlx4_0",port="1"} 1.493376e+07 node_infiniband_port_data_transmitted_bytes_total{device="mlx4_0",port="2"} 0 # HELP node_infiniband_port_discards_received_total Number of inbound packets discarded by the port because the port is down or congested # TYPE node_infiniband_port_discards_received_total counter node_infiniband_port_discards_received_total{device="mlx4_0",port="1"} 0 # HELP node_infiniband_port_discards_transmitted_total Number of outbound packets discarded by the port because the port is down or congested # TYPE node_infiniband_port_discards_transmitted_total counter node_infiniband_port_discards_transmitted_total{device="i40iw0",port="1"} 0 node_infiniband_port_discards_transmitted_total{device="mlx4_0",port="1"} 5 # HELP node_infiniband_port_errors_received_total Number of packets containing an error that were received on this port # TYPE node_infiniband_port_errors_received_total counter node_infiniband_port_errors_received_total{device="i40iw0",port="1"} 0 node_infiniband_port_errors_received_total{device="mlx4_0",port="1"} 0 # HELP node_infiniband_port_packets_received_total Number of packets received on all VLs by this port (including errors) # TYPE node_infiniband_port_packets_received_total counter node_infiniband_port_packets_received_total{device="i40iw0",port="1"} 0 node_infiniband_port_packets_received_total{device="mlx4_0",port="1"} 6.825908347e+09 # HELP node_infiniband_port_packets_transmitted_total Number of packets transmitted on all VLs from this port (including errors) # TYPE node_infiniband_port_packets_transmitted_total counter node_infiniband_port_packets_transmitted_total{device="i40iw0",port="1"} 0 node_infiniband_port_packets_transmitted_total{device="mlx4_0",port="1"} 6.235865e+06 # HELP node_infiniband_port_transmit_wait_total Number of ticks during which the port had data to transmit but no data was sent during the entire tick # TYPE node_infiniband_port_transmit_wait_total counter node_infiniband_port_transmit_wait_total{device="i40iw0",port="1"} 0 node_infiniband_port_transmit_wait_total{device="mlx4_0",port="1"} 4.294967295e+09 # 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_total Interrupt details. # TYPE node_interrupts_total counter node_interrupts_total{cpu="0",devices="",info="APIC ICR read retries",type="RTR"} 0 node_interrupts_total{cpu="0",devices="",info="Function call interrupts",type="CAL"} 148554 node_interrupts_total{cpu="0",devices="",info="IRQ work interrupts",type="IWI"} 1.509379e+06 node_interrupts_total{cpu="0",devices="",info="Local timer interrupts",type="LOC"} 1.74326351e+08 node_interrupts_total{cpu="0",devices="",info="Machine check exceptions",type="MCE"} 0 node_interrupts_total{cpu="0",devices="",info="Machine check polls",type="MCP"} 2406 node_interrupts_total{cpu="0",devices="",info="Non-maskable interrupts",type="NMI"} 47 node_interrupts_total{cpu="0",devices="",info="Performance monitoring interrupts",type="PMI"} 47 node_interrupts_total{cpu="0",devices="",info="Rescheduling interrupts",type="RES"} 1.0847134e+07 node_interrupts_total{cpu="0",devices="",info="Spurious interrupts",type="SPU"} 0 node_interrupts_total{cpu="0",devices="",info="TLB shootdowns",type="TLB"} 1.0460334e+07 node_interrupts_total{cpu="0",devices="",info="Thermal event interrupts",type="TRM"} 0 node_interrupts_total{cpu="0",devices="",info="Threshold APIC interrupts",type="THR"} 0 node_interrupts_total{cpu="0",devices="acpi",info="IR-IO-APIC-fasteoi",type="9"} 398553 node_interrupts_total{cpu="0",devices="ahci",info="IR-PCI-MSI-edge",type="43"} 7.434032e+06 node_interrupts_total{cpu="0",devices="dmar0",info="DMAR_MSI-edge",type="40"} 0 node_interrupts_total{cpu="0",devices="dmar1",info="DMAR_MSI-edge",type="41"} 0 node_interrupts_total{cpu="0",devices="ehci_hcd:usb1, mmc0",info="IR-IO-APIC-fasteoi",type="16"} 328511 node_interrupts_total{cpu="0",devices="ehci_hcd:usb2",info="IR-IO-APIC-fasteoi",type="23"} 1.451445e+06 node_interrupts_total{cpu="0",devices="i8042",info="IR-IO-APIC-edge",type="1"} 17960 node_interrupts_total{cpu="0",devices="i8042",info="IR-IO-APIC-edge",type="12"} 380847 node_interrupts_total{cpu="0",devices="i915",info="IR-PCI-MSI-edge",type="44"} 140636 node_interrupts_total{cpu="0",devices="iwlwifi",info="IR-PCI-MSI-edge",type="46"} 4.3078464e+07 node_interrupts_total{cpu="0",devices="mei_me",info="IR-PCI-MSI-edge",type="45"} 4 node_interrupts_total{cpu="0",devices="rtc0",info="IR-IO-APIC-edge",type="8"} 1 node_interrupts_total{cpu="0",devices="snd_hda_intel",info="IR-PCI-MSI-edge",type="47"} 350 node_interrupts_total{cpu="0",devices="timer",info="IR-IO-APIC-edge",type="0"} 18 node_interrupts_total{cpu="0",devices="xhci_hcd",info="IR-PCI-MSI-edge",type="42"} 378324 node_interrupts_total{cpu="1",devices="",info="APIC ICR read retries",type="RTR"} 0 node_interrupts_total{cpu="1",devices="",info="Function call interrupts",type="CAL"} 157441 node_interrupts_total{cpu="1",devices="",info="IRQ work interrupts",type="IWI"} 2.411776e+06 node_interrupts_total{cpu="1",devices="",info="Local timer interrupts",type="LOC"} 1.35776678e+08 node_interrupts_total{cpu="1",devices="",info="Machine check exceptions",type="MCE"} 0 node_interrupts_total{cpu="1",devices="",info="Machine check polls",type="MCP"} 2399 node_interrupts_total{cpu="1",devices="",info="Non-maskable interrupts",type="NMI"} 5031 node_interrupts_total{cpu="1",devices="",info="Performance monitoring interrupts",type="PMI"} 5031 node_interrupts_total{cpu="1",devices="",info="Rescheduling interrupts",type="RES"} 9.111507e+06 node_interrupts_total{cpu="1",devices="",info="Spurious interrupts",type="SPU"} 0 node_interrupts_total{cpu="1",devices="",info="TLB shootdowns",type="TLB"} 9.918429e+06 node_interrupts_total{cpu="1",devices="",info="Thermal event interrupts",type="TRM"} 0 node_interrupts_total{cpu="1",devices="",info="Threshold APIC interrupts",type="THR"} 0 node_interrupts_total{cpu="1",devices="acpi",info="IR-IO-APIC-fasteoi",type="9"} 2320 node_interrupts_total{cpu="1",devices="ahci",info="IR-PCI-MSI-edge",type="43"} 8.092205e+06 node_interrupts_total{cpu="1",devices="dmar0",info="DMAR_MSI-edge",type="40"} 0 node_interrupts_total{cpu="1",devices="dmar1",info="DMAR_MSI-edge",type="41"} 0 node_interrupts_total{cpu="1",devices="ehci_hcd:usb1, mmc0",info="IR-IO-APIC-fasteoi",type="16"} 322879 node_interrupts_total{cpu="1",devices="ehci_hcd:usb2",info="IR-IO-APIC-fasteoi",type="23"} 3.333499e+06 node_interrupts_total{cpu="1",devices="i8042",info="IR-IO-APIC-edge",type="1"} 105 node_interrupts_total{cpu="1",devices="i8042",info="IR-IO-APIC-edge",type="12"} 1021 node_interrupts_total{cpu="1",devices="i915",info="IR-PCI-MSI-edge",type="44"} 226313 node_interrupts_total{cpu="1",devices="iwlwifi",info="IR-PCI-MSI-edge",type="46"} 130 node_interrupts_total{cpu="1",devices="mei_me",info="IR-PCI-MSI-edge",type="45"} 22 node_interrupts_total{cpu="1",devices="rtc0",info="IR-IO-APIC-edge",type="8"} 0 node_interrupts_total{cpu="1",devices="snd_hda_intel",info="IR-PCI-MSI-edge",type="47"} 224 node_interrupts_total{cpu="1",devices="timer",info="IR-IO-APIC-edge",type="0"} 0 node_interrupts_total{cpu="1",devices="xhci_hcd",info="IR-PCI-MSI-edge",type="42"} 1.734637e+06 node_interrupts_total{cpu="2",devices="",info="APIC ICR read retries",type="RTR"} 0 node_interrupts_total{cpu="2",devices="",info="Function call interrupts",type="CAL"} 142912 node_interrupts_total{cpu="2",devices="",info="IRQ work interrupts",type="IWI"} 1.512975e+06 node_interrupts_total{cpu="2",devices="",info="Local timer interrupts",type="LOC"} 1.68393257e+08 node_interrupts_total{cpu="2",devices="",info="Machine check exceptions",type="MCE"} 0 node_interrupts_total{cpu="2",devices="",info="Machine check polls",type="MCP"} 2399 node_interrupts_total{cpu="2",devices="",info="Non-maskable interrupts",type="NMI"} 6211 node_interrupts_total{cpu="2",devices="",info="Performance monitoring interrupts",type="PMI"} 6211 node_interrupts_total{cpu="2",devices="",info="Rescheduling interrupts",type="RES"} 1.5999335e+07 node_interrupts_total{cpu="2",devices="",info="Spurious interrupts",type="SPU"} 0 node_interrupts_total{cpu="2",devices="",info="TLB shootdowns",type="TLB"} 1.0494258e+07 node_interrupts_total{cpu="2",devices="",info="Thermal event interrupts",type="TRM"} 0 node_interrupts_total{cpu="2",devices="",info="Threshold APIC interrupts",type="THR"} 0 node_interrupts_total{cpu="2",devices="acpi",info="IR-IO-APIC-fasteoi",type="9"} 824 node_interrupts_total{cpu="2",devices="ahci",info="IR-PCI-MSI-edge",type="43"} 6.478877e+06 node_interrupts_total{cpu="2",devices="dmar0",info="DMAR_MSI-edge",type="40"} 0 node_interrupts_total{cpu="2",devices="dmar1",info="DMAR_MSI-edge",type="41"} 0 node_interrupts_total{cpu="2",devices="ehci_hcd:usb1, mmc0",info="IR-IO-APIC-fasteoi",type="16"} 293782 node_interrupts_total{cpu="2",devices="ehci_hcd:usb2",info="IR-IO-APIC-fasteoi",type="23"} 1.092032e+06 node_interrupts_total{cpu="2",devices="i8042",info="IR-IO-APIC-edge",type="1"} 28 node_interrupts_total{cpu="2",devices="i8042",info="IR-IO-APIC-edge",type="12"} 240 node_interrupts_total{cpu="2",devices="i915",info="IR-PCI-MSI-edge",type="44"} 347 node_interrupts_total{cpu="2",devices="iwlwifi",info="IR-PCI-MSI-edge",type="46"} 460171 node_interrupts_total{cpu="2",devices="mei_me",info="IR-PCI-MSI-edge",type="45"} 0 node_interrupts_total{cpu="2",devices="rtc0",info="IR-IO-APIC-edge",type="8"} 0 node_interrupts_total{cpu="2",devices="snd_hda_intel",info="IR-PCI-MSI-edge",type="47"} 0 node_interrupts_total{cpu="2",devices="timer",info="IR-IO-APIC-edge",type="0"} 0 node_interrupts_total{cpu="2",devices="xhci_hcd",info="IR-PCI-MSI-edge",type="42"} 440240 node_interrupts_total{cpu="3",devices="",info="APIC ICR read retries",type="RTR"} 0 node_interrupts_total{cpu="3",devices="",info="Function call interrupts",type="CAL"} 155528 node_interrupts_total{cpu="3",devices="",info="IRQ work interrupts",type="IWI"} 2.428828e+06 node_interrupts_total{cpu="3",devices="",info="Local timer interrupts",type="LOC"} 1.30980079e+08 node_interrupts_total{cpu="3",devices="",info="Machine check exceptions",type="MCE"} 0 node_interrupts_total{cpu="3",devices="",info="Machine check polls",type="MCP"} 2399 node_interrupts_total{cpu="3",devices="",info="Non-maskable interrupts",type="NMI"} 4968 node_interrupts_total{cpu="3",devices="",info="Performance monitoring interrupts",type="PMI"} 4968 node_interrupts_total{cpu="3",devices="",info="Rescheduling interrupts",type="RES"} 7.45726e+06 node_interrupts_total{cpu="3",devices="",info="Spurious interrupts",type="SPU"} 0 node_interrupts_total{cpu="3",devices="",info="TLB shootdowns",type="TLB"} 1.0345022e+07 node_interrupts_total{cpu="3",devices="",info="Thermal event interrupts",type="TRM"} 0 node_interrupts_total{cpu="3",devices="",info="Threshold APIC interrupts",type="THR"} 0 node_interrupts_total{cpu="3",devices="acpi",info="IR-IO-APIC-fasteoi",type="9"} 863 node_interrupts_total{cpu="3",devices="ahci",info="IR-PCI-MSI-edge",type="43"} 7.492252e+06 node_interrupts_total{cpu="3",devices="dmar0",info="DMAR_MSI-edge",type="40"} 0 node_interrupts_total{cpu="3",devices="dmar1",info="DMAR_MSI-edge",type="41"} 0 node_interrupts_total{cpu="3",devices="ehci_hcd:usb1, mmc0",info="IR-IO-APIC-fasteoi",type="16"} 351412 node_interrupts_total{cpu="3",devices="ehci_hcd:usb2",info="IR-IO-APIC-fasteoi",type="23"} 2.644609e+06 node_interrupts_total{cpu="3",devices="i8042",info="IR-IO-APIC-edge",type="1"} 28 node_interrupts_total{cpu="3",devices="i8042",info="IR-IO-APIC-edge",type="12"} 198 node_interrupts_total{cpu="3",devices="i915",info="IR-PCI-MSI-edge",type="44"} 633 node_interrupts_total{cpu="3",devices="iwlwifi",info="IR-PCI-MSI-edge",type="46"} 290 node_interrupts_total{cpu="3",devices="mei_me",info="IR-PCI-MSI-edge",type="45"} 0 node_interrupts_total{cpu="3",devices="rtc0",info="IR-IO-APIC-edge",type="8"} 0 node_interrupts_total{cpu="3",devices="snd_hda_intel",info="IR-PCI-MSI-edge",type="47"} 0 node_interrupts_total{cpu="3",devices="timer",info="IR-IO-APIC-edge",type="0"} 0 node_interrupts_total{cpu="3",devices="xhci_hcd",info="IR-PCI-MSI-edge",type="42"} 2.434308e+06 # HELP node_intr_total Total number of interrupts serviced. # TYPE node_intr_total counter node_intr_total 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="md120"} 2.095104e+06 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="md120"} 2.095104e+06 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="md120"} 2 node_md_disks{device="md126"} 2 node_md_disks{device="md127"} 2 node_md_disks{device="md219"} 3 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="md120"} 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"} 0 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="md120"} 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_memory_Active_anon_bytes Memory information field Active_anon_bytes. # TYPE node_memory_Active_anon_bytes gauge node_memory_Active_anon_bytes 2.068484096e+09 # HELP node_memory_Active_bytes Memory information field Active_bytes. # TYPE node_memory_Active_bytes gauge node_memory_Active_bytes 2.287017984e+09 # HELP node_memory_Active_file_bytes Memory information field Active_file_bytes. # TYPE node_memory_Active_file_bytes gauge node_memory_Active_file_bytes 2.18533888e+08 # HELP node_memory_AnonHugePages_bytes Memory information field AnonHugePages_bytes. # TYPE node_memory_AnonHugePages_bytes gauge node_memory_AnonHugePages_bytes 0 # HELP node_memory_AnonPages_bytes Memory information field AnonPages_bytes. # TYPE node_memory_AnonPages_bytes gauge node_memory_AnonPages_bytes 2.298032128e+09 # HELP node_memory_Bounce_bytes Memory information field Bounce_bytes. # TYPE node_memory_Bounce_bytes gauge node_memory_Bounce_bytes 0 # HELP node_memory_Buffers_bytes Memory information field Buffers_bytes. # TYPE node_memory_Buffers_bytes gauge node_memory_Buffers_bytes 2.256896e+07 # HELP node_memory_Cached_bytes Memory information field Cached_bytes. # TYPE node_memory_Cached_bytes gauge node_memory_Cached_bytes 9.53229312e+08 # HELP node_memory_CommitLimit_bytes Memory information field CommitLimit_bytes. # TYPE node_memory_CommitLimit_bytes gauge node_memory_CommitLimit_bytes 6.210940928e+09 # HELP node_memory_Committed_AS_bytes Memory information field Committed_AS_bytes. # TYPE node_memory_Committed_AS_bytes gauge node_memory_Committed_AS_bytes 8.023486464e+09 # HELP node_memory_DirectMap2M_bytes Memory information field DirectMap2M_bytes. # TYPE node_memory_DirectMap2M_bytes gauge node_memory_DirectMap2M_bytes 3.787456512e+09 # HELP node_memory_DirectMap4k_bytes Memory information field DirectMap4k_bytes. # TYPE node_memory_DirectMap4k_bytes gauge node_memory_DirectMap4k_bytes 1.9011584e+08 # HELP node_memory_Dirty_bytes Memory information field Dirty_bytes. # TYPE node_memory_Dirty_bytes gauge node_memory_Dirty_bytes 1.077248e+06 # HELP node_memory_HardwareCorrupted_bytes Memory information field HardwareCorrupted_bytes. # TYPE node_memory_HardwareCorrupted_bytes gauge node_memory_HardwareCorrupted_bytes 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_bytes Memory information field Hugepagesize_bytes. # TYPE node_memory_Hugepagesize_bytes gauge node_memory_Hugepagesize_bytes 2.097152e+06 # HELP node_memory_Inactive_anon_bytes Memory information field Inactive_anon_bytes. # TYPE node_memory_Inactive_anon_bytes gauge node_memory_Inactive_anon_bytes 9.04245248e+08 # HELP node_memory_Inactive_bytes Memory information field Inactive_bytes. # TYPE node_memory_Inactive_bytes gauge node_memory_Inactive_bytes 1.053417472e+09 # HELP node_memory_Inactive_file_bytes Memory information field Inactive_file_bytes. # TYPE node_memory_Inactive_file_bytes gauge node_memory_Inactive_file_bytes 1.49172224e+08 # HELP node_memory_KernelStack_bytes Memory information field KernelStack_bytes. # TYPE node_memory_KernelStack_bytes gauge node_memory_KernelStack_bytes 5.9392e+06 # HELP node_memory_Mapped_bytes Memory information field Mapped_bytes. # TYPE node_memory_Mapped_bytes gauge node_memory_Mapped_bytes 2.4496128e+08 # HELP node_memory_MemFree_bytes Memory information field MemFree_bytes. # TYPE node_memory_MemFree_bytes gauge node_memory_MemFree_bytes 2.30883328e+08 # HELP node_memory_MemTotal_bytes Memory information field MemTotal_bytes. # TYPE node_memory_MemTotal_bytes gauge node_memory_MemTotal_bytes 3.831959552e+09 # HELP node_memory_Mlocked_bytes Memory information field Mlocked_bytes. # TYPE node_memory_Mlocked_bytes gauge node_memory_Mlocked_bytes 32768 # HELP node_memory_NFS_Unstable_bytes Memory information field NFS_Unstable_bytes. # TYPE node_memory_NFS_Unstable_bytes gauge node_memory_NFS_Unstable_bytes 0 # HELP node_memory_PageTables_bytes Memory information field PageTables_bytes. # TYPE node_memory_PageTables_bytes gauge node_memory_PageTables_bytes 7.7017088e+07 # HELP node_memory_SReclaimable_bytes Memory information field SReclaimable_bytes. # TYPE node_memory_SReclaimable_bytes gauge node_memory_SReclaimable_bytes 4.5846528e+07 # HELP node_memory_SUnreclaim_bytes Memory information field SUnreclaim_bytes. # TYPE node_memory_SUnreclaim_bytes gauge node_memory_SUnreclaim_bytes 5.545984e+07 # HELP node_memory_Shmem_bytes Memory information field Shmem_bytes. # TYPE node_memory_Shmem_bytes gauge node_memory_Shmem_bytes 6.0809216e+08 # HELP node_memory_Slab_bytes Memory information field Slab_bytes. # TYPE node_memory_Slab_bytes gauge node_memory_Slab_bytes 1.01306368e+08 # HELP node_memory_SwapCached_bytes Memory information field SwapCached_bytes. # TYPE node_memory_SwapCached_bytes gauge node_memory_SwapCached_bytes 1.97124096e+08 # HELP node_memory_SwapFree_bytes Memory information field SwapFree_bytes. # TYPE node_memory_SwapFree_bytes gauge node_memory_SwapFree_bytes 3.23108864e+09 # HELP node_memory_SwapTotal_bytes Memory information field SwapTotal_bytes. # TYPE node_memory_SwapTotal_bytes gauge node_memory_SwapTotal_bytes 4.2949632e+09 # HELP node_memory_Unevictable_bytes Memory information field Unevictable_bytes. # TYPE node_memory_Unevictable_bytes gauge node_memory_Unevictable_bytes 32768 # HELP node_memory_VmallocChunk_bytes Memory information field VmallocChunk_bytes. # TYPE node_memory_VmallocChunk_bytes gauge node_memory_VmallocChunk_bytes 3.5183963009024e+13 # HELP node_memory_VmallocTotal_bytes Memory information field VmallocTotal_bytes. # TYPE node_memory_VmallocTotal_bytes gauge node_memory_VmallocTotal_bytes 3.5184372087808e+13 # HELP node_memory_VmallocUsed_bytes Memory information field VmallocUsed_bytes. # TYPE node_memory_VmallocUsed_bytes gauge node_memory_VmallocUsed_bytes 3.6130816e+08 # HELP node_memory_WritebackTmp_bytes Memory information field WritebackTmp_bytes. # TYPE node_memory_WritebackTmp_bytes gauge node_memory_WritebackTmp_bytes 0 # HELP node_memory_Writeback_bytes Memory information field Writeback_bytes. # TYPE node_memory_Writeback_bytes gauge node_memory_Writeback_bytes 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 node_memory_numa_Active{node="2"} 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 node_memory_numa_Active_anon{node="2"} 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 node_memory_numa_Active_file{node="2"} 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 node_memory_numa_AnonHugePages{node="2"} 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 node_memory_numa_AnonPages{node="2"} 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 node_memory_numa_Bounce{node="2"} 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 node_memory_numa_Dirty{node="2"} 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 node_memory_numa_FilePages{node="2"} 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 node_memory_numa_HugePages_Free{node="2"} 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 node_memory_numa_HugePages_Surp{node="2"} 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 node_memory_numa_HugePages_Total{node="2"} 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 node_memory_numa_Inactive{node="2"} 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 node_memory_numa_Inactive_anon{node="2"} 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 node_memory_numa_Inactive_file{node="2"} 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 node_memory_numa_KernelStack{node="2"} 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 node_memory_numa_Mapped{node="2"} 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 node_memory_numa_MemFree{node="2"} 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 node_memory_numa_MemTotal{node="2"} 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 node_memory_numa_MemUsed{node="2"} 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 node_memory_numa_Mlocked{node="2"} 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 node_memory_numa_NFS_Unstable{node="2"} 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 node_memory_numa_PageTables{node="2"} 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 node_memory_numa_SReclaimable{node="2"} 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 node_memory_numa_SUnreclaim{node="2"} 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 node_memory_numa_Shmem{node="2"} 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 node_memory_numa_Slab{node="2"} 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 node_memory_numa_Unevictable{node="2"} 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 node_memory_numa_Writeback{node="2"} 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 node_memory_numa_WritebackTmp{node="2"} 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 node_memory_numa_interleave_hit_total{node="2"} 7286 # 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 node_memory_numa_local_node_total{node="2"} 2.671904655e+10 # 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 node_memory_numa_numa_foreign_total{node="2"} 2.624528e+06 # 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 node_memory_numa_numa_hit_total{node="2"} 2.6720946761e+10 # 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 node_memory_numa_numa_miss_total{node="2"} 9.858626709e+09 # 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 node_memory_numa_other_node_total{node="2"} 9.86052692e+09 # 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",protocol="tcp"} 13968 node_mountstats_nfs_age_seconds_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_direct_read_bytes_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_direct_write_bytes_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_attribute_invalidate_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_data_invalidate_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 226 node_mountstats_nfs_event_dnode_revalidate_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 52 node_mountstats_nfs_event_inode_revalidate_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_jukebox_delay_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_pnfs_read_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_pnfs_write_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_short_read_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_short_write_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_silly_rename_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_truncation_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 398 node_mountstats_nfs_event_vfs_access_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 77 node_mountstats_nfs_event_vfs_file_release_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 77 node_mountstats_nfs_event_vfs_flush_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_vfs_fsync_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_vfs_getdents_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_vfs_lock_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 13 node_mountstats_nfs_event_vfs_lookup_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 1 node_mountstats_nfs_event_vfs_open_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_vfs_read_page_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 331 node_mountstats_nfs_event_vfs_read_pages_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_vfs_setattr_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_vfs_update_page_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_vfs_write_page_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 47 node_mountstats_nfs_event_vfs_write_pages_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_write_extension_total{export="192.168.1.1:/srv/test",protocol="udp"} 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="ACCESS",protocol="udp"} 0 node_mountstats_nfs_operations_major_timeouts_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="tcp"} 0 node_mountstats_nfs_operations_major_timeouts_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="udp"} 0 node_mountstats_nfs_operations_major_timeouts_total{export="192.168.1.1:/srv/test",operation="READ",protocol="tcp"} 0 node_mountstats_nfs_operations_major_timeouts_total{export="192.168.1.1:/srv/test",operation="READ",protocol="udp"} 0 node_mountstats_nfs_operations_major_timeouts_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="tcp"} 0 node_mountstats_nfs_operations_major_timeouts_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="udp"} 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="ACCESS",protocol="udp"} 9.007044786793922e+12 node_mountstats_nfs_operations_queue_time_seconds_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="tcp"} 0 node_mountstats_nfs_operations_queue_time_seconds_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="udp"} 0 node_mountstats_nfs_operations_queue_time_seconds_total{export="192.168.1.1:/srv/test",operation="READ",protocol="tcp"} 0.006 node_mountstats_nfs_operations_queue_time_seconds_total{export="192.168.1.1:/srv/test",operation="READ",protocol="udp"} 0.006 node_mountstats_nfs_operations_queue_time_seconds_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="tcp"} 0 node_mountstats_nfs_operations_queue_time_seconds_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="udp"} 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="ACCESS",protocol="udp"} 3.62996810236e+11 node_mountstats_nfs_operations_received_bytes_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="tcp"} 0 node_mountstats_nfs_operations_received_bytes_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="udp"} 0 node_mountstats_nfs_operations_received_bytes_total{export="192.168.1.1:/srv/test",operation="READ",protocol="tcp"} 1.210292152e+09 node_mountstats_nfs_operations_received_bytes_total{export="192.168.1.1:/srv/test",operation="READ",protocol="udp"} 1.210292152e+09 node_mountstats_nfs_operations_received_bytes_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="tcp"} 0 node_mountstats_nfs_operations_received_bytes_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="udp"} 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="ACCESS",protocol="udp"} 1.953587717e+06 node_mountstats_nfs_operations_request_time_seconds_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="tcp"} 0 node_mountstats_nfs_operations_request_time_seconds_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="udp"} 0 node_mountstats_nfs_operations_request_time_seconds_total{export="192.168.1.1:/srv/test",operation="READ",protocol="tcp"} 79.407 node_mountstats_nfs_operations_request_time_seconds_total{export="192.168.1.1:/srv/test",operation="READ",protocol="udp"} 79.407 node_mountstats_nfs_operations_request_time_seconds_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="tcp"} 0 node_mountstats_nfs_operations_request_time_seconds_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="udp"} 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="ACCESS",protocol="udp"} 2.927395007e+09 node_mountstats_nfs_operations_requests_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="tcp"} 0 node_mountstats_nfs_operations_requests_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="udp"} 0 node_mountstats_nfs_operations_requests_total{export="192.168.1.1:/srv/test",operation="READ",protocol="tcp"} 1298 node_mountstats_nfs_operations_requests_total{export="192.168.1.1:/srv/test",operation="READ",protocol="udp"} 1298 node_mountstats_nfs_operations_requests_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="tcp"} 0 node_mountstats_nfs_operations_requests_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="udp"} 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="ACCESS",protocol="udp"} 1.667369447e+06 node_mountstats_nfs_operations_response_time_seconds_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="tcp"} 0 node_mountstats_nfs_operations_response_time_seconds_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="udp"} 0 node_mountstats_nfs_operations_response_time_seconds_total{export="192.168.1.1:/srv/test",operation="READ",protocol="tcp"} 79.386 node_mountstats_nfs_operations_response_time_seconds_total{export="192.168.1.1:/srv/test",operation="READ",protocol="udp"} 79.386 node_mountstats_nfs_operations_response_time_seconds_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="tcp"} 0 node_mountstats_nfs_operations_response_time_seconds_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="udp"} 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="ACCESS",protocol="udp"} 5.26931094212e+11 node_mountstats_nfs_operations_sent_bytes_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="tcp"} 0 node_mountstats_nfs_operations_sent_bytes_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="udp"} 0 node_mountstats_nfs_operations_sent_bytes_total{export="192.168.1.1:/srv/test",operation="READ",protocol="tcp"} 207680 node_mountstats_nfs_operations_sent_bytes_total{export="192.168.1.1:/srv/test",operation="READ",protocol="udp"} 207680 node_mountstats_nfs_operations_sent_bytes_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="tcp"} 0 node_mountstats_nfs_operations_sent_bytes_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="udp"} 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="ACCESS",protocol="udp"} 2.927394995e+09 node_mountstats_nfs_operations_transmissions_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="tcp"} 0 node_mountstats_nfs_operations_transmissions_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="udp"} 0 node_mountstats_nfs_operations_transmissions_total{export="192.168.1.1:/srv/test",operation="READ",protocol="tcp"} 1298 node_mountstats_nfs_operations_transmissions_total{export="192.168.1.1:/srv/test",operation="READ",protocol="udp"} 1298 node_mountstats_nfs_operations_transmissions_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="tcp"} 0 node_mountstats_nfs_operations_transmissions_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="udp"} 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",protocol="tcp"} 1.20764023e+09 node_mountstats_nfs_read_bytes_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 295483 node_mountstats_nfs_read_pages_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 1.210214218e+09 node_mountstats_nfs_total_read_bytes_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_total_write_bytes_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_transport_backlog_queue_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_transport_bad_transaction_ids_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_transport_bind_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 1 node_mountstats_nfs_transport_connect_total{export="192.168.1.1:/srv/test",protocol="udp"} 0 # 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",protocol="tcp"} 11 node_mountstats_nfs_transport_idle_time_seconds{export="192.168.1.1:/srv/test",protocol="udp"} 0 # 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",protocol="tcp"} 24 node_mountstats_nfs_transport_maximum_rpc_slots{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 5726 node_mountstats_nfs_transport_pending_queue_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 6428 node_mountstats_nfs_transport_receives_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 26 node_mountstats_nfs_transport_sending_queue_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 6428 node_mountstats_nfs_transport_sends_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_write_bytes_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_write_pages_total{export="192.168.1.1:/srv/test",protocol="udp"} 0 # HELP node_netstat_Icmp6_InErrors Statistic Icmp6InErrors. # TYPE node_netstat_Icmp6_InErrors untyped node_netstat_Icmp6_InErrors 0 # HELP node_netstat_Icmp6_InMsgs Statistic Icmp6InMsgs. # TYPE node_netstat_Icmp6_InMsgs untyped node_netstat_Icmp6_InMsgs 0 # HELP node_netstat_Icmp6_OutMsgs Statistic Icmp6OutMsgs. # TYPE node_netstat_Icmp6_OutMsgs untyped node_netstat_Icmp6_OutMsgs 8 # 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_OutMsgs Statistic IcmpOutMsgs. # TYPE node_netstat_Icmp_OutMsgs untyped node_netstat_Icmp_OutMsgs 120 # HELP node_netstat_Ip6_InOctets Statistic Ip6InOctets. # TYPE node_netstat_Ip6_InOctets untyped node_netstat_Ip6_InOctets 460 # HELP node_netstat_Ip6_OutOctets Statistic Ip6OutOctets. # TYPE node_netstat_Ip6_OutOctets untyped node_netstat_Ip6_OutOctets 536 # HELP node_netstat_IpExt_InOctets Statistic IpExtInOctets. # TYPE node_netstat_IpExt_InOctets untyped node_netstat_IpExt_InOctets 6.28639697e+09 # HELP node_netstat_IpExt_OutOctets Statistic IpExtOutOctets. # TYPE node_netstat_IpExt_OutOctets untyped node_netstat_IpExt_OutOctets 2.786264347e+09 # HELP node_netstat_Ip_Forwarding Statistic IpForwarding. # TYPE node_netstat_Ip_Forwarding untyped node_netstat_Ip_Forwarding 1 # 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_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_Tcp_ActiveOpens Statistic TcpActiveOpens. # TYPE node_netstat_Tcp_ActiveOpens untyped node_netstat_Tcp_ActiveOpens 3556 # HELP node_netstat_Tcp_CurrEstab Statistic TcpCurrEstab. # TYPE node_netstat_Tcp_CurrEstab untyped node_netstat_Tcp_CurrEstab 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_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_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_UdpLite6_InErrors Statistic UdpLite6InErrors. # TYPE node_netstat_UdpLite6_InErrors untyped node_netstat_UdpLite6_InErrors 0 # HELP node_netstat_UdpLite_InErrors Statistic UdpLiteInErrors. # TYPE node_netstat_UdpLite_InErrors untyped node_netstat_UdpLite_InErrors 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_network_address_assign_type address_assign_type value of /sys/class/net/. # TYPE node_network_address_assign_type gauge node_network_address_assign_type{interface="eth0"} 3 # HELP node_network_carrier carrier value of /sys/class/net/. # TYPE node_network_carrier gauge node_network_carrier{interface="eth0"} 1 # HELP node_network_carrier_changes_total carrier_changes_total value of /sys/class/net/. # TYPE node_network_carrier_changes_total counter node_network_carrier_changes_total{interface="eth0"} 2 # HELP node_network_carrier_down_changes_total carrier_down_changes_total value of /sys/class/net/. # TYPE node_network_carrier_down_changes_total counter node_network_carrier_down_changes_total{interface="eth0"} 1 # HELP node_network_carrier_up_changes_total carrier_up_changes_total value of /sys/class/net/. # TYPE node_network_carrier_up_changes_total counter node_network_carrier_up_changes_total{interface="eth0"} 1 # HELP node_network_device_id device_id value of /sys/class/net/. # TYPE node_network_device_id gauge node_network_device_id{interface="eth0"} 32 # HELP node_network_dormant dormant value of /sys/class/net/. # TYPE node_network_dormant gauge node_network_dormant{interface="eth0"} 1 # HELP node_network_flags flags value of /sys/class/net/. # TYPE node_network_flags gauge node_network_flags{interface="eth0"} 4867 # HELP node_network_iface_id iface_id value of /sys/class/net/. # TYPE node_network_iface_id gauge node_network_iface_id{interface="eth0"} 2 # HELP node_network_iface_link iface_link value of /sys/class/net/. # TYPE node_network_iface_link gauge node_network_iface_link{interface="eth0"} 2 # HELP node_network_iface_link_mode iface_link_mode value of /sys/class/net/. # TYPE node_network_iface_link_mode gauge node_network_iface_link_mode{interface="eth0"} 1 # HELP node_network_info Non-numeric data from /sys/class/net/, value is always 1. # TYPE node_network_info gauge node_network_info{address="01:01:01:01:01:01",broadcast="ff:ff:ff:ff:ff:ff",device="eth0",duplex="full",ifalias="",operstate="up"} 1 # HELP node_network_mtu_bytes mtu_bytes value of /sys/class/net/. # TYPE node_network_mtu_bytes gauge node_network_mtu_bytes{interface="eth0"} 1500 # HELP node_network_name_assign_type name_assign_type value of /sys/class/net/. # TYPE node_network_name_assign_type gauge node_network_name_assign_type{interface="eth0"} 2 # HELP node_network_net_dev_group net_dev_group value of /sys/class/net/. # TYPE node_network_net_dev_group gauge node_network_net_dev_group{interface="eth0"} 0 # HELP node_network_protocol_type protocol_type value of /sys/class/net/. # TYPE node_network_protocol_type gauge node_network_protocol_type{interface="eth0"} 1 # HELP node_network_receive_bytes_total Network device statistic receive_bytes. # TYPE node_network_receive_bytes_total counter node_network_receive_bytes_total{device="docker0"} 6.4910168e+07 node_network_receive_bytes_total{device="eth0"} 6.8210035552e+10 node_network_receive_bytes_total{device="flannel.1"} 1.8144009813e+10 node_network_receive_bytes_total{device="ibr10:30"} 0 node_network_receive_bytes_total{device="lo"} 4.35303245e+08 node_network_receive_bytes_total{device="lxcbr0"} 0 node_network_receive_bytes_total{device="tun0"} 1888 node_network_receive_bytes_total{device="veth4B09XN"} 648 node_network_receive_bytes_total{device="wlan0"} 1.0437182923e+10 node_network_receive_bytes_total{device="💩0"} 5.7750104e+07 # HELP node_network_receive_compressed_total Network device statistic receive_compressed. # TYPE node_network_receive_compressed_total counter node_network_receive_compressed_total{device="docker0"} 0 node_network_receive_compressed_total{device="eth0"} 0 node_network_receive_compressed_total{device="flannel.1"} 0 node_network_receive_compressed_total{device="ibr10:30"} 0 node_network_receive_compressed_total{device="lo"} 0 node_network_receive_compressed_total{device="lxcbr0"} 0 node_network_receive_compressed_total{device="tun0"} 0 node_network_receive_compressed_total{device="veth4B09XN"} 0 node_network_receive_compressed_total{device="wlan0"} 0 node_network_receive_compressed_total{device="💩0"} 0 # HELP node_network_receive_drop_total Network device statistic receive_drop. # TYPE node_network_receive_drop_total counter node_network_receive_drop_total{device="docker0"} 0 node_network_receive_drop_total{device="eth0"} 0 node_network_receive_drop_total{device="flannel.1"} 0 node_network_receive_drop_total{device="ibr10:30"} 0 node_network_receive_drop_total{device="lo"} 0 node_network_receive_drop_total{device="lxcbr0"} 0 node_network_receive_drop_total{device="tun0"} 0 node_network_receive_drop_total{device="veth4B09XN"} 0 node_network_receive_drop_total{device="wlan0"} 0 node_network_receive_drop_total{device="💩0"} 0 # HELP node_network_receive_errs_total Network device statistic receive_errs. # TYPE node_network_receive_errs_total counter node_network_receive_errs_total{device="docker0"} 0 node_network_receive_errs_total{device="eth0"} 0 node_network_receive_errs_total{device="flannel.1"} 0 node_network_receive_errs_total{device="ibr10:30"} 0 node_network_receive_errs_total{device="lo"} 0 node_network_receive_errs_total{device="lxcbr0"} 0 node_network_receive_errs_total{device="tun0"} 0 node_network_receive_errs_total{device="veth4B09XN"} 0 node_network_receive_errs_total{device="wlan0"} 0 node_network_receive_errs_total{device="💩0"} 0 # HELP node_network_receive_fifo_total Network device statistic receive_fifo. # TYPE node_network_receive_fifo_total counter node_network_receive_fifo_total{device="docker0"} 0 node_network_receive_fifo_total{device="eth0"} 0 node_network_receive_fifo_total{device="flannel.1"} 0 node_network_receive_fifo_total{device="ibr10:30"} 0 node_network_receive_fifo_total{device="lo"} 0 node_network_receive_fifo_total{device="lxcbr0"} 0 node_network_receive_fifo_total{device="tun0"} 0 node_network_receive_fifo_total{device="veth4B09XN"} 0 node_network_receive_fifo_total{device="wlan0"} 0 node_network_receive_fifo_total{device="💩0"} 0 # HELP node_network_receive_frame_total Network device statistic receive_frame. # TYPE node_network_receive_frame_total counter node_network_receive_frame_total{device="docker0"} 0 node_network_receive_frame_total{device="eth0"} 0 node_network_receive_frame_total{device="flannel.1"} 0 node_network_receive_frame_total{device="ibr10:30"} 0 node_network_receive_frame_total{device="lo"} 0 node_network_receive_frame_total{device="lxcbr0"} 0 node_network_receive_frame_total{device="tun0"} 0 node_network_receive_frame_total{device="veth4B09XN"} 0 node_network_receive_frame_total{device="wlan0"} 0 node_network_receive_frame_total{device="💩0"} 0 # HELP node_network_receive_multicast_total Network device statistic receive_multicast. # TYPE node_network_receive_multicast_total counter node_network_receive_multicast_total{device="docker0"} 0 node_network_receive_multicast_total{device="eth0"} 0 node_network_receive_multicast_total{device="flannel.1"} 0 node_network_receive_multicast_total{device="ibr10:30"} 0 node_network_receive_multicast_total{device="lo"} 0 node_network_receive_multicast_total{device="lxcbr0"} 0 node_network_receive_multicast_total{device="tun0"} 0 node_network_receive_multicast_total{device="veth4B09XN"} 0 node_network_receive_multicast_total{device="wlan0"} 0 node_network_receive_multicast_total{device="💩0"} 72 # HELP node_network_receive_packets_total Network device statistic receive_packets. # TYPE node_network_receive_packets_total counter node_network_receive_packets_total{device="docker0"} 1.065585e+06 node_network_receive_packets_total{device="eth0"} 5.20993275e+08 node_network_receive_packets_total{device="flannel.1"} 2.28499337e+08 node_network_receive_packets_total{device="ibr10:30"} 0 node_network_receive_packets_total{device="lo"} 1.832522e+06 node_network_receive_packets_total{device="lxcbr0"} 0 node_network_receive_packets_total{device="tun0"} 24 node_network_receive_packets_total{device="veth4B09XN"} 8 node_network_receive_packets_total{device="wlan0"} 1.3899359e+07 node_network_receive_packets_total{device="💩0"} 105557 # HELP node_network_speed_bytes speed_bytes value of /sys/class/net/. # TYPE node_network_speed_bytes gauge node_network_speed_bytes{interface="eth0"} 1.25e+08 # HELP node_network_transmit_bytes_total Network device statistic transmit_bytes. # TYPE node_network_transmit_bytes_total counter node_network_transmit_bytes_total{device="docker0"} 2.681662018e+09 node_network_transmit_bytes_total{device="eth0"} 9.315587528e+09 node_network_transmit_bytes_total{device="flannel.1"} 2.0758990068e+10 node_network_transmit_bytes_total{device="ibr10:30"} 0 node_network_transmit_bytes_total{device="lo"} 4.35303245e+08 node_network_transmit_bytes_total{device="lxcbr0"} 2.630299e+06 node_network_transmit_bytes_total{device="tun0"} 67120 node_network_transmit_bytes_total{device="veth4B09XN"} 1.943284e+06 node_network_transmit_bytes_total{device="wlan0"} 2.85164936e+09 node_network_transmit_bytes_total{device="💩0"} 4.04570255e+08 # HELP node_network_transmit_carrier_total Network device statistic transmit_carrier. # TYPE node_network_transmit_carrier_total counter node_network_transmit_carrier_total{device="docker0"} 0 node_network_transmit_carrier_total{device="eth0"} 0 node_network_transmit_carrier_total{device="flannel.1"} 0 node_network_transmit_carrier_total{device="ibr10:30"} 0 node_network_transmit_carrier_total{device="lo"} 0 node_network_transmit_carrier_total{device="lxcbr0"} 0 node_network_transmit_carrier_total{device="tun0"} 0 node_network_transmit_carrier_total{device="veth4B09XN"} 0 node_network_transmit_carrier_total{device="wlan0"} 0 node_network_transmit_carrier_total{device="💩0"} 0 # HELP node_network_transmit_colls_total Network device statistic transmit_colls. # TYPE node_network_transmit_colls_total counter node_network_transmit_colls_total{device="docker0"} 0 node_network_transmit_colls_total{device="eth0"} 0 node_network_transmit_colls_total{device="flannel.1"} 0 node_network_transmit_colls_total{device="ibr10:30"} 0 node_network_transmit_colls_total{device="lo"} 0 node_network_transmit_colls_total{device="lxcbr0"} 0 node_network_transmit_colls_total{device="tun0"} 0 node_network_transmit_colls_total{device="veth4B09XN"} 0 node_network_transmit_colls_total{device="wlan0"} 0 node_network_transmit_colls_total{device="💩0"} 0 # HELP node_network_transmit_compressed_total Network device statistic transmit_compressed. # TYPE node_network_transmit_compressed_total counter node_network_transmit_compressed_total{device="docker0"} 0 node_network_transmit_compressed_total{device="eth0"} 0 node_network_transmit_compressed_total{device="flannel.1"} 0 node_network_transmit_compressed_total{device="ibr10:30"} 0 node_network_transmit_compressed_total{device="lo"} 0 node_network_transmit_compressed_total{device="lxcbr0"} 0 node_network_transmit_compressed_total{device="tun0"} 0 node_network_transmit_compressed_total{device="veth4B09XN"} 0 node_network_transmit_compressed_total{device="wlan0"} 0 node_network_transmit_compressed_total{device="💩0"} 0 # HELP node_network_transmit_drop_total Network device statistic transmit_drop. # TYPE node_network_transmit_drop_total counter node_network_transmit_drop_total{device="docker0"} 0 node_network_transmit_drop_total{device="eth0"} 0 node_network_transmit_drop_total{device="flannel.1"} 64 node_network_transmit_drop_total{device="ibr10:30"} 0 node_network_transmit_drop_total{device="lo"} 0 node_network_transmit_drop_total{device="lxcbr0"} 0 node_network_transmit_drop_total{device="tun0"} 0 node_network_transmit_drop_total{device="veth4B09XN"} 0 node_network_transmit_drop_total{device="wlan0"} 0 node_network_transmit_drop_total{device="💩0"} 0 # HELP node_network_transmit_errs_total Network device statistic transmit_errs. # TYPE node_network_transmit_errs_total counter node_network_transmit_errs_total{device="docker0"} 0 node_network_transmit_errs_total{device="eth0"} 0 node_network_transmit_errs_total{device="flannel.1"} 0 node_network_transmit_errs_total{device="ibr10:30"} 0 node_network_transmit_errs_total{device="lo"} 0 node_network_transmit_errs_total{device="lxcbr0"} 0 node_network_transmit_errs_total{device="tun0"} 0 node_network_transmit_errs_total{device="veth4B09XN"} 0 node_network_transmit_errs_total{device="wlan0"} 0 node_network_transmit_errs_total{device="💩0"} 0 # HELP node_network_transmit_fifo_total Network device statistic transmit_fifo. # TYPE node_network_transmit_fifo_total counter node_network_transmit_fifo_total{device="docker0"} 0 node_network_transmit_fifo_total{device="eth0"} 0 node_network_transmit_fifo_total{device="flannel.1"} 0 node_network_transmit_fifo_total{device="ibr10:30"} 0 node_network_transmit_fifo_total{device="lo"} 0 node_network_transmit_fifo_total{device="lxcbr0"} 0 node_network_transmit_fifo_total{device="tun0"} 0 node_network_transmit_fifo_total{device="veth4B09XN"} 0 node_network_transmit_fifo_total{device="wlan0"} 0 node_network_transmit_fifo_total{device="💩0"} 0 # HELP node_network_transmit_packets_total Network device statistic transmit_packets. # TYPE node_network_transmit_packets_total counter node_network_transmit_packets_total{device="docker0"} 1.929779e+06 node_network_transmit_packets_total{device="eth0"} 4.3451486e+07 node_network_transmit_packets_total{device="flannel.1"} 2.58369223e+08 node_network_transmit_packets_total{device="ibr10:30"} 0 node_network_transmit_packets_total{device="lo"} 1.832522e+06 node_network_transmit_packets_total{device="lxcbr0"} 28339 node_network_transmit_packets_total{device="tun0"} 934 node_network_transmit_packets_total{device="veth4B09XN"} 10640 node_network_transmit_packets_total{device="wlan0"} 1.17262e+07 node_network_transmit_packets_total{device="💩0"} 304261 # HELP node_network_transmit_queue_length transmit_queue_length value of /sys/class/net/. # TYPE node_network_transmit_queue_length gauge node_network_transmit_queue_length{interface="eth0"} 1000 # HELP node_network_up Value is 1 if operstate is 'up', 0 otherwise. # TYPE node_network_up gauge node_network_up{device="eth0"} 1 # 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_connections_total Total number of NFSd TCP connections. # TYPE node_nfs_connections_total counter node_nfs_connections_total 45 # HELP node_nfs_packets_total Total NFSd network packets (sent+received) by protocol type. # TYPE node_nfs_packets_total counter node_nfs_packets_total{protocol="tcp"} 69 node_nfs_packets_total{protocol="udp"} 70 # HELP node_nfs_requests_total Number of NFS procedures invoked. # TYPE node_nfs_requests_total counter node_nfs_requests_total{method="Access",proto="3"} 1.17661341e+08 node_nfs_requests_total{method="Access",proto="4"} 58 node_nfs_requests_total{method="Allocate",proto="4"} 0 node_nfs_requests_total{method="BindConnToSession",proto="4"} 0 node_nfs_requests_total{method="Clone",proto="4"} 0 node_nfs_requests_total{method="Close",proto="4"} 28 node_nfs_requests_total{method="Commit",proto="3"} 23729 node_nfs_requests_total{method="Commit",proto="4"} 83 node_nfs_requests_total{method="Create",proto="2"} 52 node_nfs_requests_total{method="Create",proto="3"} 2.993289e+06 node_nfs_requests_total{method="Create",proto="4"} 15 node_nfs_requests_total{method="CreateSession",proto="4"} 32 node_nfs_requests_total{method="DeAllocate",proto="4"} 0 node_nfs_requests_total{method="DelegReturn",proto="4"} 97 node_nfs_requests_total{method="DestroyClientID",proto="4"} 0 node_nfs_requests_total{method="DestroySession",proto="4"} 67 node_nfs_requests_total{method="ExchangeID",proto="4"} 58 node_nfs_requests_total{method="FreeStateID",proto="4"} 0 node_nfs_requests_total{method="FsInfo",proto="3"} 2 node_nfs_requests_total{method="FsInfo",proto="4"} 68 node_nfs_requests_total{method="FsLocations",proto="4"} 32 node_nfs_requests_total{method="FsStat",proto="2"} 82 node_nfs_requests_total{method="FsStat",proto="3"} 13332 node_nfs_requests_total{method="FsidPresent",proto="4"} 11 node_nfs_requests_total{method="GetACL",proto="4"} 36 node_nfs_requests_total{method="GetAttr",proto="2"} 57 node_nfs_requests_total{method="GetAttr",proto="3"} 1.061909262e+09 node_nfs_requests_total{method="GetDeviceInfo",proto="4"} 1 node_nfs_requests_total{method="GetDeviceList",proto="4"} 0 node_nfs_requests_total{method="GetLeaseTime",proto="4"} 28 node_nfs_requests_total{method="Getattr",proto="4"} 88 node_nfs_requests_total{method="LayoutCommit",proto="4"} 26 node_nfs_requests_total{method="LayoutGet",proto="4"} 90 node_nfs_requests_total{method="LayoutReturn",proto="4"} 0 node_nfs_requests_total{method="LayoutStats",proto="4"} 0 node_nfs_requests_total{method="Link",proto="2"} 17 node_nfs_requests_total{method="Link",proto="3"} 0 node_nfs_requests_total{method="Link",proto="4"} 21 node_nfs_requests_total{method="Lock",proto="4"} 39 node_nfs_requests_total{method="Lockt",proto="4"} 68 node_nfs_requests_total{method="Locku",proto="4"} 59 node_nfs_requests_total{method="Lookup",proto="2"} 71 node_nfs_requests_total{method="Lookup",proto="3"} 4.077635e+06 node_nfs_requests_total{method="Lookup",proto="4"} 29 node_nfs_requests_total{method="LookupRoot",proto="4"} 74 node_nfs_requests_total{method="MkDir",proto="2"} 50 node_nfs_requests_total{method="MkDir",proto="3"} 590 node_nfs_requests_total{method="MkNod",proto="3"} 0 node_nfs_requests_total{method="Null",proto="2"} 16 node_nfs_requests_total{method="Null",proto="3"} 0 node_nfs_requests_total{method="Null",proto="4"} 98 node_nfs_requests_total{method="Open",proto="4"} 85 node_nfs_requests_total{method="OpenConfirm",proto="4"} 23 node_nfs_requests_total{method="OpenDowngrade",proto="4"} 1 node_nfs_requests_total{method="OpenNoattr",proto="4"} 24 node_nfs_requests_total{method="PathConf",proto="3"} 1 node_nfs_requests_total{method="Pathconf",proto="4"} 53 node_nfs_requests_total{method="Read",proto="2"} 45 node_nfs_requests_total{method="Read",proto="3"} 2.9391916e+07 node_nfs_requests_total{method="Read",proto="4"} 51 node_nfs_requests_total{method="ReadDir",proto="2"} 70 node_nfs_requests_total{method="ReadDir",proto="3"} 3983 node_nfs_requests_total{method="ReadDir",proto="4"} 66 node_nfs_requests_total{method="ReadDirPlus",proto="3"} 92385 node_nfs_requests_total{method="ReadLink",proto="2"} 73 node_nfs_requests_total{method="ReadLink",proto="3"} 5 node_nfs_requests_total{method="ReadLink",proto="4"} 54 node_nfs_requests_total{method="ReclaimComplete",proto="4"} 35 node_nfs_requests_total{method="ReleaseLockowner",proto="4"} 85 node_nfs_requests_total{method="Remove",proto="2"} 83 node_nfs_requests_total{method="Remove",proto="3"} 7815 node_nfs_requests_total{method="Remove",proto="4"} 69 node_nfs_requests_total{method="Rename",proto="2"} 61 node_nfs_requests_total{method="Rename",proto="3"} 1130 node_nfs_requests_total{method="Rename",proto="4"} 96 node_nfs_requests_total{method="Renew",proto="4"} 83 node_nfs_requests_total{method="RmDir",proto="2"} 23 node_nfs_requests_total{method="RmDir",proto="3"} 15 node_nfs_requests_total{method="Root",proto="2"} 52 node_nfs_requests_total{method="Secinfo",proto="4"} 81 node_nfs_requests_total{method="SecinfoNoName",proto="4"} 0 node_nfs_requests_total{method="Seek",proto="4"} 0 node_nfs_requests_total{method="Sequence",proto="4"} 13 node_nfs_requests_total{method="ServerCaps",proto="4"} 56 node_nfs_requests_total{method="SetACL",proto="4"} 49 node_nfs_requests_total{method="SetAttr",proto="2"} 74 node_nfs_requests_total{method="SetAttr",proto="3"} 48906 node_nfs_requests_total{method="SetClientID",proto="4"} 12 node_nfs_requests_total{method="SetClientIDConfirm",proto="4"} 84 node_nfs_requests_total{method="Setattr",proto="4"} 73 node_nfs_requests_total{method="StatFs",proto="4"} 86 node_nfs_requests_total{method="SymLink",proto="2"} 53 node_nfs_requests_total{method="SymLink",proto="3"} 0 node_nfs_requests_total{method="Symlink",proto="4"} 84 node_nfs_requests_total{method="TestStateID",proto="4"} 0 node_nfs_requests_total{method="WrCache",proto="2"} 86 node_nfs_requests_total{method="Write",proto="2"} 0 node_nfs_requests_total{method="Write",proto="3"} 2.570425e+06 node_nfs_requests_total{method="Write",proto="4"} 54 # HELP node_nfs_rpc_authentication_refreshes_total Number of RPC authentication refreshes performed. # TYPE node_nfs_rpc_authentication_refreshes_total counter node_nfs_rpc_authentication_refreshes_total 1.218815394e+09 # HELP node_nfs_rpc_retransmissions_total Number of RPC transmissions performed. # TYPE node_nfs_rpc_retransmissions_total counter node_nfs_rpc_retransmissions_total 374636 # HELP node_nfs_rpcs_total Total number of RPCs performed. # TYPE node_nfs_rpcs_total counter node_nfs_rpcs_total 1.218785755e+09 # HELP node_nfsd_connections_total Total number of NFSd TCP connections. # TYPE node_nfsd_connections_total counter node_nfsd_connections_total 1 # HELP node_nfsd_disk_bytes_read_total Total NFSd bytes read. # TYPE node_nfsd_disk_bytes_read_total counter node_nfsd_disk_bytes_read_total 1.572864e+08 # HELP node_nfsd_disk_bytes_written_total Total NFSd bytes written. # TYPE node_nfsd_disk_bytes_written_total counter node_nfsd_disk_bytes_written_total 72864 # HELP node_nfsd_file_handles_stale_total Total number of NFSd stale file handles # TYPE node_nfsd_file_handles_stale_total counter node_nfsd_file_handles_stale_total 0 # HELP node_nfsd_packets_total Total NFSd network packets (sent+received) by protocol type. # TYPE node_nfsd_packets_total counter node_nfsd_packets_total{proto="tcp"} 917 node_nfsd_packets_total{proto="udp"} 55 # HELP node_nfsd_read_ahead_cache_not_found_total Total number of NFSd read ahead cache not found. # TYPE node_nfsd_read_ahead_cache_not_found_total counter node_nfsd_read_ahead_cache_not_found_total 0 # HELP node_nfsd_read_ahead_cache_size_blocks How large the read ahead cache is in blocks. # TYPE node_nfsd_read_ahead_cache_size_blocks gauge node_nfsd_read_ahead_cache_size_blocks 32 # HELP node_nfsd_reply_cache_hits_total Total number of NFSd Reply Cache hits (client lost server response). # TYPE node_nfsd_reply_cache_hits_total counter node_nfsd_reply_cache_hits_total 0 # HELP node_nfsd_reply_cache_misses_total Total number of NFSd Reply Cache an operation that requires caching (idempotent). # TYPE node_nfsd_reply_cache_misses_total counter node_nfsd_reply_cache_misses_total 6 # HELP node_nfsd_reply_cache_nocache_total Total number of NFSd Reply Cache non-idempotent operations (rename/delete/…). # TYPE node_nfsd_reply_cache_nocache_total counter node_nfsd_reply_cache_nocache_total 18622 # HELP node_nfsd_requests_total Total number NFSd Requests by method and protocol. # TYPE node_nfsd_requests_total counter node_nfsd_requests_total{method="Access",proto="3"} 111 node_nfsd_requests_total{method="Access",proto="4"} 1098 node_nfsd_requests_total{method="Close",proto="4"} 2 node_nfsd_requests_total{method="Commit",proto="3"} 0 node_nfsd_requests_total{method="Commit",proto="4"} 0 node_nfsd_requests_total{method="Create",proto="2"} 0 node_nfsd_requests_total{method="Create",proto="3"} 0 node_nfsd_requests_total{method="Create",proto="4"} 0 node_nfsd_requests_total{method="DelegPurge",proto="4"} 0 node_nfsd_requests_total{method="DelegReturn",proto="4"} 0 node_nfsd_requests_total{method="FsInfo",proto="3"} 2 node_nfsd_requests_total{method="FsStat",proto="2"} 2 node_nfsd_requests_total{method="FsStat",proto="3"} 0 node_nfsd_requests_total{method="GetAttr",proto="2"} 69 node_nfsd_requests_total{method="GetAttr",proto="3"} 112 node_nfsd_requests_total{method="GetAttr",proto="4"} 8179 node_nfsd_requests_total{method="GetFH",proto="4"} 5896 node_nfsd_requests_total{method="Link",proto="2"} 0 node_nfsd_requests_total{method="Link",proto="3"} 0 node_nfsd_requests_total{method="Link",proto="4"} 0 node_nfsd_requests_total{method="Lock",proto="4"} 0 node_nfsd_requests_total{method="Lockt",proto="4"} 0 node_nfsd_requests_total{method="Locku",proto="4"} 0 node_nfsd_requests_total{method="Lookup",proto="2"} 4410 node_nfsd_requests_total{method="Lookup",proto="3"} 2719 node_nfsd_requests_total{method="Lookup",proto="4"} 5900 node_nfsd_requests_total{method="LookupRoot",proto="4"} 0 node_nfsd_requests_total{method="MkDir",proto="2"} 0 node_nfsd_requests_total{method="MkDir",proto="3"} 0 node_nfsd_requests_total{method="MkNod",proto="3"} 0 node_nfsd_requests_total{method="Nverify",proto="4"} 0 node_nfsd_requests_total{method="Open",proto="4"} 2 node_nfsd_requests_total{method="OpenAttr",proto="4"} 0 node_nfsd_requests_total{method="OpenConfirm",proto="4"} 2 node_nfsd_requests_total{method="OpenDgrd",proto="4"} 0 node_nfsd_requests_total{method="PathConf",proto="3"} 1 node_nfsd_requests_total{method="PutFH",proto="4"} 9609 node_nfsd_requests_total{method="Read",proto="2"} 0 node_nfsd_requests_total{method="Read",proto="3"} 0 node_nfsd_requests_total{method="Read",proto="4"} 150 node_nfsd_requests_total{method="ReadDir",proto="2"} 99 node_nfsd_requests_total{method="ReadDir",proto="3"} 27 node_nfsd_requests_total{method="ReadDir",proto="4"} 1272 node_nfsd_requests_total{method="ReadDirPlus",proto="3"} 216 node_nfsd_requests_total{method="ReadLink",proto="2"} 0 node_nfsd_requests_total{method="ReadLink",proto="3"} 0 node_nfsd_requests_total{method="ReadLink",proto="4"} 0 node_nfsd_requests_total{method="RelLockOwner",proto="4"} 0 node_nfsd_requests_total{method="Remove",proto="2"} 0 node_nfsd_requests_total{method="Remove",proto="3"} 0 node_nfsd_requests_total{method="Remove",proto="4"} 0 node_nfsd_requests_total{method="Rename",proto="2"} 0 node_nfsd_requests_total{method="Rename",proto="3"} 0 node_nfsd_requests_total{method="Rename",proto="4"} 0 node_nfsd_requests_total{method="Renew",proto="4"} 1236 node_nfsd_requests_total{method="RestoreFH",proto="4"} 0 node_nfsd_requests_total{method="RmDir",proto="2"} 0 node_nfsd_requests_total{method="RmDir",proto="3"} 0 node_nfsd_requests_total{method="Root",proto="2"} 0 node_nfsd_requests_total{method="SaveFH",proto="4"} 0 node_nfsd_requests_total{method="SecInfo",proto="4"} 0 node_nfsd_requests_total{method="SetAttr",proto="2"} 0 node_nfsd_requests_total{method="SetAttr",proto="3"} 0 node_nfsd_requests_total{method="SetAttr",proto="4"} 0 node_nfsd_requests_total{method="SymLink",proto="2"} 0 node_nfsd_requests_total{method="SymLink",proto="3"} 0 node_nfsd_requests_total{method="Verify",proto="4"} 3 node_nfsd_requests_total{method="WrCache",proto="2"} 0 node_nfsd_requests_total{method="Write",proto="2"} 0 node_nfsd_requests_total{method="Write",proto="3"} 0 node_nfsd_requests_total{method="Write",proto="4"} 3 # HELP node_nfsd_rpc_errors_total Total number of NFSd RPC errors by error type. # TYPE node_nfsd_rpc_errors_total counter node_nfsd_rpc_errors_total{error="auth"} 2 node_nfsd_rpc_errors_total{error="cInt"} 0 node_nfsd_rpc_errors_total{error="fmt"} 1 # HELP node_nfsd_server_rpcs_total Total number of NFSd RPCs. # TYPE node_nfsd_server_rpcs_total counter node_nfsd_server_rpcs_total 18628 # HELP node_nfsd_server_threads Total number of NFSd kernel threads that are running. # TYPE node_nfsd_server_threads gauge node_nfsd_server_threads 8 # HELP node_pressure_cpu_waiting_seconds_total Total time in seconds that processes have waited for CPU time # TYPE node_pressure_cpu_waiting_seconds_total counter node_pressure_cpu_waiting_seconds_total 14.036781000000001 # HELP node_pressure_io_stalled_seconds_total Total time in seconds no process could make progress due to IO congestion # TYPE node_pressure_io_stalled_seconds_total counter node_pressure_io_stalled_seconds_total 159.229614 # HELP node_pressure_io_waiting_seconds_total Total time in seconds that processes have waited due to IO congestion # TYPE node_pressure_io_waiting_seconds_total counter node_pressure_io_waiting_seconds_total 159.886802 # HELP node_pressure_memory_stalled_seconds_total Total time in seconds no process could make progress due to memory congestion # TYPE node_pressure_memory_stalled_seconds_total counter node_pressure_memory_stalled_seconds_total 0 # HELP node_pressure_memory_waiting_seconds_total Total time in seconds that processes have waited for memory # TYPE node_pressure_memory_waiting_seconds_total counter node_pressure_memory_waiting_seconds_total 0 # HELP node_processes_max_processes Number of max PIDs limit # TYPE node_processes_max_processes gauge node_processes_max_processes 123 # HELP node_processes_max_threads Limit of threads in the system # TYPE node_processes_max_threads gauge node_processes_max_threads 7801 # HELP node_processes_pids Number of PIDs # TYPE node_processes_pids gauge node_processes_pids 1 # HELP node_processes_state Number of processes in each state. # TYPE node_processes_state gauge node_processes_state{state="S"} 1 # HELP node_processes_threads Allocated threads in system # TYPE node_processes_threads gauge node_processes_threads 1 # 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="cpufreq"} 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="meminfo"} 1 node_scrape_collector_success{collector="meminfo_numa"} 1 node_scrape_collector_success{collector="mountstats"} 1 node_scrape_collector_success{collector="netclass"} 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="nfsd"} 1 node_scrape_collector_success{collector="pressure"} 1 node_scrape_collector_success{collector="processes"} 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="vmstat"} 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 65536 # 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_seconds Unixtime mtime of textfiles successfully read. # TYPE node_textfile_mtime_seconds 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_vmstat_oom_kill /proc/vmstat information field oom_kill. # TYPE node_vmstat_oom_kill untyped node_vmstat_oom_kill 0 # HELP node_vmstat_pgfault /proc/vmstat information field pgfault. # TYPE node_vmstat_pgfault untyped node_vmstat_pgfault 2.320168809e+09 # HELP node_vmstat_pgmajfault /proc/vmstat information field pgmajfault. # TYPE node_vmstat_pgmajfault untyped node_vmstat_pgmajfault 507162 # HELP node_vmstat_pgpgin /proc/vmstat information field pgpgin. # TYPE node_vmstat_pgpgin untyped node_vmstat_pgpgin 7.344136e+06 # HELP node_vmstat_pgpgout /proc/vmstat information field pgpgout. # TYPE node_vmstat_pgpgout untyped node_vmstat_pgpgout 1.541180581e+09 # HELP node_vmstat_pswpin /proc/vmstat information field pswpin. # TYPE node_vmstat_pswpin untyped node_vmstat_pswpin 1476 # HELP node_vmstat_pswpout /proc/vmstat information field pswpout. # TYPE node_vmstat_pswpout untyped node_vmstat_pswpout 35045 # 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",mac_address="01:02:03:04:05:06"} 2 node_wifi_station_beacon_loss_total{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 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",mac_address="01:02:03:04:05:06"} 60 node_wifi_station_connected_seconds_total{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 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",mac_address="01:02:03:04:05:06"} 0.8 node_wifi_station_inactive_seconds{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 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",mac_address="01:02:03:04:05:06"} 2.56e+08 node_wifi_station_receive_bits_per_second{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 1.28e+08 # HELP node_wifi_station_receive_bytes_total The total number of bytes received by a WiFi station. # TYPE node_wifi_station_receive_bytes_total counter node_wifi_station_receive_bytes_total{device="wlan0",mac_address="01:02:03:04:05:06"} 0 node_wifi_station_receive_bytes_total{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 0 # 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",mac_address="01:02:03:04:05:06"} -26 node_wifi_station_signal_dbm{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} -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",mac_address="01:02:03:04:05:06"} 3.28e+08 node_wifi_station_transmit_bits_per_second{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 1.64e+08 # HELP node_wifi_station_transmit_bytes_total The total number of bytes transmitted by a WiFi station. # TYPE node_wifi_station_transmit_bytes_total counter node_wifi_station_transmit_bytes_total{device="wlan0",mac_address="01:02:03:04:05:06"} 0 node_wifi_station_transmit_bytes_total{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 0 # 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",mac_address="01:02:03:04:05:06"} 4 node_wifi_station_transmit_failed_total{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 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",mac_address="01:02:03:04:05:06"} 20 node_wifi_station_transmit_retries_total{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 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_abd_linear_cnt kstat.zfs.misc.abdstats.linear_cnt # TYPE node_zfs_abd_linear_cnt untyped node_zfs_abd_linear_cnt 62 # HELP node_zfs_abd_linear_data_size kstat.zfs.misc.abdstats.linear_data_size # TYPE node_zfs_abd_linear_data_size untyped node_zfs_abd_linear_data_size 223232 # HELP node_zfs_abd_scatter_chunk_waste kstat.zfs.misc.abdstats.scatter_chunk_waste # TYPE node_zfs_abd_scatter_chunk_waste untyped node_zfs_abd_scatter_chunk_waste 0 # HELP node_zfs_abd_scatter_cnt kstat.zfs.misc.abdstats.scatter_cnt # TYPE node_zfs_abd_scatter_cnt untyped node_zfs_abd_scatter_cnt 1 # HELP node_zfs_abd_scatter_data_size kstat.zfs.misc.abdstats.scatter_data_size # TYPE node_zfs_abd_scatter_data_size untyped node_zfs_abd_scatter_data_size 16384 # HELP node_zfs_abd_scatter_order_0 kstat.zfs.misc.abdstats.scatter_order_0 # TYPE node_zfs_abd_scatter_order_0 untyped node_zfs_abd_scatter_order_0 0 # HELP node_zfs_abd_scatter_order_1 kstat.zfs.misc.abdstats.scatter_order_1 # TYPE node_zfs_abd_scatter_order_1 untyped node_zfs_abd_scatter_order_1 0 # HELP node_zfs_abd_scatter_order_10 kstat.zfs.misc.abdstats.scatter_order_10 # TYPE node_zfs_abd_scatter_order_10 untyped node_zfs_abd_scatter_order_10 0 # HELP node_zfs_abd_scatter_order_2 kstat.zfs.misc.abdstats.scatter_order_2 # TYPE node_zfs_abd_scatter_order_2 untyped node_zfs_abd_scatter_order_2 1 # HELP node_zfs_abd_scatter_order_3 kstat.zfs.misc.abdstats.scatter_order_3 # TYPE node_zfs_abd_scatter_order_3 untyped node_zfs_abd_scatter_order_3 0 # HELP node_zfs_abd_scatter_order_4 kstat.zfs.misc.abdstats.scatter_order_4 # TYPE node_zfs_abd_scatter_order_4 untyped node_zfs_abd_scatter_order_4 0 # HELP node_zfs_abd_scatter_order_5 kstat.zfs.misc.abdstats.scatter_order_5 # TYPE node_zfs_abd_scatter_order_5 untyped node_zfs_abd_scatter_order_5 0 # HELP node_zfs_abd_scatter_order_6 kstat.zfs.misc.abdstats.scatter_order_6 # TYPE node_zfs_abd_scatter_order_6 untyped node_zfs_abd_scatter_order_6 0 # HELP node_zfs_abd_scatter_order_7 kstat.zfs.misc.abdstats.scatter_order_7 # TYPE node_zfs_abd_scatter_order_7 untyped node_zfs_abd_scatter_order_7 0 # HELP node_zfs_abd_scatter_order_8 kstat.zfs.misc.abdstats.scatter_order_8 # TYPE node_zfs_abd_scatter_order_8 untyped node_zfs_abd_scatter_order_8 0 # HELP node_zfs_abd_scatter_order_9 kstat.zfs.misc.abdstats.scatter_order_9 # TYPE node_zfs_abd_scatter_order_9 untyped node_zfs_abd_scatter_order_9 0 # HELP node_zfs_abd_scatter_page_alloc_retry kstat.zfs.misc.abdstats.scatter_page_alloc_retry # TYPE node_zfs_abd_scatter_page_alloc_retry untyped node_zfs_abd_scatter_page_alloc_retry 0 # HELP node_zfs_abd_scatter_page_multi_chunk kstat.zfs.misc.abdstats.scatter_page_multi_chunk # TYPE node_zfs_abd_scatter_page_multi_chunk untyped node_zfs_abd_scatter_page_multi_chunk 0 # HELP node_zfs_abd_scatter_page_multi_zone kstat.zfs.misc.abdstats.scatter_page_multi_zone # TYPE node_zfs_abd_scatter_page_multi_zone untyped node_zfs_abd_scatter_page_multi_zone 0 # HELP node_zfs_abd_scatter_sg_table_retry kstat.zfs.misc.abdstats.scatter_sg_table_retry # TYPE node_zfs_abd_scatter_sg_table_retry untyped node_zfs_abd_scatter_sg_table_retry 0 # HELP node_zfs_abd_struct_size kstat.zfs.misc.abdstats.struct_size # TYPE node_zfs_abd_struct_size untyped node_zfs_abd_struct_size 2520 # 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_dbuf_dbuf_cache_count kstat.zfs.misc.dbuf_stats.dbuf_cache_count # TYPE node_zfs_dbuf_dbuf_cache_count untyped node_zfs_dbuf_dbuf_cache_count 27 # HELP node_zfs_dbuf_dbuf_cache_hiwater_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_hiwater_bytes # TYPE node_zfs_dbuf_dbuf_cache_hiwater_bytes untyped node_zfs_dbuf_dbuf_cache_hiwater_bytes 6.9117804e+07 # HELP node_zfs_dbuf_dbuf_cache_level_0 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_0 # TYPE node_zfs_dbuf_dbuf_cache_level_0 untyped node_zfs_dbuf_dbuf_cache_level_0 27 # HELP node_zfs_dbuf_dbuf_cache_level_0_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_0_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_0_bytes untyped node_zfs_dbuf_dbuf_cache_level_0_bytes 302080 # HELP node_zfs_dbuf_dbuf_cache_level_1 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_1 # TYPE node_zfs_dbuf_dbuf_cache_level_1 untyped node_zfs_dbuf_dbuf_cache_level_1 0 # HELP node_zfs_dbuf_dbuf_cache_level_10 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_10 # TYPE node_zfs_dbuf_dbuf_cache_level_10 untyped node_zfs_dbuf_dbuf_cache_level_10 0 # HELP node_zfs_dbuf_dbuf_cache_level_10_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_10_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_10_bytes untyped node_zfs_dbuf_dbuf_cache_level_10_bytes 0 # HELP node_zfs_dbuf_dbuf_cache_level_11 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_11 # TYPE node_zfs_dbuf_dbuf_cache_level_11 untyped node_zfs_dbuf_dbuf_cache_level_11 0 # HELP node_zfs_dbuf_dbuf_cache_level_11_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_11_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_11_bytes untyped node_zfs_dbuf_dbuf_cache_level_11_bytes 0 # HELP node_zfs_dbuf_dbuf_cache_level_1_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_1_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_1_bytes untyped node_zfs_dbuf_dbuf_cache_level_1_bytes 0 # HELP node_zfs_dbuf_dbuf_cache_level_2 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_2 # TYPE node_zfs_dbuf_dbuf_cache_level_2 untyped node_zfs_dbuf_dbuf_cache_level_2 0 # HELP node_zfs_dbuf_dbuf_cache_level_2_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_2_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_2_bytes untyped node_zfs_dbuf_dbuf_cache_level_2_bytes 0 # HELP node_zfs_dbuf_dbuf_cache_level_3 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_3 # TYPE node_zfs_dbuf_dbuf_cache_level_3 untyped node_zfs_dbuf_dbuf_cache_level_3 0 # HELP node_zfs_dbuf_dbuf_cache_level_3_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_3_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_3_bytes untyped node_zfs_dbuf_dbuf_cache_level_3_bytes 0 # HELP node_zfs_dbuf_dbuf_cache_level_4 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_4 # TYPE node_zfs_dbuf_dbuf_cache_level_4 untyped node_zfs_dbuf_dbuf_cache_level_4 0 # HELP node_zfs_dbuf_dbuf_cache_level_4_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_4_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_4_bytes untyped node_zfs_dbuf_dbuf_cache_level_4_bytes 0 # HELP node_zfs_dbuf_dbuf_cache_level_5 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_5 # TYPE node_zfs_dbuf_dbuf_cache_level_5 untyped node_zfs_dbuf_dbuf_cache_level_5 0 # HELP node_zfs_dbuf_dbuf_cache_level_5_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_5_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_5_bytes untyped node_zfs_dbuf_dbuf_cache_level_5_bytes 0 # HELP node_zfs_dbuf_dbuf_cache_level_6 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_6 # TYPE node_zfs_dbuf_dbuf_cache_level_6 untyped node_zfs_dbuf_dbuf_cache_level_6 0 # HELP node_zfs_dbuf_dbuf_cache_level_6_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_6_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_6_bytes untyped node_zfs_dbuf_dbuf_cache_level_6_bytes 0 # HELP node_zfs_dbuf_dbuf_cache_level_7 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_7 # TYPE node_zfs_dbuf_dbuf_cache_level_7 untyped node_zfs_dbuf_dbuf_cache_level_7 0 # HELP node_zfs_dbuf_dbuf_cache_level_7_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_7_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_7_bytes untyped node_zfs_dbuf_dbuf_cache_level_7_bytes 0 # HELP node_zfs_dbuf_dbuf_cache_level_8 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_8 # TYPE node_zfs_dbuf_dbuf_cache_level_8 untyped node_zfs_dbuf_dbuf_cache_level_8 0 # HELP node_zfs_dbuf_dbuf_cache_level_8_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_8_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_8_bytes untyped node_zfs_dbuf_dbuf_cache_level_8_bytes 0 # HELP node_zfs_dbuf_dbuf_cache_level_9 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_9 # TYPE node_zfs_dbuf_dbuf_cache_level_9 untyped node_zfs_dbuf_dbuf_cache_level_9 0 # HELP node_zfs_dbuf_dbuf_cache_level_9_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_9_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_9_bytes untyped node_zfs_dbuf_dbuf_cache_level_9_bytes 0 # HELP node_zfs_dbuf_dbuf_cache_lowater_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_lowater_bytes # TYPE node_zfs_dbuf_dbuf_cache_lowater_bytes untyped node_zfs_dbuf_dbuf_cache_lowater_bytes 5.6550932e+07 # HELP node_zfs_dbuf_dbuf_cache_max_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_max_bytes # TYPE node_zfs_dbuf_dbuf_cache_max_bytes untyped node_zfs_dbuf_dbuf_cache_max_bytes 6.2834368e+07 # HELP node_zfs_dbuf_dbuf_cache_size kstat.zfs.misc.dbuf_stats.dbuf_cache_size # TYPE node_zfs_dbuf_dbuf_cache_size untyped node_zfs_dbuf_dbuf_cache_size 302080 # HELP node_zfs_dbuf_dbuf_cache_size_max kstat.zfs.misc.dbuf_stats.dbuf_cache_size_max # TYPE node_zfs_dbuf_dbuf_cache_size_max untyped node_zfs_dbuf_dbuf_cache_size_max 394240 # HELP node_zfs_dbuf_dbuf_cache_total_evicts kstat.zfs.misc.dbuf_stats.dbuf_cache_total_evicts # TYPE node_zfs_dbuf_dbuf_cache_total_evicts untyped node_zfs_dbuf_dbuf_cache_total_evicts 0 # HELP node_zfs_dbuf_hash_chain_max kstat.zfs.misc.dbuf_stats.hash_chain_max # TYPE node_zfs_dbuf_hash_chain_max untyped node_zfs_dbuf_hash_chain_max 0 # HELP node_zfs_dbuf_hash_chains kstat.zfs.misc.dbuf_stats.hash_chains # TYPE node_zfs_dbuf_hash_chains untyped node_zfs_dbuf_hash_chains 0 # HELP node_zfs_dbuf_hash_collisions kstat.zfs.misc.dbuf_stats.hash_collisions # TYPE node_zfs_dbuf_hash_collisions untyped node_zfs_dbuf_hash_collisions 0 # HELP node_zfs_dbuf_hash_dbuf_level_0 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_0 # TYPE node_zfs_dbuf_hash_dbuf_level_0 untyped node_zfs_dbuf_hash_dbuf_level_0 37 # HELP node_zfs_dbuf_hash_dbuf_level_0_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_0_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_0_bytes untyped node_zfs_dbuf_hash_dbuf_level_0_bytes 465920 # HELP node_zfs_dbuf_hash_dbuf_level_1 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_1 # TYPE node_zfs_dbuf_hash_dbuf_level_1 untyped node_zfs_dbuf_hash_dbuf_level_1 10 # HELP node_zfs_dbuf_hash_dbuf_level_10 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_10 # TYPE node_zfs_dbuf_hash_dbuf_level_10 untyped node_zfs_dbuf_hash_dbuf_level_10 0 # HELP node_zfs_dbuf_hash_dbuf_level_10_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_10_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_10_bytes untyped node_zfs_dbuf_hash_dbuf_level_10_bytes 0 # HELP node_zfs_dbuf_hash_dbuf_level_11 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_11 # TYPE node_zfs_dbuf_hash_dbuf_level_11 untyped node_zfs_dbuf_hash_dbuf_level_11 0 # HELP node_zfs_dbuf_hash_dbuf_level_11_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_11_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_11_bytes untyped node_zfs_dbuf_hash_dbuf_level_11_bytes 0 # HELP node_zfs_dbuf_hash_dbuf_level_1_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_1_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_1_bytes untyped node_zfs_dbuf_hash_dbuf_level_1_bytes 1.31072e+06 # HELP node_zfs_dbuf_hash_dbuf_level_2 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_2 # TYPE node_zfs_dbuf_hash_dbuf_level_2 untyped node_zfs_dbuf_hash_dbuf_level_2 2 # HELP node_zfs_dbuf_hash_dbuf_level_2_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_2_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_2_bytes untyped node_zfs_dbuf_hash_dbuf_level_2_bytes 262144 # HELP node_zfs_dbuf_hash_dbuf_level_3 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_3 # TYPE node_zfs_dbuf_hash_dbuf_level_3 untyped node_zfs_dbuf_hash_dbuf_level_3 2 # HELP node_zfs_dbuf_hash_dbuf_level_3_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_3_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_3_bytes untyped node_zfs_dbuf_hash_dbuf_level_3_bytes 262144 # HELP node_zfs_dbuf_hash_dbuf_level_4 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_4 # TYPE node_zfs_dbuf_hash_dbuf_level_4 untyped node_zfs_dbuf_hash_dbuf_level_4 2 # HELP node_zfs_dbuf_hash_dbuf_level_4_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_4_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_4_bytes untyped node_zfs_dbuf_hash_dbuf_level_4_bytes 262144 # HELP node_zfs_dbuf_hash_dbuf_level_5 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_5 # TYPE node_zfs_dbuf_hash_dbuf_level_5 untyped node_zfs_dbuf_hash_dbuf_level_5 2 # HELP node_zfs_dbuf_hash_dbuf_level_5_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_5_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_5_bytes untyped node_zfs_dbuf_hash_dbuf_level_5_bytes 262144 # HELP node_zfs_dbuf_hash_dbuf_level_6 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_6 # TYPE node_zfs_dbuf_hash_dbuf_level_6 untyped node_zfs_dbuf_hash_dbuf_level_6 0 # HELP node_zfs_dbuf_hash_dbuf_level_6_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_6_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_6_bytes untyped node_zfs_dbuf_hash_dbuf_level_6_bytes 0 # HELP node_zfs_dbuf_hash_dbuf_level_7 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_7 # TYPE node_zfs_dbuf_hash_dbuf_level_7 untyped node_zfs_dbuf_hash_dbuf_level_7 0 # HELP node_zfs_dbuf_hash_dbuf_level_7_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_7_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_7_bytes untyped node_zfs_dbuf_hash_dbuf_level_7_bytes 0 # HELP node_zfs_dbuf_hash_dbuf_level_8 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_8 # TYPE node_zfs_dbuf_hash_dbuf_level_8 untyped node_zfs_dbuf_hash_dbuf_level_8 0 # HELP node_zfs_dbuf_hash_dbuf_level_8_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_8_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_8_bytes untyped node_zfs_dbuf_hash_dbuf_level_8_bytes 0 # HELP node_zfs_dbuf_hash_dbuf_level_9 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_9 # TYPE node_zfs_dbuf_hash_dbuf_level_9 untyped node_zfs_dbuf_hash_dbuf_level_9 0 # HELP node_zfs_dbuf_hash_dbuf_level_9_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_9_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_9_bytes untyped node_zfs_dbuf_hash_dbuf_level_9_bytes 0 # HELP node_zfs_dbuf_hash_elements kstat.zfs.misc.dbuf_stats.hash_elements # TYPE node_zfs_dbuf_hash_elements untyped node_zfs_dbuf_hash_elements 55 # HELP node_zfs_dbuf_hash_elements_max kstat.zfs.misc.dbuf_stats.hash_elements_max # TYPE node_zfs_dbuf_hash_elements_max untyped node_zfs_dbuf_hash_elements_max 55 # HELP node_zfs_dbuf_hash_hits kstat.zfs.misc.dbuf_stats.hash_hits # TYPE node_zfs_dbuf_hash_hits untyped node_zfs_dbuf_hash_hits 108807 # HELP node_zfs_dbuf_hash_insert_race kstat.zfs.misc.dbuf_stats.hash_insert_race # TYPE node_zfs_dbuf_hash_insert_race untyped node_zfs_dbuf_hash_insert_race 0 # HELP node_zfs_dbuf_hash_misses kstat.zfs.misc.dbuf_stats.hash_misses # TYPE node_zfs_dbuf_hash_misses untyped node_zfs_dbuf_hash_misses 1851 # 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_dnode_dnode_alloc_next_block kstat.zfs.misc.dnodestats.dnode_alloc_next_block # TYPE node_zfs_dnode_dnode_alloc_next_block untyped node_zfs_dnode_dnode_alloc_next_block 0 # HELP node_zfs_dnode_dnode_alloc_next_chunk kstat.zfs.misc.dnodestats.dnode_alloc_next_chunk # TYPE node_zfs_dnode_dnode_alloc_next_chunk untyped node_zfs_dnode_dnode_alloc_next_chunk 0 # HELP node_zfs_dnode_dnode_alloc_race kstat.zfs.misc.dnodestats.dnode_alloc_race # TYPE node_zfs_dnode_dnode_alloc_race untyped node_zfs_dnode_dnode_alloc_race 0 # HELP node_zfs_dnode_dnode_allocate kstat.zfs.misc.dnodestats.dnode_allocate # TYPE node_zfs_dnode_dnode_allocate untyped node_zfs_dnode_dnode_allocate 0 # HELP node_zfs_dnode_dnode_buf_evict kstat.zfs.misc.dnodestats.dnode_buf_evict # TYPE node_zfs_dnode_dnode_buf_evict untyped node_zfs_dnode_dnode_buf_evict 17 # HELP node_zfs_dnode_dnode_hold_alloc_hits kstat.zfs.misc.dnodestats.dnode_hold_alloc_hits # TYPE node_zfs_dnode_dnode_hold_alloc_hits untyped node_zfs_dnode_dnode_hold_alloc_hits 37617 # HELP node_zfs_dnode_dnode_hold_alloc_interior kstat.zfs.misc.dnodestats.dnode_hold_alloc_interior # TYPE node_zfs_dnode_dnode_hold_alloc_interior untyped node_zfs_dnode_dnode_hold_alloc_interior 0 # HELP node_zfs_dnode_dnode_hold_alloc_lock_misses kstat.zfs.misc.dnodestats.dnode_hold_alloc_lock_misses # TYPE node_zfs_dnode_dnode_hold_alloc_lock_misses untyped node_zfs_dnode_dnode_hold_alloc_lock_misses 0 # HELP node_zfs_dnode_dnode_hold_alloc_lock_retry kstat.zfs.misc.dnodestats.dnode_hold_alloc_lock_retry # TYPE node_zfs_dnode_dnode_hold_alloc_lock_retry untyped node_zfs_dnode_dnode_hold_alloc_lock_retry 0 # HELP node_zfs_dnode_dnode_hold_alloc_misses kstat.zfs.misc.dnodestats.dnode_hold_alloc_misses # TYPE node_zfs_dnode_dnode_hold_alloc_misses untyped node_zfs_dnode_dnode_hold_alloc_misses 0 # HELP node_zfs_dnode_dnode_hold_alloc_type_none kstat.zfs.misc.dnodestats.dnode_hold_alloc_type_none # TYPE node_zfs_dnode_dnode_hold_alloc_type_none untyped node_zfs_dnode_dnode_hold_alloc_type_none 0 # HELP node_zfs_dnode_dnode_hold_dbuf_hold kstat.zfs.misc.dnodestats.dnode_hold_dbuf_hold # TYPE node_zfs_dnode_dnode_hold_dbuf_hold untyped node_zfs_dnode_dnode_hold_dbuf_hold 0 # HELP node_zfs_dnode_dnode_hold_dbuf_read kstat.zfs.misc.dnodestats.dnode_hold_dbuf_read # TYPE node_zfs_dnode_dnode_hold_dbuf_read untyped node_zfs_dnode_dnode_hold_dbuf_read 0 # HELP node_zfs_dnode_dnode_hold_free_hits kstat.zfs.misc.dnodestats.dnode_hold_free_hits # TYPE node_zfs_dnode_dnode_hold_free_hits untyped node_zfs_dnode_dnode_hold_free_hits 0 # HELP node_zfs_dnode_dnode_hold_free_lock_misses kstat.zfs.misc.dnodestats.dnode_hold_free_lock_misses # TYPE node_zfs_dnode_dnode_hold_free_lock_misses untyped node_zfs_dnode_dnode_hold_free_lock_misses 0 # HELP node_zfs_dnode_dnode_hold_free_lock_retry kstat.zfs.misc.dnodestats.dnode_hold_free_lock_retry # TYPE node_zfs_dnode_dnode_hold_free_lock_retry untyped node_zfs_dnode_dnode_hold_free_lock_retry 0 # HELP node_zfs_dnode_dnode_hold_free_misses kstat.zfs.misc.dnodestats.dnode_hold_free_misses # TYPE node_zfs_dnode_dnode_hold_free_misses untyped node_zfs_dnode_dnode_hold_free_misses 0 # HELP node_zfs_dnode_dnode_hold_free_overflow kstat.zfs.misc.dnodestats.dnode_hold_free_overflow # TYPE node_zfs_dnode_dnode_hold_free_overflow untyped node_zfs_dnode_dnode_hold_free_overflow 0 # HELP node_zfs_dnode_dnode_hold_free_refcount kstat.zfs.misc.dnodestats.dnode_hold_free_refcount # TYPE node_zfs_dnode_dnode_hold_free_refcount untyped node_zfs_dnode_dnode_hold_free_refcount 0 # HELP node_zfs_dnode_dnode_hold_free_txg kstat.zfs.misc.dnodestats.dnode_hold_free_txg # TYPE node_zfs_dnode_dnode_hold_free_txg untyped node_zfs_dnode_dnode_hold_free_txg 0 # HELP node_zfs_dnode_dnode_move_active kstat.zfs.misc.dnodestats.dnode_move_active # TYPE node_zfs_dnode_dnode_move_active untyped node_zfs_dnode_dnode_move_active 0 # HELP node_zfs_dnode_dnode_move_handle kstat.zfs.misc.dnodestats.dnode_move_handle # TYPE node_zfs_dnode_dnode_move_handle untyped node_zfs_dnode_dnode_move_handle 0 # HELP node_zfs_dnode_dnode_move_invalid kstat.zfs.misc.dnodestats.dnode_move_invalid # TYPE node_zfs_dnode_dnode_move_invalid untyped node_zfs_dnode_dnode_move_invalid 0 # HELP node_zfs_dnode_dnode_move_recheck1 kstat.zfs.misc.dnodestats.dnode_move_recheck1 # TYPE node_zfs_dnode_dnode_move_recheck1 untyped node_zfs_dnode_dnode_move_recheck1 0 # HELP node_zfs_dnode_dnode_move_recheck2 kstat.zfs.misc.dnodestats.dnode_move_recheck2 # TYPE node_zfs_dnode_dnode_move_recheck2 untyped node_zfs_dnode_dnode_move_recheck2 0 # HELP node_zfs_dnode_dnode_move_rwlock kstat.zfs.misc.dnodestats.dnode_move_rwlock # TYPE node_zfs_dnode_dnode_move_rwlock untyped node_zfs_dnode_dnode_move_rwlock 0 # HELP node_zfs_dnode_dnode_move_special kstat.zfs.misc.dnodestats.dnode_move_special # TYPE node_zfs_dnode_dnode_move_special untyped node_zfs_dnode_dnode_move_special 0 # HELP node_zfs_dnode_dnode_reallocate kstat.zfs.misc.dnodestats.dnode_reallocate # TYPE node_zfs_dnode_dnode_reallocate untyped node_zfs_dnode_dnode_reallocate 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_vdev_mirror_non_rotating_linear kstat.zfs.misc.vdev_mirror_stats.non_rotating_linear # TYPE node_zfs_vdev_mirror_non_rotating_linear untyped node_zfs_vdev_mirror_non_rotating_linear 0 # HELP node_zfs_vdev_mirror_non_rotating_seek kstat.zfs.misc.vdev_mirror_stats.non_rotating_seek # TYPE node_zfs_vdev_mirror_non_rotating_seek untyped node_zfs_vdev_mirror_non_rotating_seek 0 # HELP node_zfs_vdev_mirror_preferred_found kstat.zfs.misc.vdev_mirror_stats.preferred_found # TYPE node_zfs_vdev_mirror_preferred_found untyped node_zfs_vdev_mirror_preferred_found 0 # HELP node_zfs_vdev_mirror_preferred_not_found kstat.zfs.misc.vdev_mirror_stats.preferred_not_found # TYPE node_zfs_vdev_mirror_preferred_not_found untyped node_zfs_vdev_mirror_preferred_not_found 94 # HELP node_zfs_vdev_mirror_rotating_linear kstat.zfs.misc.vdev_mirror_stats.rotating_linear # TYPE node_zfs_vdev_mirror_rotating_linear untyped node_zfs_vdev_mirror_rotating_linear 0 # HELP node_zfs_vdev_mirror_rotating_offset kstat.zfs.misc.vdev_mirror_stats.rotating_offset # TYPE node_zfs_vdev_mirror_rotating_offset untyped node_zfs_vdev_mirror_rotating_offset 0 # HELP node_zfs_vdev_mirror_rotating_seek kstat.zfs.misc.vdev_mirror_stats.rotating_seek # TYPE node_zfs_vdev_mirror_rotating_seek untyped node_zfs_vdev_mirror_rotating_seek 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 1.8446744073709537e+19 # 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 process_virtual_memory_max_bytes Maximum amount of virtual memory available in bytes. # TYPE process_virtual_memory_max_bytes gauge # HELP promhttp_metric_handler_requests_in_flight Current number of scrapes being served. # TYPE promhttp_metric_handler_requests_in_flight gauge promhttp_metric_handler_requests_in_flight 1 # HELP promhttp_metric_handler_requests_total Total number of scrapes by HTTP status code. # TYPE promhttp_metric_handler_requests_total counter promhttp_metric_handler_requests_total{code="200"} 0 promhttp_metric_handler_requests_total{code="500"} 0 promhttp_metric_handler_requests_total{code="503"} 0 # 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 # HELP testmetric2_2 Metric read from collector/fixtures/textfile/two_metric_files/metrics2.prom # TYPE testmetric2_2 untyped testmetric2_2{foo="baz"} 40 prometheus-node-exporter-0.18.1+ds/collector/fixtures/e2e-output.txt000066400000000000000000006353301350016654700256210ustar00rootroot00000000000000# 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 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, usable 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_total 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_total counter node_bcache_cache_read_races_total{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_seconds Node boot time, in unixtime. # TYPE node_boot_time_seconds gauge node_boot_time_seconds 1.418183276e+09 # HELP node_buddyinfo_blocks Count of free blocks according to size. # TYPE node_buddyinfo_blocks gauge node_buddyinfo_blocks{node="0",size="0",zone="DMA"} 1 node_buddyinfo_blocks{node="0",size="0",zone="DMA32"} 759 node_buddyinfo_blocks{node="0",size="0",zone="Normal"} 4381 node_buddyinfo_blocks{node="0",size="1",zone="DMA"} 0 node_buddyinfo_blocks{node="0",size="1",zone="DMA32"} 572 node_buddyinfo_blocks{node="0",size="1",zone="Normal"} 1093 node_buddyinfo_blocks{node="0",size="10",zone="DMA"} 3 node_buddyinfo_blocks{node="0",size="10",zone="DMA32"} 0 node_buddyinfo_blocks{node="0",size="10",zone="Normal"} 0 node_buddyinfo_blocks{node="0",size="2",zone="DMA"} 1 node_buddyinfo_blocks{node="0",size="2",zone="DMA32"} 791 node_buddyinfo_blocks{node="0",size="2",zone="Normal"} 185 node_buddyinfo_blocks{node="0",size="3",zone="DMA"} 0 node_buddyinfo_blocks{node="0",size="3",zone="DMA32"} 475 node_buddyinfo_blocks{node="0",size="3",zone="Normal"} 1530 node_buddyinfo_blocks{node="0",size="4",zone="DMA"} 2 node_buddyinfo_blocks{node="0",size="4",zone="DMA32"} 194 node_buddyinfo_blocks{node="0",size="4",zone="Normal"} 567 node_buddyinfo_blocks{node="0",size="5",zone="DMA"} 1 node_buddyinfo_blocks{node="0",size="5",zone="DMA32"} 45 node_buddyinfo_blocks{node="0",size="5",zone="Normal"} 102 node_buddyinfo_blocks{node="0",size="6",zone="DMA"} 1 node_buddyinfo_blocks{node="0",size="6",zone="DMA32"} 12 node_buddyinfo_blocks{node="0",size="6",zone="Normal"} 4 node_buddyinfo_blocks{node="0",size="7",zone="DMA"} 0 node_buddyinfo_blocks{node="0",size="7",zone="DMA32"} 0 node_buddyinfo_blocks{node="0",size="7",zone="Normal"} 0 node_buddyinfo_blocks{node="0",size="8",zone="DMA"} 1 node_buddyinfo_blocks{node="0",size="8",zone="DMA32"} 0 node_buddyinfo_blocks{node="0",size="8",zone="Normal"} 0 node_buddyinfo_blocks{node="0",size="9",zone="DMA"} 1 node_buddyinfo_blocks{node="0",size="9",zone="DMA32"} 0 node_buddyinfo_blocks{node="0",size="9",zone="Normal"} 0 # HELP node_context_switches_total Total number of context switches. # TYPE node_context_switches_total counter node_context_switches_total 3.8014093e+07 # 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{core="0",package="0"} 5 node_cpu_core_throttles_total{core="0",package="1"} 0 node_cpu_core_throttles_total{core="1",package="0"} 0 node_cpu_core_throttles_total{core="1",package="1"} 9 # HELP node_cpu_guest_seconds_total Seconds the cpus spent in guests (VMs) for each mode. # TYPE node_cpu_guest_seconds_total counter node_cpu_guest_seconds_total{cpu="0",mode="nice"} 0.01 node_cpu_guest_seconds_total{cpu="0",mode="user"} 0.02 node_cpu_guest_seconds_total{cpu="1",mode="nice"} 0.02 node_cpu_guest_seconds_total{cpu="1",mode="user"} 0.03 node_cpu_guest_seconds_total{cpu="2",mode="nice"} 0.03 node_cpu_guest_seconds_total{cpu="2",mode="user"} 0.04 node_cpu_guest_seconds_total{cpu="3",mode="nice"} 0.04 node_cpu_guest_seconds_total{cpu="3",mode="user"} 0.05 node_cpu_guest_seconds_total{cpu="4",mode="nice"} 0.05 node_cpu_guest_seconds_total{cpu="4",mode="user"} 0.06 node_cpu_guest_seconds_total{cpu="5",mode="nice"} 0.06 node_cpu_guest_seconds_total{cpu="5",mode="user"} 0.07 node_cpu_guest_seconds_total{cpu="6",mode="nice"} 0.07 node_cpu_guest_seconds_total{cpu="6",mode="user"} 0.08 node_cpu_guest_seconds_total{cpu="7",mode="nice"} 0.08 node_cpu_guest_seconds_total{cpu="7",mode="user"} 0.09 # 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{package="0"} 30 node_cpu_package_throttles_total{package="1"} 6 # HELP node_cpu_scaling_frequency_hertz Current scaled cpu thread frequency in hertz. # TYPE node_cpu_scaling_frequency_hertz gauge node_cpu_scaling_frequency_hertz{cpu="0"} 1.699981e+09 node_cpu_scaling_frequency_hertz{cpu="1"} 1.699981e+09 node_cpu_scaling_frequency_hertz{cpu="2"} 8e+06 node_cpu_scaling_frequency_hertz{cpu="3"} 8e+06 # HELP node_cpu_scaling_frequency_max_hrts Maximum scaled cpu thread frequency in hertz. # TYPE node_cpu_scaling_frequency_max_hrts gauge node_cpu_scaling_frequency_max_hrts{cpu="0"} 3.7e+09 node_cpu_scaling_frequency_max_hrts{cpu="1"} 3.7e+09 node_cpu_scaling_frequency_max_hrts{cpu="2"} 4.2e+09 node_cpu_scaling_frequency_max_hrts{cpu="3"} 4.2e+09 # HELP node_cpu_scaling_frequency_min_hrts Minimum scaled cpu thread frequency in hertz. # TYPE node_cpu_scaling_frequency_min_hrts gauge node_cpu_scaling_frequency_min_hrts{cpu="0"} 8e+08 node_cpu_scaling_frequency_min_hrts{cpu="1"} 8e+08 node_cpu_scaling_frequency_min_hrts{cpu="2"} 1e+06 node_cpu_scaling_frequency_min_hrts{cpu="3"} 1e+06 # HELP node_cpu_seconds_total Seconds the cpus spent in each mode. # TYPE node_cpu_seconds_total counter node_cpu_seconds_total{cpu="0",mode="idle"} 10870.69 node_cpu_seconds_total{cpu="0",mode="iowait"} 2.2 node_cpu_seconds_total{cpu="0",mode="irq"} 0.01 node_cpu_seconds_total{cpu="0",mode="nice"} 0.19 node_cpu_seconds_total{cpu="0",mode="softirq"} 34.1 node_cpu_seconds_total{cpu="0",mode="steal"} 0 node_cpu_seconds_total{cpu="0",mode="system"} 210.45 node_cpu_seconds_total{cpu="0",mode="user"} 444.9 node_cpu_seconds_total{cpu="1",mode="idle"} 11107.87 node_cpu_seconds_total{cpu="1",mode="iowait"} 5.91 node_cpu_seconds_total{cpu="1",mode="irq"} 0 node_cpu_seconds_total{cpu="1",mode="nice"} 0.23 node_cpu_seconds_total{cpu="1",mode="softirq"} 0.46 node_cpu_seconds_total{cpu="1",mode="steal"} 0 node_cpu_seconds_total{cpu="1",mode="system"} 164.74 node_cpu_seconds_total{cpu="1",mode="user"} 478.69 node_cpu_seconds_total{cpu="2",mode="idle"} 11123.21 node_cpu_seconds_total{cpu="2",mode="iowait"} 4.41 node_cpu_seconds_total{cpu="2",mode="irq"} 0 node_cpu_seconds_total{cpu="2",mode="nice"} 0.36 node_cpu_seconds_total{cpu="2",mode="softirq"} 3.26 node_cpu_seconds_total{cpu="2",mode="steal"} 0 node_cpu_seconds_total{cpu="2",mode="system"} 159.16 node_cpu_seconds_total{cpu="2",mode="user"} 465.04 node_cpu_seconds_total{cpu="3",mode="idle"} 11132.3 node_cpu_seconds_total{cpu="3",mode="iowait"} 5.33 node_cpu_seconds_total{cpu="3",mode="irq"} 0 node_cpu_seconds_total{cpu="3",mode="nice"} 1.02 node_cpu_seconds_total{cpu="3",mode="softirq"} 0.6 node_cpu_seconds_total{cpu="3",mode="steal"} 0 node_cpu_seconds_total{cpu="3",mode="system"} 156.83 node_cpu_seconds_total{cpu="3",mode="user"} 470.54 node_cpu_seconds_total{cpu="4",mode="idle"} 11403.21 node_cpu_seconds_total{cpu="4",mode="iowait"} 2.17 node_cpu_seconds_total{cpu="4",mode="irq"} 0 node_cpu_seconds_total{cpu="4",mode="nice"} 0.25 node_cpu_seconds_total{cpu="4",mode="softirq"} 0.08 node_cpu_seconds_total{cpu="4",mode="steal"} 0 node_cpu_seconds_total{cpu="4",mode="system"} 107.76 node_cpu_seconds_total{cpu="4",mode="user"} 284.13 node_cpu_seconds_total{cpu="5",mode="idle"} 11362.7 node_cpu_seconds_total{cpu="5",mode="iowait"} 6.72 node_cpu_seconds_total{cpu="5",mode="irq"} 0 node_cpu_seconds_total{cpu="5",mode="nice"} 1.01 node_cpu_seconds_total{cpu="5",mode="softirq"} 0.3 node_cpu_seconds_total{cpu="5",mode="steal"} 0 node_cpu_seconds_total{cpu="5",mode="system"} 115.86 node_cpu_seconds_total{cpu="5",mode="user"} 292.71 node_cpu_seconds_total{cpu="6",mode="idle"} 11397.21 node_cpu_seconds_total{cpu="6",mode="iowait"} 3.19 node_cpu_seconds_total{cpu="6",mode="irq"} 0 node_cpu_seconds_total{cpu="6",mode="nice"} 0.36 node_cpu_seconds_total{cpu="6",mode="softirq"} 0.29 node_cpu_seconds_total{cpu="6",mode="steal"} 0 node_cpu_seconds_total{cpu="6",mode="system"} 102.76 node_cpu_seconds_total{cpu="6",mode="user"} 291.52 node_cpu_seconds_total{cpu="7",mode="idle"} 11392.82 node_cpu_seconds_total{cpu="7",mode="iowait"} 5.55 node_cpu_seconds_total{cpu="7",mode="irq"} 0 node_cpu_seconds_total{cpu="7",mode="nice"} 2.68 node_cpu_seconds_total{cpu="7",mode="softirq"} 0.31 node_cpu_seconds_total{cpu="7",mode="steal"} 0 node_cpu_seconds_total{cpu="7",mode="system"} 101.64 node_cpu_seconds_total{cpu="7",mode="user"} 290.98 # HELP node_disk_discard_time_seconds_total This is the total number of seconds spent by all discards. # TYPE node_disk_discard_time_seconds_total counter node_disk_discard_time_seconds_total{device="sdb"} 11.13 # HELP node_disk_discarded_sectors_total The total number of sectors discarded successfully. # TYPE node_disk_discarded_sectors_total counter node_disk_discarded_sectors_total{device="sdb"} 1.925173784e+09 # HELP node_disk_discards_completed_total The total number of discards completed successfully. # TYPE node_disk_discards_completed_total counter node_disk_discards_completed_total{device="sdb"} 68851 # HELP node_disk_discards_merged_total The total number of discards merged. # TYPE node_disk_discards_merged_total counter node_disk_discards_merged_total{device="sdb"} 0 # 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="sdb"} 0 node_disk_io_now{device="sr0"} 0 node_disk_io_now{device="vda"} 0 # HELP node_disk_io_time_seconds_total Total seconds spent doing I/Os. # TYPE node_disk_io_time_seconds_total counter node_disk_io_time_seconds_total{device="dm-0"} 11325.968 node_disk_io_time_seconds_total{device="dm-1"} 0.076 node_disk_io_time_seconds_total{device="dm-2"} 65.4 node_disk_io_time_seconds_total{device="dm-3"} 0.016 node_disk_io_time_seconds_total{device="dm-4"} 0.024 node_disk_io_time_seconds_total{device="dm-5"} 58.848 node_disk_io_time_seconds_total{device="mmcblk0"} 0.136 node_disk_io_time_seconds_total{device="mmcblk0p1"} 0.024 node_disk_io_time_seconds_total{device="mmcblk0p2"} 0.068 node_disk_io_time_seconds_total{device="nvme0n1"} 222.766 node_disk_io_time_seconds_total{device="sda"} 9653.880000000001 node_disk_io_time_seconds_total{device="sdb"} 60.730000000000004 node_disk_io_time_seconds_total{device="sr0"} 0 node_disk_io_time_seconds_total{device="vda"} 41614.592000000004 # HELP node_disk_io_time_weighted_seconds_total The weighted # of seconds spent doing I/Os. # TYPE node_disk_io_time_weighted_seconds_total counter node_disk_io_time_weighted_seconds_total{device="dm-0"} 1.206301256e+06 node_disk_io_time_weighted_seconds_total{device="dm-1"} 0.084 node_disk_io_time_weighted_seconds_total{device="dm-2"} 129.416 node_disk_io_time_weighted_seconds_total{device="dm-3"} 0.10400000000000001 node_disk_io_time_weighted_seconds_total{device="dm-4"} 0.044 node_disk_io_time_weighted_seconds_total{device="dm-5"} 105.632 node_disk_io_time_weighted_seconds_total{device="mmcblk0"} 0.156 node_disk_io_time_weighted_seconds_total{device="mmcblk0p1"} 0.024 node_disk_io_time_weighted_seconds_total{device="mmcblk0p2"} 0.068 node_disk_io_time_weighted_seconds_total{device="nvme0n1"} 1032.546 node_disk_io_time_weighted_seconds_total{device="sda"} 82621.804 node_disk_io_time_weighted_seconds_total{device="sdb"} 67.07000000000001 node_disk_io_time_weighted_seconds_total{device="sr0"} 0 node_disk_io_time_weighted_seconds_total{device="vda"} 2.0778722280000001e+06 # HELP node_disk_read_bytes_total The total number of bytes read successfully. # TYPE node_disk_read_bytes_total counter node_disk_read_bytes_total{device="dm-0"} 5.13708655616e+11 node_disk_read_bytes_total{device="dm-1"} 1.589248e+06 node_disk_read_bytes_total{device="dm-2"} 1.578752e+08 node_disk_read_bytes_total{device="dm-3"} 1.98144e+06 node_disk_read_bytes_total{device="dm-4"} 529408 node_disk_read_bytes_total{device="dm-5"} 4.3150848e+07 node_disk_read_bytes_total{device="mmcblk0"} 798720 node_disk_read_bytes_total{device="mmcblk0p1"} 81920 node_disk_read_bytes_total{device="mmcblk0p2"} 389120 node_disk_read_bytes_total{device="nvme0n1"} 2.377714176e+09 node_disk_read_bytes_total{device="sda"} 5.13713216512e+11 node_disk_read_bytes_total{device="sdb"} 4.944782848e+09 node_disk_read_bytes_total{device="sr0"} 0 node_disk_read_bytes_total{device="vda"} 1.6727491584e+10 # HELP node_disk_read_time_seconds_total The total number of seconds spent by all reads. # TYPE node_disk_read_time_seconds_total counter node_disk_read_time_seconds_total{device="dm-0"} 46229.572 node_disk_read_time_seconds_total{device="dm-1"} 0.084 node_disk_read_time_seconds_total{device="dm-2"} 6.5360000000000005 node_disk_read_time_seconds_total{device="dm-3"} 0.10400000000000001 node_disk_read_time_seconds_total{device="dm-4"} 0.028 node_disk_read_time_seconds_total{device="dm-5"} 0.924 node_disk_read_time_seconds_total{device="mmcblk0"} 0.156 node_disk_read_time_seconds_total{device="mmcblk0p1"} 0.024 node_disk_read_time_seconds_total{device="mmcblk0p2"} 0.068 node_disk_read_time_seconds_total{device="nvme0n1"} 21.650000000000002 node_disk_read_time_seconds_total{device="sda"} 18492.372 node_disk_read_time_seconds_total{device="sdb"} 0.084 node_disk_read_time_seconds_total{device="sr0"} 0 node_disk_read_time_seconds_total{device="vda"} 8655.768 # HELP node_disk_reads_completed_total The total number of reads completed successfully. # TYPE node_disk_reads_completed_total counter node_disk_reads_completed_total{device="dm-0"} 5.9910002e+07 node_disk_reads_completed_total{device="dm-1"} 388 node_disk_reads_completed_total{device="dm-2"} 11571 node_disk_reads_completed_total{device="dm-3"} 3870 node_disk_reads_completed_total{device="dm-4"} 392 node_disk_reads_completed_total{device="dm-5"} 3729 node_disk_reads_completed_total{device="mmcblk0"} 192 node_disk_reads_completed_total{device="mmcblk0p1"} 17 node_disk_reads_completed_total{device="mmcblk0p2"} 95 node_disk_reads_completed_total{device="nvme0n1"} 47114 node_disk_reads_completed_total{device="sda"} 2.5354637e+07 node_disk_reads_completed_total{device="sdb"} 326552 node_disk_reads_completed_total{device="sr0"} 0 node_disk_reads_completed_total{device="vda"} 1.775784e+06 # HELP node_disk_reads_merged_total The total number of reads merged. # TYPE node_disk_reads_merged_total counter node_disk_reads_merged_total{device="dm-0"} 0 node_disk_reads_merged_total{device="dm-1"} 0 node_disk_reads_merged_total{device="dm-2"} 0 node_disk_reads_merged_total{device="dm-3"} 0 node_disk_reads_merged_total{device="dm-4"} 0 node_disk_reads_merged_total{device="dm-5"} 0 node_disk_reads_merged_total{device="mmcblk0"} 3 node_disk_reads_merged_total{device="mmcblk0p1"} 3 node_disk_reads_merged_total{device="mmcblk0p2"} 0 node_disk_reads_merged_total{device="nvme0n1"} 4 node_disk_reads_merged_total{device="sda"} 3.4367663e+07 node_disk_reads_merged_total{device="sdb"} 841 node_disk_reads_merged_total{device="sr0"} 0 node_disk_reads_merged_total{device="vda"} 15386 # HELP node_disk_write_time_seconds_total This is the total number of seconds spent by all writes. # TYPE node_disk_write_time_seconds_total counter node_disk_write_time_seconds_total{device="dm-0"} 1.1585578e+06 node_disk_write_time_seconds_total{device="dm-1"} 0 node_disk_write_time_seconds_total{device="dm-2"} 122.884 node_disk_write_time_seconds_total{device="dm-3"} 0 node_disk_write_time_seconds_total{device="dm-4"} 0.016 node_disk_write_time_seconds_total{device="dm-5"} 104.684 node_disk_write_time_seconds_total{device="mmcblk0"} 0 node_disk_write_time_seconds_total{device="mmcblk0p1"} 0 node_disk_write_time_seconds_total{device="mmcblk0p2"} 0 node_disk_write_time_seconds_total{device="nvme0n1"} 1011.053 node_disk_write_time_seconds_total{device="sda"} 63877.96 node_disk_write_time_seconds_total{device="sdb"} 5.007 node_disk_write_time_seconds_total{device="sr0"} 0 node_disk_write_time_seconds_total{device="vda"} 2.069221364e+06 # HELP node_disk_writes_completed_total The total number of writes completed successfully. # TYPE node_disk_writes_completed_total counter node_disk_writes_completed_total{device="dm-0"} 3.9231014e+07 node_disk_writes_completed_total{device="dm-1"} 74 node_disk_writes_completed_total{device="dm-2"} 153522 node_disk_writes_completed_total{device="dm-3"} 0 node_disk_writes_completed_total{device="dm-4"} 38 node_disk_writes_completed_total{device="dm-5"} 98918 node_disk_writes_completed_total{device="mmcblk0"} 0 node_disk_writes_completed_total{device="mmcblk0p1"} 0 node_disk_writes_completed_total{device="mmcblk0p2"} 0 node_disk_writes_completed_total{device="nvme0n1"} 1.07832e+06 node_disk_writes_completed_total{device="sda"} 2.8444756e+07 node_disk_writes_completed_total{device="sdb"} 41822 node_disk_writes_completed_total{device="sr0"} 0 node_disk_writes_completed_total{device="vda"} 6.038856e+06 # HELP node_disk_writes_merged_total The number of writes merged. # TYPE node_disk_writes_merged_total counter node_disk_writes_merged_total{device="dm-0"} 0 node_disk_writes_merged_total{device="dm-1"} 0 node_disk_writes_merged_total{device="dm-2"} 0 node_disk_writes_merged_total{device="dm-3"} 0 node_disk_writes_merged_total{device="dm-4"} 0 node_disk_writes_merged_total{device="dm-5"} 0 node_disk_writes_merged_total{device="mmcblk0"} 0 node_disk_writes_merged_total{device="mmcblk0p1"} 0 node_disk_writes_merged_total{device="mmcblk0p2"} 0 node_disk_writes_merged_total{device="nvme0n1"} 43950 node_disk_writes_merged_total{device="sda"} 1.1134226e+07 node_disk_writes_merged_total{device="sdb"} 2895 node_disk_writes_merged_total{device="sr0"} 0 node_disk_writes_merged_total{device="vda"} 2.0711856e+07 # HELP node_disk_written_bytes_total The total number of bytes written successfully. # TYPE node_disk_written_bytes_total counter node_disk_written_bytes_total{device="dm-0"} 2.5891680256e+11 node_disk_written_bytes_total{device="dm-1"} 303104 node_disk_written_bytes_total{device="dm-2"} 2.607828992e+09 node_disk_written_bytes_total{device="dm-3"} 0 node_disk_written_bytes_total{device="dm-4"} 70144 node_disk_written_bytes_total{device="dm-5"} 5.89664256e+08 node_disk_written_bytes_total{device="mmcblk0"} 0 node_disk_written_bytes_total{device="mmcblk0p1"} 0 node_disk_written_bytes_total{device="mmcblk0p2"} 0 node_disk_written_bytes_total{device="nvme0n1"} 2.0199236096e+10 node_disk_written_bytes_total{device="sda"} 2.58916880384e+11 node_disk_written_bytes_total{device="sdb"} 1.01012736e+09 node_disk_written_bytes_total{device="sr0"} 0 node_disk_written_bytes_total{device="vda"} 1.0938236928e+11 # 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 Total number of forks. # TYPE node_forks_total counter node_forks_total 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="i40iw0",port="1"} 0 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="i40iw0",port="1"} 0 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_constraint_errors_received_total Number of packets received on the switch physical port that are discarded # TYPE node_infiniband_port_constraint_errors_received_total counter node_infiniband_port_constraint_errors_received_total{device="i40iw0",port="1"} 0 node_infiniband_port_constraint_errors_received_total{device="mlx4_0",port="1"} 0 # HELP node_infiniband_port_constraint_errors_transmitted_total Number of packets not transmitted from the switch physical port # TYPE node_infiniband_port_constraint_errors_transmitted_total counter node_infiniband_port_constraint_errors_transmitted_total{device="i40iw0",port="1"} 0 node_infiniband_port_constraint_errors_transmitted_total{device="mlx4_0",port="1"} 0 # HELP node_infiniband_port_data_received_bytes_total Number of data octets received on all links # TYPE node_infiniband_port_data_received_bytes_total counter node_infiniband_port_data_received_bytes_total{device="i40iw0",port="1"} 0 node_infiniband_port_data_received_bytes_total{device="mlx4_0",port="1"} 1.8527668e+07 node_infiniband_port_data_received_bytes_total{device="mlx4_0",port="2"} 0 # HELP node_infiniband_port_data_transmitted_bytes_total Number of data octets transmitted on all links # TYPE node_infiniband_port_data_transmitted_bytes_total counter node_infiniband_port_data_transmitted_bytes_total{device="i40iw0",port="1"} 0 node_infiniband_port_data_transmitted_bytes_total{device="mlx4_0",port="1"} 1.493376e+07 node_infiniband_port_data_transmitted_bytes_total{device="mlx4_0",port="2"} 0 # HELP node_infiniband_port_discards_received_total Number of inbound packets discarded by the port because the port is down or congested # TYPE node_infiniband_port_discards_received_total counter node_infiniband_port_discards_received_total{device="mlx4_0",port="1"} 0 # HELP node_infiniband_port_discards_transmitted_total Number of outbound packets discarded by the port because the port is down or congested # TYPE node_infiniband_port_discards_transmitted_total counter node_infiniband_port_discards_transmitted_total{device="i40iw0",port="1"} 0 node_infiniband_port_discards_transmitted_total{device="mlx4_0",port="1"} 5 # HELP node_infiniband_port_errors_received_total Number of packets containing an error that were received on this port # TYPE node_infiniband_port_errors_received_total counter node_infiniband_port_errors_received_total{device="i40iw0",port="1"} 0 node_infiniband_port_errors_received_total{device="mlx4_0",port="1"} 0 # HELP node_infiniband_port_packets_received_total Number of packets received on all VLs by this port (including errors) # TYPE node_infiniband_port_packets_received_total counter node_infiniband_port_packets_received_total{device="i40iw0",port="1"} 0 node_infiniband_port_packets_received_total{device="mlx4_0",port="1"} 6.825908347e+09 # HELP node_infiniband_port_packets_transmitted_total Number of packets transmitted on all VLs from this port (including errors) # TYPE node_infiniband_port_packets_transmitted_total counter node_infiniband_port_packets_transmitted_total{device="i40iw0",port="1"} 0 node_infiniband_port_packets_transmitted_total{device="mlx4_0",port="1"} 6.235865e+06 # HELP node_infiniband_port_transmit_wait_total Number of ticks during which the port had data to transmit but no data was sent during the entire tick # TYPE node_infiniband_port_transmit_wait_total counter node_infiniband_port_transmit_wait_total{device="i40iw0",port="1"} 0 node_infiniband_port_transmit_wait_total{device="mlx4_0",port="1"} 4.294967295e+09 # 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_total Interrupt details. # TYPE node_interrupts_total counter node_interrupts_total{cpu="0",devices="",info="APIC ICR read retries",type="RTR"} 0 node_interrupts_total{cpu="0",devices="",info="Function call interrupts",type="CAL"} 148554 node_interrupts_total{cpu="0",devices="",info="IRQ work interrupts",type="IWI"} 1.509379e+06 node_interrupts_total{cpu="0",devices="",info="Local timer interrupts",type="LOC"} 1.74326351e+08 node_interrupts_total{cpu="0",devices="",info="Machine check exceptions",type="MCE"} 0 node_interrupts_total{cpu="0",devices="",info="Machine check polls",type="MCP"} 2406 node_interrupts_total{cpu="0",devices="",info="Non-maskable interrupts",type="NMI"} 47 node_interrupts_total{cpu="0",devices="",info="Performance monitoring interrupts",type="PMI"} 47 node_interrupts_total{cpu="0",devices="",info="Rescheduling interrupts",type="RES"} 1.0847134e+07 node_interrupts_total{cpu="0",devices="",info="Spurious interrupts",type="SPU"} 0 node_interrupts_total{cpu="0",devices="",info="TLB shootdowns",type="TLB"} 1.0460334e+07 node_interrupts_total{cpu="0",devices="",info="Thermal event interrupts",type="TRM"} 0 node_interrupts_total{cpu="0",devices="",info="Threshold APIC interrupts",type="THR"} 0 node_interrupts_total{cpu="0",devices="acpi",info="IR-IO-APIC-fasteoi",type="9"} 398553 node_interrupts_total{cpu="0",devices="ahci",info="IR-PCI-MSI-edge",type="43"} 7.434032e+06 node_interrupts_total{cpu="0",devices="dmar0",info="DMAR_MSI-edge",type="40"} 0 node_interrupts_total{cpu="0",devices="dmar1",info="DMAR_MSI-edge",type="41"} 0 node_interrupts_total{cpu="0",devices="ehci_hcd:usb1, mmc0",info="IR-IO-APIC-fasteoi",type="16"} 328511 node_interrupts_total{cpu="0",devices="ehci_hcd:usb2",info="IR-IO-APIC-fasteoi",type="23"} 1.451445e+06 node_interrupts_total{cpu="0",devices="i8042",info="IR-IO-APIC-edge",type="1"} 17960 node_interrupts_total{cpu="0",devices="i8042",info="IR-IO-APIC-edge",type="12"} 380847 node_interrupts_total{cpu="0",devices="i915",info="IR-PCI-MSI-edge",type="44"} 140636 node_interrupts_total{cpu="0",devices="iwlwifi",info="IR-PCI-MSI-edge",type="46"} 4.3078464e+07 node_interrupts_total{cpu="0",devices="mei_me",info="IR-PCI-MSI-edge",type="45"} 4 node_interrupts_total{cpu="0",devices="rtc0",info="IR-IO-APIC-edge",type="8"} 1 node_interrupts_total{cpu="0",devices="snd_hda_intel",info="IR-PCI-MSI-edge",type="47"} 350 node_interrupts_total{cpu="0",devices="timer",info="IR-IO-APIC-edge",type="0"} 18 node_interrupts_total{cpu="0",devices="xhci_hcd",info="IR-PCI-MSI-edge",type="42"} 378324 node_interrupts_total{cpu="1",devices="",info="APIC ICR read retries",type="RTR"} 0 node_interrupts_total{cpu="1",devices="",info="Function call interrupts",type="CAL"} 157441 node_interrupts_total{cpu="1",devices="",info="IRQ work interrupts",type="IWI"} 2.411776e+06 node_interrupts_total{cpu="1",devices="",info="Local timer interrupts",type="LOC"} 1.35776678e+08 node_interrupts_total{cpu="1",devices="",info="Machine check exceptions",type="MCE"} 0 node_interrupts_total{cpu="1",devices="",info="Machine check polls",type="MCP"} 2399 node_interrupts_total{cpu="1",devices="",info="Non-maskable interrupts",type="NMI"} 5031 node_interrupts_total{cpu="1",devices="",info="Performance monitoring interrupts",type="PMI"} 5031 node_interrupts_total{cpu="1",devices="",info="Rescheduling interrupts",type="RES"} 9.111507e+06 node_interrupts_total{cpu="1",devices="",info="Spurious interrupts",type="SPU"} 0 node_interrupts_total{cpu="1",devices="",info="TLB shootdowns",type="TLB"} 9.918429e+06 node_interrupts_total{cpu="1",devices="",info="Thermal event interrupts",type="TRM"} 0 node_interrupts_total{cpu="1",devices="",info="Threshold APIC interrupts",type="THR"} 0 node_interrupts_total{cpu="1",devices="acpi",info="IR-IO-APIC-fasteoi",type="9"} 2320 node_interrupts_total{cpu="1",devices="ahci",info="IR-PCI-MSI-edge",type="43"} 8.092205e+06 node_interrupts_total{cpu="1",devices="dmar0",info="DMAR_MSI-edge",type="40"} 0 node_interrupts_total{cpu="1",devices="dmar1",info="DMAR_MSI-edge",type="41"} 0 node_interrupts_total{cpu="1",devices="ehci_hcd:usb1, mmc0",info="IR-IO-APIC-fasteoi",type="16"} 322879 node_interrupts_total{cpu="1",devices="ehci_hcd:usb2",info="IR-IO-APIC-fasteoi",type="23"} 3.333499e+06 node_interrupts_total{cpu="1",devices="i8042",info="IR-IO-APIC-edge",type="1"} 105 node_interrupts_total{cpu="1",devices="i8042",info="IR-IO-APIC-edge",type="12"} 1021 node_interrupts_total{cpu="1",devices="i915",info="IR-PCI-MSI-edge",type="44"} 226313 node_interrupts_total{cpu="1",devices="iwlwifi",info="IR-PCI-MSI-edge",type="46"} 130 node_interrupts_total{cpu="1",devices="mei_me",info="IR-PCI-MSI-edge",type="45"} 22 node_interrupts_total{cpu="1",devices="rtc0",info="IR-IO-APIC-edge",type="8"} 0 node_interrupts_total{cpu="1",devices="snd_hda_intel",info="IR-PCI-MSI-edge",type="47"} 224 node_interrupts_total{cpu="1",devices="timer",info="IR-IO-APIC-edge",type="0"} 0 node_interrupts_total{cpu="1",devices="xhci_hcd",info="IR-PCI-MSI-edge",type="42"} 1.734637e+06 node_interrupts_total{cpu="2",devices="",info="APIC ICR read retries",type="RTR"} 0 node_interrupts_total{cpu="2",devices="",info="Function call interrupts",type="CAL"} 142912 node_interrupts_total{cpu="2",devices="",info="IRQ work interrupts",type="IWI"} 1.512975e+06 node_interrupts_total{cpu="2",devices="",info="Local timer interrupts",type="LOC"} 1.68393257e+08 node_interrupts_total{cpu="2",devices="",info="Machine check exceptions",type="MCE"} 0 node_interrupts_total{cpu="2",devices="",info="Machine check polls",type="MCP"} 2399 node_interrupts_total{cpu="2",devices="",info="Non-maskable interrupts",type="NMI"} 6211 node_interrupts_total{cpu="2",devices="",info="Performance monitoring interrupts",type="PMI"} 6211 node_interrupts_total{cpu="2",devices="",info="Rescheduling interrupts",type="RES"} 1.5999335e+07 node_interrupts_total{cpu="2",devices="",info="Spurious interrupts",type="SPU"} 0 node_interrupts_total{cpu="2",devices="",info="TLB shootdowns",type="TLB"} 1.0494258e+07 node_interrupts_total{cpu="2",devices="",info="Thermal event interrupts",type="TRM"} 0 node_interrupts_total{cpu="2",devices="",info="Threshold APIC interrupts",type="THR"} 0 node_interrupts_total{cpu="2",devices="acpi",info="IR-IO-APIC-fasteoi",type="9"} 824 node_interrupts_total{cpu="2",devices="ahci",info="IR-PCI-MSI-edge",type="43"} 6.478877e+06 node_interrupts_total{cpu="2",devices="dmar0",info="DMAR_MSI-edge",type="40"} 0 node_interrupts_total{cpu="2",devices="dmar1",info="DMAR_MSI-edge",type="41"} 0 node_interrupts_total{cpu="2",devices="ehci_hcd:usb1, mmc0",info="IR-IO-APIC-fasteoi",type="16"} 293782 node_interrupts_total{cpu="2",devices="ehci_hcd:usb2",info="IR-IO-APIC-fasteoi",type="23"} 1.092032e+06 node_interrupts_total{cpu="2",devices="i8042",info="IR-IO-APIC-edge",type="1"} 28 node_interrupts_total{cpu="2",devices="i8042",info="IR-IO-APIC-edge",type="12"} 240 node_interrupts_total{cpu="2",devices="i915",info="IR-PCI-MSI-edge",type="44"} 347 node_interrupts_total{cpu="2",devices="iwlwifi",info="IR-PCI-MSI-edge",type="46"} 460171 node_interrupts_total{cpu="2",devices="mei_me",info="IR-PCI-MSI-edge",type="45"} 0 node_interrupts_total{cpu="2",devices="rtc0",info="IR-IO-APIC-edge",type="8"} 0 node_interrupts_total{cpu="2",devices="snd_hda_intel",info="IR-PCI-MSI-edge",type="47"} 0 node_interrupts_total{cpu="2",devices="timer",info="IR-IO-APIC-edge",type="0"} 0 node_interrupts_total{cpu="2",devices="xhci_hcd",info="IR-PCI-MSI-edge",type="42"} 440240 node_interrupts_total{cpu="3",devices="",info="APIC ICR read retries",type="RTR"} 0 node_interrupts_total{cpu="3",devices="",info="Function call interrupts",type="CAL"} 155528 node_interrupts_total{cpu="3",devices="",info="IRQ work interrupts",type="IWI"} 2.428828e+06 node_interrupts_total{cpu="3",devices="",info="Local timer interrupts",type="LOC"} 1.30980079e+08 node_interrupts_total{cpu="3",devices="",info="Machine check exceptions",type="MCE"} 0 node_interrupts_total{cpu="3",devices="",info="Machine check polls",type="MCP"} 2399 node_interrupts_total{cpu="3",devices="",info="Non-maskable interrupts",type="NMI"} 4968 node_interrupts_total{cpu="3",devices="",info="Performance monitoring interrupts",type="PMI"} 4968 node_interrupts_total{cpu="3",devices="",info="Rescheduling interrupts",type="RES"} 7.45726e+06 node_interrupts_total{cpu="3",devices="",info="Spurious interrupts",type="SPU"} 0 node_interrupts_total{cpu="3",devices="",info="TLB shootdowns",type="TLB"} 1.0345022e+07 node_interrupts_total{cpu="3",devices="",info="Thermal event interrupts",type="TRM"} 0 node_interrupts_total{cpu="3",devices="",info="Threshold APIC interrupts",type="THR"} 0 node_interrupts_total{cpu="3",devices="acpi",info="IR-IO-APIC-fasteoi",type="9"} 863 node_interrupts_total{cpu="3",devices="ahci",info="IR-PCI-MSI-edge",type="43"} 7.492252e+06 node_interrupts_total{cpu="3",devices="dmar0",info="DMAR_MSI-edge",type="40"} 0 node_interrupts_total{cpu="3",devices="dmar1",info="DMAR_MSI-edge",type="41"} 0 node_interrupts_total{cpu="3",devices="ehci_hcd:usb1, mmc0",info="IR-IO-APIC-fasteoi",type="16"} 351412 node_interrupts_total{cpu="3",devices="ehci_hcd:usb2",info="IR-IO-APIC-fasteoi",type="23"} 2.644609e+06 node_interrupts_total{cpu="3",devices="i8042",info="IR-IO-APIC-edge",type="1"} 28 node_interrupts_total{cpu="3",devices="i8042",info="IR-IO-APIC-edge",type="12"} 198 node_interrupts_total{cpu="3",devices="i915",info="IR-PCI-MSI-edge",type="44"} 633 node_interrupts_total{cpu="3",devices="iwlwifi",info="IR-PCI-MSI-edge",type="46"} 290 node_interrupts_total{cpu="3",devices="mei_me",info="IR-PCI-MSI-edge",type="45"} 0 node_interrupts_total{cpu="3",devices="rtc0",info="IR-IO-APIC-edge",type="8"} 0 node_interrupts_total{cpu="3",devices="snd_hda_intel",info="IR-PCI-MSI-edge",type="47"} 0 node_interrupts_total{cpu="3",devices="timer",info="IR-IO-APIC-edge",type="0"} 0 node_interrupts_total{cpu="3",devices="xhci_hcd",info="IR-PCI-MSI-edge",type="42"} 2.434308e+06 # HELP node_intr_total Total number of interrupts serviced. # TYPE node_intr_total counter node_intr_total 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="md120"} 2.095104e+06 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="md120"} 2.095104e+06 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="md120"} 2 node_md_disks{device="md126"} 2 node_md_disks{device="md127"} 2 node_md_disks{device="md219"} 3 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="md120"} 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"} 0 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="md120"} 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_memory_Active_anon_bytes Memory information field Active_anon_bytes. # TYPE node_memory_Active_anon_bytes gauge node_memory_Active_anon_bytes 2.068484096e+09 # HELP node_memory_Active_bytes Memory information field Active_bytes. # TYPE node_memory_Active_bytes gauge node_memory_Active_bytes 2.287017984e+09 # HELP node_memory_Active_file_bytes Memory information field Active_file_bytes. # TYPE node_memory_Active_file_bytes gauge node_memory_Active_file_bytes 2.18533888e+08 # HELP node_memory_AnonHugePages_bytes Memory information field AnonHugePages_bytes. # TYPE node_memory_AnonHugePages_bytes gauge node_memory_AnonHugePages_bytes 0 # HELP node_memory_AnonPages_bytes Memory information field AnonPages_bytes. # TYPE node_memory_AnonPages_bytes gauge node_memory_AnonPages_bytes 2.298032128e+09 # HELP node_memory_Bounce_bytes Memory information field Bounce_bytes. # TYPE node_memory_Bounce_bytes gauge node_memory_Bounce_bytes 0 # HELP node_memory_Buffers_bytes Memory information field Buffers_bytes. # TYPE node_memory_Buffers_bytes gauge node_memory_Buffers_bytes 2.256896e+07 # HELP node_memory_Cached_bytes Memory information field Cached_bytes. # TYPE node_memory_Cached_bytes gauge node_memory_Cached_bytes 9.53229312e+08 # HELP node_memory_CommitLimit_bytes Memory information field CommitLimit_bytes. # TYPE node_memory_CommitLimit_bytes gauge node_memory_CommitLimit_bytes 6.210940928e+09 # HELP node_memory_Committed_AS_bytes Memory information field Committed_AS_bytes. # TYPE node_memory_Committed_AS_bytes gauge node_memory_Committed_AS_bytes 8.023486464e+09 # HELP node_memory_DirectMap2M_bytes Memory information field DirectMap2M_bytes. # TYPE node_memory_DirectMap2M_bytes gauge node_memory_DirectMap2M_bytes 3.787456512e+09 # HELP node_memory_DirectMap4k_bytes Memory information field DirectMap4k_bytes. # TYPE node_memory_DirectMap4k_bytes gauge node_memory_DirectMap4k_bytes 1.9011584e+08 # HELP node_memory_Dirty_bytes Memory information field Dirty_bytes. # TYPE node_memory_Dirty_bytes gauge node_memory_Dirty_bytes 1.077248e+06 # HELP node_memory_HardwareCorrupted_bytes Memory information field HardwareCorrupted_bytes. # TYPE node_memory_HardwareCorrupted_bytes gauge node_memory_HardwareCorrupted_bytes 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_bytes Memory information field Hugepagesize_bytes. # TYPE node_memory_Hugepagesize_bytes gauge node_memory_Hugepagesize_bytes 2.097152e+06 # HELP node_memory_Inactive_anon_bytes Memory information field Inactive_anon_bytes. # TYPE node_memory_Inactive_anon_bytes gauge node_memory_Inactive_anon_bytes 9.04245248e+08 # HELP node_memory_Inactive_bytes Memory information field Inactive_bytes. # TYPE node_memory_Inactive_bytes gauge node_memory_Inactive_bytes 1.053417472e+09 # HELP node_memory_Inactive_file_bytes Memory information field Inactive_file_bytes. # TYPE node_memory_Inactive_file_bytes gauge node_memory_Inactive_file_bytes 1.49172224e+08 # HELP node_memory_KernelStack_bytes Memory information field KernelStack_bytes. # TYPE node_memory_KernelStack_bytes gauge node_memory_KernelStack_bytes 5.9392e+06 # HELP node_memory_Mapped_bytes Memory information field Mapped_bytes. # TYPE node_memory_Mapped_bytes gauge node_memory_Mapped_bytes 2.4496128e+08 # HELP node_memory_MemFree_bytes Memory information field MemFree_bytes. # TYPE node_memory_MemFree_bytes gauge node_memory_MemFree_bytes 2.30883328e+08 # HELP node_memory_MemTotal_bytes Memory information field MemTotal_bytes. # TYPE node_memory_MemTotal_bytes gauge node_memory_MemTotal_bytes 3.831959552e+09 # HELP node_memory_Mlocked_bytes Memory information field Mlocked_bytes. # TYPE node_memory_Mlocked_bytes gauge node_memory_Mlocked_bytes 32768 # HELP node_memory_NFS_Unstable_bytes Memory information field NFS_Unstable_bytes. # TYPE node_memory_NFS_Unstable_bytes gauge node_memory_NFS_Unstable_bytes 0 # HELP node_memory_PageTables_bytes Memory information field PageTables_bytes. # TYPE node_memory_PageTables_bytes gauge node_memory_PageTables_bytes 7.7017088e+07 # HELP node_memory_SReclaimable_bytes Memory information field SReclaimable_bytes. # TYPE node_memory_SReclaimable_bytes gauge node_memory_SReclaimable_bytes 4.5846528e+07 # HELP node_memory_SUnreclaim_bytes Memory information field SUnreclaim_bytes. # TYPE node_memory_SUnreclaim_bytes gauge node_memory_SUnreclaim_bytes 5.545984e+07 # HELP node_memory_Shmem_bytes Memory information field Shmem_bytes. # TYPE node_memory_Shmem_bytes gauge node_memory_Shmem_bytes 6.0809216e+08 # HELP node_memory_Slab_bytes Memory information field Slab_bytes. # TYPE node_memory_Slab_bytes gauge node_memory_Slab_bytes 1.01306368e+08 # HELP node_memory_SwapCached_bytes Memory information field SwapCached_bytes. # TYPE node_memory_SwapCached_bytes gauge node_memory_SwapCached_bytes 1.97124096e+08 # HELP node_memory_SwapFree_bytes Memory information field SwapFree_bytes. # TYPE node_memory_SwapFree_bytes gauge node_memory_SwapFree_bytes 3.23108864e+09 # HELP node_memory_SwapTotal_bytes Memory information field SwapTotal_bytes. # TYPE node_memory_SwapTotal_bytes gauge node_memory_SwapTotal_bytes 4.2949632e+09 # HELP node_memory_Unevictable_bytes Memory information field Unevictable_bytes. # TYPE node_memory_Unevictable_bytes gauge node_memory_Unevictable_bytes 32768 # HELP node_memory_VmallocChunk_bytes Memory information field VmallocChunk_bytes. # TYPE node_memory_VmallocChunk_bytes gauge node_memory_VmallocChunk_bytes 3.5183963009024e+13 # HELP node_memory_VmallocTotal_bytes Memory information field VmallocTotal_bytes. # TYPE node_memory_VmallocTotal_bytes gauge node_memory_VmallocTotal_bytes 3.5184372087808e+13 # HELP node_memory_VmallocUsed_bytes Memory information field VmallocUsed_bytes. # TYPE node_memory_VmallocUsed_bytes gauge node_memory_VmallocUsed_bytes 3.6130816e+08 # HELP node_memory_WritebackTmp_bytes Memory information field WritebackTmp_bytes. # TYPE node_memory_WritebackTmp_bytes gauge node_memory_WritebackTmp_bytes 0 # HELP node_memory_Writeback_bytes Memory information field Writeback_bytes. # TYPE node_memory_Writeback_bytes gauge node_memory_Writeback_bytes 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 node_memory_numa_Active{node="2"} 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 node_memory_numa_Active_anon{node="2"} 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 node_memory_numa_Active_file{node="2"} 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 node_memory_numa_AnonHugePages{node="2"} 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 node_memory_numa_AnonPages{node="2"} 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 node_memory_numa_Bounce{node="2"} 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 node_memory_numa_Dirty{node="2"} 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 node_memory_numa_FilePages{node="2"} 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 node_memory_numa_HugePages_Free{node="2"} 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 node_memory_numa_HugePages_Surp{node="2"} 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 node_memory_numa_HugePages_Total{node="2"} 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 node_memory_numa_Inactive{node="2"} 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 node_memory_numa_Inactive_anon{node="2"} 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 node_memory_numa_Inactive_file{node="2"} 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 node_memory_numa_KernelStack{node="2"} 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 node_memory_numa_Mapped{node="2"} 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 node_memory_numa_MemFree{node="2"} 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 node_memory_numa_MemTotal{node="2"} 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 node_memory_numa_MemUsed{node="2"} 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 node_memory_numa_Mlocked{node="2"} 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 node_memory_numa_NFS_Unstable{node="2"} 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 node_memory_numa_PageTables{node="2"} 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 node_memory_numa_SReclaimable{node="2"} 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 node_memory_numa_SUnreclaim{node="2"} 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 node_memory_numa_Shmem{node="2"} 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 node_memory_numa_Slab{node="2"} 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 node_memory_numa_Unevictable{node="2"} 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 node_memory_numa_Writeback{node="2"} 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 node_memory_numa_WritebackTmp{node="2"} 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 node_memory_numa_interleave_hit_total{node="2"} 7286 # 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 node_memory_numa_local_node_total{node="2"} 2.671904655e+10 # 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 node_memory_numa_numa_foreign_total{node="2"} 2.624528e+06 # 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 node_memory_numa_numa_hit_total{node="2"} 2.6720946761e+10 # 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 node_memory_numa_numa_miss_total{node="2"} 9.858626709e+09 # 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 node_memory_numa_other_node_total{node="2"} 9.86052692e+09 # 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",protocol="tcp"} 13968 node_mountstats_nfs_age_seconds_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_direct_read_bytes_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_direct_write_bytes_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_attribute_invalidate_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_data_invalidate_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 226 node_mountstats_nfs_event_dnode_revalidate_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 52 node_mountstats_nfs_event_inode_revalidate_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_jukebox_delay_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_pnfs_read_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_pnfs_write_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_short_read_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_short_write_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_silly_rename_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_truncation_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 398 node_mountstats_nfs_event_vfs_access_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 77 node_mountstats_nfs_event_vfs_file_release_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 77 node_mountstats_nfs_event_vfs_flush_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_vfs_fsync_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_vfs_getdents_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_vfs_lock_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 13 node_mountstats_nfs_event_vfs_lookup_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 1 node_mountstats_nfs_event_vfs_open_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_vfs_read_page_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 331 node_mountstats_nfs_event_vfs_read_pages_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_vfs_setattr_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_vfs_update_page_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_vfs_write_page_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 47 node_mountstats_nfs_event_vfs_write_pages_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_event_write_extension_total{export="192.168.1.1:/srv/test",protocol="udp"} 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="ACCESS",protocol="udp"} 0 node_mountstats_nfs_operations_major_timeouts_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="tcp"} 0 node_mountstats_nfs_operations_major_timeouts_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="udp"} 0 node_mountstats_nfs_operations_major_timeouts_total{export="192.168.1.1:/srv/test",operation="READ",protocol="tcp"} 0 node_mountstats_nfs_operations_major_timeouts_total{export="192.168.1.1:/srv/test",operation="READ",protocol="udp"} 0 node_mountstats_nfs_operations_major_timeouts_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="tcp"} 0 node_mountstats_nfs_operations_major_timeouts_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="udp"} 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="ACCESS",protocol="udp"} 9.007044786793922e+12 node_mountstats_nfs_operations_queue_time_seconds_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="tcp"} 0 node_mountstats_nfs_operations_queue_time_seconds_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="udp"} 0 node_mountstats_nfs_operations_queue_time_seconds_total{export="192.168.1.1:/srv/test",operation="READ",protocol="tcp"} 0.006 node_mountstats_nfs_operations_queue_time_seconds_total{export="192.168.1.1:/srv/test",operation="READ",protocol="udp"} 0.006 node_mountstats_nfs_operations_queue_time_seconds_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="tcp"} 0 node_mountstats_nfs_operations_queue_time_seconds_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="udp"} 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="ACCESS",protocol="udp"} 3.62996810236e+11 node_mountstats_nfs_operations_received_bytes_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="tcp"} 0 node_mountstats_nfs_operations_received_bytes_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="udp"} 0 node_mountstats_nfs_operations_received_bytes_total{export="192.168.1.1:/srv/test",operation="READ",protocol="tcp"} 1.210292152e+09 node_mountstats_nfs_operations_received_bytes_total{export="192.168.1.1:/srv/test",operation="READ",protocol="udp"} 1.210292152e+09 node_mountstats_nfs_operations_received_bytes_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="tcp"} 0 node_mountstats_nfs_operations_received_bytes_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="udp"} 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="ACCESS",protocol="udp"} 1.953587717e+06 node_mountstats_nfs_operations_request_time_seconds_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="tcp"} 0 node_mountstats_nfs_operations_request_time_seconds_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="udp"} 0 node_mountstats_nfs_operations_request_time_seconds_total{export="192.168.1.1:/srv/test",operation="READ",protocol="tcp"} 79.407 node_mountstats_nfs_operations_request_time_seconds_total{export="192.168.1.1:/srv/test",operation="READ",protocol="udp"} 79.407 node_mountstats_nfs_operations_request_time_seconds_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="tcp"} 0 node_mountstats_nfs_operations_request_time_seconds_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="udp"} 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="ACCESS",protocol="udp"} 2.927395007e+09 node_mountstats_nfs_operations_requests_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="tcp"} 0 node_mountstats_nfs_operations_requests_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="udp"} 0 node_mountstats_nfs_operations_requests_total{export="192.168.1.1:/srv/test",operation="READ",protocol="tcp"} 1298 node_mountstats_nfs_operations_requests_total{export="192.168.1.1:/srv/test",operation="READ",protocol="udp"} 1298 node_mountstats_nfs_operations_requests_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="tcp"} 0 node_mountstats_nfs_operations_requests_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="udp"} 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="ACCESS",protocol="udp"} 1.667369447e+06 node_mountstats_nfs_operations_response_time_seconds_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="tcp"} 0 node_mountstats_nfs_operations_response_time_seconds_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="udp"} 0 node_mountstats_nfs_operations_response_time_seconds_total{export="192.168.1.1:/srv/test",operation="READ",protocol="tcp"} 79.386 node_mountstats_nfs_operations_response_time_seconds_total{export="192.168.1.1:/srv/test",operation="READ",protocol="udp"} 79.386 node_mountstats_nfs_operations_response_time_seconds_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="tcp"} 0 node_mountstats_nfs_operations_response_time_seconds_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="udp"} 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="ACCESS",protocol="udp"} 5.26931094212e+11 node_mountstats_nfs_operations_sent_bytes_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="tcp"} 0 node_mountstats_nfs_operations_sent_bytes_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="udp"} 0 node_mountstats_nfs_operations_sent_bytes_total{export="192.168.1.1:/srv/test",operation="READ",protocol="tcp"} 207680 node_mountstats_nfs_operations_sent_bytes_total{export="192.168.1.1:/srv/test",operation="READ",protocol="udp"} 207680 node_mountstats_nfs_operations_sent_bytes_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="tcp"} 0 node_mountstats_nfs_operations_sent_bytes_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="udp"} 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="ACCESS",protocol="udp"} 2.927394995e+09 node_mountstats_nfs_operations_transmissions_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="tcp"} 0 node_mountstats_nfs_operations_transmissions_total{export="192.168.1.1:/srv/test",operation="NULL",protocol="udp"} 0 node_mountstats_nfs_operations_transmissions_total{export="192.168.1.1:/srv/test",operation="READ",protocol="tcp"} 1298 node_mountstats_nfs_operations_transmissions_total{export="192.168.1.1:/srv/test",operation="READ",protocol="udp"} 1298 node_mountstats_nfs_operations_transmissions_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="tcp"} 0 node_mountstats_nfs_operations_transmissions_total{export="192.168.1.1:/srv/test",operation="WRITE",protocol="udp"} 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",protocol="tcp"} 1.20764023e+09 node_mountstats_nfs_read_bytes_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 295483 node_mountstats_nfs_read_pages_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 1.210214218e+09 node_mountstats_nfs_total_read_bytes_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_total_write_bytes_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_transport_backlog_queue_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_transport_bad_transaction_ids_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_transport_bind_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 1 node_mountstats_nfs_transport_connect_total{export="192.168.1.1:/srv/test",protocol="udp"} 0 # 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",protocol="tcp"} 11 node_mountstats_nfs_transport_idle_time_seconds{export="192.168.1.1:/srv/test",protocol="udp"} 0 # 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",protocol="tcp"} 24 node_mountstats_nfs_transport_maximum_rpc_slots{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 5726 node_mountstats_nfs_transport_pending_queue_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 6428 node_mountstats_nfs_transport_receives_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 26 node_mountstats_nfs_transport_sending_queue_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 6428 node_mountstats_nfs_transport_sends_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_write_bytes_total{export="192.168.1.1:/srv/test",protocol="udp"} 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",protocol="tcp"} 0 node_mountstats_nfs_write_pages_total{export="192.168.1.1:/srv/test",protocol="udp"} 0 # HELP node_netstat_Icmp6_InErrors Statistic Icmp6InErrors. # TYPE node_netstat_Icmp6_InErrors untyped node_netstat_Icmp6_InErrors 0 # HELP node_netstat_Icmp6_InMsgs Statistic Icmp6InMsgs. # TYPE node_netstat_Icmp6_InMsgs untyped node_netstat_Icmp6_InMsgs 0 # HELP node_netstat_Icmp6_OutMsgs Statistic Icmp6OutMsgs. # TYPE node_netstat_Icmp6_OutMsgs untyped node_netstat_Icmp6_OutMsgs 8 # 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_OutMsgs Statistic IcmpOutMsgs. # TYPE node_netstat_Icmp_OutMsgs untyped node_netstat_Icmp_OutMsgs 120 # HELP node_netstat_Ip6_InOctets Statistic Ip6InOctets. # TYPE node_netstat_Ip6_InOctets untyped node_netstat_Ip6_InOctets 460 # HELP node_netstat_Ip6_OutOctets Statistic Ip6OutOctets. # TYPE node_netstat_Ip6_OutOctets untyped node_netstat_Ip6_OutOctets 536 # HELP node_netstat_IpExt_InOctets Statistic IpExtInOctets. # TYPE node_netstat_IpExt_InOctets untyped node_netstat_IpExt_InOctets 6.28639697e+09 # HELP node_netstat_IpExt_OutOctets Statistic IpExtOutOctets. # TYPE node_netstat_IpExt_OutOctets untyped node_netstat_IpExt_OutOctets 2.786264347e+09 # HELP node_netstat_Ip_Forwarding Statistic IpForwarding. # TYPE node_netstat_Ip_Forwarding untyped node_netstat_Ip_Forwarding 1 # 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_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_Tcp_ActiveOpens Statistic TcpActiveOpens. # TYPE node_netstat_Tcp_ActiveOpens untyped node_netstat_Tcp_ActiveOpens 3556 # HELP node_netstat_Tcp_CurrEstab Statistic TcpCurrEstab. # TYPE node_netstat_Tcp_CurrEstab untyped node_netstat_Tcp_CurrEstab 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_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_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_UdpLite6_InErrors Statistic UdpLite6InErrors. # TYPE node_netstat_UdpLite6_InErrors untyped node_netstat_UdpLite6_InErrors 0 # HELP node_netstat_UdpLite_InErrors Statistic UdpLiteInErrors. # TYPE node_netstat_UdpLite_InErrors untyped node_netstat_UdpLite_InErrors 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_network_address_assign_type address_assign_type value of /sys/class/net/. # TYPE node_network_address_assign_type gauge node_network_address_assign_type{device="eth0"} 3 # HELP node_network_carrier carrier value of /sys/class/net/. # TYPE node_network_carrier gauge node_network_carrier{device="eth0"} 1 # HELP node_network_carrier_changes_total carrier_changes_total value of /sys/class/net/. # TYPE node_network_carrier_changes_total counter node_network_carrier_changes_total{device="eth0"} 2 # HELP node_network_carrier_down_changes_total carrier_down_changes_total value of /sys/class/net/. # TYPE node_network_carrier_down_changes_total counter node_network_carrier_down_changes_total{device="eth0"} 1 # HELP node_network_carrier_up_changes_total carrier_up_changes_total value of /sys/class/net/. # TYPE node_network_carrier_up_changes_total counter node_network_carrier_up_changes_total{device="eth0"} 1 # HELP node_network_device_id device_id value of /sys/class/net/. # TYPE node_network_device_id gauge node_network_device_id{device="eth0"} 32 # HELP node_network_dormant dormant value of /sys/class/net/. # TYPE node_network_dormant gauge node_network_dormant{device="eth0"} 1 # HELP node_network_flags flags value of /sys/class/net/. # TYPE node_network_flags gauge node_network_flags{device="eth0"} 4867 # HELP node_network_iface_id iface_id value of /sys/class/net/. # TYPE node_network_iface_id gauge node_network_iface_id{device="eth0"} 2 # HELP node_network_iface_link iface_link value of /sys/class/net/. # TYPE node_network_iface_link gauge node_network_iface_link{device="eth0"} 2 # HELP node_network_iface_link_mode iface_link_mode value of /sys/class/net/. # TYPE node_network_iface_link_mode gauge node_network_iface_link_mode{device="eth0"} 1 # HELP node_network_info Non-numeric data from /sys/class/net/, value is always 1. # TYPE node_network_info gauge node_network_info{address="01:01:01:01:01:01",broadcast="ff:ff:ff:ff:ff:ff",device="eth0",duplex="full",ifalias="",operstate="up"} 1 # HELP node_network_mtu_bytes mtu_bytes value of /sys/class/net/. # TYPE node_network_mtu_bytes gauge node_network_mtu_bytes{device="eth0"} 1500 # HELP node_network_name_assign_type name_assign_type value of /sys/class/net/. # TYPE node_network_name_assign_type gauge node_network_name_assign_type{device="eth0"} 2 # HELP node_network_net_dev_group net_dev_group value of /sys/class/net/. # TYPE node_network_net_dev_group gauge node_network_net_dev_group{device="eth0"} 0 # HELP node_network_protocol_type protocol_type value of /sys/class/net/. # TYPE node_network_protocol_type gauge node_network_protocol_type{device="eth0"} 1 # HELP node_network_receive_bytes_total Network device statistic receive_bytes. # TYPE node_network_receive_bytes_total counter node_network_receive_bytes_total{device="docker0"} 6.4910168e+07 node_network_receive_bytes_total{device="eth0"} 6.8210035552e+10 node_network_receive_bytes_total{device="flannel.1"} 1.8144009813e+10 node_network_receive_bytes_total{device="ibr10:30"} 0 node_network_receive_bytes_total{device="lo"} 4.35303245e+08 node_network_receive_bytes_total{device="lxcbr0"} 0 node_network_receive_bytes_total{device="tun0"} 1888 node_network_receive_bytes_total{device="veth4B09XN"} 648 node_network_receive_bytes_total{device="wlan0"} 1.0437182923e+10 node_network_receive_bytes_total{device="💩0"} 5.7750104e+07 # HELP node_network_receive_compressed_total Network device statistic receive_compressed. # TYPE node_network_receive_compressed_total counter node_network_receive_compressed_total{device="docker0"} 0 node_network_receive_compressed_total{device="eth0"} 0 node_network_receive_compressed_total{device="flannel.1"} 0 node_network_receive_compressed_total{device="ibr10:30"} 0 node_network_receive_compressed_total{device="lo"} 0 node_network_receive_compressed_total{device="lxcbr0"} 0 node_network_receive_compressed_total{device="tun0"} 0 node_network_receive_compressed_total{device="veth4B09XN"} 0 node_network_receive_compressed_total{device="wlan0"} 0 node_network_receive_compressed_total{device="💩0"} 0 # HELP node_network_receive_drop_total Network device statistic receive_drop. # TYPE node_network_receive_drop_total counter node_network_receive_drop_total{device="docker0"} 0 node_network_receive_drop_total{device="eth0"} 0 node_network_receive_drop_total{device="flannel.1"} 0 node_network_receive_drop_total{device="ibr10:30"} 0 node_network_receive_drop_total{device="lo"} 0 node_network_receive_drop_total{device="lxcbr0"} 0 node_network_receive_drop_total{device="tun0"} 0 node_network_receive_drop_total{device="veth4B09XN"} 0 node_network_receive_drop_total{device="wlan0"} 0 node_network_receive_drop_total{device="💩0"} 0 # HELP node_network_receive_errs_total Network device statistic receive_errs. # TYPE node_network_receive_errs_total counter node_network_receive_errs_total{device="docker0"} 0 node_network_receive_errs_total{device="eth0"} 0 node_network_receive_errs_total{device="flannel.1"} 0 node_network_receive_errs_total{device="ibr10:30"} 0 node_network_receive_errs_total{device="lo"} 0 node_network_receive_errs_total{device="lxcbr0"} 0 node_network_receive_errs_total{device="tun0"} 0 node_network_receive_errs_total{device="veth4B09XN"} 0 node_network_receive_errs_total{device="wlan0"} 0 node_network_receive_errs_total{device="💩0"} 0 # HELP node_network_receive_fifo_total Network device statistic receive_fifo. # TYPE node_network_receive_fifo_total counter node_network_receive_fifo_total{device="docker0"} 0 node_network_receive_fifo_total{device="eth0"} 0 node_network_receive_fifo_total{device="flannel.1"} 0 node_network_receive_fifo_total{device="ibr10:30"} 0 node_network_receive_fifo_total{device="lo"} 0 node_network_receive_fifo_total{device="lxcbr0"} 0 node_network_receive_fifo_total{device="tun0"} 0 node_network_receive_fifo_total{device="veth4B09XN"} 0 node_network_receive_fifo_total{device="wlan0"} 0 node_network_receive_fifo_total{device="💩0"} 0 # HELP node_network_receive_frame_total Network device statistic receive_frame. # TYPE node_network_receive_frame_total counter node_network_receive_frame_total{device="docker0"} 0 node_network_receive_frame_total{device="eth0"} 0 node_network_receive_frame_total{device="flannel.1"} 0 node_network_receive_frame_total{device="ibr10:30"} 0 node_network_receive_frame_total{device="lo"} 0 node_network_receive_frame_total{device="lxcbr0"} 0 node_network_receive_frame_total{device="tun0"} 0 node_network_receive_frame_total{device="veth4B09XN"} 0 node_network_receive_frame_total{device="wlan0"} 0 node_network_receive_frame_total{device="💩0"} 0 # HELP node_network_receive_multicast_total Network device statistic receive_multicast. # TYPE node_network_receive_multicast_total counter node_network_receive_multicast_total{device="docker0"} 0 node_network_receive_multicast_total{device="eth0"} 0 node_network_receive_multicast_total{device="flannel.1"} 0 node_network_receive_multicast_total{device="ibr10:30"} 0 node_network_receive_multicast_total{device="lo"} 0 node_network_receive_multicast_total{device="lxcbr0"} 0 node_network_receive_multicast_total{device="tun0"} 0 node_network_receive_multicast_total{device="veth4B09XN"} 0 node_network_receive_multicast_total{device="wlan0"} 0 node_network_receive_multicast_total{device="💩0"} 72 # HELP node_network_receive_packets_total Network device statistic receive_packets. # TYPE node_network_receive_packets_total counter node_network_receive_packets_total{device="docker0"} 1.065585e+06 node_network_receive_packets_total{device="eth0"} 5.20993275e+08 node_network_receive_packets_total{device="flannel.1"} 2.28499337e+08 node_network_receive_packets_total{device="ibr10:30"} 0 node_network_receive_packets_total{device="lo"} 1.832522e+06 node_network_receive_packets_total{device="lxcbr0"} 0 node_network_receive_packets_total{device="tun0"} 24 node_network_receive_packets_total{device="veth4B09XN"} 8 node_network_receive_packets_total{device="wlan0"} 1.3899359e+07 node_network_receive_packets_total{device="💩0"} 105557 # HELP node_network_speed_bytes speed_bytes value of /sys/class/net/. # TYPE node_network_speed_bytes gauge node_network_speed_bytes{device="eth0"} 1.25e+08 # HELP node_network_transmit_bytes_total Network device statistic transmit_bytes. # TYPE node_network_transmit_bytes_total counter node_network_transmit_bytes_total{device="docker0"} 2.681662018e+09 node_network_transmit_bytes_total{device="eth0"} 9.315587528e+09 node_network_transmit_bytes_total{device="flannel.1"} 2.0758990068e+10 node_network_transmit_bytes_total{device="ibr10:30"} 0 node_network_transmit_bytes_total{device="lo"} 4.35303245e+08 node_network_transmit_bytes_total{device="lxcbr0"} 2.630299e+06 node_network_transmit_bytes_total{device="tun0"} 67120 node_network_transmit_bytes_total{device="veth4B09XN"} 1.943284e+06 node_network_transmit_bytes_total{device="wlan0"} 2.85164936e+09 node_network_transmit_bytes_total{device="💩0"} 4.04570255e+08 # HELP node_network_transmit_carrier_total Network device statistic transmit_carrier. # TYPE node_network_transmit_carrier_total counter node_network_transmit_carrier_total{device="docker0"} 0 node_network_transmit_carrier_total{device="eth0"} 0 node_network_transmit_carrier_total{device="flannel.1"} 0 node_network_transmit_carrier_total{device="ibr10:30"} 0 node_network_transmit_carrier_total{device="lo"} 0 node_network_transmit_carrier_total{device="lxcbr0"} 0 node_network_transmit_carrier_total{device="tun0"} 0 node_network_transmit_carrier_total{device="veth4B09XN"} 0 node_network_transmit_carrier_total{device="wlan0"} 0 node_network_transmit_carrier_total{device="💩0"} 0 # HELP node_network_transmit_colls_total Network device statistic transmit_colls. # TYPE node_network_transmit_colls_total counter node_network_transmit_colls_total{device="docker0"} 0 node_network_transmit_colls_total{device="eth0"} 0 node_network_transmit_colls_total{device="flannel.1"} 0 node_network_transmit_colls_total{device="ibr10:30"} 0 node_network_transmit_colls_total{device="lo"} 0 node_network_transmit_colls_total{device="lxcbr0"} 0 node_network_transmit_colls_total{device="tun0"} 0 node_network_transmit_colls_total{device="veth4B09XN"} 0 node_network_transmit_colls_total{device="wlan0"} 0 node_network_transmit_colls_total{device="💩0"} 0 # HELP node_network_transmit_compressed_total Network device statistic transmit_compressed. # TYPE node_network_transmit_compressed_total counter node_network_transmit_compressed_total{device="docker0"} 0 node_network_transmit_compressed_total{device="eth0"} 0 node_network_transmit_compressed_total{device="flannel.1"} 0 node_network_transmit_compressed_total{device="ibr10:30"} 0 node_network_transmit_compressed_total{device="lo"} 0 node_network_transmit_compressed_total{device="lxcbr0"} 0 node_network_transmit_compressed_total{device="tun0"} 0 node_network_transmit_compressed_total{device="veth4B09XN"} 0 node_network_transmit_compressed_total{device="wlan0"} 0 node_network_transmit_compressed_total{device="💩0"} 0 # HELP node_network_transmit_drop_total Network device statistic transmit_drop. # TYPE node_network_transmit_drop_total counter node_network_transmit_drop_total{device="docker0"} 0 node_network_transmit_drop_total{device="eth0"} 0 node_network_transmit_drop_total{device="flannel.1"} 64 node_network_transmit_drop_total{device="ibr10:30"} 0 node_network_transmit_drop_total{device="lo"} 0 node_network_transmit_drop_total{device="lxcbr0"} 0 node_network_transmit_drop_total{device="tun0"} 0 node_network_transmit_drop_total{device="veth4B09XN"} 0 node_network_transmit_drop_total{device="wlan0"} 0 node_network_transmit_drop_total{device="💩0"} 0 # HELP node_network_transmit_errs_total Network device statistic transmit_errs. # TYPE node_network_transmit_errs_total counter node_network_transmit_errs_total{device="docker0"} 0 node_network_transmit_errs_total{device="eth0"} 0 node_network_transmit_errs_total{device="flannel.1"} 0 node_network_transmit_errs_total{device="ibr10:30"} 0 node_network_transmit_errs_total{device="lo"} 0 node_network_transmit_errs_total{device="lxcbr0"} 0 node_network_transmit_errs_total{device="tun0"} 0 node_network_transmit_errs_total{device="veth4B09XN"} 0 node_network_transmit_errs_total{device="wlan0"} 0 node_network_transmit_errs_total{device="💩0"} 0 # HELP node_network_transmit_fifo_total Network device statistic transmit_fifo. # TYPE node_network_transmit_fifo_total counter node_network_transmit_fifo_total{device="docker0"} 0 node_network_transmit_fifo_total{device="eth0"} 0 node_network_transmit_fifo_total{device="flannel.1"} 0 node_network_transmit_fifo_total{device="ibr10:30"} 0 node_network_transmit_fifo_total{device="lo"} 0 node_network_transmit_fifo_total{device="lxcbr0"} 0 node_network_transmit_fifo_total{device="tun0"} 0 node_network_transmit_fifo_total{device="veth4B09XN"} 0 node_network_transmit_fifo_total{device="wlan0"} 0 node_network_transmit_fifo_total{device="💩0"} 0 # HELP node_network_transmit_packets_total Network device statistic transmit_packets. # TYPE node_network_transmit_packets_total counter node_network_transmit_packets_total{device="docker0"} 1.929779e+06 node_network_transmit_packets_total{device="eth0"} 4.3451486e+07 node_network_transmit_packets_total{device="flannel.1"} 2.58369223e+08 node_network_transmit_packets_total{device="ibr10:30"} 0 node_network_transmit_packets_total{device="lo"} 1.832522e+06 node_network_transmit_packets_total{device="lxcbr0"} 28339 node_network_transmit_packets_total{device="tun0"} 934 node_network_transmit_packets_total{device="veth4B09XN"} 10640 node_network_transmit_packets_total{device="wlan0"} 1.17262e+07 node_network_transmit_packets_total{device="💩0"} 304261 # HELP node_network_transmit_queue_length transmit_queue_length value of /sys/class/net/. # TYPE node_network_transmit_queue_length gauge node_network_transmit_queue_length{device="eth0"} 1000 # HELP node_network_up Value is 1 if operstate is 'up', 0 otherwise. # TYPE node_network_up gauge node_network_up{device="eth0"} 1 # 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_connections_total Total number of NFSd TCP connections. # TYPE node_nfs_connections_total counter node_nfs_connections_total 45 # HELP node_nfs_packets_total Total NFSd network packets (sent+received) by protocol type. # TYPE node_nfs_packets_total counter node_nfs_packets_total{protocol="tcp"} 69 node_nfs_packets_total{protocol="udp"} 70 # HELP node_nfs_requests_total Number of NFS procedures invoked. # TYPE node_nfs_requests_total counter node_nfs_requests_total{method="Access",proto="3"} 1.17661341e+08 node_nfs_requests_total{method="Access",proto="4"} 58 node_nfs_requests_total{method="Allocate",proto="4"} 0 node_nfs_requests_total{method="BindConnToSession",proto="4"} 0 node_nfs_requests_total{method="Clone",proto="4"} 0 node_nfs_requests_total{method="Close",proto="4"} 28 node_nfs_requests_total{method="Commit",proto="3"} 23729 node_nfs_requests_total{method="Commit",proto="4"} 83 node_nfs_requests_total{method="Create",proto="2"} 52 node_nfs_requests_total{method="Create",proto="3"} 2.993289e+06 node_nfs_requests_total{method="Create",proto="4"} 15 node_nfs_requests_total{method="CreateSession",proto="4"} 32 node_nfs_requests_total{method="DeAllocate",proto="4"} 0 node_nfs_requests_total{method="DelegReturn",proto="4"} 97 node_nfs_requests_total{method="DestroyClientID",proto="4"} 0 node_nfs_requests_total{method="DestroySession",proto="4"} 67 node_nfs_requests_total{method="ExchangeID",proto="4"} 58 node_nfs_requests_total{method="FreeStateID",proto="4"} 0 node_nfs_requests_total{method="FsInfo",proto="3"} 2 node_nfs_requests_total{method="FsInfo",proto="4"} 68 node_nfs_requests_total{method="FsLocations",proto="4"} 32 node_nfs_requests_total{method="FsStat",proto="2"} 82 node_nfs_requests_total{method="FsStat",proto="3"} 13332 node_nfs_requests_total{method="FsidPresent",proto="4"} 11 node_nfs_requests_total{method="GetACL",proto="4"} 36 node_nfs_requests_total{method="GetAttr",proto="2"} 57 node_nfs_requests_total{method="GetAttr",proto="3"} 1.061909262e+09 node_nfs_requests_total{method="GetDeviceInfo",proto="4"} 1 node_nfs_requests_total{method="GetDeviceList",proto="4"} 0 node_nfs_requests_total{method="GetLeaseTime",proto="4"} 28 node_nfs_requests_total{method="Getattr",proto="4"} 88 node_nfs_requests_total{method="LayoutCommit",proto="4"} 26 node_nfs_requests_total{method="LayoutGet",proto="4"} 90 node_nfs_requests_total{method="LayoutReturn",proto="4"} 0 node_nfs_requests_total{method="LayoutStats",proto="4"} 0 node_nfs_requests_total{method="Link",proto="2"} 17 node_nfs_requests_total{method="Link",proto="3"} 0 node_nfs_requests_total{method="Link",proto="4"} 21 node_nfs_requests_total{method="Lock",proto="4"} 39 node_nfs_requests_total{method="Lockt",proto="4"} 68 node_nfs_requests_total{method="Locku",proto="4"} 59 node_nfs_requests_total{method="Lookup",proto="2"} 71 node_nfs_requests_total{method="Lookup",proto="3"} 4.077635e+06 node_nfs_requests_total{method="Lookup",proto="4"} 29 node_nfs_requests_total{method="LookupRoot",proto="4"} 74 node_nfs_requests_total{method="MkDir",proto="2"} 50 node_nfs_requests_total{method="MkDir",proto="3"} 590 node_nfs_requests_total{method="MkNod",proto="3"} 0 node_nfs_requests_total{method="Null",proto="2"} 16 node_nfs_requests_total{method="Null",proto="3"} 0 node_nfs_requests_total{method="Null",proto="4"} 98 node_nfs_requests_total{method="Open",proto="4"} 85 node_nfs_requests_total{method="OpenConfirm",proto="4"} 23 node_nfs_requests_total{method="OpenDowngrade",proto="4"} 1 node_nfs_requests_total{method="OpenNoattr",proto="4"} 24 node_nfs_requests_total{method="PathConf",proto="3"} 1 node_nfs_requests_total{method="Pathconf",proto="4"} 53 node_nfs_requests_total{method="Read",proto="2"} 45 node_nfs_requests_total{method="Read",proto="3"} 2.9391916e+07 node_nfs_requests_total{method="Read",proto="4"} 51 node_nfs_requests_total{method="ReadDir",proto="2"} 70 node_nfs_requests_total{method="ReadDir",proto="3"} 3983 node_nfs_requests_total{method="ReadDir",proto="4"} 66 node_nfs_requests_total{method="ReadDirPlus",proto="3"} 92385 node_nfs_requests_total{method="ReadLink",proto="2"} 73 node_nfs_requests_total{method="ReadLink",proto="3"} 5 node_nfs_requests_total{method="ReadLink",proto="4"} 54 node_nfs_requests_total{method="ReclaimComplete",proto="4"} 35 node_nfs_requests_total{method="ReleaseLockowner",proto="4"} 85 node_nfs_requests_total{method="Remove",proto="2"} 83 node_nfs_requests_total{method="Remove",proto="3"} 7815 node_nfs_requests_total{method="Remove",proto="4"} 69 node_nfs_requests_total{method="Rename",proto="2"} 61 node_nfs_requests_total{method="Rename",proto="3"} 1130 node_nfs_requests_total{method="Rename",proto="4"} 96 node_nfs_requests_total{method="Renew",proto="4"} 83 node_nfs_requests_total{method="RmDir",proto="2"} 23 node_nfs_requests_total{method="RmDir",proto="3"} 15 node_nfs_requests_total{method="Root",proto="2"} 52 node_nfs_requests_total{method="Secinfo",proto="4"} 81 node_nfs_requests_total{method="SecinfoNoName",proto="4"} 0 node_nfs_requests_total{method="Seek",proto="4"} 0 node_nfs_requests_total{method="Sequence",proto="4"} 13 node_nfs_requests_total{method="ServerCaps",proto="4"} 56 node_nfs_requests_total{method="SetACL",proto="4"} 49 node_nfs_requests_total{method="SetAttr",proto="2"} 74 node_nfs_requests_total{method="SetAttr",proto="3"} 48906 node_nfs_requests_total{method="SetClientID",proto="4"} 12 node_nfs_requests_total{method="SetClientIDConfirm",proto="4"} 84 node_nfs_requests_total{method="Setattr",proto="4"} 73 node_nfs_requests_total{method="StatFs",proto="4"} 86 node_nfs_requests_total{method="SymLink",proto="2"} 53 node_nfs_requests_total{method="SymLink",proto="3"} 0 node_nfs_requests_total{method="Symlink",proto="4"} 84 node_nfs_requests_total{method="TestStateID",proto="4"} 0 node_nfs_requests_total{method="WrCache",proto="2"} 86 node_nfs_requests_total{method="Write",proto="2"} 0 node_nfs_requests_total{method="Write",proto="3"} 2.570425e+06 node_nfs_requests_total{method="Write",proto="4"} 54 # HELP node_nfs_rpc_authentication_refreshes_total Number of RPC authentication refreshes performed. # TYPE node_nfs_rpc_authentication_refreshes_total counter node_nfs_rpc_authentication_refreshes_total 1.218815394e+09 # HELP node_nfs_rpc_retransmissions_total Number of RPC transmissions performed. # TYPE node_nfs_rpc_retransmissions_total counter node_nfs_rpc_retransmissions_total 374636 # HELP node_nfs_rpcs_total Total number of RPCs performed. # TYPE node_nfs_rpcs_total counter node_nfs_rpcs_total 1.218785755e+09 # HELP node_nfsd_connections_total Total number of NFSd TCP connections. # TYPE node_nfsd_connections_total counter node_nfsd_connections_total 1 # HELP node_nfsd_disk_bytes_read_total Total NFSd bytes read. # TYPE node_nfsd_disk_bytes_read_total counter node_nfsd_disk_bytes_read_total 1.572864e+08 # HELP node_nfsd_disk_bytes_written_total Total NFSd bytes written. # TYPE node_nfsd_disk_bytes_written_total counter node_nfsd_disk_bytes_written_total 72864 # HELP node_nfsd_file_handles_stale_total Total number of NFSd stale file handles # TYPE node_nfsd_file_handles_stale_total counter node_nfsd_file_handles_stale_total 0 # HELP node_nfsd_packets_total Total NFSd network packets (sent+received) by protocol type. # TYPE node_nfsd_packets_total counter node_nfsd_packets_total{proto="tcp"} 917 node_nfsd_packets_total{proto="udp"} 55 # HELP node_nfsd_read_ahead_cache_not_found_total Total number of NFSd read ahead cache not found. # TYPE node_nfsd_read_ahead_cache_not_found_total counter node_nfsd_read_ahead_cache_not_found_total 0 # HELP node_nfsd_read_ahead_cache_size_blocks How large the read ahead cache is in blocks. # TYPE node_nfsd_read_ahead_cache_size_blocks gauge node_nfsd_read_ahead_cache_size_blocks 32 # HELP node_nfsd_reply_cache_hits_total Total number of NFSd Reply Cache hits (client lost server response). # TYPE node_nfsd_reply_cache_hits_total counter node_nfsd_reply_cache_hits_total 0 # HELP node_nfsd_reply_cache_misses_total Total number of NFSd Reply Cache an operation that requires caching (idempotent). # TYPE node_nfsd_reply_cache_misses_total counter node_nfsd_reply_cache_misses_total 6 # HELP node_nfsd_reply_cache_nocache_total Total number of NFSd Reply Cache non-idempotent operations (rename/delete/…). # TYPE node_nfsd_reply_cache_nocache_total counter node_nfsd_reply_cache_nocache_total 18622 # HELP node_nfsd_requests_total Total number NFSd Requests by method and protocol. # TYPE node_nfsd_requests_total counter node_nfsd_requests_total{method="Access",proto="3"} 111 node_nfsd_requests_total{method="Access",proto="4"} 1098 node_nfsd_requests_total{method="Close",proto="4"} 2 node_nfsd_requests_total{method="Commit",proto="3"} 0 node_nfsd_requests_total{method="Commit",proto="4"} 0 node_nfsd_requests_total{method="Create",proto="2"} 0 node_nfsd_requests_total{method="Create",proto="3"} 0 node_nfsd_requests_total{method="Create",proto="4"} 0 node_nfsd_requests_total{method="DelegPurge",proto="4"} 0 node_nfsd_requests_total{method="DelegReturn",proto="4"} 0 node_nfsd_requests_total{method="FsInfo",proto="3"} 2 node_nfsd_requests_total{method="FsStat",proto="2"} 2 node_nfsd_requests_total{method="FsStat",proto="3"} 0 node_nfsd_requests_total{method="GetAttr",proto="2"} 69 node_nfsd_requests_total{method="GetAttr",proto="3"} 112 node_nfsd_requests_total{method="GetAttr",proto="4"} 8179 node_nfsd_requests_total{method="GetFH",proto="4"} 5896 node_nfsd_requests_total{method="Link",proto="2"} 0 node_nfsd_requests_total{method="Link",proto="3"} 0 node_nfsd_requests_total{method="Link",proto="4"} 0 node_nfsd_requests_total{method="Lock",proto="4"} 0 node_nfsd_requests_total{method="Lockt",proto="4"} 0 node_nfsd_requests_total{method="Locku",proto="4"} 0 node_nfsd_requests_total{method="Lookup",proto="2"} 4410 node_nfsd_requests_total{method="Lookup",proto="3"} 2719 node_nfsd_requests_total{method="Lookup",proto="4"} 5900 node_nfsd_requests_total{method="LookupRoot",proto="4"} 0 node_nfsd_requests_total{method="MkDir",proto="2"} 0 node_nfsd_requests_total{method="MkDir",proto="3"} 0 node_nfsd_requests_total{method="MkNod",proto="3"} 0 node_nfsd_requests_total{method="Nverify",proto="4"} 0 node_nfsd_requests_total{method="Open",proto="4"} 2 node_nfsd_requests_total{method="OpenAttr",proto="4"} 0 node_nfsd_requests_total{method="OpenConfirm",proto="4"} 2 node_nfsd_requests_total{method="OpenDgrd",proto="4"} 0 node_nfsd_requests_total{method="PathConf",proto="3"} 1 node_nfsd_requests_total{method="PutFH",proto="4"} 9609 node_nfsd_requests_total{method="Read",proto="2"} 0 node_nfsd_requests_total{method="Read",proto="3"} 0 node_nfsd_requests_total{method="Read",proto="4"} 150 node_nfsd_requests_total{method="ReadDir",proto="2"} 99 node_nfsd_requests_total{method="ReadDir",proto="3"} 27 node_nfsd_requests_total{method="ReadDir",proto="4"} 1272 node_nfsd_requests_total{method="ReadDirPlus",proto="3"} 216 node_nfsd_requests_total{method="ReadLink",proto="2"} 0 node_nfsd_requests_total{method="ReadLink",proto="3"} 0 node_nfsd_requests_total{method="ReadLink",proto="4"} 0 node_nfsd_requests_total{method="RelLockOwner",proto="4"} 0 node_nfsd_requests_total{method="Remove",proto="2"} 0 node_nfsd_requests_total{method="Remove",proto="3"} 0 node_nfsd_requests_total{method="Remove",proto="4"} 0 node_nfsd_requests_total{method="Rename",proto="2"} 0 node_nfsd_requests_total{method="Rename",proto="3"} 0 node_nfsd_requests_total{method="Rename",proto="4"} 0 node_nfsd_requests_total{method="Renew",proto="4"} 1236 node_nfsd_requests_total{method="RestoreFH",proto="4"} 0 node_nfsd_requests_total{method="RmDir",proto="2"} 0 node_nfsd_requests_total{method="RmDir",proto="3"} 0 node_nfsd_requests_total{method="Root",proto="2"} 0 node_nfsd_requests_total{method="SaveFH",proto="4"} 0 node_nfsd_requests_total{method="SecInfo",proto="4"} 0 node_nfsd_requests_total{method="SetAttr",proto="2"} 0 node_nfsd_requests_total{method="SetAttr",proto="3"} 0 node_nfsd_requests_total{method="SetAttr",proto="4"} 0 node_nfsd_requests_total{method="SymLink",proto="2"} 0 node_nfsd_requests_total{method="SymLink",proto="3"} 0 node_nfsd_requests_total{method="Verify",proto="4"} 3 node_nfsd_requests_total{method="WrCache",proto="2"} 0 node_nfsd_requests_total{method="Write",proto="2"} 0 node_nfsd_requests_total{method="Write",proto="3"} 0 node_nfsd_requests_total{method="Write",proto="4"} 3 # HELP node_nfsd_rpc_errors_total Total number of NFSd RPC errors by error type. # TYPE node_nfsd_rpc_errors_total counter node_nfsd_rpc_errors_total{error="auth"} 2 node_nfsd_rpc_errors_total{error="cInt"} 0 node_nfsd_rpc_errors_total{error="fmt"} 1 # HELP node_nfsd_server_rpcs_total Total number of NFSd RPCs. # TYPE node_nfsd_server_rpcs_total counter node_nfsd_server_rpcs_total 18628 # HELP node_nfsd_server_threads Total number of NFSd kernel threads that are running. # TYPE node_nfsd_server_threads gauge node_nfsd_server_threads 8 # HELP node_pressure_cpu_waiting_seconds_total Total time in seconds that processes have waited for CPU time # TYPE node_pressure_cpu_waiting_seconds_total counter node_pressure_cpu_waiting_seconds_total 14.036781000000001 # HELP node_pressure_io_stalled_seconds_total Total time in seconds no process could make progress due to IO congestion # TYPE node_pressure_io_stalled_seconds_total counter node_pressure_io_stalled_seconds_total 159.229614 # HELP node_pressure_io_waiting_seconds_total Total time in seconds that processes have waited due to IO congestion # TYPE node_pressure_io_waiting_seconds_total counter node_pressure_io_waiting_seconds_total 159.886802 # HELP node_pressure_memory_stalled_seconds_total Total time in seconds no process could make progress due to memory congestion # TYPE node_pressure_memory_stalled_seconds_total counter node_pressure_memory_stalled_seconds_total 0 # HELP node_pressure_memory_waiting_seconds_total Total time in seconds that processes have waited for memory # TYPE node_pressure_memory_waiting_seconds_total counter node_pressure_memory_waiting_seconds_total 0 # HELP node_processes_max_processes Number of max PIDs limit # TYPE node_processes_max_processes gauge node_processes_max_processes 123 # HELP node_processes_max_threads Limit of threads in the system # TYPE node_processes_max_threads gauge node_processes_max_threads 7801 # HELP node_processes_pids Number of PIDs # TYPE node_processes_pids gauge node_processes_pids 1 # HELP node_processes_state Number of processes in each state. # TYPE node_processes_state gauge node_processes_state{state="S"} 1 # HELP node_processes_threads Allocated threads in system # TYPE node_processes_threads gauge node_processes_threads 1 # 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="cpufreq"} 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="meminfo"} 1 node_scrape_collector_success{collector="meminfo_numa"} 1 node_scrape_collector_success{collector="mountstats"} 1 node_scrape_collector_success{collector="netclass"} 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="nfsd"} 1 node_scrape_collector_success{collector="pressure"} 1 node_scrape_collector_success{collector="processes"} 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="vmstat"} 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_seconds Unixtime mtime of textfiles successfully read. # TYPE node_textfile_mtime_seconds 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_vmstat_oom_kill /proc/vmstat information field oom_kill. # TYPE node_vmstat_oom_kill untyped node_vmstat_oom_kill 0 # HELP node_vmstat_pgfault /proc/vmstat information field pgfault. # TYPE node_vmstat_pgfault untyped node_vmstat_pgfault 2.320168809e+09 # HELP node_vmstat_pgmajfault /proc/vmstat information field pgmajfault. # TYPE node_vmstat_pgmajfault untyped node_vmstat_pgmajfault 507162 # HELP node_vmstat_pgpgin /proc/vmstat information field pgpgin. # TYPE node_vmstat_pgpgin untyped node_vmstat_pgpgin 7.344136e+06 # HELP node_vmstat_pgpgout /proc/vmstat information field pgpgout. # TYPE node_vmstat_pgpgout untyped node_vmstat_pgpgout 1.541180581e+09 # HELP node_vmstat_pswpin /proc/vmstat information field pswpin. # TYPE node_vmstat_pswpin untyped node_vmstat_pswpin 1476 # HELP node_vmstat_pswpout /proc/vmstat information field pswpout. # TYPE node_vmstat_pswpout untyped node_vmstat_pswpout 35045 # 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",mac_address="01:02:03:04:05:06"} 2 node_wifi_station_beacon_loss_total{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 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",mac_address="01:02:03:04:05:06"} 60 node_wifi_station_connected_seconds_total{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 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",mac_address="01:02:03:04:05:06"} 0.8 node_wifi_station_inactive_seconds{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 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",mac_address="01:02:03:04:05:06"} 2.56e+08 node_wifi_station_receive_bits_per_second{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 1.28e+08 # HELP node_wifi_station_receive_bytes_total The total number of bytes received by a WiFi station. # TYPE node_wifi_station_receive_bytes_total counter node_wifi_station_receive_bytes_total{device="wlan0",mac_address="01:02:03:04:05:06"} 0 node_wifi_station_receive_bytes_total{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 0 # 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",mac_address="01:02:03:04:05:06"} -26 node_wifi_station_signal_dbm{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} -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",mac_address="01:02:03:04:05:06"} 3.28e+08 node_wifi_station_transmit_bits_per_second{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 1.64e+08 # HELP node_wifi_station_transmit_bytes_total The total number of bytes transmitted by a WiFi station. # TYPE node_wifi_station_transmit_bytes_total counter node_wifi_station_transmit_bytes_total{device="wlan0",mac_address="01:02:03:04:05:06"} 0 node_wifi_station_transmit_bytes_total{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 0 # 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",mac_address="01:02:03:04:05:06"} 4 node_wifi_station_transmit_failed_total{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 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",mac_address="01:02:03:04:05:06"} 20 node_wifi_station_transmit_retries_total{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 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_abd_linear_cnt kstat.zfs.misc.abdstats.linear_cnt # TYPE node_zfs_abd_linear_cnt untyped node_zfs_abd_linear_cnt 62 # HELP node_zfs_abd_linear_data_size kstat.zfs.misc.abdstats.linear_data_size # TYPE node_zfs_abd_linear_data_size untyped node_zfs_abd_linear_data_size 223232 # HELP node_zfs_abd_scatter_chunk_waste kstat.zfs.misc.abdstats.scatter_chunk_waste # TYPE node_zfs_abd_scatter_chunk_waste untyped node_zfs_abd_scatter_chunk_waste 0 # HELP node_zfs_abd_scatter_cnt kstat.zfs.misc.abdstats.scatter_cnt # TYPE node_zfs_abd_scatter_cnt untyped node_zfs_abd_scatter_cnt 1 # HELP node_zfs_abd_scatter_data_size kstat.zfs.misc.abdstats.scatter_data_size # TYPE node_zfs_abd_scatter_data_size untyped node_zfs_abd_scatter_data_size 16384 # HELP node_zfs_abd_scatter_order_0 kstat.zfs.misc.abdstats.scatter_order_0 # TYPE node_zfs_abd_scatter_order_0 untyped node_zfs_abd_scatter_order_0 0 # HELP node_zfs_abd_scatter_order_1 kstat.zfs.misc.abdstats.scatter_order_1 # TYPE node_zfs_abd_scatter_order_1 untyped node_zfs_abd_scatter_order_1 0 # HELP node_zfs_abd_scatter_order_10 kstat.zfs.misc.abdstats.scatter_order_10 # TYPE node_zfs_abd_scatter_order_10 untyped node_zfs_abd_scatter_order_10 0 # HELP node_zfs_abd_scatter_order_2 kstat.zfs.misc.abdstats.scatter_order_2 # TYPE node_zfs_abd_scatter_order_2 untyped node_zfs_abd_scatter_order_2 1 # HELP node_zfs_abd_scatter_order_3 kstat.zfs.misc.abdstats.scatter_order_3 # TYPE node_zfs_abd_scatter_order_3 untyped node_zfs_abd_scatter_order_3 0 # HELP node_zfs_abd_scatter_order_4 kstat.zfs.misc.abdstats.scatter_order_4 # TYPE node_zfs_abd_scatter_order_4 untyped node_zfs_abd_scatter_order_4 0 # HELP node_zfs_abd_scatter_order_5 kstat.zfs.misc.abdstats.scatter_order_5 # TYPE node_zfs_abd_scatter_order_5 untyped node_zfs_abd_scatter_order_5 0 # HELP node_zfs_abd_scatter_order_6 kstat.zfs.misc.abdstats.scatter_order_6 # TYPE node_zfs_abd_scatter_order_6 untyped node_zfs_abd_scatter_order_6 0 # HELP node_zfs_abd_scatter_order_7 kstat.zfs.misc.abdstats.scatter_order_7 # TYPE node_zfs_abd_scatter_order_7 untyped node_zfs_abd_scatter_order_7 0 # HELP node_zfs_abd_scatter_order_8 kstat.zfs.misc.abdstats.scatter_order_8 # TYPE node_zfs_abd_scatter_order_8 untyped node_zfs_abd_scatter_order_8 0 # HELP node_zfs_abd_scatter_order_9 kstat.zfs.misc.abdstats.scatter_order_9 # TYPE node_zfs_abd_scatter_order_9 untyped node_zfs_abd_scatter_order_9 0 # HELP node_zfs_abd_scatter_page_alloc_retry kstat.zfs.misc.abdstats.scatter_page_alloc_retry # TYPE node_zfs_abd_scatter_page_alloc_retry untyped node_zfs_abd_scatter_page_alloc_retry 0 # HELP node_zfs_abd_scatter_page_multi_chunk kstat.zfs.misc.abdstats.scatter_page_multi_chunk # TYPE node_zfs_abd_scatter_page_multi_chunk untyped node_zfs_abd_scatter_page_multi_chunk 0 # HELP node_zfs_abd_scatter_page_multi_zone kstat.zfs.misc.abdstats.scatter_page_multi_zone # TYPE node_zfs_abd_scatter_page_multi_zone untyped node_zfs_abd_scatter_page_multi_zone 0 # HELP node_zfs_abd_scatter_sg_table_retry kstat.zfs.misc.abdstats.scatter_sg_table_retry # TYPE node_zfs_abd_scatter_sg_table_retry untyped node_zfs_abd_scatter_sg_table_retry 0 # HELP node_zfs_abd_struct_size kstat.zfs.misc.abdstats.struct_size # TYPE node_zfs_abd_struct_size untyped node_zfs_abd_struct_size 2520 # 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_dbuf_dbuf_cache_count kstat.zfs.misc.dbuf_stats.dbuf_cache_count # TYPE node_zfs_dbuf_dbuf_cache_count untyped node_zfs_dbuf_dbuf_cache_count 27 # HELP node_zfs_dbuf_dbuf_cache_hiwater_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_hiwater_bytes # TYPE node_zfs_dbuf_dbuf_cache_hiwater_bytes untyped node_zfs_dbuf_dbuf_cache_hiwater_bytes 6.9117804e+07 # HELP node_zfs_dbuf_dbuf_cache_level_0 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_0 # TYPE node_zfs_dbuf_dbuf_cache_level_0 untyped node_zfs_dbuf_dbuf_cache_level_0 27 # HELP node_zfs_dbuf_dbuf_cache_level_0_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_0_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_0_bytes untyped node_zfs_dbuf_dbuf_cache_level_0_bytes 302080 # HELP node_zfs_dbuf_dbuf_cache_level_1 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_1 # TYPE node_zfs_dbuf_dbuf_cache_level_1 untyped node_zfs_dbuf_dbuf_cache_level_1 0 # HELP node_zfs_dbuf_dbuf_cache_level_10 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_10 # TYPE node_zfs_dbuf_dbuf_cache_level_10 untyped node_zfs_dbuf_dbuf_cache_level_10 0 # HELP node_zfs_dbuf_dbuf_cache_level_10_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_10_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_10_bytes untyped node_zfs_dbuf_dbuf_cache_level_10_bytes 0 # HELP node_zfs_dbuf_dbuf_cache_level_11 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_11 # TYPE node_zfs_dbuf_dbuf_cache_level_11 untyped node_zfs_dbuf_dbuf_cache_level_11 0 # HELP node_zfs_dbuf_dbuf_cache_level_11_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_11_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_11_bytes untyped node_zfs_dbuf_dbuf_cache_level_11_bytes 0 # HELP node_zfs_dbuf_dbuf_cache_level_1_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_1_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_1_bytes untyped node_zfs_dbuf_dbuf_cache_level_1_bytes 0 # HELP node_zfs_dbuf_dbuf_cache_level_2 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_2 # TYPE node_zfs_dbuf_dbuf_cache_level_2 untyped node_zfs_dbuf_dbuf_cache_level_2 0 # HELP node_zfs_dbuf_dbuf_cache_level_2_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_2_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_2_bytes untyped node_zfs_dbuf_dbuf_cache_level_2_bytes 0 # HELP node_zfs_dbuf_dbuf_cache_level_3 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_3 # TYPE node_zfs_dbuf_dbuf_cache_level_3 untyped node_zfs_dbuf_dbuf_cache_level_3 0 # HELP node_zfs_dbuf_dbuf_cache_level_3_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_3_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_3_bytes untyped node_zfs_dbuf_dbuf_cache_level_3_bytes 0 # HELP node_zfs_dbuf_dbuf_cache_level_4 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_4 # TYPE node_zfs_dbuf_dbuf_cache_level_4 untyped node_zfs_dbuf_dbuf_cache_level_4 0 # HELP node_zfs_dbuf_dbuf_cache_level_4_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_4_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_4_bytes untyped node_zfs_dbuf_dbuf_cache_level_4_bytes 0 # HELP node_zfs_dbuf_dbuf_cache_level_5 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_5 # TYPE node_zfs_dbuf_dbuf_cache_level_5 untyped node_zfs_dbuf_dbuf_cache_level_5 0 # HELP node_zfs_dbuf_dbuf_cache_level_5_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_5_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_5_bytes untyped node_zfs_dbuf_dbuf_cache_level_5_bytes 0 # HELP node_zfs_dbuf_dbuf_cache_level_6 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_6 # TYPE node_zfs_dbuf_dbuf_cache_level_6 untyped node_zfs_dbuf_dbuf_cache_level_6 0 # HELP node_zfs_dbuf_dbuf_cache_level_6_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_6_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_6_bytes untyped node_zfs_dbuf_dbuf_cache_level_6_bytes 0 # HELP node_zfs_dbuf_dbuf_cache_level_7 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_7 # TYPE node_zfs_dbuf_dbuf_cache_level_7 untyped node_zfs_dbuf_dbuf_cache_level_7 0 # HELP node_zfs_dbuf_dbuf_cache_level_7_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_7_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_7_bytes untyped node_zfs_dbuf_dbuf_cache_level_7_bytes 0 # HELP node_zfs_dbuf_dbuf_cache_level_8 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_8 # TYPE node_zfs_dbuf_dbuf_cache_level_8 untyped node_zfs_dbuf_dbuf_cache_level_8 0 # HELP node_zfs_dbuf_dbuf_cache_level_8_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_8_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_8_bytes untyped node_zfs_dbuf_dbuf_cache_level_8_bytes 0 # HELP node_zfs_dbuf_dbuf_cache_level_9 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_9 # TYPE node_zfs_dbuf_dbuf_cache_level_9 untyped node_zfs_dbuf_dbuf_cache_level_9 0 # HELP node_zfs_dbuf_dbuf_cache_level_9_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_9_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_9_bytes untyped node_zfs_dbuf_dbuf_cache_level_9_bytes 0 # HELP node_zfs_dbuf_dbuf_cache_lowater_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_lowater_bytes # TYPE node_zfs_dbuf_dbuf_cache_lowater_bytes untyped node_zfs_dbuf_dbuf_cache_lowater_bytes 5.6550932e+07 # HELP node_zfs_dbuf_dbuf_cache_max_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_max_bytes # TYPE node_zfs_dbuf_dbuf_cache_max_bytes untyped node_zfs_dbuf_dbuf_cache_max_bytes 6.2834368e+07 # HELP node_zfs_dbuf_dbuf_cache_size kstat.zfs.misc.dbuf_stats.dbuf_cache_size # TYPE node_zfs_dbuf_dbuf_cache_size untyped node_zfs_dbuf_dbuf_cache_size 302080 # HELP node_zfs_dbuf_dbuf_cache_size_max kstat.zfs.misc.dbuf_stats.dbuf_cache_size_max # TYPE node_zfs_dbuf_dbuf_cache_size_max untyped node_zfs_dbuf_dbuf_cache_size_max 394240 # HELP node_zfs_dbuf_dbuf_cache_total_evicts kstat.zfs.misc.dbuf_stats.dbuf_cache_total_evicts # TYPE node_zfs_dbuf_dbuf_cache_total_evicts untyped node_zfs_dbuf_dbuf_cache_total_evicts 0 # HELP node_zfs_dbuf_hash_chain_max kstat.zfs.misc.dbuf_stats.hash_chain_max # TYPE node_zfs_dbuf_hash_chain_max untyped node_zfs_dbuf_hash_chain_max 0 # HELP node_zfs_dbuf_hash_chains kstat.zfs.misc.dbuf_stats.hash_chains # TYPE node_zfs_dbuf_hash_chains untyped node_zfs_dbuf_hash_chains 0 # HELP node_zfs_dbuf_hash_collisions kstat.zfs.misc.dbuf_stats.hash_collisions # TYPE node_zfs_dbuf_hash_collisions untyped node_zfs_dbuf_hash_collisions 0 # HELP node_zfs_dbuf_hash_dbuf_level_0 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_0 # TYPE node_zfs_dbuf_hash_dbuf_level_0 untyped node_zfs_dbuf_hash_dbuf_level_0 37 # HELP node_zfs_dbuf_hash_dbuf_level_0_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_0_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_0_bytes untyped node_zfs_dbuf_hash_dbuf_level_0_bytes 465920 # HELP node_zfs_dbuf_hash_dbuf_level_1 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_1 # TYPE node_zfs_dbuf_hash_dbuf_level_1 untyped node_zfs_dbuf_hash_dbuf_level_1 10 # HELP node_zfs_dbuf_hash_dbuf_level_10 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_10 # TYPE node_zfs_dbuf_hash_dbuf_level_10 untyped node_zfs_dbuf_hash_dbuf_level_10 0 # HELP node_zfs_dbuf_hash_dbuf_level_10_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_10_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_10_bytes untyped node_zfs_dbuf_hash_dbuf_level_10_bytes 0 # HELP node_zfs_dbuf_hash_dbuf_level_11 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_11 # TYPE node_zfs_dbuf_hash_dbuf_level_11 untyped node_zfs_dbuf_hash_dbuf_level_11 0 # HELP node_zfs_dbuf_hash_dbuf_level_11_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_11_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_11_bytes untyped node_zfs_dbuf_hash_dbuf_level_11_bytes 0 # HELP node_zfs_dbuf_hash_dbuf_level_1_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_1_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_1_bytes untyped node_zfs_dbuf_hash_dbuf_level_1_bytes 1.31072e+06 # HELP node_zfs_dbuf_hash_dbuf_level_2 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_2 # TYPE node_zfs_dbuf_hash_dbuf_level_2 untyped node_zfs_dbuf_hash_dbuf_level_2 2 # HELP node_zfs_dbuf_hash_dbuf_level_2_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_2_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_2_bytes untyped node_zfs_dbuf_hash_dbuf_level_2_bytes 262144 # HELP node_zfs_dbuf_hash_dbuf_level_3 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_3 # TYPE node_zfs_dbuf_hash_dbuf_level_3 untyped node_zfs_dbuf_hash_dbuf_level_3 2 # HELP node_zfs_dbuf_hash_dbuf_level_3_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_3_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_3_bytes untyped node_zfs_dbuf_hash_dbuf_level_3_bytes 262144 # HELP node_zfs_dbuf_hash_dbuf_level_4 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_4 # TYPE node_zfs_dbuf_hash_dbuf_level_4 untyped node_zfs_dbuf_hash_dbuf_level_4 2 # HELP node_zfs_dbuf_hash_dbuf_level_4_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_4_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_4_bytes untyped node_zfs_dbuf_hash_dbuf_level_4_bytes 262144 # HELP node_zfs_dbuf_hash_dbuf_level_5 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_5 # TYPE node_zfs_dbuf_hash_dbuf_level_5 untyped node_zfs_dbuf_hash_dbuf_level_5 2 # HELP node_zfs_dbuf_hash_dbuf_level_5_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_5_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_5_bytes untyped node_zfs_dbuf_hash_dbuf_level_5_bytes 262144 # HELP node_zfs_dbuf_hash_dbuf_level_6 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_6 # TYPE node_zfs_dbuf_hash_dbuf_level_6 untyped node_zfs_dbuf_hash_dbuf_level_6 0 # HELP node_zfs_dbuf_hash_dbuf_level_6_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_6_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_6_bytes untyped node_zfs_dbuf_hash_dbuf_level_6_bytes 0 # HELP node_zfs_dbuf_hash_dbuf_level_7 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_7 # TYPE node_zfs_dbuf_hash_dbuf_level_7 untyped node_zfs_dbuf_hash_dbuf_level_7 0 # HELP node_zfs_dbuf_hash_dbuf_level_7_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_7_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_7_bytes untyped node_zfs_dbuf_hash_dbuf_level_7_bytes 0 # HELP node_zfs_dbuf_hash_dbuf_level_8 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_8 # TYPE node_zfs_dbuf_hash_dbuf_level_8 untyped node_zfs_dbuf_hash_dbuf_level_8 0 # HELP node_zfs_dbuf_hash_dbuf_level_8_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_8_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_8_bytes untyped node_zfs_dbuf_hash_dbuf_level_8_bytes 0 # HELP node_zfs_dbuf_hash_dbuf_level_9 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_9 # TYPE node_zfs_dbuf_hash_dbuf_level_9 untyped node_zfs_dbuf_hash_dbuf_level_9 0 # HELP node_zfs_dbuf_hash_dbuf_level_9_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_9_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_9_bytes untyped node_zfs_dbuf_hash_dbuf_level_9_bytes 0 # HELP node_zfs_dbuf_hash_elements kstat.zfs.misc.dbuf_stats.hash_elements # TYPE node_zfs_dbuf_hash_elements untyped node_zfs_dbuf_hash_elements 55 # HELP node_zfs_dbuf_hash_elements_max kstat.zfs.misc.dbuf_stats.hash_elements_max # TYPE node_zfs_dbuf_hash_elements_max untyped node_zfs_dbuf_hash_elements_max 55 # HELP node_zfs_dbuf_hash_hits kstat.zfs.misc.dbuf_stats.hash_hits # TYPE node_zfs_dbuf_hash_hits untyped node_zfs_dbuf_hash_hits 108807 # HELP node_zfs_dbuf_hash_insert_race kstat.zfs.misc.dbuf_stats.hash_insert_race # TYPE node_zfs_dbuf_hash_insert_race untyped node_zfs_dbuf_hash_insert_race 0 # HELP node_zfs_dbuf_hash_misses kstat.zfs.misc.dbuf_stats.hash_misses # TYPE node_zfs_dbuf_hash_misses untyped node_zfs_dbuf_hash_misses 1851 # 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_dnode_dnode_alloc_next_block kstat.zfs.misc.dnodestats.dnode_alloc_next_block # TYPE node_zfs_dnode_dnode_alloc_next_block untyped node_zfs_dnode_dnode_alloc_next_block 0 # HELP node_zfs_dnode_dnode_alloc_next_chunk kstat.zfs.misc.dnodestats.dnode_alloc_next_chunk # TYPE node_zfs_dnode_dnode_alloc_next_chunk untyped node_zfs_dnode_dnode_alloc_next_chunk 0 # HELP node_zfs_dnode_dnode_alloc_race kstat.zfs.misc.dnodestats.dnode_alloc_race # TYPE node_zfs_dnode_dnode_alloc_race untyped node_zfs_dnode_dnode_alloc_race 0 # HELP node_zfs_dnode_dnode_allocate kstat.zfs.misc.dnodestats.dnode_allocate # TYPE node_zfs_dnode_dnode_allocate untyped node_zfs_dnode_dnode_allocate 0 # HELP node_zfs_dnode_dnode_buf_evict kstat.zfs.misc.dnodestats.dnode_buf_evict # TYPE node_zfs_dnode_dnode_buf_evict untyped node_zfs_dnode_dnode_buf_evict 17 # HELP node_zfs_dnode_dnode_hold_alloc_hits kstat.zfs.misc.dnodestats.dnode_hold_alloc_hits # TYPE node_zfs_dnode_dnode_hold_alloc_hits untyped node_zfs_dnode_dnode_hold_alloc_hits 37617 # HELP node_zfs_dnode_dnode_hold_alloc_interior kstat.zfs.misc.dnodestats.dnode_hold_alloc_interior # TYPE node_zfs_dnode_dnode_hold_alloc_interior untyped node_zfs_dnode_dnode_hold_alloc_interior 0 # HELP node_zfs_dnode_dnode_hold_alloc_lock_misses kstat.zfs.misc.dnodestats.dnode_hold_alloc_lock_misses # TYPE node_zfs_dnode_dnode_hold_alloc_lock_misses untyped node_zfs_dnode_dnode_hold_alloc_lock_misses 0 # HELP node_zfs_dnode_dnode_hold_alloc_lock_retry kstat.zfs.misc.dnodestats.dnode_hold_alloc_lock_retry # TYPE node_zfs_dnode_dnode_hold_alloc_lock_retry untyped node_zfs_dnode_dnode_hold_alloc_lock_retry 0 # HELP node_zfs_dnode_dnode_hold_alloc_misses kstat.zfs.misc.dnodestats.dnode_hold_alloc_misses # TYPE node_zfs_dnode_dnode_hold_alloc_misses untyped node_zfs_dnode_dnode_hold_alloc_misses 0 # HELP node_zfs_dnode_dnode_hold_alloc_type_none kstat.zfs.misc.dnodestats.dnode_hold_alloc_type_none # TYPE node_zfs_dnode_dnode_hold_alloc_type_none untyped node_zfs_dnode_dnode_hold_alloc_type_none 0 # HELP node_zfs_dnode_dnode_hold_dbuf_hold kstat.zfs.misc.dnodestats.dnode_hold_dbuf_hold # TYPE node_zfs_dnode_dnode_hold_dbuf_hold untyped node_zfs_dnode_dnode_hold_dbuf_hold 0 # HELP node_zfs_dnode_dnode_hold_dbuf_read kstat.zfs.misc.dnodestats.dnode_hold_dbuf_read # TYPE node_zfs_dnode_dnode_hold_dbuf_read untyped node_zfs_dnode_dnode_hold_dbuf_read 0 # HELP node_zfs_dnode_dnode_hold_free_hits kstat.zfs.misc.dnodestats.dnode_hold_free_hits # TYPE node_zfs_dnode_dnode_hold_free_hits untyped node_zfs_dnode_dnode_hold_free_hits 0 # HELP node_zfs_dnode_dnode_hold_free_lock_misses kstat.zfs.misc.dnodestats.dnode_hold_free_lock_misses # TYPE node_zfs_dnode_dnode_hold_free_lock_misses untyped node_zfs_dnode_dnode_hold_free_lock_misses 0 # HELP node_zfs_dnode_dnode_hold_free_lock_retry kstat.zfs.misc.dnodestats.dnode_hold_free_lock_retry # TYPE node_zfs_dnode_dnode_hold_free_lock_retry untyped node_zfs_dnode_dnode_hold_free_lock_retry 0 # HELP node_zfs_dnode_dnode_hold_free_misses kstat.zfs.misc.dnodestats.dnode_hold_free_misses # TYPE node_zfs_dnode_dnode_hold_free_misses untyped node_zfs_dnode_dnode_hold_free_misses 0 # HELP node_zfs_dnode_dnode_hold_free_overflow kstat.zfs.misc.dnodestats.dnode_hold_free_overflow # TYPE node_zfs_dnode_dnode_hold_free_overflow untyped node_zfs_dnode_dnode_hold_free_overflow 0 # HELP node_zfs_dnode_dnode_hold_free_refcount kstat.zfs.misc.dnodestats.dnode_hold_free_refcount # TYPE node_zfs_dnode_dnode_hold_free_refcount untyped node_zfs_dnode_dnode_hold_free_refcount 0 # HELP node_zfs_dnode_dnode_hold_free_txg kstat.zfs.misc.dnodestats.dnode_hold_free_txg # TYPE node_zfs_dnode_dnode_hold_free_txg untyped node_zfs_dnode_dnode_hold_free_txg 0 # HELP node_zfs_dnode_dnode_move_active kstat.zfs.misc.dnodestats.dnode_move_active # TYPE node_zfs_dnode_dnode_move_active untyped node_zfs_dnode_dnode_move_active 0 # HELP node_zfs_dnode_dnode_move_handle kstat.zfs.misc.dnodestats.dnode_move_handle # TYPE node_zfs_dnode_dnode_move_handle untyped node_zfs_dnode_dnode_move_handle 0 # HELP node_zfs_dnode_dnode_move_invalid kstat.zfs.misc.dnodestats.dnode_move_invalid # TYPE node_zfs_dnode_dnode_move_invalid untyped node_zfs_dnode_dnode_move_invalid 0 # HELP node_zfs_dnode_dnode_move_recheck1 kstat.zfs.misc.dnodestats.dnode_move_recheck1 # TYPE node_zfs_dnode_dnode_move_recheck1 untyped node_zfs_dnode_dnode_move_recheck1 0 # HELP node_zfs_dnode_dnode_move_recheck2 kstat.zfs.misc.dnodestats.dnode_move_recheck2 # TYPE node_zfs_dnode_dnode_move_recheck2 untyped node_zfs_dnode_dnode_move_recheck2 0 # HELP node_zfs_dnode_dnode_move_rwlock kstat.zfs.misc.dnodestats.dnode_move_rwlock # TYPE node_zfs_dnode_dnode_move_rwlock untyped node_zfs_dnode_dnode_move_rwlock 0 # HELP node_zfs_dnode_dnode_move_special kstat.zfs.misc.dnodestats.dnode_move_special # TYPE node_zfs_dnode_dnode_move_special untyped node_zfs_dnode_dnode_move_special 0 # HELP node_zfs_dnode_dnode_reallocate kstat.zfs.misc.dnodestats.dnode_reallocate # TYPE node_zfs_dnode_dnode_reallocate untyped node_zfs_dnode_dnode_reallocate 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_vdev_mirror_non_rotating_linear kstat.zfs.misc.vdev_mirror_stats.non_rotating_linear # TYPE node_zfs_vdev_mirror_non_rotating_linear untyped node_zfs_vdev_mirror_non_rotating_linear 0 # HELP node_zfs_vdev_mirror_non_rotating_seek kstat.zfs.misc.vdev_mirror_stats.non_rotating_seek # TYPE node_zfs_vdev_mirror_non_rotating_seek untyped node_zfs_vdev_mirror_non_rotating_seek 0 # HELP node_zfs_vdev_mirror_preferred_found kstat.zfs.misc.vdev_mirror_stats.preferred_found # TYPE node_zfs_vdev_mirror_preferred_found untyped node_zfs_vdev_mirror_preferred_found 0 # HELP node_zfs_vdev_mirror_preferred_not_found kstat.zfs.misc.vdev_mirror_stats.preferred_not_found # TYPE node_zfs_vdev_mirror_preferred_not_found untyped node_zfs_vdev_mirror_preferred_not_found 94 # HELP node_zfs_vdev_mirror_rotating_linear kstat.zfs.misc.vdev_mirror_stats.rotating_linear # TYPE node_zfs_vdev_mirror_rotating_linear untyped node_zfs_vdev_mirror_rotating_linear 0 # HELP node_zfs_vdev_mirror_rotating_offset kstat.zfs.misc.vdev_mirror_stats.rotating_offset # TYPE node_zfs_vdev_mirror_rotating_offset untyped node_zfs_vdev_mirror_rotating_offset 0 # HELP node_zfs_vdev_mirror_rotating_seek kstat.zfs.misc.vdev_mirror_stats.rotating_seek # TYPE node_zfs_vdev_mirror_rotating_seek untyped node_zfs_vdev_mirror_rotating_seek 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 1.8446744073709537e+19 # 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 process_virtual_memory_max_bytes Maximum amount of virtual memory available in bytes. # TYPE process_virtual_memory_max_bytes gauge # HELP promhttp_metric_handler_requests_in_flight Current number of scrapes being served. # TYPE promhttp_metric_handler_requests_in_flight gauge promhttp_metric_handler_requests_in_flight 1 # HELP promhttp_metric_handler_requests_total Total number of scrapes by HTTP status code. # TYPE promhttp_metric_handler_requests_total counter promhttp_metric_handler_requests_total{code="200"} 0 promhttp_metric_handler_requests_total{code="500"} 0 promhttp_metric_handler_requests_total{code="503"} 0 # 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 # HELP testmetric2_2 Metric read from collector/fixtures/textfile/two_metric_files/metrics2.prom # TYPE testmetric2_2 untyped testmetric2_2{foo="baz"} 40 prometheus-node-exporter-0.18.1+ds/collector/fixtures/ip_vs_result.txt000066400000000000000000000112501350016654700263130ustar00rootroot00000000000000# 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.18.1+ds/collector/fixtures/proc/000077500000000000000000000000001350016654700240005ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/1/000077500000000000000000000000001350016654700241405ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/1/mounts000066400000000000000000000050221350016654700254070ustar00rootroot00000000000000rootfs / 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 /dev/sda /var/lib/kubelet/plugins/kubernetes.io/vsphere-volume/mounts/[vsanDatastore]\040bafb9e5a-8856-7e6c-699c-801844e77a4a/kubernetes-dynamic-pvc-3eba5bba-48a3-11e8-89ab-005056b92113.vmdk ext4 rw,relatime,data=ordered 0 0 /dev/sda /var/lib/kubelet/plugins/kubernetes.io/vsphere-volume/mounts/[vsanDatastore]\011bafb9e5a-8856-7e6c-699c-801844e77a4a/kubernetes-dynamic-pvc-3eba5bba-48a3-11e8-89ab-005056b92113.vmdk ext4 rw,relatime,data=ordered 0 0 prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/10/000077500000000000000000000000001350016654700242205ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/10/mountstats000066400000000000000000000054521350016654700263720ustar00rootroot00000000000000device 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 ACCESS: 2927395007 2927394995 0 526931094212 362996810236 18446743919241604546 1667369447 1953587717 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=udp,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: udp 832 0 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 ACCESS: 2927395007 2927394995 0 526931094212 362996810236 18446743919241604546 1667369447 1953587717 prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/10/stat000066400000000000000000000002321350016654700251130ustar00rootroot0000000000000017 (khungtaskd) S 2 0 0 0 -1 2129984 0 0 0 0 14 0 0 0 20 0 1 0 24 0 0 18446744073709551615 0 0 0 0 0 0 0 2147483647 0 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/11/000077500000000000000000000000001350016654700242215ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/11/.missing_stat000066400000000000000000000000001350016654700267140ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/buddyinfo000066400000000000000000000004541350016654700257110ustar00rootroot00000000000000Node 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.18.1+ds/collector/fixtures/proc/diskstats000066400000000000000000000053301350016654700257350ustar00rootroot00000000000000 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 8 0 sdb 326552 841 9657779 84 41822 2895 1972905 5007 0 60730 67070 68851 0 1925173784 11130 8 1 sdb1 231 3 34466 4 24 23 106 0 0 64 64 0 0 0 0 8 2 sdb2 326310 838 9622281 67 40726 2872 1972799 4924 0 58250 64567 68851 0 1925173784 11130 prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/drbd000066400000000000000000000004101350016654700246310ustar00rootroot00000000000000version: 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.18.1+ds/collector/fixtures/proc/interrupts000066400000000000000000000042751350016654700261520ustar00rootroot00000000000000 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.18.1+ds/collector/fixtures/proc/loadavg000066400000000000000000000000331350016654700253340ustar00rootroot000000000000000.21 0.37 0.39 1/719 19737 prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/mdstat000066400000000000000000000032601350016654700252200ustar00rootroot00000000000000Personalities : [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 md120 : active linear sda1[1] sdb1[0] 2095104 blocks super 1.2 0k rounding unused devices: prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/mdstat_invalid000066400000000000000000000001421350016654700267220ustar00rootroot00000000000000Personalities : [invalid] md3 : invalid 314159265 blocks 64k chunks unused devices: prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/meminfo000066400000000000000000000022221350016654700253530ustar00rootroot00000000000000MemTotal: 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.18.1+ds/collector/fixtures/proc/net/000077500000000000000000000000001350016654700245665ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/net/arp000066400000000000000000000010211350016654700252650ustar00rootroot00000000000000IP 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.18.1+ds/collector/fixtures/proc/net/dev000066400000000000000000000027031350016654700252710ustar00rootroot00000000000000Inter-| 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 ibr10:30: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 flannel.1: 18144009813 228499337 0 0 0 0 0 0 20758990068 258369223 0 64 0 0 0 0 💩0: 57750104 105557 0 0 0 0 0 72 404570255 304261 0 0 0 0 0 0 prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/net/ip_vs000066400000000000000000000013021350016654700256250ustar00rootroot00000000000000IP 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.18.1+ds/collector/fixtures/proc/net/ip_vs_stats000066400000000000000000000004621350016654700270510ustar00rootroot00000000000000 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.18.1+ds/collector/fixtures/proc/net/netstat000066400000000000000000000032321350016654700261730ustar00rootroot00000000000000TcpExt: 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.18.1+ds/collector/fixtures/proc/net/rpc/000077500000000000000000000000001350016654700253525ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/net/rpc/nfs000066400000000000000000000006001350016654700260570ustar00rootroot00000000000000net 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.18.1+ds/collector/fixtures/proc/net/rpc/nfsd000066400000000000000000000007431350016654700262330ustar00rootroot00000000000000rc 0 6 18622 fh 0 0 0 0 0 io 157286400 72864 th 8 0 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ra 32 0 0 0 0 0 0 0 0 0 0 0 net 972 55 917 1 rpc 18628 3 1 2 0 proc2 18 2 69 0 0 4410 0 0 0 0 0 0 0 0 0 0 0 99 2 proc3 22 2 112 0 2719 111 0 0 0 0 0 0 0 0 0 0 0 27 216 0 2 1 0 proc4 2 2 10853 proc4ops 72 0 0 0 1098 2 0 0 0 0 8179 5896 0 0 0 0 5900 0 0 2 0 2 0 9609 0 2 150 1272 0 0 0 1236 0 0 0 0 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/net/snmp000066400000000000000000000022621350016654700254700ustar00rootroot00000000000000Ip: 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.18.1+ds/collector/fixtures/proc/net/snmp6000066400000000000000000000056531350016654700255650ustar00rootroot00000000000000Ip6InReceives 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.18.1+ds/collector/fixtures/proc/net/sockstat000066400000000000000000000002041350016654700263400ustar00rootroot00000000000000sockets: 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.18.1+ds/collector/fixtures/proc/net/sockstat_rhe4000066400000000000000000000001551350016654700272670ustar00rootroot00000000000000sockets: 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.18.1+ds/collector/fixtures/proc/net/tcpstat000066400000000000000000000007021350016654700261720ustar00rootroot00000000000000 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.18.1+ds/collector/fixtures/proc/pressure/000077500000000000000000000000001350016654700256505ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/pressure/cpu000066400000000000000000000000661350016654700263640ustar00rootroot00000000000000some avg10=0.00 avg60=0.00 avg300=0.00 total=14036781 prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/pressure/io000066400000000000000000000001561350016654700262040ustar00rootroot00000000000000some avg10=0.18 avg60=0.34 avg300=0.10 total=159886802 full avg10=0.18 avg60=0.34 avg300=0.10 total=159229614 prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/pressure/memory000066400000000000000000000001361350016654700271030ustar00rootroot00000000000000some avg10=0.00 avg60=0.00 avg300=0.00 total=0 full avg10=0.00 avg60=0.00 avg300=0.00 total=0 prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/self00007770000000000000000000000000135001665470025012210ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/spl/000077500000000000000000000000001350016654700245765ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/spl/kstat/000077500000000000000000000000001350016654700257245ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/spl/kstat/zfs/000077500000000000000000000000001350016654700265265ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/spl/kstat/zfs/abdstats000066400000000000000000000016321350016654700302600ustar00rootroot000000000000007 1 0x01 21 5712 73163810083184 309946154984654 name type data struct_size 4 2520 linear_cnt 4 62 linear_data_size 4 223232 scatter_cnt 4 1 scatter_data_size 4 16384 scatter_chunk_waste 4 0 scatter_order_0 4 0 scatter_order_1 4 0 scatter_order_2 4 1 scatter_order_3 4 0 scatter_order_4 4 0 scatter_order_5 4 0 scatter_order_6 4 0 scatter_order_7 4 0 scatter_order_8 4 0 scatter_order_9 4 0 scatter_order_10 4 0 scatter_page_multi_chunk 4 0 scatter_page_multi_zone 4 0 scatter_page_alloc_retry 4 0 scatter_sg_table_retry 4 0 prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/spl/kstat/zfs/arcstats000066400000000000000000000075661350016654700303130ustar00rootroot000000000000006 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.18.1+ds/collector/fixtures/proc/spl/kstat/zfs/dbuf_stats000066400000000000000000000051061350016654700306110ustar00rootroot0000000000000015 1 0x01 63 17136 73163812943503 309964267073187 name type data dbuf_cache_count 4 27 dbuf_cache_size 4 302080 dbuf_cache_size_max 4 394240 dbuf_cache_max_bytes 4 62834368 dbuf_cache_lowater_bytes 4 56550932 dbuf_cache_hiwater_bytes 4 69117804 dbuf_cache_total_evicts 4 0 dbuf_cache_level_0 4 27 dbuf_cache_level_1 4 0 dbuf_cache_level_2 4 0 dbuf_cache_level_3 4 0 dbuf_cache_level_4 4 0 dbuf_cache_level_5 4 0 dbuf_cache_level_6 4 0 dbuf_cache_level_7 4 0 dbuf_cache_level_8 4 0 dbuf_cache_level_9 4 0 dbuf_cache_level_10 4 0 dbuf_cache_level_11 4 0 dbuf_cache_level_0_bytes 4 302080 dbuf_cache_level_1_bytes 4 0 dbuf_cache_level_2_bytes 4 0 dbuf_cache_level_3_bytes 4 0 dbuf_cache_level_4_bytes 4 0 dbuf_cache_level_5_bytes 4 0 dbuf_cache_level_6_bytes 4 0 dbuf_cache_level_7_bytes 4 0 dbuf_cache_level_8_bytes 4 0 dbuf_cache_level_9_bytes 4 0 dbuf_cache_level_10_bytes 4 0 dbuf_cache_level_11_bytes 4 0 hash_hits 4 108807 hash_misses 4 1851 hash_collisions 4 0 hash_elements 4 55 hash_elements_max 4 55 hash_chains 4 0 hash_chain_max 4 0 hash_insert_race 4 0 hash_dbuf_level_0 4 37 hash_dbuf_level_1 4 10 hash_dbuf_level_2 4 2 hash_dbuf_level_3 4 2 hash_dbuf_level_4 4 2 hash_dbuf_level_5 4 2 hash_dbuf_level_6 4 0 hash_dbuf_level_7 4 0 hash_dbuf_level_8 4 0 hash_dbuf_level_9 4 0 hash_dbuf_level_10 4 0 hash_dbuf_level_11 4 0 hash_dbuf_level_0_bytes 4 465920 hash_dbuf_level_1_bytes 4 1310720 hash_dbuf_level_2_bytes 4 262144 hash_dbuf_level_3_bytes 4 262144 hash_dbuf_level_4_bytes 4 262144 hash_dbuf_level_5_bytes 4 262144 hash_dbuf_level_6_bytes 4 0 hash_dbuf_level_7_bytes 4 0 hash_dbuf_level_8_bytes 4 0 hash_dbuf_level_9_bytes 4 0 hash_dbuf_level_10_bytes 4 0 hash_dbuf_level_11_bytes 4 0 prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/spl/kstat/zfs/dmu_tx000066400000000000000000000010101350016654700277410ustar00rootroot000000000000005 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.18.1+ds/collector/fixtures/proc/spl/kstat/zfs/dnodestats000066400000000000000000000022441350016654700306230ustar00rootroot0000000000000010 1 0x01 28 7616 73163810135894 309969103316276 name type data dnode_hold_dbuf_hold 4 0 dnode_hold_dbuf_read 4 0 dnode_hold_alloc_hits 4 37617 dnode_hold_alloc_misses 4 0 dnode_hold_alloc_interior 4 0 dnode_hold_alloc_lock_retry 4 0 dnode_hold_alloc_lock_misses 4 0 dnode_hold_alloc_type_none 4 0 dnode_hold_free_hits 4 0 dnode_hold_free_misses 4 0 dnode_hold_free_lock_misses 4 0 dnode_hold_free_lock_retry 4 0 dnode_hold_free_overflow 4 0 dnode_hold_free_refcount 4 0 dnode_hold_free_txg 4 0 dnode_allocate 4 0 dnode_reallocate 4 0 dnode_buf_evict 4 17 dnode_alloc_next_chunk 4 0 dnode_alloc_race 4 0 dnode_alloc_next_block 4 0 dnode_move_invalid 4 0 dnode_move_recheck1 4 0 dnode_move_recheck2 4 0 dnode_move_special 4 0 dnode_move_handle 4 0 dnode_move_rwlock 4 0 dnode_move_active 4 0 prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/spl/kstat/zfs/fm000066400000000000000000000003611350016654700270530ustar00rootroot000000000000000 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.18.1+ds/collector/fixtures/proc/spl/kstat/zfs/pool1/000077500000000000000000000000001350016654700275605ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/spl/kstat/zfs/pool1/io000066400000000000000000000004241350016654700301120ustar00rootroot0000000000000012 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.18.1+ds/collector/fixtures/proc/spl/kstat/zfs/poolz1/000077500000000000000000000000001350016654700277525ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/spl/kstat/zfs/poolz1/io000066400000000000000000000004441350016654700303060ustar00rootroot0000000000000016 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.18.1+ds/collector/fixtures/proc/spl/kstat/zfs/vdev_cache_stats000066400000000000000000000003121350016654700317520ustar00rootroot000000000000008 1 0x01 3 144 8012540758 352116106118781 name type data delegations 4 40 hits 4 0 misses 4 0 prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/spl/kstat/zfs/vdev_mirror_stats000066400000000000000000000005541350016654700322310ustar00rootroot0000000000000018 1 0x01 7 1904 73163813004224 309980651991187 name type data rotating_linear 4 0 rotating_offset 4 0 rotating_seek 4 0 non_rotating_linear 4 0 non_rotating_seek 4 0 preferred_found 4 0 preferred_not_found 4 94 prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/spl/kstat/zfs/xuio_stats000066400000000000000000000004771350016654700306630ustar00rootroot000000000000002 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.18.1+ds/collector/fixtures/proc/spl/kstat/zfs/zfetchstats000066400000000000000000000010211350016654700310050ustar00rootroot000000000000004 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.18.1+ds/collector/fixtures/proc/spl/kstat/zfs/zil000066400000000000000000000011441350016654700272470ustar00rootroot000000000000007 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 18446744073709537686 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.18.1+ds/collector/fixtures/proc/stat000066400000000000000000000040601350016654700246760ustar00rootroot00000000000000cpu 301854 612 111922 8979004 3552 2 3944 0 44 36 cpu0 44490 19 21045 1087069 220 1 3410 0 2 1 cpu1 47869 23 16474 1110787 591 0 46 0 3 2 cpu2 46504 36 15916 1112321 441 0 326 0 4 3 cpu3 47054 102 15683 1113230 533 0 60 0 5 4 cpu4 28413 25 10776 1140321 217 0 8 0 6 5 cpu5 29271 101 11586 1136270 672 0 30 0 7 6 cpu6 29152 36 10276 1139721 319 0 29 0 8 7 cpu7 29098 268 10164 1139282 555 0 31 0 9 8 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.18.1+ds/collector/fixtures/proc/sys/000077500000000000000000000000001350016654700246165ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/sys/fs/000077500000000000000000000000001350016654700252265ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/sys/fs/file-nr000066400000000000000000000000171350016654700265030ustar00rootroot000000000000001024 0 1631329 prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/sys/kernel/000077500000000000000000000000001350016654700260765ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/sys/kernel/pid_max000066400000000000000000000000041350016654700274340ustar00rootroot00000000000000123 prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/sys/kernel/random/000077500000000000000000000000001350016654700273565ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/sys/kernel/random/entropy_avail000066400000000000000000000000051350016654700321500ustar00rootroot000000000000001337 prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/sys/kernel/threads-max000066400000000000000000000000041350016654700302300ustar00rootroot000000000000007801prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/sys/net/000077500000000000000000000000001350016654700254045ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/sys/net/netfilter/000077500000000000000000000000001350016654700274005ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/sys/net/netfilter/nf_conntrack_count000066400000000000000000000000041350016654700331720ustar00rootroot00000000000000123 prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/sys/net/netfilter/nf_conntrack_max000066400000000000000000000000061350016654700326310ustar00rootroot0000000000000065536 prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/sys/pid_max000066400000000000000000000000041350016654700261540ustar00rootroot00000000000000123 prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/sys/threads-max000066400000000000000000000000041350016654700267500ustar00rootroot000000000000007801prometheus-node-exporter-0.18.1+ds/collector/fixtures/proc/vmstat000066400000000000000000000051161350016654700252440ustar00rootroot00000000000000nr_free_pages 977769 nr_alloc_batch 4158 nr_inactive_anon 125031 nr_active_anon 622512 nr_inactive_file 92317 nr_active_file 324014 nr_unevictable 12 nr_mlock 12 nr_anon_pages 713633 nr_mapped 118021 nr_file_pages 450840 nr_dirty 21 nr_writeback 0 nr_slab_reclaimable 85763 nr_slab_unreclaimable 431112 nr_page_table_pages 12504 nr_kernel_stack 1156 nr_overhead 4956 nr_unstable 0 nr_bounce 0 nr_vmscan_write 35050 nr_vmscan_immediate_reclaim 27 nr_writeback_temp 0 nr_isolated_anon 0 nr_isolated_file 0 nr_shmem 20623 nr_dirtied 11127183 nr_written 11122061 nr_pages_scanned 0 numa_hit 2601972389 numa_miss 0 numa_foreign 0 numa_interleave 32353 numa_local 2601972389 numa_other 0 workingset_refault 157066 workingset_activate 104270 workingset_nodereclaim 0 nr_anon_transparent_hugepages 556 nr_free_cma 0 nr_dirty_threshold 270390 nr_dirty_background_threshold 135030 pgpgin 7344136 pgpgout 1541180581 pswpin 1476 pswpout 35045 pgalloc_dma 12 pgalloc_dma32 611781566 pgalloc_normal 2287227526 pgalloc_movable 0 pgfree 2938719870 pgactivate 152952989 pgdeactivate 898450 pgfault 2320168809 pgmajfault 507162 pgrefill_dma 0 pgrefill_dma32 186367 pgrefill_normal 603970 pgrefill_movable 0 pgsteal_kswapd_dma 0 pgsteal_kswapd_dma32 78783 pgsteal_kswapd_normal 254128 pgsteal_kswapd_movable 0 pgsteal_direct_dma 0 pgsteal_direct_dma32 44 pgsteal_direct_normal 6484 pgsteal_direct_movable 0 pgscan_kswapd_dma 0 pgscan_kswapd_dma32 107656 pgscan_kswapd_normal 358784 pgscan_kswapd_movable 0 pgscan_direct_dma 0 pgscan_direct_dma32 67 pgscan_direct_normal 6796 pgscan_direct_movable 0 pgscan_direct_throttle 0 zone_reclaim_failed 0 pginodesteal 412258 slabs_scanned 14355346 kswapd_inodesteal 288891 kswapd_low_wmark_hit_quickly 109 kswapd_high_wmark_hit_quickly 45 pageoutrun 247 allocstall 83165 pgrotated 35014 drop_pagecache 0 drop_slab 0 numa_pte_updates 0 numa_huge_pte_updates 0 numa_hint_faults 0 numa_hint_faults_local 0 numa_pages_migrated 0 pgmigrate_success 37070309 pgmigrate_fail 36815 compact_migrate_scanned 830267783 compact_free_scanned 12336622550 compact_isolated 82707414 compact_stall 210959 compact_fail 164840 compact_success 46119 htlb_buddy_alloc_success 0 htlb_buddy_alloc_fail 0 unevictable_pgs_culled 2188 unevictable_pgs_scanned 0 unevictable_pgs_rescued 3962 unevictable_pgs_mlocked 3994 unevictable_pgs_munlocked 3968 unevictable_pgs_cleared 14 unevictable_pgs_stranded 14 thp_fault_alloc 142261 thp_fault_fallback 98119 thp_collapse_alloc 88421 thp_collapse_alloc_failed 20954 thp_split 69984 thp_zero_page_alloc 9 thp_zero_page_alloc_failed 20 balloon_inflate 0 balloon_deflate 0 balloon_migrate 0 oom_kill 0 prometheus-node-exporter-0.18.1+ds/collector/fixtures/qdisc/000077500000000000000000000000001350016654700241405ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/qdisc/results.json000066400000000000000000000004441350016654700265360ustar00rootroot00000000000000[ { "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.18.1+ds/collector/fixtures/sys.ttar000066400000000000000000003025671350016654700245640ustar00rootroot00000000000000# 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 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/cpu/devices/cpu0 SymlinkTo: ../../../devices/system/cpu/cpu0 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/cpu/devices/cpu1 SymlinkTo: ../../../devices/system/cpu/cpu1 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/cpu/devices/cpu2 SymlinkTo: ../../../devices/system/cpu/cpu2 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/cpu/devices/cpu3 SymlinkTo: ../../../devices/system/cpu/cpu3 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus/node Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/bus/node/devices Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/node/devices/node0 SymlinkTo: ../../../devices/system/node/node0 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/bus/node/devices/node1 SymlinkTo: ../../../devices/system/node/node1 # 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/i40iw0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/infiniband/i40iw0/ports Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/infiniband/i40iw0/ports/1 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/infiniband/i40iw0/ports/1/counters Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/i40iw0/ports/1/counters/VL15_dropped Lines: 1 N/A (no PMA) Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/i40iw0/ports/1/counters/excessive_buffer_overrun_errors Lines: 1 N/A (no PMA) Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/i40iw0/ports/1/counters/link_downed Lines: 1 N/A (no PMA) Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/i40iw0/ports/1/counters/link_error_recovery Lines: 1 N/A (no PMA) Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/i40iw0/ports/1/counters/local_link_integrity_errors Lines: 1 N/A (no PMA) Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/i40iw0/ports/1/counters/port_rcv_constraint_errors Lines: 1 N/A (no PMA) Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/i40iw0/ports/1/counters/port_rcv_data Lines: 1 N/A (no PMA) Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/i40iw0/ports/1/counters/port_rcv_errors Lines: 1 N/A (no PMA) Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/i40iw0/ports/1/counters/port_rcv_packets Lines: 1 N/A (no PMA) Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/i40iw0/ports/1/counters/port_rcv_remote_physical_errors Lines: 1 N/A (no PMA) Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/i40iw0/ports/1/counters/port_rcv_switch_relay_errors Lines: 1 N/A (no PMA) Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/i40iw0/ports/1/counters/port_xmit_constraint_errors Lines: 1 N/A (no PMA) Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/i40iw0/ports/1/counters/port_xmit_data Lines: 1 N/A (no PMA) Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/i40iw0/ports/1/counters/port_xmit_discards Lines: 1 N/A (no PMA) Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/i40iw0/ports/1/counters/port_xmit_packets Lines: 1 N/A (no PMA) Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/i40iw0/ports/1/counters/port_xmit_wait Lines: 1 N/A (no PMA) Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/i40iw0/ports/1/counters/symbol_error Lines: 1 N/A (no PMA) Mode: 644 # 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_constraint_errors Lines: 1 0 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_rcv_discards Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/1/counters/port_xmit_discards Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/1/counters/port_rcv_errors Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/1/counters/port_rcv_packets Lines: 1 6825908347 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/1/counters/port_xmit_constraint_errors Lines: 1 0 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/port_xmit_discards Lines: 1 5 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/1/counters/port_xmit_packets Lines: 1 6235865 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/infiniband/mlx4_0/ports/1/counters/port_xmit_wait Lines: 1 4294967295 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 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/addr_assign_type Lines: 1 3 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/addr_len Lines: 1 6 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/address Lines: 1 01:01:01:01:01:01 Mode: 644 # 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/bond0/broadcast Lines: 1 ff:ff:ff:ff:ff:ff Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/carrier Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/carrier_changes Lines: 1 2 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/carrier_down_count Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/carrier_up_count Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/dev_id Lines: 1 0x20 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/dormant Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/duplex Lines: 1 full Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/flags Lines: 1 0x1303 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/ifalias Lines: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/ifindex Lines: 1 2 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/iflink Lines: 1 2 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/link_mode Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/mtu Lines: 1 1500 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/name_assign_type Lines: 1 2 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/netdev_group Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/operstate Lines: 1 up Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/phys_port_id Lines: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/phys_port_name Lines: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/phys_switch_id Lines: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/speed Lines: 1 1000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/tx_queue_len Lines: 1 1000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/bond0/type Lines: 1 1 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 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/addr_assign_type Lines: 1 3 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/addr_len Lines: 1 6 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/address Lines: 1 01:01:01:01:01:01 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/net/dmz/bonding Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/bonding/slaves Lines: 1 eth0 eth4 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/broadcast Lines: 1 ff:ff:ff:ff:ff:ff Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/carrier Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/carrier_changes Lines: 1 2 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/carrier_down_count Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/carrier_up_count Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/dev_id Lines: 1 0x20 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/dormant Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/duplex Lines: 1 full Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/flags Lines: 1 0x1303 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/ifalias Lines: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/ifindex Lines: 1 2 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/iflink Lines: 1 2 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/link_mode Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/mtu Lines: 1 1500 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/name_assign_type Lines: 1 2 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/netdev_group Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/operstate Lines: 1 up Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/phys_port_id Lines: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/phys_port_name Lines: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/phys_switch_id Lines: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/net/dmz/slave_eth0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/net/dmz/slave_eth0/bonding_slave Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/slave_eth0/bonding_slave/mii_status Lines: 1 up Mode: 644 # 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 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/net/dmz/slave_eth4/bonding_slave Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/slave_eth4/bonding_slave/mii_status Lines: 1 up Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/slave_eth4/operstate Lines: 1 up Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/speed Lines: 1 1000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/tx_queue_len Lines: 1 1000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/dmz/type Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/eth0 SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/ # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/net/int Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/addr_assign_type Lines: 1 3 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/addr_len Lines: 1 6 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/address Lines: 1 01:01:01:01:01:01 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/net/int/bonding Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/bonding/slaves Lines: 1 eth5 eth1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/broadcast Lines: 1 ff:ff:ff:ff:ff:ff Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/carrier Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/carrier_changes Lines: 1 2 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/carrier_down_count Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/carrier_up_count Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/dev_id Lines: 1 0x20 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/dormant Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/duplex Lines: 1 full Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/flags Lines: 1 0x1303 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/ifalias Lines: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/ifindex Lines: 1 2 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/iflink Lines: 1 2 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/link_mode Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/mtu Lines: 1 1500 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/name_assign_type Lines: 1 2 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/netdev_group Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/operstate Lines: 1 up Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/phys_port_id Lines: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/phys_port_name Lines: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/phys_switch_id Lines: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/net/int/slave_eth1 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/net/int/slave_eth1/bonding_slave Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/slave_eth1/bonding_slave/mii_status Lines: 1 down Mode: 644 # 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 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/net/int/slave_eth5/bonding_slave Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/slave_eth5/bonding_slave/mii_status Lines: 1 up Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/slave_eth5/operstate Lines: 1 up Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/speed Lines: 1 1000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/tx_queue_len Lines: 1 1000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/net/int/type Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:03.0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/addr_assign_type Lines: 1 3 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/addr_len Lines: 1 6 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/address Lines: 1 01:01:01:01:01:01 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/broadcast Lines: 1 ff:ff:ff:ff:ff:ff Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/carrier Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/carrier_changes Lines: 1 2 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/carrier_down_count Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/carrier_up_count Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/dev_id Lines: 1 0x20 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/dormant Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/duplex Lines: 1 full Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/flags Lines: 1 0x1303 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/ifalias Lines: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/ifindex Lines: 1 2 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/iflink Lines: 1 2 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/link_mode Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/mtu Lines: 1 1500 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/name_assign_type Lines: 1 2 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/netdev_group Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/operstate Lines: 1 up Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/phys_port_id Lines: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/phys_port_name Lines: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/phys_switch_id Lines: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/speed Lines: 1 1000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/tx_queue_len Lines: 1 1000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/net/eth0/type Lines: 1 1 Mode: 644 # 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/cpu Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/cpu/cpu0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/cpu/cpu0/cpufreq Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency Lines: 1 0 Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu0/cpufreq/related_cpus Lines: 1 0 Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors Lines: 1 performance powersave Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq Lines: 1 1699981 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu0/cpufreq/scaling_driver Lines: 1 intel_pstate Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu0/cpufreq/scaling_governor Lines: 1 powersave Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq Lines: 1 3700000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq Lines: 1 800000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed Lines: 1 Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/cpu/cpu0/thermal_throttle Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu0/thermal_throttle/core_throttle_count Lines: 1 5 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu0/thermal_throttle/package_throttle_count Lines: 1 30 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/cpu/cpu0/topology Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu0/topology/core_id Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu0/topology/physical_package_id Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/cpu/cpu1 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/cpu/cpu1/cpufreq Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_transition_latency Lines: 1 0 Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu1/cpufreq/related_cpus Lines: 1 0 Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu1/cpufreq/scaling_available_governors Lines: 1 performance powersave Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq Lines: 1 1699981 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu1/cpufreq/scaling_driver Lines: 1 intel_pstate Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu1/cpufreq/scaling_governor Lines: 1 powersave Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq Lines: 1 3700000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq Lines: 1 800000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu1/cpufreq/scaling_setspeed Lines: 1 Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/cpu/cpu1/thermal_throttle Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu1/thermal_throttle/core_throttle_count Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu1/thermal_throttle/package_throttle_count Lines: 1 30 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/cpu/cpu1/topology Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu1/topology/core_id Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu1/topology/physical_package_id Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/cpu/cpu2 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/cpu/cpu2/cpufreq Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_transition_latency Lines: 1 0 Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu2/cpufreq/related_cpus Lines: 1 0 Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu2/cpufreq/scaling_available_governors Lines: 1 performance powersave Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu2/cpufreq/scaling_cur_freq Lines: 1 8000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu2/cpufreq/scaling_driver Lines: 1 intel_pstate Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu2/cpufreq/scaling_governor Lines: 1 powersave Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq Lines: 1 4200000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq Lines: 1 1000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu2/cpufreq/scaling_setspeed Lines: 1 Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/cpu/cpu2/thermal_throttle Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu2/thermal_throttle/core_throttle_count Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu2/thermal_throttle/package_throttle_count Lines: 1 6 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/cpu/cpu2/topology Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu2/topology/core_id Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu2/topology/physical_package_id Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/cpu/cpu3 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/cpu/cpu3/cpufreq Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu3/cpufreq/cpuinfo_transition_latency Lines: 1 0 Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu3/cpufreq/related_cpus Lines: 1 0 Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu3/cpufreq/scaling_available_governors Lines: 1 performance powersave Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu3/cpufreq/scaling_cur_freq Lines: 1 8000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu3/cpufreq/scaling_driver Lines: 1 intel_pstate Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu3/cpufreq/scaling_governor Lines: 1 powersave Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq Lines: 1 4200000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq Lines: 1 1000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu3/cpufreq/scaling_setspeed Lines: 1 Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/cpu/cpu3/thermal_throttle Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu3/thermal_throttle/core_throttle_count Lines: 1 9 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu3/thermal_throttle/package_throttle_count Lines: 1 6 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/cpu/cpu3/topology Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu3/topology/core_id Lines: 1 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/cpu/cpu3/topology/physical_package_id Lines: 1 1 Mode: 644 # 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/cpu0 SymlinkTo: ../../cpu/cpu0 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/node/node0/cpu1 SymlinkTo: ../../cpu/cpu1 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/node/node0/cpulist Lines: 1 0-1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/node/node0/meminfo Lines: 29 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/cpu2 SymlinkTo: ../../cpu/cpu2 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/node/node1/cpu3 SymlinkTo: ../../cpu/cpu3 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/node/node1/cpulist Lines: 1 2-3 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/node/node1/meminfo Lines: 29 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/devices/system/node/node2 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/node/node2/cpulist Lines: 1 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/node/node2/meminfo Lines: 29 Node 2 MemTotal: 134217728 kB Node 2 MemFree: 39634788 kB Node 2 MemUsed: 94582940 kB Node 2 Active: 5604496 kB Node 2 Inactive: 71450592 kB Node 2 Active(anon): 590464 kB Node 2 Inactive(anon): 285088 kB Node 2 Active(file): 5014032 kB Node 2 Inactive(file): 71165504 kB Node 2 Unevictable: 0 kB Node 2 Mlocked: 0 kB Node 2 Dirty: 120 kB Node 2 Writeback: 0 kB Node 2 FilePages: 83579188 kB Node 2 Mapped: 864112 kB Node 2 AnonPages: 671932 kB Node 2 Shmem: 87580 kB Node 2 KernelStack: 31104 kB Node 2 PageTables: 124272 kB Node 2 NFS_Unstable: 0 kB Node 2 Bounce: 0 kB Node 2 WritebackTmp: 0 kB Node 2 Slab: 7020716 kB Node 2 SReclaimable: 4614084 kB Node 2 SUnreclaim: 2406632 kB Node 2 AnonHugePages: 90112 kB Node 2 HugePages_Total: 0 Node 2 HugePages_Free: 0 Node 2 HugePages_Surp: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/system/node/node2/numastat Lines: 6 numa_hit 26720946761 numa_miss 9858626709 numa_foreign 2624528 interleave_hit 7286 local_node 26719046550 other_node 9860526920 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.18.1+ds/collector/fixtures/textfile/000077500000000000000000000000001350016654700246615ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/client_side_timestamp.out000066400000000000000000000002461350016654700317610ustar00rootroot00000000000000# 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 1 prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/client_side_timestamp/000077500000000000000000000000001350016654700312265ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/client_side_timestamp/metrics.prom000066400000000000000000000000751350016654700335750ustar00rootroot00000000000000metric_with_custom_timestamp 1 1441205977284 normal_metric 2 prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/different_metric_types.out000066400000000000000000000037261350016654700321570ustar00rootroot00000000000000# HELP event_duration_seconds_total Query timings # TYPE event_duration_seconds_total summary event_duration_seconds_total{baz="inner_eval",quantile="0.5"} 1.073e-06 event_duration_seconds_total{baz="inner_eval",quantile="0.9"} 1.928e-06 event_duration_seconds_total{baz="inner_eval",quantile="0.99"} 4.35e-06 event_duration_seconds_total_sum{baz="inner_eval"} 1.8652166505091474e+06 event_duration_seconds_total_count{baz="inner_eval"} 1.492355615e+09 event_duration_seconds_total{baz="prepare_time",quantile="0.5"} 4.283e-06 event_duration_seconds_total{baz="prepare_time",quantile="0.9"} 7.796e-06 event_duration_seconds_total{baz="prepare_time",quantile="0.99"} 2.2083e-05 event_duration_seconds_total_sum{baz="prepare_time"} 840923.7919437207 event_duration_seconds_total_count{baz="prepare_time"} 1.492355814e+09 event_duration_seconds_total{baz="result_append",quantile="0.5"} 1.566e-06 event_duration_seconds_total{baz="result_append",quantile="0.9"} 3.223e-06 event_duration_seconds_total{baz="result_append",quantile="0.99"} 6.53e-06 event_duration_seconds_total_sum{baz="result_append"} 4.404109951000078 event_duration_seconds_total_count{baz="result_append"} 1.427647e+06 event_duration_seconds_total{baz="result_sort",quantile="0.5"} 1.847e-06 event_duration_seconds_total{baz="result_sort",quantile="0.9"} 2.975e-06 event_duration_seconds_total{baz="result_sort",quantile="0.99"} 4.08e-06 event_duration_seconds_total_sum{baz="result_sort"} 3.4123187829998307 event_duration_seconds_total_count{baz="result_sort"} 1.427647e+06 # HELP events_total this is a test metric # TYPE events_total counter events_total{foo="bar"} 10 events_total{foo="baz"} 20 # HELP node_textfile_mtime_seconds Unixtime mtime of textfiles successfully read. # TYPE node_textfile_mtime_seconds gauge node_textfile_mtime_seconds{file="metrics.prom"} 1 # 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 prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/different_metric_types/000077500000000000000000000000001350016654700314165ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/different_metric_types/metrics.prom000066400000000000000000000032041350016654700337620ustar00rootroot00000000000000# HELP events_total this is a test metric # TYPE events_total counter events_total{foo="bar"} 10 events_total{foo="baz"} 20 # HELP event_duration_seconds_total Query timings # TYPE event_duration_seconds_total summary event_duration_seconds_total{baz="inner_eval",quantile="0.5"} 1.073e-06 event_duration_seconds_total{baz="inner_eval",quantile="0.9"} 1.928e-06 event_duration_seconds_total{baz="inner_eval",quantile="0.99"} 4.35e-06 event_duration_seconds_total_sum{baz="inner_eval"} 1.8652166505091474e+06 event_duration_seconds_total_count{baz="inner_eval"} 1.492355615e+09 event_duration_seconds_total{baz="prepare_time",quantile="0.5"} 4.283e-06 event_duration_seconds_total{baz="prepare_time",quantile="0.9"} 7.796e-06 event_duration_seconds_total{baz="prepare_time",quantile="0.99"} 2.2083e-05 event_duration_seconds_total_sum{baz="prepare_time"} 840923.7919437207 event_duration_seconds_total_count{baz="prepare_time"} 1.492355814e+09 event_duration_seconds_total{baz="result_append",quantile="0.5"} 1.566e-06 event_duration_seconds_total{baz="result_append",quantile="0.9"} 3.223e-06 event_duration_seconds_total{baz="result_append",quantile="0.99"} 6.53e-06 event_duration_seconds_total_sum{baz="result_append"} 4.404109951000078 event_duration_seconds_total_count{baz="result_append"} 1.427647e+06 event_duration_seconds_total{baz="result_sort",quantile="0.5"} 1.847e-06 event_duration_seconds_total{baz="result_sort",quantile="0.9"} 2.975e-06 event_duration_seconds_total{baz="result_sort",quantile="0.99"} 4.08e-06 event_duration_seconds_total_sum{baz="result_sort"} 3.4123187829998307 event_duration_seconds_total_count{baz="result_sort"} 1.427647e+06 prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/histogram.out000066400000000000000000000024731350016654700274150ustar00rootroot00000000000000# HELP node_textfile_mtime_seconds Unixtime mtime of textfiles successfully read. # TYPE node_textfile_mtime_seconds gauge node_textfile_mtime_seconds{file="metrics.prom"} 1 # 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 prometheus_tsdb_compaction_chunk_range Final time range of chunks on their first compaction # TYPE prometheus_tsdb_compaction_chunk_range histogram prometheus_tsdb_compaction_chunk_range_bucket{le="100"} 0 prometheus_tsdb_compaction_chunk_range_bucket{le="400"} 0 prometheus_tsdb_compaction_chunk_range_bucket{le="1600"} 0 prometheus_tsdb_compaction_chunk_range_bucket{le="6400"} 0 prometheus_tsdb_compaction_chunk_range_bucket{le="25600"} 7 prometheus_tsdb_compaction_chunk_range_bucket{le="102400"} 7 prometheus_tsdb_compaction_chunk_range_bucket{le="409600"} 1.412839e+06 prometheus_tsdb_compaction_chunk_range_bucket{le="1.6384e+06"} 1.69185e+06 prometheus_tsdb_compaction_chunk_range_bucket{le="6.5536e+06"} 1.691853e+06 prometheus_tsdb_compaction_chunk_range_bucket{le="2.62144e+07"} 1.691853e+06 prometheus_tsdb_compaction_chunk_range_bucket{le="+Inf"} 1.691853e+06 prometheus_tsdb_compaction_chunk_range_sum 6.71393432189e+11 prometheus_tsdb_compaction_chunk_range_count 1.691853e+06 prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/histogram/000077500000000000000000000000001350016654700266565ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/histogram/metrics.prom000066400000000000000000000017471350016654700312340ustar00rootroot00000000000000# HELP prometheus_tsdb_compaction_chunk_range Final time range of chunks on their first compaction # TYPE prometheus_tsdb_compaction_chunk_range histogram prometheus_tsdb_compaction_chunk_range_bucket{le="100"} 0 prometheus_tsdb_compaction_chunk_range_bucket{le="400"} 0 prometheus_tsdb_compaction_chunk_range_bucket{le="1600"} 0 prometheus_tsdb_compaction_chunk_range_bucket{le="6400"} 0 prometheus_tsdb_compaction_chunk_range_bucket{le="25600"} 7 prometheus_tsdb_compaction_chunk_range_bucket{le="102400"} 7 prometheus_tsdb_compaction_chunk_range_bucket{le="409600"} 1.412839e+06 prometheus_tsdb_compaction_chunk_range_bucket{le="1.6384e+06"} 1.69185e+06 prometheus_tsdb_compaction_chunk_range_bucket{le="6.5536e+06"} 1.691853e+06 prometheus_tsdb_compaction_chunk_range_bucket{le="2.62144e+07"} 1.691853e+06 prometheus_tsdb_compaction_chunk_range_bucket{le="+Inf"} 1.691853e+06 prometheus_tsdb_compaction_chunk_range_sum 6.71393432189e+11 prometheus_tsdb_compaction_chunk_range_count 1.691853e+06 prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/histogram_extra_dimension.out000066400000000000000000000046171350016654700326670ustar00rootroot00000000000000# HELP node_textfile_mtime_seconds Unixtime mtime of textfiles successfully read. # TYPE node_textfile_mtime_seconds gauge node_textfile_mtime_seconds{file="metrics.prom"} 1 # 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 prometheus_tsdb_compaction_chunk_range Final time range of chunks on their first compaction # TYPE prometheus_tsdb_compaction_chunk_range histogram prometheus_tsdb_compaction_chunk_range_bucket{foo="bar",le="100"} 0 prometheus_tsdb_compaction_chunk_range_bucket{foo="bar",le="400"} 0 prometheus_tsdb_compaction_chunk_range_bucket{foo="bar",le="1600"} 0 prometheus_tsdb_compaction_chunk_range_bucket{foo="bar",le="6400"} 0 prometheus_tsdb_compaction_chunk_range_bucket{foo="bar",le="25600"} 7 prometheus_tsdb_compaction_chunk_range_bucket{foo="bar",le="102400"} 7 prometheus_tsdb_compaction_chunk_range_bucket{foo="bar",le="409600"} 1.412839e+06 prometheus_tsdb_compaction_chunk_range_bucket{foo="bar",le="1.6384e+06"} 1.69185e+06 prometheus_tsdb_compaction_chunk_range_bucket{foo="bar",le="6.5536e+06"} 1.691853e+06 prometheus_tsdb_compaction_chunk_range_bucket{foo="bar",le="2.62144e+07"} 1.691853e+06 prometheus_tsdb_compaction_chunk_range_bucket{foo="bar",le="+Inf"} 1.691853e+06 prometheus_tsdb_compaction_chunk_range_sum{foo="bar"} 6.71393432189e+11 prometheus_tsdb_compaction_chunk_range_count{foo="bar"} 1.691853e+06 prometheus_tsdb_compaction_chunk_range_bucket{foo="baz",le="100"} 0 prometheus_tsdb_compaction_chunk_range_bucket{foo="baz",le="400"} 0 prometheus_tsdb_compaction_chunk_range_bucket{foo="baz",le="1600"} 0 prometheus_tsdb_compaction_chunk_range_bucket{foo="baz",le="6400"} 0 prometheus_tsdb_compaction_chunk_range_bucket{foo="baz",le="25600"} 7 prometheus_tsdb_compaction_chunk_range_bucket{foo="baz",le="102400"} 7 prometheus_tsdb_compaction_chunk_range_bucket{foo="baz",le="409600"} 1.412839e+06 prometheus_tsdb_compaction_chunk_range_bucket{foo="baz",le="1.6384e+06"} 1.69185e+06 prometheus_tsdb_compaction_chunk_range_bucket{foo="baz",le="6.5536e+06"} 1.691853e+06 prometheus_tsdb_compaction_chunk_range_bucket{foo="baz",le="2.62144e+07"} 1.691853e+06 prometheus_tsdb_compaction_chunk_range_bucket{foo="baz",le="+Inf"} 1.691853e+06 prometheus_tsdb_compaction_chunk_range_sum{foo="baz"} 6.71393432189e+11 prometheus_tsdb_compaction_chunk_range_count{foo="baz"} 1.691853e+06 prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/histogram_extra_dimension/000077500000000000000000000000001350016654700321265ustar00rootroot00000000000000metrics.prom000066400000000000000000000040731350016654700344200ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/histogram_extra_dimension# HELP prometheus_tsdb_compaction_chunk_range Final time range of chunks on their first compaction # TYPE prometheus_tsdb_compaction_chunk_range histogram prometheus_tsdb_compaction_chunk_range_bucket{foo="bar",le="100"} 0 prometheus_tsdb_compaction_chunk_range_bucket{foo="bar",le="400"} 0 prometheus_tsdb_compaction_chunk_range_bucket{foo="bar",le="1600"} 0 prometheus_tsdb_compaction_chunk_range_bucket{foo="bar",le="6400"} 0 prometheus_tsdb_compaction_chunk_range_bucket{foo="bar",le="25600"} 7 prometheus_tsdb_compaction_chunk_range_bucket{foo="bar",le="102400"} 7 prometheus_tsdb_compaction_chunk_range_bucket{foo="bar",le="409600"} 1.412839e+06 prometheus_tsdb_compaction_chunk_range_bucket{foo="bar",le="1.6384e+06"} 1.69185e+06 prometheus_tsdb_compaction_chunk_range_bucket{foo="bar",le="6.5536e+06"} 1.691853e+06 prometheus_tsdb_compaction_chunk_range_bucket{foo="bar",le="2.62144e+07"} 1.691853e+06 prometheus_tsdb_compaction_chunk_range_bucket{foo="bar",le="+Inf"} 1.691853e+06 prometheus_tsdb_compaction_chunk_range_sum{foo="bar"} 6.71393432189e+11 prometheus_tsdb_compaction_chunk_range_count{foo="bar"} 1.691853e+06 prometheus_tsdb_compaction_chunk_range_bucket{foo="baz",le="100"} 0 prometheus_tsdb_compaction_chunk_range_bucket{foo="baz",le="400"} 0 prometheus_tsdb_compaction_chunk_range_bucket{foo="baz",le="1600"} 0 prometheus_tsdb_compaction_chunk_range_bucket{foo="baz",le="6400"} 0 prometheus_tsdb_compaction_chunk_range_bucket{foo="baz",le="25600"} 7 prometheus_tsdb_compaction_chunk_range_bucket{foo="baz",le="102400"} 7 prometheus_tsdb_compaction_chunk_range_bucket{foo="baz",le="409600"} 1.412839e+06 prometheus_tsdb_compaction_chunk_range_bucket{foo="baz",le="1.6384e+06"} 1.69185e+06 prometheus_tsdb_compaction_chunk_range_bucket{foo="baz",le="6.5536e+06"} 1.691853e+06 prometheus_tsdb_compaction_chunk_range_bucket{foo="baz",le="2.62144e+07"} 1.691853e+06 prometheus_tsdb_compaction_chunk_range_bucket{foo="baz",le="+Inf"} 1.691853e+06 prometheus_tsdb_compaction_chunk_range_sum{foo="baz"} 6.71393432189e+11 prometheus_tsdb_compaction_chunk_range_count{foo="baz"} 1.691853e+06 prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/inconsistent_metrics.out000066400000000000000000000036201350016654700316610ustar00rootroot00000000000000# HELP go_goroutines Number of goroutines that currently exist. # TYPE go_goroutines gauge go_goroutines{foo=""} 20 go_goroutines{foo="bar"} 229 # HELP http_requests_total Total number of HTTP requests made. # TYPE http_requests_total counter http_requests_total{baz="",code="200",foo="",handler="",method="get"} 11 http_requests_total{baz="",code="200",foo="",handler="alerts",method="get"} 35 http_requests_total{baz="",code="200",foo="",handler="config",method="get"} 8 http_requests_total{baz="",code="200",foo="",handler="flags",method="get"} 18 http_requests_total{baz="",code="200",foo="",handler="graph",method="get"} 89 http_requests_total{baz="",code="200",foo="",handler="prometheus",method="get"} 17051 http_requests_total{baz="",code="200",foo="",handler="query",method="get"} 401 http_requests_total{baz="",code="200",foo="",handler="query_range",method="get"} 15663 http_requests_total{baz="",code="200",foo="",handler="rules",method="get"} 7 http_requests_total{baz="",code="200",foo="",handler="series",method="get"} 221 http_requests_total{baz="",code="200",foo="",handler="static",method="get"} 1647 http_requests_total{baz="",code="200",foo="",handler="status",method="get"} 12 http_requests_total{baz="",code="200",foo="bar",handler="",method="get"} 325 http_requests_total{baz="",code="206",foo="",handler="static",method="get"} 2 http_requests_total{baz="",code="400",foo="",handler="query_range",method="get"} 40 http_requests_total{baz="",code="503",foo="",handler="query_range",method="get"} 3 http_requests_total{baz="bar",code="200",foo="",handler="",method="get"} 93 # HELP node_textfile_mtime_seconds Unixtime mtime of textfiles successfully read. # TYPE node_textfile_mtime_seconds gauge node_textfile_mtime_seconds{file="metrics.prom"} 1 # 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 prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/inconsistent_metrics/000077500000000000000000000000001350016654700311275ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/inconsistent_metrics/metrics.prom000066400000000000000000000024661350016654700335040ustar00rootroot00000000000000# HELP http_requests_total Total number of HTTP requests made. # TYPE http_requests_total counter http_requests_total{code="200",handler="alerts",method="get"} 35 http_requests_total{code="200",handler="config",method="get"} 8 http_requests_total{code="200",method="get", foo="bar"} 325 http_requests_total{code="200",handler="flags",method="get"} 18 http_requests_total{code="200",handler="graph",method="get"} 89 http_requests_total{code="200",method="get", baz="bar"} 93 http_requests_total{code="200",handler="prometheus",method="get"} 17051 http_requests_total{code="200",handler="query",method="get"} 401 http_requests_total{code="200",handler="query_range",method="get"} 15663 http_requests_total{code="200",handler="rules",method="get"} 7 http_requests_total{code="200",handler="series",method="get"} 221 http_requests_total{code="200",handler="static",method="get"} 1647 http_requests_total{code="200",handler="status",method="get"} 12 http_requests_total{code="200",method="get"} 11 http_requests_total{code="206",handler="static",method="get"} 2 http_requests_total{code="400",handler="query_range",method="get"} 40 http_requests_total{code="503",handler="query_range",method="get"} 3 # HELP go_goroutines Number of goroutines that currently exist. # TYPE go_goroutines gauge go_goroutines{foo="bar"} 229 go_goroutines 20 prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/no_metric_files.out000066400000000000000000000002461350016654700305550ustar00rootroot00000000000000# 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 prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/no_metric_files/000077500000000000000000000000001350016654700300225ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/no_metric_files/non_matching_file.txt000066400000000000000000000000351350016654700342240ustar00rootroot00000000000000This file should be ignored. prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/nonexistent_path.out000066400000000000000000000002461350016654700310060ustar00rootroot00000000000000# 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 1 prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/summary.out000066400000000000000000000035321350016654700271120ustar00rootroot00000000000000# HELP event_duration_seconds_total Query timings # TYPE event_duration_seconds_total summary event_duration_seconds_total{baz="inner_eval",quantile="0.5"} 1.073e-06 event_duration_seconds_total{baz="inner_eval",quantile="0.9"} 1.928e-06 event_duration_seconds_total{baz="inner_eval",quantile="0.99"} 4.35e-06 event_duration_seconds_total_sum{baz="inner_eval"} 1.8652166505091474e+06 event_duration_seconds_total_count{baz="inner_eval"} 1.492355615e+09 event_duration_seconds_total{baz="prepare_time",quantile="0.5"} 4.283e-06 event_duration_seconds_total{baz="prepare_time",quantile="0.9"} 7.796e-06 event_duration_seconds_total{baz="prepare_time",quantile="0.99"} 2.2083e-05 event_duration_seconds_total_sum{baz="prepare_time"} 840923.7919437207 event_duration_seconds_total_count{baz="prepare_time"} 1.492355814e+09 event_duration_seconds_total{baz="result_append",quantile="0.5"} 1.566e-06 event_duration_seconds_total{baz="result_append",quantile="0.9"} 3.223e-06 event_duration_seconds_total{baz="result_append",quantile="0.99"} 6.53e-06 event_duration_seconds_total_sum{baz="result_append"} 4.404109951000078 event_duration_seconds_total_count{baz="result_append"} 1.427647e+06 event_duration_seconds_total{baz="result_sort",quantile="0.5"} 1.847e-06 event_duration_seconds_total{baz="result_sort",quantile="0.9"} 2.975e-06 event_duration_seconds_total{baz="result_sort",quantile="0.99"} 4.08e-06 event_duration_seconds_total_sum{baz="result_sort"} 3.4123187829998307 event_duration_seconds_total_count{baz="result_sort"} 1.427647e+06 # HELP node_textfile_mtime_seconds Unixtime mtime of textfiles successfully read. # TYPE node_textfile_mtime_seconds gauge node_textfile_mtime_seconds{file="metrics.prom"} 1 # 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 prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/summary/000077500000000000000000000000001350016654700263565ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/summary/metrics.prom000066400000000000000000000030061350016654700307220ustar00rootroot00000000000000# HELP event_duration_seconds_total Query timings # TYPE event_duration_seconds_total summary event_duration_seconds_total{baz="inner_eval",quantile="0.5"} 1.073e-06 event_duration_seconds_total{baz="inner_eval",quantile="0.9"} 1.928e-06 event_duration_seconds_total{baz="inner_eval",quantile="0.99"} 4.35e-06 event_duration_seconds_total_sum{baz="inner_eval"} 1.8652166505091474e+06 event_duration_seconds_total_count{baz="inner_eval"} 1.492355615e+09 event_duration_seconds_total{baz="prepare_time",quantile="0.5"} 4.283e-06 event_duration_seconds_total{baz="prepare_time",quantile="0.9"} 7.796e-06 event_duration_seconds_total{baz="prepare_time",quantile="0.99"} 2.2083e-05 event_duration_seconds_total_sum{baz="prepare_time"} 840923.7919437207 event_duration_seconds_total_count{baz="prepare_time"} 1.492355814e+09 event_duration_seconds_total{baz="result_append",quantile="0.5"} 1.566e-06 event_duration_seconds_total{baz="result_append",quantile="0.9"} 3.223e-06 event_duration_seconds_total{baz="result_append",quantile="0.99"} 6.53e-06 event_duration_seconds_total_sum{baz="result_append"} 4.404109951000078 event_duration_seconds_total_count{baz="result_append"} 1.427647e+06 event_duration_seconds_total{baz="result_sort",quantile="0.5"} 1.847e-06 event_duration_seconds_total{baz="result_sort",quantile="0.9"} 2.975e-06 event_duration_seconds_total{baz="result_sort",quantile="0.99"} 4.08e-06 event_duration_seconds_total_sum{baz="result_sort"} 3.4123187829998307 event_duration_seconds_total_count{baz="result_sort"} 1.427647e+06 prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/summary_extra_dimension.out000066400000000000000000000032171350016654700323620ustar00rootroot00000000000000# HELP node_textfile_mtime_seconds Unixtime mtime of textfiles successfully read. # TYPE node_textfile_mtime_seconds gauge node_textfile_mtime_seconds{file="metrics.prom"} 1 # 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 prometheus_rule_evaluation_duration_seconds The duration for a rule to execute. # TYPE prometheus_rule_evaluation_duration_seconds summary prometheus_rule_evaluation_duration_seconds{handler="",rule_type="alerting",quantile="0.9"} 0.001765451 prometheus_rule_evaluation_duration_seconds{handler="",rule_type="alerting",quantile="0.99"} 0.018672076 prometheus_rule_evaluation_duration_seconds_sum{handler="",rule_type="alerting"} 214.85081044700146 prometheus_rule_evaluation_duration_seconds_count{handler="",rule_type="alerting"} 185209 prometheus_rule_evaluation_duration_seconds{handler="",rule_type="recording",quantile="0.5"} 4.3132e-05 prometheus_rule_evaluation_duration_seconds{handler="",rule_type="recording",quantile="0.9"} 8.9295e-05 prometheus_rule_evaluation_duration_seconds{handler="",rule_type="recording",quantile="0.99"} 0.000193657 prometheus_rule_evaluation_duration_seconds_sum{handler="",rule_type="recording"} 185091.01317759082 prometheus_rule_evaluation_duration_seconds_count{handler="",rule_type="recording"} 1.0020195e+08 prometheus_rule_evaluation_duration_seconds{handler="foo",rule_type="alerting",quantile="0.5"} 0.000571464 prometheus_rule_evaluation_duration_seconds_sum{handler="foo",rule_type="alerting"} 0 prometheus_rule_evaluation_duration_seconds_count{handler="foo",rule_type="alerting"} 0 prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/summary_extra_dimension/000077500000000000000000000000001350016654700316265ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/summary_extra_dimension/metrics.prom000066400000000000000000000020531350016654700341730ustar00rootroot00000000000000# HELP prometheus_rule_evaluation_duration_seconds The duration for a rule to execute. # TYPE prometheus_rule_evaluation_duration_seconds summary prometheus_rule_evaluation_duration_seconds{rule_type="alerting",quantile="0.5", handler="foo"} 0.000571464 prometheus_rule_evaluation_duration_seconds{rule_type="alerting",quantile="0.9"} 0.001765451 prometheus_rule_evaluation_duration_seconds{rule_type="alerting",quantile="0.99"} 0.018672076 prometheus_rule_evaluation_duration_seconds_sum{rule_type="alerting"} 214.85081044700146 prometheus_rule_evaluation_duration_seconds_count{rule_type="alerting"} 185209 prometheus_rule_evaluation_duration_seconds{rule_type="recording",quantile="0.5"} 4.3132e-05 prometheus_rule_evaluation_duration_seconds{rule_type="recording",quantile="0.9"} 8.9295e-05 prometheus_rule_evaluation_duration_seconds{rule_type="recording",quantile="0.99"} 0.000193657 prometheus_rule_evaluation_duration_seconds_sum{rule_type="recording"} 185091.01317759082 prometheus_rule_evaluation_duration_seconds_count{rule_type="recording"} 1.0020195e+08 prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/two_metric_files.out000066400000000000000000000017111350016654700307500ustar00rootroot00000000000000# HELP node_textfile_mtime_seconds Unixtime mtime of textfiles successfully read. # TYPE node_textfile_mtime_seconds gauge node_textfile_mtime_seconds{file="metrics1.prom"} 1 node_textfile_mtime_seconds{file="metrics2.prom"} 1 # 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 testmetric1_1 Metric read from fixtures/textfile/two_metric_files/metrics1.prom # TYPE testmetric1_1 untyped testmetric1_1{foo="bar"} 10 # HELP testmetric1_2 Metric read from fixtures/textfile/two_metric_files/metrics1.prom # TYPE testmetric1_2 untyped testmetric1_2{foo="baz"} 20 # HELP testmetric2_1 Metric read from fixtures/textfile/two_metric_files/metrics2.prom # TYPE testmetric2_1 untyped testmetric2_1{foo="bar"} 30 # HELP testmetric2_2 Metric read from fixtures/textfile/two_metric_files/metrics2.prom # TYPE testmetric2_2 untyped testmetric2_2{foo="baz"} 40 prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/two_metric_files/000077500000000000000000000000001350016654700302175ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/two_metric_files/metrics1.prom000066400000000000000000000000701350016654700326420ustar00rootroot00000000000000testmetric1_1{foo="bar"} 10 testmetric1_2{foo="baz"} 20 prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/two_metric_files/metrics2.prom000066400000000000000000000000701350016654700326430ustar00rootroot00000000000000testmetric2_1{foo="bar"} 30 testmetric2_2{foo="baz"} 40 non_matching_file.txt000066400000000000000000000000351350016654700343420ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/textfile/two_metric_filesThis file should be ignored. prometheus-node-exporter-0.18.1+ds/collector/fixtures/wifi/000077500000000000000000000000001350016654700237735ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/wifi/interfaces.json000066400000000000000000000002151350016654700270070ustar00rootroot00000000000000[ { "name": "wlan0", "type": 2, "frequency": 2412 }, { "name": "wlan1", "type": 3, "frequency": 2412 }, { "type": 10 } ] prometheus-node-exporter-0.18.1+ds/collector/fixtures/wifi/wlan0/000077500000000000000000000000001350016654700250145ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures/wifi/wlan0/bss.json000066400000000000000000000000731350016654700264760ustar00rootroot00000000000000{ "ssid": "Example", "bssid": "ABEiM0RV", "status": 1 } prometheus-node-exporter-0.18.1+ds/collector/fixtures/wifi/wlan0/stationinfo.json000066400000000000000000000007341350016654700302500ustar00rootroot00000000000000[ { "hardwareaddr": "qrvM3e7/", "connected": 30000000000, "inactive": 400000000, "receivebitrate": 128000000, "transmitbitrate": 164000000, "signal": -52, "transmitretries": 10, "transmitfailed": 2, "beaconloss": 1 }, { "hardwareaddr": "AQIDBAUG", "connected": 60000000000, "inactive": 800000000, "receivebitrate": 256000000, "transmitbitrate": 328000000, "signal": -26, "transmitretries": 20, "transmitfailed": 4, "beaconloss": 2 } ] prometheus-node-exporter-0.18.1+ds/collector/fixtures_hidepid/000077500000000000000000000000001350016654700245235ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures_hidepid/proc/000077500000000000000000000000001350016654700254665ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/collector/fixtures_hidepid/proc/mounts000066400000000000000000000000271350016654700267350ustar00rootroot00000000000000rootfs / rootfs rw 0 0 prometheus-node-exporter-0.18.1+ds/collector/helper.go000066400000000000000000000016231350016654700227740ustar00rootroot00000000000000// 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.18.1+ds/collector/hwmon_linux.go000066400000000000000000000330451350016654700240670ustar00rootroot00000000000000// 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/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, filepath.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(filepath.Join(dir, "device")); err == nil { err := collectSensorData(filepath.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" { if element == "" { element = "input" } 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(filepath.Join(dir, "device")) if devErr == nil { devPathPrefix, devName := filepath.Split(devicePath) _, devType := filepath.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(filepath.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 := filepath.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(filepath.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 := filepath.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 := filepath.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.18.1+ds/collector/infiniband_linux.go000066400000000000000000000224601350016654700250370ustar00rootroot00000000000000// 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" "strings" "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_constraint_errors_received_total": {"port_rcv_constraint_errors", "Number of packets received on the switch physical port that are discarded"}, "port_constraint_errors_transmitted_total": {"port_xmit_constraint_errors", "Number of packets not transmitted from the switch physical port"}, "port_data_received_bytes_total": {"port_rcv_data", "Number of data octets received on all links"}, "port_data_transmitted_bytes_total": {"port_xmit_data", "Number of data octets transmitted on all links"}, "port_discards_received_total": {"port_rcv_discards", "Number of inbound packets discarded by the port because the port is down or congested"}, "port_discards_transmitted_total": {"port_xmit_discards", "Number of outbound packets discarded by the port because the port is down or congested"}, "port_errors_received_total": {"port_rcv_errors", "Number of packets containing an error that were received on this port"}, "port_packets_received_total": {"port_rcv_packets", "Number of packets received on all VLs by this port (including errors)"}, "port_packets_transmitted_total": {"port_xmit_packets", "Number of packets transmitted on all VLs from this port (including errors)"}, "port_transmit_wait_total": {"port_xmit_wait", "Number of ticks during which the port had data to transmit but no data was sent during the entire tick"}, "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 { // Ugly workaround for handling #966, when counters are // `N/A (not available)`. // This was already patched and submitted, see // https://www.spinics.net/lists/linux-rdma/msg68596.html // Remove this as soon as the fix lands in the enterprise distros. if strings.Contains(err.Error(), "N/A (no PMA)") { log.Debugf("%q value is N/A", metricFile) return 0, 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.18.1+ds/collector/infiniband_linux_test.go000066400000000000000000000022001350016654700260640ustar00rootroot00000000000000// 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 != 2 { 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.18.1+ds/collector/interrupts_common.go000066400000000000000000000022431350016654700253030ustar00rootroot00000000000000// 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_total", "Interrupt details.", interruptLabelNames, nil, ), prometheus.CounterValue}, }, nil } prometheus-node-exporter-0.18.1+ds/collector/interrupts_linux.go000066400000000000000000000047461350016654700251640ustar00rootroot00000000000000// 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.18.1+ds/collector/interrupts_linux_test.go000066400000000000000000000021261350016654700262110ustar00rootroot00000000000000// 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.18.1+ds/collector/interrupts_openbsd.go000066400000000000000000000055521350016654700254530ustar00rootroot00000000000000// 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.18.1+ds/collector/ipvs_linux.go000066400000000000000000000116041350016654700237150ustar00rootroot00000000000000// 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, fmt.Errorf("failed to open procfs: %v", 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.18.1+ds/collector/ipvs_linux_test.go000066400000000000000000000120611350016654700247520ustar00rootroot00000000000000// 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.18.1+ds/collector/ksmd_linux.go000066400000000000000000000042301350016654700236670ustar00rootroot00000000000000// 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/filepath" "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(filepath.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.18.1+ds/collector/kvm_bsd.c000066400000000000000000000022641350016654700227610ustar00rootroot00000000000000// 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 !nomeminfo // +build freebsd dragonfly #include #include #include #include #include int _kvm_swap_used_pages(uint64_t *out) { const int total_only = 1; // from kvm_getswapinfo(3) kvm_t *kd; struct kvm_swap current; kd = kvm_open(NULL, _PATH_DEVNULL, NULL, O_RDONLY, NULL); if (kd == NULL) { return -1; } if (kvm_getswapinfo(kd, ¤t, total_only, 0) == -1) { goto error1; } if (kvm_close(kd) != 0) { return -1; } kd = NULL; *out = current.ksw_used; return 0; error1: if (kd != NULL) { kvm_close(kd); } return -1; } prometheus-node-exporter-0.18.1+ds/collector/kvm_bsd.go000066400000000000000000000020231350016654700231350ustar00rootroot00000000000000// 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 !nomeminfo // +build freebsd dragonfly package collector import ( "fmt" "sync" ) // #cgo LDFLAGS: -lkvm // #include "kvm_bsd.h" import "C" type kvm struct { mu sync.Mutex hasErr bool } func (k *kvm) SwapUsedPages() (value uint64, err error) { k.mu.Lock() defer k.mu.Unlock() if C._kvm_swap_used_pages((*C.uint64_t)(&value)) == -1 { k.hasErr = true return 0, fmt.Errorf("couldn't get kvm stats") } return value, nil } prometheus-node-exporter-0.18.1+ds/collector/kvm_bsd.h000066400000000000000000000013041350016654700227600ustar00rootroot00000000000000// 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 !nomeminfo // +build freebsd dragonfly #include int _kvm_swap_used_pages(uint64_t *out); prometheus-node-exporter-0.18.1+ds/collector/loadavg.go000066400000000000000000000033021350016654700231260ustar00rootroot00000000000000// 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.18.1+ds/collector/loadavg_freebsd.go000066400000000000000000000020401350016654700246160ustar00rootroot00000000000000// 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.18.1+ds/collector/loadavg_linux.go000066400000000000000000000026151350016654700243530ustar00rootroot00000000000000// 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.18.1+ds/collector/loadavg_linux_test.go000066400000000000000000000016051350016654700254100ustar00rootroot00000000000000// 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.18.1+ds/collector/loadavg_solaris.go000066400000000000000000000026611350016654700246710ustar00rootroot00000000000000// 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" "strconv" "github.com/siebenmann/go-kstat" ) // #include import "C" func kstatToFloat(ks *kstat.KStat, kstatKey string) float64 { kstatValue, err := ks.GetNamed(kstatKey) if err != nil { panic(err) } kstatLoadavg, err := strconv.ParseFloat( fmt.Sprintf("%.2f", float64(kstatValue.UintVal)/C.FSCALE), 64) if err != nil { panic(err) } return kstatLoadavg } func getLoad() ([]float64, error) { tok, err := kstat.Open() if err != nil { panic(err) } defer tok.Close() ks, err := tok.Lookup("unix", 0, "system_misc") if err != nil { panic(err) } loadavg1Min := kstatToFloat(ks, "avenrun_1min") loadavg5Min := kstatToFloat(ks, "avenrun_5min") loadavg15Min := kstatToFloat(ks, "avenrun_15min") return []float64{loadavg1Min, loadavg5Min, loadavg15Min}, nil } prometheus-node-exporter-0.18.1+ds/collector/loadavg_unix.go000066400000000000000000000017501350016654700241760ustar00rootroot00000000000000// 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.18.1+ds/collector/logind_linux.go000066400000000000000000000142551350016654700242150ustar00rootroot00000000000000// 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.18.1+ds/collector/logind_linux_test.go000066400000000000000000000055661350016654700252610ustar00rootroot00000000000000// 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.18.1+ds/collector/mdadm_linux.go000066400000000000000000000211321350016654700240130ustar00rootroot00000000000000// 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|rounding)`) buildlineRE = regexp.MustCompile(`\((\d+)/\d+\)`) unknownPersonalityLineRE = regexp.MustCompile(`(\d+) blocks (.*)`) raidPersonalityRE = regexp.MustCompile(`^(linear|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" || personality == "linear": 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.Debugf("Personality unknown: %s", mainLine) md.disksTotal = int64(len(mainLine) - 3) md.blocksTotal, err = evalUnknownPersonalitylineRE(lines[i+1]) } if err != nil { return mdStates, fmt.Errorf("error parsing mdstat: %s", err) } if !md.active { md.disksActive = 0 } 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.18.1+ds/collector/mdadm_linux_test.go000066400000000000000000000042441350016654700250570ustar00rootroot00000000000000// 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, 0, 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}, "md120": {"md120", true, 2, 2, 2095104, 2095104}, "md126": {"md126", true, 2, 2, 1855870976, 1855870976}, "md219": {"md219", false, 0, 3, 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.18.1+ds/collector/meminfo.go000066400000000000000000000034531350016654700231520ustar00rootroot00000000000000// 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 linux openbsd // +build !nomeminfo package collector import ( "fmt" "strings" "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 { var metricType prometheus.ValueType 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 { if strings.HasSuffix(k, "_total") { metricType = prometheus.CounterValue } else { metricType = prometheus.GaugeValue } ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, memInfoSubsystem, k), fmt.Sprintf("Memory information field %s.", k), nil, nil, ), metricType, v, ) } return nil } prometheus-node-exporter-0.18.1+ds/collector/meminfo_darwin.go000066400000000000000000000037651350016654700245240ustar00rootroot00000000000000// 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" "unsafe" "golang.org/x/sys/unix" ) func (c *meminfoCollector) getMemInfo() (map[string]float64, error) { host := C.mach_host_self() infoCount := C.mach_msg_type_number_t(C.HOST_VM_INFO64_COUNT) vmstat := C.vm_statistics64_data_t{} ret := C.host_statistics64( C.host_t(host), C.HOST_VM_INFO64, 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")) var pageSize C.vm_size_t C.host_page_size(C.host_t(host), &pageSize) ps := float64(pageSize) return map[string]float64{ "active_bytes": ps * float64(vmstat.active_count), "compressed_bytes": ps * float64(vmstat.compressor_page_count), "inactive_bytes": ps * float64(vmstat.inactive_count), "wired_bytes": ps * float64(vmstat.wire_count), "free_bytes": ps * float64(vmstat.free_count), "swapped_in_bytes_total": ps * float64(vmstat.pageins), "swapped_out_bytes_total": ps * float64(vmstat.pageouts), "total_bytes": float64(total), }, nil } prometheus-node-exporter-0.18.1+ds/collector/meminfo_linux.go000066400000000000000000000032401350016654700243630ustar00rootroot00000000000000// 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) } key := parts[0][:len(parts[0])-1] // remove trailing : from key // Active(anon) -> Active_anon key = re.ReplaceAllString(key, "_${1}") switch len(parts) { case 2: // no unit case 3: // has unit, we presume kB fv *= 1024 key = key + "_bytes" default: return nil, fmt.Errorf("invalid line in meminfo: %s", line) } memInfo[key] = fv } return memInfo, scanner.Err() } prometheus-node-exporter-0.18.1+ds/collector/meminfo_linux_test.go000066400000000000000000000021371350016654700254260ustar00rootroot00000000000000// 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_bytes"]; want != got { t.Errorf("want memory total %f, got %f", want, got) } if want, got := 3787456512.0, memInfo["DirectMap2M_bytes"]; want != got { t.Errorf("want memory directMap2M %f, got %f", want, got) } } prometheus-node-exporter-0.18.1+ds/collector/meminfo_numa_linux.go000066400000000000000000000106731350016654700254130ustar00rootroot00000000000000// 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/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(filepath.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(filepath.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.18.1+ds/collector/meminfo_numa_linux_test.go000066400000000000000000000055201350016654700264450ustar00rootroot00000000000000// 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.18.1+ds/collector/meminfo_openbsd.go000066400000000000000000000036651350016654700246710ustar00rootroot00000000000000// 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 // +build !nomeminfo package collector import ( "fmt" ) /* #include #include #include int sysctl_uvmexp(struct uvmexp *uvmexp) { static int uvmexp_mib[] = {CTL_VM, VM_UVMEXP}; size_t sz = sizeof(struct uvmexp); if(sysctl(uvmexp_mib, 2, uvmexp, &sz, NULL, 0) < 0) return -1; return 0; } */ import "C" func (c *meminfoCollector) getMemInfo() (map[string]float64, error) { var uvmexp C.struct_uvmexp if _, err := C.sysctl_uvmexp(&uvmexp); err != nil { return nil, fmt.Errorf("sysctl CTL_VM VM_UVMEXP failed: %v", err) } ps := float64(uvmexp.pagesize) // see uvm(9) return map[string]float64{ "active_bytes": ps * float64(uvmexp.active), "cache_bytes": ps * float64(uvmexp.vnodepages), "free_bytes": ps * float64(uvmexp.free), "inactive_bytes": ps * float64(uvmexp.inactive), "size_bytes": ps * float64(uvmexp.npages), "swap_size_bytes": ps * float64(uvmexp.swpages), "swap_used_bytes": ps * float64(uvmexp.swpginuse), "swapped_in_pages_bytes_total": ps * float64(uvmexp.pgswapin), "swapped_out_pages_bytes_total": ps * float64(uvmexp.pgswapout), "wired_bytes": ps * float64(uvmexp.wired), }, nil } prometheus-node-exporter-0.18.1+ds/collector/memory_bsd.go000066400000000000000000000106011350016654700236510ustar00rootroot00000000000000// 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" ) const ( memorySubsystem = "memory" ) type memoryCollector struct { pageSize uint64 sysctls []bsdSysctl kvm kvm } func init() { registerCollector("meminfo", defaultEnabled, NewMemoryCollector) } // NewMemoryCollector returns a new Collector exposing memory stats. func NewMemoryCollector() (Collector, error) { 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) mibSwapTotal := "vm.swap_total" /* swap_total is FreeBSD specific. Fall back to Dfly specific mib if not present. */ _, err = unix.SysctlUint64(mibSwapTotal) if err != nil { mibSwapTotal = "vm.swap_size" } fromPage := func(v float64) float64 { return v * size } return &memoryCollector{ pageSize: uint64(tmp32), sysctls: []bsdSysctl{ // Descriptions via: https://wiki.freebsd.org/Memory { name: "active_bytes", description: "Recently used by userland", mib: "vm.stats.vm.v_active_count", conversion: fromPage, }, { name: "inactive_bytes", description: "Not recently used by userland", mib: "vm.stats.vm.v_inactive_count", conversion: fromPage, }, { name: "wired_bytes", description: "Locked in memory by kernel, mlock, etc", mib: "vm.stats.vm.v_wire_count", conversion: fromPage, }, { name: "cache_bytes", description: "Almost free, backed by swap or files, available for re-allocation", mib: "vm.stats.vm.v_cache_count", conversion: fromPage, }, { name: "buffer_bytes", description: "Disk IO Cache entries for non ZFS filesystems, only usable by kernel", mib: "vfs.bufspace", dataType: bsdSysctlTypeCLong, }, { name: "free_bytes", description: "Unallocated, available for allocation", mib: "vm.stats.vm.v_free_count", conversion: fromPage, }, { name: "size_bytes", description: "Total physical memory size", mib: "vm.stats.vm.v_page_count", conversion: fromPage, }, { name: "swap_size_bytes", description: "Total swap memory size", mib: mibSwapTotal, dataType: bsdSysctlTypeUint64, }, // Descriptions via: top(1) { name: "swap_in_bytes_total", description: "Bytes paged in from swap devices", mib: "vm.stats.vm.v_swappgsin", valueType: prometheus.CounterValue, conversion: fromPage, }, { name: "swap_out_bytes_total", description: "Bytes paged out to swap devices", mib: "vm.stats.vm.v_swappgsout", valueType: prometheus.CounterValue, conversion: fromPage, }, }, }, nil } // Update checks relevant sysctls for current memory usage, and kvm for swap // usage. func (c *memoryCollector) Update(ch chan<- prometheus.Metric) error { for _, m := range c.sysctls { v, err := m.Value() if err != nil { return fmt.Errorf("couldn't get memory: %s", err) } // Most are gauges. if m.valueType == 0 { m.valueType = prometheus.GaugeValue } ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, memorySubsystem, m.name), m.description, nil, nil, ), m.valueType, v) } swapUsed, err := c.kvm.SwapUsedPages() if err != nil { return fmt.Errorf("couldn't get kvm: %s", err) } ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, memorySubsystem, "swap_used_bytes"), "Currently allocated swap", nil, nil, ), prometheus.GaugeValue, float64(swapUsed*c.pageSize)) return nil } prometheus-node-exporter-0.18.1+ds/collector/mountstats_linux.go000066400000000000000000000625531350016654700251660ustar00rootroot00000000000000// 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/common/log" "github.com/prometheus/procfs" ) var ( // 64-bit float mantissa: https://en.wikipedia.org/wiki/Double-precision_floating-point_format float64Mantissa uint64 = 9007199254740992 ) 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 } // used to uniquely identify an NFS mount to prevent duplicates type nfsDeviceIdentifier struct { Device string Protocol string } 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", "protocol"} opLabels = []string{"export", "protocol", "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) } // store all seen nfsDeviceIdentifiers for deduplication deviceList := make(map[nfsDeviceIdentifier]bool) 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 } deviceIdentifier := nfsDeviceIdentifier{m.Device, stats.Transport.Protocol} i := deviceList[deviceIdentifier] if i { log.Debugf("Skipping duplicate device entry %q", deviceIdentifier) continue } deviceList[deviceIdentifier] = true c.updateNFSStats(ch, m.Device, stats.Transport.Protocol, stats) } return nil } func (c *mountStatsCollector) updateNFSStats(ch chan<- prometheus.Metric, export string, protocol string, s *procfs.MountStatsNFS) { ch <- prometheus.MustNewConstMetric( c.NFSAgeSecondsTotal, prometheus.CounterValue, s.Age.Seconds(), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSReadBytesTotal, prometheus.CounterValue, float64(s.Bytes.Read), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSWriteBytesTotal, prometheus.CounterValue, float64(s.Bytes.Write), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSDirectReadBytesTotal, prometheus.CounterValue, float64(s.Bytes.DirectRead), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSDirectWriteBytesTotal, prometheus.CounterValue, float64(s.Bytes.DirectWrite), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSTotalReadBytesTotal, prometheus.CounterValue, float64(s.Bytes.ReadTotal), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSTotalWriteBytesTotal, prometheus.CounterValue, float64(s.Bytes.WriteTotal), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSReadPagesTotal, prometheus.CounterValue, float64(s.Bytes.ReadPages), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSWritePagesTotal, prometheus.CounterValue, float64(s.Bytes.WritePages), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSTransportBindTotal, prometheus.CounterValue, float64(s.Transport.Bind), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSTransportConnectTotal, prometheus.CounterValue, float64(s.Transport.Connect), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSTransportIdleTimeSeconds, prometheus.GaugeValue, float64(s.Transport.IdleTimeSeconds%float64Mantissa), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSTransportSendsTotal, prometheus.CounterValue, float64(s.Transport.Sends), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSTransportReceivesTotal, prometheus.CounterValue, float64(s.Transport.Receives), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSTransportBadTransactionIDsTotal, prometheus.CounterValue, float64(s.Transport.BadTransactionIDs), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSTransportBacklogQueueTotal, prometheus.CounterValue, float64(s.Transport.CumulativeBacklog), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSTransportMaximumRPCSlots, prometheus.GaugeValue, float64(s.Transport.MaximumRPCSlotsUsed), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSTransportSendingQueueTotal, prometheus.CounterValue, float64(s.Transport.CumulativeSendingQueue), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSTransportPendingQueueTotal, prometheus.CounterValue, float64(s.Transport.CumulativePendingQueue), export, protocol, ) for _, op := range s.Operations { ch <- prometheus.MustNewConstMetric( c.NFSOperationsRequestsTotal, prometheus.CounterValue, float64(op.Requests), export, protocol, op.Operation, ) ch <- prometheus.MustNewConstMetric( c.NFSOperationsTransmissionsTotal, prometheus.CounterValue, float64(op.Transmissions), export, protocol, op.Operation, ) ch <- prometheus.MustNewConstMetric( c.NFSOperationsMajorTimeoutsTotal, prometheus.CounterValue, float64(op.MajorTimeouts), export, protocol, op.Operation, ) ch <- prometheus.MustNewConstMetric( c.NFSOperationsSentBytesTotal, prometheus.CounterValue, float64(op.BytesSent), export, protocol, op.Operation, ) ch <- prometheus.MustNewConstMetric( c.NFSOperationsReceivedBytesTotal, prometheus.CounterValue, float64(op.BytesReceived), export, protocol, op.Operation, ) ch <- prometheus.MustNewConstMetric( c.NFSOperationsQueueTimeSecondsTotal, prometheus.CounterValue, float64(op.CumulativeQueueMilliseconds%float64Mantissa)/1000.0, export, protocol, op.Operation, ) ch <- prometheus.MustNewConstMetric( c.NFSOperationsResponseTimeSecondsTotal, prometheus.CounterValue, float64(op.CumulativeTotalResponseMilliseconds%float64Mantissa)/1000.0, export, protocol, op.Operation, ) ch <- prometheus.MustNewConstMetric( c.NFSOperationsRequestTimeSecondsTotal, prometheus.CounterValue, float64(op.CumulativeTotalRequestMilliseconds%float64Mantissa)/1000.0, export, protocol, op.Operation, ) } ch <- prometheus.MustNewConstMetric( c.NFSEventInodeRevalidateTotal, prometheus.CounterValue, float64(s.Events.InodeRevalidate), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventDnodeRevalidateTotal, prometheus.CounterValue, float64(s.Events.DnodeRevalidate), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventDataInvalidateTotal, prometheus.CounterValue, float64(s.Events.DataInvalidate), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventAttributeInvalidateTotal, prometheus.CounterValue, float64(s.Events.AttributeInvalidate), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSOpenTotal, prometheus.CounterValue, float64(s.Events.VFSOpen), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSLookupTotal, prometheus.CounterValue, float64(s.Events.VFSLookup), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSAccessTotal, prometheus.CounterValue, float64(s.Events.VFSAccess), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSUpdatePageTotal, prometheus.CounterValue, float64(s.Events.VFSUpdatePage), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSReadPageTotal, prometheus.CounterValue, float64(s.Events.VFSReadPage), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSReadPagesTotal, prometheus.CounterValue, float64(s.Events.VFSReadPages), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSWritePageTotal, prometheus.CounterValue, float64(s.Events.VFSWritePage), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSWritePagesTotal, prometheus.CounterValue, float64(s.Events.VFSWritePages), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSGetdentsTotal, prometheus.CounterValue, float64(s.Events.VFSGetdents), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSSetattrTotal, prometheus.CounterValue, float64(s.Events.VFSSetattr), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSFlushTotal, prometheus.CounterValue, float64(s.Events.VFSFlush), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSFsyncTotal, prometheus.CounterValue, float64(s.Events.VFSFsync), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSLockTotal, prometheus.CounterValue, float64(s.Events.VFSLock), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventVFSFileReleaseTotal, prometheus.CounterValue, float64(s.Events.VFSFileRelease), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventTruncationTotal, prometheus.CounterValue, float64(s.Events.Truncation), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventWriteExtensionTotal, prometheus.CounterValue, float64(s.Events.WriteExtension), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventSillyRenameTotal, prometheus.CounterValue, float64(s.Events.SillyRename), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventShortReadTotal, prometheus.CounterValue, float64(s.Events.ShortRead), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventShortWriteTotal, prometheus.CounterValue, float64(s.Events.ShortWrite), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventJukeboxDelayTotal, prometheus.CounterValue, float64(s.Events.JukeboxDelay), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventPNFSReadTotal, prometheus.CounterValue, float64(s.Events.PNFSRead), export, protocol, ) ch <- prometheus.MustNewConstMetric( c.NFSEventPNFSWriteTotal, prometheus.CounterValue, float64(s.Events.PNFSWrite), export, protocol, ) } prometheus-node-exporter-0.18.1+ds/collector/netclass_linux.go000066400000000000000000000140021350016654700245430ustar00rootroot00000000000000// Copyright 2018 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 !nonetclass // +build linux package collector import ( "fmt" "regexp" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/procfs/sysfs" kingpin "gopkg.in/alecthomas/kingpin.v2" ) var ( netclassIgnoredDevices = kingpin.Flag("collector.netclass.ignored-devices", "Regexp of net devices to ignore for netclass collector.").Default("^$").String() ) type netClassCollector struct { fs sysfs.FS subsystem string ignoredDevicesPattern *regexp.Regexp metricDescs map[string]*prometheus.Desc } func init() { registerCollector("netclass", defaultEnabled, NewNetClassCollector) } // NewNetClassCollector returns a new Collector exposing network class stats. func NewNetClassCollector() (Collector, error) { fs, err := sysfs.NewFS(*sysPath) if err != nil { return nil, fmt.Errorf("failed to open sysfs: %v", err) } pattern := regexp.MustCompile(*netclassIgnoredDevices) return &netClassCollector{ fs: fs, subsystem: "network", ignoredDevicesPattern: pattern, metricDescs: map[string]*prometheus.Desc{}, }, nil } func (c *netClassCollector) Update(ch chan<- prometheus.Metric) error { netClass, err := c.getNetClassInfo() if err != nil { return fmt.Errorf("could not get net class info: %s", err) } for _, ifaceInfo := range netClass { upDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, c.subsystem, "up"), "Value is 1 if operstate is 'up', 0 otherwise.", []string{"device"}, nil, ) upValue := 0.0 if ifaceInfo.OperState == "up" { upValue = 1.0 } ch <- prometheus.MustNewConstMetric(upDesc, prometheus.GaugeValue, upValue, ifaceInfo.Name) infoDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, c.subsystem, "info"), "Non-numeric data from /sys/class/net/, value is always 1.", []string{"device", "address", "broadcast", "duplex", "operstate", "ifalias"}, nil, ) infoValue := 1.0 ch <- prometheus.MustNewConstMetric(infoDesc, prometheus.GaugeValue, infoValue, ifaceInfo.Name, ifaceInfo.Address, ifaceInfo.Broadcast, ifaceInfo.Duplex, ifaceInfo.OperState, ifaceInfo.IfAlias) if ifaceInfo.AddrAssignType != nil { pushMetric(ch, c.subsystem, "address_assign_type", *ifaceInfo.AddrAssignType, ifaceInfo.Name, prometheus.GaugeValue) } if ifaceInfo.Carrier != nil { pushMetric(ch, c.subsystem, "carrier", *ifaceInfo.Carrier, ifaceInfo.Name, prometheus.GaugeValue) } if ifaceInfo.CarrierChanges != nil { pushMetric(ch, c.subsystem, "carrier_changes_total", *ifaceInfo.CarrierChanges, ifaceInfo.Name, prometheus.CounterValue) } if ifaceInfo.CarrierUpCount != nil { pushMetric(ch, c.subsystem, "carrier_up_changes_total", *ifaceInfo.CarrierUpCount, ifaceInfo.Name, prometheus.CounterValue) } if ifaceInfo.CarrierDownCount != nil { pushMetric(ch, c.subsystem, "carrier_down_changes_total", *ifaceInfo.CarrierDownCount, ifaceInfo.Name, prometheus.CounterValue) } if ifaceInfo.DevID != nil { pushMetric(ch, c.subsystem, "device_id", *ifaceInfo.DevID, ifaceInfo.Name, prometheus.GaugeValue) } if ifaceInfo.Dormant != nil { pushMetric(ch, c.subsystem, "dormant", *ifaceInfo.Dormant, ifaceInfo.Name, prometheus.GaugeValue) } if ifaceInfo.Flags != nil { pushMetric(ch, c.subsystem, "flags", *ifaceInfo.Flags, ifaceInfo.Name, prometheus.GaugeValue) } if ifaceInfo.IfIndex != nil { pushMetric(ch, c.subsystem, "iface_id", *ifaceInfo.IfIndex, ifaceInfo.Name, prometheus.GaugeValue) } if ifaceInfo.IfLink != nil { pushMetric(ch, c.subsystem, "iface_link", *ifaceInfo.IfLink, ifaceInfo.Name, prometheus.GaugeValue) } if ifaceInfo.LinkMode != nil { pushMetric(ch, c.subsystem, "iface_link_mode", *ifaceInfo.LinkMode, ifaceInfo.Name, prometheus.GaugeValue) } if ifaceInfo.MTU != nil { pushMetric(ch, c.subsystem, "mtu_bytes", *ifaceInfo.MTU, ifaceInfo.Name, prometheus.GaugeValue) } if ifaceInfo.NameAssignType != nil { pushMetric(ch, c.subsystem, "name_assign_type", *ifaceInfo.NameAssignType, ifaceInfo.Name, prometheus.GaugeValue) } if ifaceInfo.NetDevGroup != nil { pushMetric(ch, c.subsystem, "net_dev_group", *ifaceInfo.NetDevGroup, ifaceInfo.Name, prometheus.GaugeValue) } if ifaceInfo.Speed != nil { speedBytes := int64(*ifaceInfo.Speed / 8 * 1000 * 1000) pushMetric(ch, c.subsystem, "speed_bytes", speedBytes, ifaceInfo.Name, prometheus.GaugeValue) } if ifaceInfo.TxQueueLen != nil { pushMetric(ch, c.subsystem, "transmit_queue_length", *ifaceInfo.TxQueueLen, ifaceInfo.Name, prometheus.GaugeValue) } if ifaceInfo.Type != nil { pushMetric(ch, c.subsystem, "protocol_type", *ifaceInfo.Type, ifaceInfo.Name, prometheus.GaugeValue) } } return nil } func pushMetric(ch chan<- prometheus.Metric, subsystem string, name string, value int64, ifaceName string, valueType prometheus.ValueType) { fieldDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, name), fmt.Sprintf("%s value of /sys/class/net/.", name), []string{"device"}, nil, ) ch <- prometheus.MustNewConstMetric(fieldDesc, valueType, float64(value), ifaceName) } func (c *netClassCollector) getNetClassInfo() (sysfs.NetClass, error) { netClass, err := c.fs.NewNetClass() if err != nil { return netClass, fmt.Errorf("error obtaining net class info: %s", err) } for device := range netClass { if c.ignoredDevicesPattern.MatchString(device) { delete(netClass, device) } } return netClass, nil } prometheus-node-exporter-0.18.1+ds/collector/netdev_bsd.go000066400000000000000000000045651350016654700236420ustar00rootroot00000000000000// 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.18.1+ds/collector/netdev_bsd_test.go000066400000000000000000000026741350016654700247000ustar00rootroot00000000000000// 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.18.1+ds/collector/netdev_common.go000066400000000000000000000044311350016654700243520ustar00rootroot00000000000000// 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+"_total"), 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.CounterValue, v, dev) } } return nil } prometheus-node-exporter-0.18.1+ds/collector/netdev_darwin.go000066400000000000000000000057441350016654700243560ustar00rootroot00000000000000// 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 ( "bytes" "encoding/binary" "errors" "net" "regexp" "strconv" "github.com/prometheus/common/log" "golang.org/x/sys/unix" ) func getNetDevStats(ignore *regexp.Regexp) (map[string]map[string]string, error) { netDev := map[string]map[string]string{} ifs, err := net.Interfaces() if err != nil { return nil, errors.New("net.Interfaces() failed") } for _, iface := range ifs { ifaceData, err := getIfaceData(iface.Index) if err != nil { log.Debugf("failed to load data for interface %q: %v", iface.Name, err) continue } if ignore.MatchString(iface.Name) { log.Debugf("Ignoring device: %s", iface.Name) continue } devStats := map[string]string{} devStats["receive_packets"] = strconv.FormatUint(ifaceData.Data.Ipackets, 10) devStats["transmit_packets"] = strconv.FormatUint(ifaceData.Data.Opackets, 10) devStats["receive_errs"] = strconv.FormatUint(ifaceData.Data.Ierrors, 10) devStats["transmit_errs"] = strconv.FormatUint(ifaceData.Data.Oerrors, 10) devStats["receive_bytes"] = strconv.FormatUint(ifaceData.Data.Ibytes, 10) devStats["transmit_bytes"] = strconv.FormatUint(ifaceData.Data.Obytes, 10) devStats["receive_multicast"] = strconv.FormatUint(ifaceData.Data.Imcasts, 10) devStats["transmit_multicast"] = strconv.FormatUint(ifaceData.Data.Omcasts, 10) netDev[iface.Name] = devStats } return netDev, nil } func getIfaceData(index int) (*ifMsghdr2, error) { var data ifMsghdr2 rawData, err := unix.SysctlRaw("net", unix.AF_ROUTE, 0, 0, unix.NET_RT_IFLIST2, index) if err != nil { return nil, err } err = binary.Read(bytes.NewReader(rawData), binary.LittleEndian, &data) return &data, err } type ifMsghdr2 struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 _ [2]byte SndLen int32 SndMaxlen int32 SndDrops int32 Timer int32 Data ifData64 } type ifData64 struct { Type uint8 Typelen uint8 Physical uint8 Addrlen uint8 Hdrlen uint8 Recvquota uint8 Xmitquota uint8 Unused1 uint8 Mtu uint32 Metric uint32 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Noproto uint64 Recvtiming uint32 Xmittiming uint32 Lastchange unix.Timeval32 } prometheus-node-exporter-0.18.1+ds/collector/netdev_linux.go000066400000000000000000000047041350016654700242240ustar00rootroot00000000000000// 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 ( procNetDevInterfaceRE = regexp.MustCompile(`^(.+): *(.+)$`) 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()) } receiveHeader := strings.Fields(parts[1]) transmitHeader := strings.Fields(parts[2]) headerLength := len(receiveHeader) + len(transmitHeader) netDev := map[string]map[string]string{} for scanner.Scan() { line := strings.TrimLeft(scanner.Text(), " ") parts := procNetDevInterfaceRE.FindStringSubmatch(line) if len(parts) != 3 { return nil, fmt.Errorf("couldn't get interface name, invalid line in net/dev: %q", line) } dev := parts[1] if ignore.MatchString(dev) { log.Debugf("Ignoring device: %s", dev) continue } values := procNetDevFieldSep.Split(strings.TrimLeft(parts[2], " "), -1) if len(values) != headerLength { return nil, fmt.Errorf("couldn't get values, invalid line in net/dev: %q", parts[2]) } netDev[dev] = map[string]string{} for i := 0; i < len(receiveHeader); i++ { netDev[dev]["receive_"+receiveHeader[i]] = values[i] } for i := 0; i < len(transmitHeader); i++ { netDev[dev]["transmit_"+transmitHeader[i]] = values[i+len(receiveHeader)] } } return netDev, scanner.Err() } prometheus-node-exporter-0.18.1+ds/collector/netdev_linux_test.go000066400000000000000000000035341350016654700252630ustar00rootroot00000000000000// 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 := 9, 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") } if want, got := "0", netStats["ibr10:30"]["receive_fifo"]; want != got { t.Error("want fixture interface ibr10:30 to exist, but it does not") } if want, got := "72", netStats["💩0"]["receive_multicast"]; want != got { t.Error("want fixture interface 💩0 to exist, but it does not") } } prometheus-node-exporter-0.18.1+ds/collector/netdev_openbsd.go000066400000000000000000000040201350016654700245060ustar00rootroot00000000000000// 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.18.1+ds/collector/netstat_linux.go000066400000000000000000000112651350016654700244210ustar00rootroot00000000000000// 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" "regexp" "strconv" "strings" "github.com/prometheus/client_golang/prometheus" "gopkg.in/alecthomas/kingpin.v2" ) const ( netStatsSubsystem = "netstat" ) var ( netStatFields = kingpin.Flag("collector.netstat.fields", "Regexp of fields to return for netstat collector.").Default("^(.*_(InErrors|InErrs)|Ip_Forwarding|Ip(6|Ext)_(InOctets|OutOctets)|Icmp6?_(InMsgs|OutMsgs)|TcpExt_(Listen.*|Syncookies.*|TCPSynRetrans)|Tcp_(ActiveOpens|InSegs|OutSegs|PassiveOpens|RetransSegs|CurrEstab)|Udp6?_(InDatagrams|OutDatagrams|NoPorts))$").String() ) type netStatCollector struct { fieldPattern *regexp.Regexp } func init() { registerCollector("netstat", defaultEnabled, NewNetStatCollector) } // NewNetStatCollector takes and returns // a new Collector exposing network stats. func NewNetStatCollector() (Collector, error) { pattern := regexp.MustCompile(*netStatFields) return &netStatCollector{ fieldPattern: pattern, }, 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) } if !c.fieldPattern.MatchString(key) { continue } 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.18.1+ds/collector/netstat_linux_test.go000066400000000000000000000033561350016654700254620ustar00rootroot00000000000000// 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.18.1+ds/collector/nfs_linux.go000066400000000000000000000126721350016654700235300ustar00rootroot00000000000000// 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 ( "fmt" "os" "reflect" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" "github.com/prometheus/procfs/nfs" ) const ( nfsSubsystem = "nfs" ) type nfsCollector struct { fs nfs.FS nfsNetReadsDesc *prometheus.Desc nfsNetConnectionsDesc *prometheus.Desc nfsRPCOperationsDesc *prometheus.Desc nfsRPCRetransmissionsDesc *prometheus.Desc nfsRPCAuthenticationRefreshesDesc *prometheus.Desc nfsProceduresDesc *prometheus.Desc } func init() { registerCollector("nfs", defaultEnabled, NewNfsCollector) } // NewNfsCollector returns a new Collector exposing NFS statistics. func NewNfsCollector() (Collector, error) { fs, err := nfs.NewFS(*procPath) if err != nil { return nil, fmt.Errorf("failed to open procfs: %v", err) } return &nfsCollector{ fs: fs, nfsNetReadsDesc: prometheus.NewDesc( prometheus.BuildFQName(namespace, nfsSubsystem, "packets_total"), "Total NFSd network packets (sent+received) by protocol type.", []string{"protocol"}, nil, ), nfsNetConnectionsDesc: prometheus.NewDesc( prometheus.BuildFQName(namespace, nfsSubsystem, "connections_total"), "Total number of NFSd TCP connections.", nil, nil, ), nfsRPCOperationsDesc: prometheus.NewDesc( prometheus.BuildFQName(namespace, nfsSubsystem, "rpcs_total"), "Total number of RPCs performed.", nil, nil, ), nfsRPCRetransmissionsDesc: prometheus.NewDesc( prometheus.BuildFQName(namespace, nfsSubsystem, "rpc_retransmissions_total"), "Number of RPC transmissions performed.", nil, nil, ), nfsRPCAuthenticationRefreshesDesc: prometheus.NewDesc( prometheus.BuildFQName(namespace, nfsSubsystem, "rpc_authentication_refreshes_total"), "Number of RPC authentication refreshes performed.", nil, nil, ), nfsProceduresDesc: prometheus.NewDesc( prometheus.BuildFQName(namespace, nfsSubsystem, "requests_total"), "Number of NFS procedures invoked.", []string{"proto", "method"}, nil, ), }, nil } func (c *nfsCollector) Update(ch chan<- prometheus.Metric) error { stats, err := c.fs.ClientRPCStats() if err != nil { if os.IsNotExist(err) { log.Debugf("Not collecting NFS metrics: %s", err) return nil } return fmt.Errorf("failed to retrieve nfs stats: %v", err) } c.updateNFSNetworkStats(ch, &stats.Network) c.updateNFSClientRPCStats(ch, &stats.ClientRPC) c.updateNFSRequestsv2Stats(ch, &stats.V2Stats) c.updateNFSRequestsv3Stats(ch, &stats.V3Stats) c.updateNFSRequestsv4Stats(ch, &stats.ClientV4Stats) return nil } // updateNFSNetworkStats collects statistics for network packets/connections. func (c *nfsCollector) updateNFSNetworkStats(ch chan<- prometheus.Metric, s *nfs.Network) { ch <- prometheus.MustNewConstMetric(c.nfsNetReadsDesc, prometheus.CounterValue, float64(s.UDPCount), "udp") ch <- prometheus.MustNewConstMetric(c.nfsNetReadsDesc, prometheus.CounterValue, float64(s.TCPCount), "tcp") ch <- prometheus.MustNewConstMetric(c.nfsNetConnectionsDesc, prometheus.CounterValue, float64(s.TCPConnect)) } // updateNFSClientRPCStats collects statistics for kernel server RPCs. func (c *nfsCollector) updateNFSClientRPCStats(ch chan<- prometheus.Metric, s *nfs.ClientRPC) { ch <- prometheus.MustNewConstMetric(c.nfsRPCOperationsDesc, prometheus.CounterValue, float64(s.RPCCount)) ch <- prometheus.MustNewConstMetric(c.nfsRPCRetransmissionsDesc, prometheus.CounterValue, float64(s.Retransmissions)) ch <- prometheus.MustNewConstMetric(c.nfsRPCAuthenticationRefreshesDesc, prometheus.CounterValue, float64(s.AuthRefreshes)) } // updateNFSRequestsv2Stats collects statistics for NFSv2 requests. func (c *nfsCollector) updateNFSRequestsv2Stats(ch chan<- prometheus.Metric, s *nfs.V2Stats) { const proto = "2" v := reflect.ValueOf(s).Elem() for i := 0; i < v.NumField(); i++ { field := v.Field(i) ch <- prometheus.MustNewConstMetric(c.nfsProceduresDesc, prometheus.CounterValue, float64(field.Uint()), proto, v.Type().Field(i).Name) } } // updateNFSRequestsv3Stats collects statistics for NFSv3 requests. func (c *nfsCollector) updateNFSRequestsv3Stats(ch chan<- prometheus.Metric, s *nfs.V3Stats) { const proto = "3" v := reflect.ValueOf(s).Elem() for i := 0; i < v.NumField(); i++ { field := v.Field(i) ch <- prometheus.MustNewConstMetric(c.nfsProceduresDesc, prometheus.CounterValue, float64(field.Uint()), proto, v.Type().Field(i).Name) } } // updateNFSRequestsv4Stats collects statistics for NFSv4 requests. func (c *nfsCollector) updateNFSRequestsv4Stats(ch chan<- prometheus.Metric, s *nfs.ClientV4Stats) { const proto = "4" v := reflect.ValueOf(s).Elem() for i := 0; i < v.NumField(); i++ { field := v.Field(i) ch <- prometheus.MustNewConstMetric(c.nfsProceduresDesc, prometheus.CounterValue, float64(field.Uint()), proto, v.Type().Field(i).Name) } } prometheus-node-exporter-0.18.1+ds/collector/nfsd_linux.go000066400000000000000000000400371350016654700236700ustar00rootroot00000000000000// Copyright 2018 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" "os" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" "github.com/prometheus/procfs/nfs" ) // A nfsdCollector is a Collector which gathers metrics from /proc/net/rpc/nfsd. // See: https://www.svennd.be/nfsd-stats-explained-procnetrpcnfsd/ type nfsdCollector struct { fs nfs.FS requestsDesc *prometheus.Desc } func init() { registerCollector("nfsd", defaultEnabled, NewNFSdCollector) } const ( nfsdSubsystem = "nfsd" ) // NewNFSdCollector returns a new Collector exposing /proc/net/rpc/nfsd statistics. func NewNFSdCollector() (Collector, error) { fs, err := nfs.NewFS(*procPath) if err != nil { return nil, fmt.Errorf("failed to open procfs: %v", err) } return &nfsdCollector{ fs: fs, requestsDesc: prometheus.NewDesc( prometheus.BuildFQName(namespace, nfsdSubsystem, "requests_total"), "Total number NFSd Requests by method and protocol.", []string{"proto", "method"}, nil, ), }, nil } // Update implements Collector. func (c *nfsdCollector) Update(ch chan<- prometheus.Metric) error { stats, err := c.fs.ServerRPCStats() if err != nil { if os.IsNotExist(err) { log.Debugf("Not collecting NFSd metrics: %s", err) return nil } return fmt.Errorf("failed to retrieve nfsd stats: %v", err) } c.updateNFSdReplyCacheStats(ch, &stats.ReplyCache) c.updateNFSdFileHandlesStats(ch, &stats.FileHandles) c.updateNFSdInputOutputStats(ch, &stats.InputOutput) c.updateNFSdThreadsStats(ch, &stats.Threads) c.updateNFSdReadAheadCacheStats(ch, &stats.ReadAheadCache) c.updateNFSdNetworkStats(ch, &stats.Network) c.updateNFSdServerRPCStats(ch, &stats.ServerRPC) c.updateNFSdRequestsv2Stats(ch, &stats.V2Stats) c.updateNFSdRequestsv3Stats(ch, &stats.V3Stats) c.updateNFSdRequestsv4Stats(ch, &stats.V4Ops) return nil } // updateNFSdReplyCacheStats collects statistics for the reply cache. func (c *nfsdCollector) updateNFSdReplyCacheStats(ch chan<- prometheus.Metric, s *nfs.ReplyCache) { ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, nfsdSubsystem, "reply_cache_hits_total"), "Total number of NFSd Reply Cache hits (client lost server response).", nil, nil, ), prometheus.CounterValue, float64(s.Hits)) ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, nfsdSubsystem, "reply_cache_misses_total"), "Total number of NFSd Reply Cache an operation that requires caching (idempotent).", nil, nil, ), prometheus.CounterValue, float64(s.Misses)) ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, nfsdSubsystem, "reply_cache_nocache_total"), "Total number of NFSd Reply Cache non-idempotent operations (rename/delete/…).", nil, nil, ), prometheus.CounterValue, float64(s.NoCache)) } // updateNFSdFileHandlesStats collects statistics for the file handles. func (c *nfsdCollector) updateNFSdFileHandlesStats(ch chan<- prometheus.Metric, s *nfs.FileHandles) { ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, nfsdSubsystem, "file_handles_stale_total"), "Total number of NFSd stale file handles", nil, nil, ), prometheus.CounterValue, float64(s.Stale)) // NOTE: Other FileHandles entries are unused in the kernel. } // updateNFSdInputOutputStats collects statistics for the bytes in/out. func (c *nfsdCollector) updateNFSdInputOutputStats(ch chan<- prometheus.Metric, s *nfs.InputOutput) { ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, nfsdSubsystem, "disk_bytes_read_total"), "Total NFSd bytes read.", nil, nil, ), prometheus.CounterValue, float64(s.Read)) ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, nfsdSubsystem, "disk_bytes_written_total"), "Total NFSd bytes written.", nil, nil, ), prometheus.CounterValue, float64(s.Write)) } // updateNFSdThreadsStats collects statistics for kernel server threads. func (c *nfsdCollector) updateNFSdThreadsStats(ch chan<- prometheus.Metric, s *nfs.Threads) { ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, nfsdSubsystem, "server_threads"), "Total number of NFSd kernel threads that are running.", nil, nil, ), prometheus.GaugeValue, float64(s.Threads)) } // updateNFSdReadAheadCacheStats collects statistics for the read ahead cache. func (c *nfsdCollector) updateNFSdReadAheadCacheStats(ch chan<- prometheus.Metric, s *nfs.ReadAheadCache) { ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, nfsdSubsystem, "read_ahead_cache_size_blocks"), "How large the read ahead cache is in blocks.", nil, nil, ), prometheus.GaugeValue, float64(s.CacheSize)) ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, nfsdSubsystem, "read_ahead_cache_not_found_total"), "Total number of NFSd read ahead cache not found.", nil, nil, ), prometheus.CounterValue, float64(s.NotFound)) } // updateNFSdNetworkStats collects statistics for network packets/connections. func (c *nfsdCollector) updateNFSdNetworkStats(ch chan<- prometheus.Metric, s *nfs.Network) { packetDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, nfsdSubsystem, "packets_total"), "Total NFSd network packets (sent+received) by protocol type.", []string{"proto"}, nil, ) ch <- prometheus.MustNewConstMetric( packetDesc, prometheus.CounterValue, float64(s.UDPCount), "udp") ch <- prometheus.MustNewConstMetric( packetDesc, prometheus.CounterValue, float64(s.TCPCount), "tcp") ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, nfsdSubsystem, "connections_total"), "Total number of NFSd TCP connections.", nil, nil, ), prometheus.CounterValue, float64(s.TCPConnect)) } // updateNFSdServerRPCStats collects statistics for kernel server RPCs. func (c *nfsdCollector) updateNFSdServerRPCStats(ch chan<- prometheus.Metric, s *nfs.ServerRPC) { badRPCDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, nfsdSubsystem, "rpc_errors_total"), "Total number of NFSd RPC errors by error type.", []string{"error"}, nil, ) ch <- prometheus.MustNewConstMetric( badRPCDesc, prometheus.CounterValue, float64(s.BadFmt), "fmt") ch <- prometheus.MustNewConstMetric( badRPCDesc, prometheus.CounterValue, float64(s.BadAuth), "auth") ch <- prometheus.MustNewConstMetric( badRPCDesc, prometheus.CounterValue, float64(s.BadcInt), "cInt") ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( prometheus.BuildFQName(namespace, nfsdSubsystem, "server_rpcs_total"), "Total number of NFSd RPCs.", nil, nil, ), prometheus.CounterValue, float64(s.RPCCount)) } // updateNFSdRequestsv2Stats collects statistics for NFSv2 requests. func (c *nfsdCollector) updateNFSdRequestsv2Stats(ch chan<- prometheus.Metric, s *nfs.V2Stats) { const proto = "2" ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.GetAttr), proto, "GetAttr") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.SetAttr), proto, "SetAttr") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Root), proto, "Root") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Lookup), proto, "Lookup") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.ReadLink), proto, "ReadLink") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Read), proto, "Read") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.WrCache), proto, "WrCache") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Write), proto, "Write") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Create), proto, "Create") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Remove), proto, "Remove") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Rename), proto, "Rename") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Link), proto, "Link") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.SymLink), proto, "SymLink") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.MkDir), proto, "MkDir") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.RmDir), proto, "RmDir") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.ReadDir), proto, "ReadDir") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.FsStat), proto, "FsStat") } // updateNFSdRequestsv3Stats collects statistics for NFSv3 requests. func (c *nfsdCollector) updateNFSdRequestsv3Stats(ch chan<- prometheus.Metric, s *nfs.V3Stats) { const proto = "3" ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.GetAttr), proto, "GetAttr") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.SetAttr), proto, "SetAttr") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Lookup), proto, "Lookup") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Access), proto, "Access") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.ReadLink), proto, "ReadLink") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Read), proto, "Read") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Write), proto, "Write") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Create), proto, "Create") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.MkDir), proto, "MkDir") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.SymLink), proto, "SymLink") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.MkNod), proto, "MkNod") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Remove), proto, "Remove") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.RmDir), proto, "RmDir") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Rename), proto, "Rename") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Link), proto, "Link") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.ReadDir), proto, "ReadDir") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.ReadDirPlus), proto, "ReadDirPlus") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.FsStat), proto, "FsStat") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.FsInfo), proto, "FsInfo") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.PathConf), proto, "PathConf") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Commit), proto, "Commit") } // updateNFSdRequestsv4Stats collects statistics for NFSv4 requests. func (c *nfsdCollector) updateNFSdRequestsv4Stats(ch chan<- prometheus.Metric, s *nfs.V4Ops) { const proto = "4" ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Access), proto, "Access") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Close), proto, "Close") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Commit), proto, "Commit") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Create), proto, "Create") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.DelegPurge), proto, "DelegPurge") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.DelegReturn), proto, "DelegReturn") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.GetAttr), proto, "GetAttr") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.GetFH), proto, "GetFH") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Link), proto, "Link") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Lock), proto, "Lock") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Lockt), proto, "Lockt") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Locku), proto, "Locku") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Lookup), proto, "Lookup") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.LookupRoot), proto, "LookupRoot") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Nverify), proto, "Nverify") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Open), proto, "Open") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.OpenAttr), proto, "OpenAttr") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.OpenConfirm), proto, "OpenConfirm") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.OpenDgrd), proto, "OpenDgrd") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.PutFH), proto, "PutFH") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Read), proto, "Read") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.ReadDir), proto, "ReadDir") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.ReadLink), proto, "ReadLink") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Remove), proto, "Remove") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Rename), proto, "Rename") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Renew), proto, "Renew") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.RestoreFH), proto, "RestoreFH") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.SaveFH), proto, "SaveFH") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.SecInfo), proto, "SecInfo") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.SetAttr), proto, "SetAttr") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Verify), proto, "Verify") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Write), proto, "Write") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.RelLockOwner), proto, "RelLockOwner") } prometheus-node-exporter-0.18.1+ds/collector/ntp.go000066400000000000000000000142721350016654700223220ustar00rootroot00000000000000// 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" "sync" "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 leapMidnightMutex.Lock() 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 } leapMidnightMutex.Unlock() 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.18.1+ds/collector/paths.go000066400000000000000000000024111350016654700226300ustar00rootroot00000000000000// 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/filepath" "github.com/prometheus/procfs" kingpin "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() rootfsPath = kingpin.Flag("path.rootfs", "rootfs mountpoint.").Default("/").String() ) func procFilePath(name string) string { return filepath.Join(*procPath, name) } func sysFilePath(name string) string { return filepath.Join(*sysPath, name) } func rootfsFilePath(name string) string { return filepath.Join(*rootfsPath, name) } prometheus-node-exporter-0.18.1+ds/collector/paths_test.go000066400000000000000000000045231350016654700236750ustar00rootroot00000000000000// 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.18.1+ds/collector/perf_linux.go000066400000000000000000000330171350016654700236720ustar00rootroot00000000000000// Copyright 2019 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" "runtime" perf "github.com/hodgesds/perf-utils" "github.com/prometheus/client_golang/prometheus" ) const ( perfSubsystem = "perf" ) func init() { registerCollector(perfSubsystem, defaultDisabled, NewPerfCollector) } // perfCollector is a Collecter that uses the perf subsystem to collect // metrics. It uses perf_event_open an ioctls for profiling. Due to the fact // that the perf subsystem is highly dependent on kernel configuration and // settings not all profiler values may be exposed on the target system at any // given time. type perfCollector struct { perfHwProfilers map[int]perf.HardwareProfiler perfSwProfilers map[int]perf.SoftwareProfiler perfCacheProfilers map[int]perf.CacheProfiler desc map[string]*prometheus.Desc } // NewPerfCollector returns a new perf based collector, it creates a profiler // per CPU. func NewPerfCollector() (Collector, error) { collector := &perfCollector{ perfHwProfilers: map[int]perf.HardwareProfiler{}, perfSwProfilers: map[int]perf.SoftwareProfiler{}, perfCacheProfilers: map[int]perf.CacheProfiler{}, } ncpus := runtime.NumCPU() for i := 0; i < ncpus; i++ { // Use -1 to profile all processes on the CPU, see: // man perf_event_open collector.perfHwProfilers[i] = perf.NewHardwareProfiler(-1, i) if err := collector.perfHwProfilers[i].Start(); err != nil { return collector, err } collector.perfSwProfilers[i] = perf.NewSoftwareProfiler(-1, i) if err := collector.perfSwProfilers[i].Start(); err != nil { return collector, err } collector.perfCacheProfilers[i] = perf.NewCacheProfiler(-1, i) if err := collector.perfCacheProfilers[i].Start(); err != nil { return collector, err } } collector.desc = map[string]*prometheus.Desc{ "cpucycles_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "cpucycles_total", ), "Number of CPU cycles (frequency scaled)", []string{"cpu"}, nil, ), "instructions_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "instructions_total", ), "Number of CPU instructions", []string{"cpu"}, nil, ), "branch_instructions_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "branch_instructions_total", ), "Number of CPU branch instructions", []string{"cpu"}, nil, ), "branch_misses_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "branch_misses_total", ), "Number of CPU branch misses", []string{"cpu"}, nil, ), "cache_refs_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "cache_refs_total", ), "Number of cache references (non frequency scaled)", []string{"cpu"}, nil, ), "cache_misses_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "cache_misses_total", ), "Number of cache misses", []string{"cpu"}, nil, ), "ref_cpucycles_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "ref_cpucycles_total", ), "Number of CPU cycles", []string{"cpu"}, nil, ), "page_faults_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "page_faults_total", ), "Number of page faults", []string{"cpu"}, nil, ), "context_switches_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "context_switches_total", ), "Number of context switches", []string{"cpu"}, nil, ), "cpu_migrations_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "cpu_migrations_total", ), "Number of CPU process migrations", []string{"cpu"}, nil, ), "minor_faults_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "minor_faults_total", ), "Number of minor page faults", []string{"cpu"}, nil, ), "major_faults_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "major_faults_total", ), "Number of major page faults", []string{"cpu"}, nil, ), "cache_l1d_read_hits_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "cache_l1d_read_hits_total", ), "Number L1 data cache read hits", []string{"cpu"}, nil, ), "cache_l1d_read_misses_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "cache_l1d_read_misses_total", ), "Number L1 data cache read misses", []string{"cpu"}, nil, ), "cache_l1d_write_hits_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "cache_l1d_write_hits_total", ), "Number L1 data cache write hits", []string{"cpu"}, nil, ), "cache_l1_instr_read_misses_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "cache_l1_instr_read_misses_total", ), "Number instruction L1 instruction read misses", []string{"cpu"}, nil, ), "cache_tlb_instr_read_hits_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "cache_tlb_instr_read_hits_total", ), "Number instruction TLB read hits", []string{"cpu"}, nil, ), "cache_tlb_instr_read_misses_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "cache_tlb_instr_read_misses_total", ), "Number instruction TLB read misses", []string{"cpu"}, nil, ), "cache_ll_read_hits_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "cache_ll_read_hits_total", ), "Number last level read hits", []string{"cpu"}, nil, ), "cache_ll_read_misses_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "cache_ll_read_misses_total", ), "Number last level read misses", []string{"cpu"}, nil, ), "cache_ll_write_hits_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "cache_ll_write_hits_total", ), "Number last level write hits", []string{"cpu"}, nil, ), "cache_ll_write_misses_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "cache_ll_write_misses_total", ), "Number last level write misses", []string{"cpu"}, nil, ), "cache_bpu_read_hits_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "cache_bpu_read_hits_total", ), "Number BPU read hits", []string{"cpu"}, nil, ), "cache_bpu_read_misses_total": prometheus.NewDesc( prometheus.BuildFQName( namespace, perfSubsystem, "cache_bpu_read_misses_total", ), "Number BPU read misses", []string{"cpu"}, nil, ), } return collector, nil } // Update implements the Collector interface and will collect metrics per CPU. func (c *perfCollector) Update(ch chan<- prometheus.Metric) error { if err := c.updateHardwareStats(ch); err != nil { return err } if err := c.updateSoftwareStats(ch); err != nil { return err } if err := c.updateCacheStats(ch); err != nil { return err } return nil } func (c *perfCollector) updateHardwareStats(ch chan<- prometheus.Metric) error { for cpu, profiler := range c.perfHwProfilers { cpuStr := fmt.Sprintf("%d", cpu) hwProfile, err := profiler.Profile() if err != nil { return err } if hwProfile == nil { continue } if hwProfile.CPUCycles != nil { ch <- prometheus.MustNewConstMetric( c.desc["cpucycles_total"], prometheus.CounterValue, float64(*hwProfile.CPUCycles), cpuStr, ) } if hwProfile.Instructions != nil { ch <- prometheus.MustNewConstMetric( c.desc["instructions_total"], prometheus.CounterValue, float64(*hwProfile.Instructions), cpuStr, ) } if hwProfile.BranchInstr != nil { ch <- prometheus.MustNewConstMetric( c.desc["branch_instructions_total"], prometheus.CounterValue, float64(*hwProfile.BranchInstr), cpuStr, ) } if hwProfile.BranchMisses != nil { ch <- prometheus.MustNewConstMetric( c.desc["branch_misses_total"], prometheus.CounterValue, float64(*hwProfile.BranchMisses), cpuStr, ) } if hwProfile.CacheRefs != nil { ch <- prometheus.MustNewConstMetric( c.desc["cache_refs_total"], prometheus.CounterValue, float64(*hwProfile.CacheRefs), cpuStr, ) } if hwProfile.CacheMisses != nil { ch <- prometheus.MustNewConstMetric( c.desc["cache_misses_total"], prometheus.CounterValue, float64(*hwProfile.CacheMisses), cpuStr, ) } if hwProfile.RefCPUCycles != nil { ch <- prometheus.MustNewConstMetric( c.desc["ref_cpucycles_total"], prometheus.CounterValue, float64(*hwProfile.RefCPUCycles), cpuStr, ) } } return nil } func (c *perfCollector) updateSoftwareStats(ch chan<- prometheus.Metric) error { for cpu, profiler := range c.perfSwProfilers { cpuStr := fmt.Sprintf("%d", cpu) swProfile, err := profiler.Profile() if err != nil { return err } if swProfile == nil { continue } if swProfile.PageFaults != nil { ch <- prometheus.MustNewConstMetric( c.desc["page_faults_total"], prometheus.CounterValue, float64(*swProfile.PageFaults), cpuStr, ) } if swProfile.ContextSwitches != nil { ch <- prometheus.MustNewConstMetric( c.desc["context_switches_total"], prometheus.CounterValue, float64(*swProfile.ContextSwitches), cpuStr, ) } if swProfile.CPUMigrations != nil { ch <- prometheus.MustNewConstMetric( c.desc["cpu_migrations_total"], prometheus.CounterValue, float64(*swProfile.CPUMigrations), cpuStr, ) } if swProfile.MinorPageFaults != nil { ch <- prometheus.MustNewConstMetric( c.desc["minor_faults_total"], prometheus.CounterValue, float64(*swProfile.MinorPageFaults), cpuStr, ) } if swProfile.MajorPageFaults != nil { ch <- prometheus.MustNewConstMetric( c.desc["major_faults_total"], prometheus.CounterValue, float64(*swProfile.MajorPageFaults), cpuStr, ) } } return nil } func (c *perfCollector) updateCacheStats(ch chan<- prometheus.Metric) error { for cpu, profiler := range c.perfCacheProfilers { cpuStr := fmt.Sprintf("%d", cpu) cacheProfile, err := profiler.Profile() if err != nil { return err } if cacheProfile == nil { continue } if cacheProfile.L1DataReadHit != nil { ch <- prometheus.MustNewConstMetric( c.desc["cache_l1d_read_hits_total"], prometheus.CounterValue, float64(*cacheProfile.L1DataReadHit), cpuStr, ) } if cacheProfile.L1DataReadMiss != nil { ch <- prometheus.MustNewConstMetric( c.desc["cache_l1d_read_misses_total"], prometheus.CounterValue, float64(*cacheProfile.L1DataReadMiss), cpuStr, ) } if cacheProfile.L1DataWriteHit != nil { ch <- prometheus.MustNewConstMetric( c.desc["cache_l1d_write_hits_total"], prometheus.CounterValue, float64(*cacheProfile.L1DataWriteHit), cpuStr, ) } if cacheProfile.L1InstrReadMiss != nil { ch <- prometheus.MustNewConstMetric( c.desc["cache_l1_instr_read_misses_total"], prometheus.CounterValue, float64(*cacheProfile.L1InstrReadMiss), cpuStr, ) } if cacheProfile.InstrTLBReadHit != nil { ch <- prometheus.MustNewConstMetric( c.desc["cache_tlb_instr_read_hits_total"], prometheus.CounterValue, float64(*cacheProfile.InstrTLBReadHit), cpuStr, ) } if cacheProfile.InstrTLBReadMiss != nil { ch <- prometheus.MustNewConstMetric( c.desc["cache_tlb_instr_read_misses_total"], prometheus.CounterValue, float64(*cacheProfile.InstrTLBReadMiss), cpuStr, ) } if cacheProfile.LastLevelReadHit != nil { ch <- prometheus.MustNewConstMetric( c.desc["cache_ll_read_hits_total"], prometheus.CounterValue, float64(*cacheProfile.LastLevelReadHit), cpuStr, ) } if cacheProfile.LastLevelReadMiss != nil { ch <- prometheus.MustNewConstMetric( c.desc["cache_ll_read_misses_total"], prometheus.CounterValue, float64(*cacheProfile.LastLevelReadMiss), cpuStr, ) } if cacheProfile.LastLevelWriteHit != nil { ch <- prometheus.MustNewConstMetric( c.desc["cache_ll_write_hits_total"], prometheus.CounterValue, float64(*cacheProfile.LastLevelWriteHit), cpuStr, ) } if cacheProfile.LastLevelWriteMiss != nil { ch <- prometheus.MustNewConstMetric( c.desc["cache_ll_write_misses_total"], prometheus.CounterValue, float64(*cacheProfile.LastLevelWriteMiss), cpuStr, ) } if cacheProfile.BPUReadHit != nil { ch <- prometheus.MustNewConstMetric( c.desc["cache_bpu_read_hits_total"], prometheus.CounterValue, float64(*cacheProfile.BPUReadHit), cpuStr, ) } if cacheProfile.BPUReadMiss != nil { ch <- prometheus.MustNewConstMetric( c.desc["cache_bpu_read_misses_total"], prometheus.CounterValue, float64(*cacheProfile.BPUReadMiss), cpuStr, ) } } return nil } prometheus-node-exporter-0.18.1+ds/collector/perf_linux_test.go000066400000000000000000000027761350016654700247410ustar00rootroot00000000000000// Copyright 2019 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 !noprocesses package collector import ( "io/ioutil" "strconv" "strings" "testing" "github.com/prometheus/client_golang/prometheus" ) func TestPerfCollector(t *testing.T) { paranoidBytes, err := ioutil.ReadFile("/proc/sys/kernel/perf_event_paranoid") if err != nil { t.Skip("Procfs not mounted, skipping perf tests") } paranoidStr := strings.Replace(string(paranoidBytes), "\n", "", -1) paranoid, err := strconv.Atoi(paranoidStr) if err != nil { t.Fatalf("Expected perf_event_paranoid to be an int, got: %s", paranoidStr) } if paranoid >= 1 { t.Skip("Skipping perf tests, set perf_event_paranoid to 0") } collector, err := NewPerfCollector() if err != nil { t.Fatal(err) } // Setup background goroutine to capture metrics. metrics := make(chan prometheus.Metric) defer close(metrics) go func() { for range metrics { } }() if err := collector.Update(metrics); err != nil { t.Fatal(err) } } prometheus-node-exporter-0.18.1+ds/collector/pressure_linux.go000066400000000000000000000070301350016654700246020ustar00rootroot00000000000000// Copyright 2019 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 !nopressure package collector import ( "fmt" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" "github.com/prometheus/procfs" ) var ( psiResources = []string{"cpu", "io", "memory"} ) type pressureStatsCollector struct { cpu *prometheus.Desc io *prometheus.Desc ioFull *prometheus.Desc mem *prometheus.Desc memFull *prometheus.Desc fs procfs.FS } func init() { registerCollector("pressure", defaultEnabled, NewPressureStatsCollector) } // NewPressureStatsCollector returns a Collector exposing pressure stall information func NewPressureStatsCollector() (Collector, error) { fs, err := procfs.NewFS(*procPath) if err != nil { return nil, fmt.Errorf("failed to open procfs: %v", err) } return &pressureStatsCollector{ cpu: prometheus.NewDesc( prometheus.BuildFQName(namespace, "pressure", "cpu_waiting_seconds_total"), "Total time in seconds that processes have waited for CPU time", nil, nil, ), io: prometheus.NewDesc( prometheus.BuildFQName(namespace, "pressure", "io_waiting_seconds_total"), "Total time in seconds that processes have waited due to IO congestion", nil, nil, ), ioFull: prometheus.NewDesc( prometheus.BuildFQName(namespace, "pressure", "io_stalled_seconds_total"), "Total time in seconds no process could make progress due to IO congestion", nil, nil, ), mem: prometheus.NewDesc( prometheus.BuildFQName(namespace, "pressure", "memory_waiting_seconds_total"), "Total time in seconds that processes have waited for memory", nil, nil, ), memFull: prometheus.NewDesc( prometheus.BuildFQName(namespace, "pressure", "memory_stalled_seconds_total"), "Total time in seconds no process could make progress due to memory congestion", nil, nil, ), fs: fs, }, nil } // Update calls procfs.NewPSIStatsForResource for the different resources and updates the values func (c *pressureStatsCollector) Update(ch chan<- prometheus.Metric) error { for _, res := range psiResources { log.Debugf("collecting statistics for resource: %s", res) vals, err := c.fs.NewPSIStatsForResource(res) if err != nil { log.Debug("pressure information is unavailable, you need a Linux kernel >= 4.20 and/or CONFIG_PSI enabled for your kernel") return nil } switch res { case "cpu": ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, float64(vals.Some.Total)/1000.0/1000.0) case "io": ch <- prometheus.MustNewConstMetric(c.io, prometheus.CounterValue, float64(vals.Some.Total)/1000.0/1000.0) ch <- prometheus.MustNewConstMetric(c.ioFull, prometheus.CounterValue, float64(vals.Full.Total)/1000.0/1000.0) case "memory": ch <- prometheus.MustNewConstMetric(c.mem, prometheus.CounterValue, float64(vals.Some.Total)/1000.0/1000.0) ch <- prometheus.MustNewConstMetric(c.memFull, prometheus.CounterValue, float64(vals.Full.Total)/1000.0/1000.0) default: log.Debugf("did not account for resource: %s", res) } } return nil } prometheus-node-exporter-0.18.1+ds/collector/processes_linux.go000066400000000000000000000073711350016654700247500ustar00rootroot00000000000000// Copyright 2018 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 !noprocesses package collector import ( "fmt" "os" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" "github.com/prometheus/procfs" ) type processCollector struct { fs procfs.FS threadAlloc *prometheus.Desc threadLimit *prometheus.Desc procsState *prometheus.Desc pidUsed *prometheus.Desc pidMax *prometheus.Desc } func init() { registerCollector("processes", defaultDisabled, NewProcessStatCollector) } // NewProcessStatCollector returns a new Collector exposing process data read from the proc filesystem. func NewProcessStatCollector() (Collector, error) { fs, err := procfs.NewFS(*procPath) if err != nil { return nil, fmt.Errorf("failed to open procfs: %v", err) } subsystem := "processes" return &processCollector{ fs: fs, threadAlloc: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "threads"), "Allocated threads in system", nil, nil, ), threadLimit: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "max_threads"), "Limit of threads in the system", nil, nil, ), procsState: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "state"), "Number of processes in each state.", []string{"state"}, nil, ), pidUsed: prometheus.NewDesc(prometheus.BuildFQName(namespace, subsystem, "pids"), "Number of PIDs", nil, nil, ), pidMax: prometheus.NewDesc(prometheus.BuildFQName(namespace, subsystem, "max_processes"), "Number of max PIDs limit", nil, nil, ), }, nil } func (c *processCollector) Update(ch chan<- prometheus.Metric) error { pids, states, threads, err := c.getAllocatedThreads() if err != nil { return fmt.Errorf("unable to retrieve number of allocated threads: %q", err) } ch <- prometheus.MustNewConstMetric(c.threadAlloc, prometheus.GaugeValue, float64(threads)) maxThreads, err := readUintFromFile(procFilePath("sys/kernel/threads-max")) if err != nil { return fmt.Errorf("unable to retrieve limit number of threads: %q", err) } ch <- prometheus.MustNewConstMetric(c.threadLimit, prometheus.GaugeValue, float64(maxThreads)) for state := range states { ch <- prometheus.MustNewConstMetric(c.procsState, prometheus.GaugeValue, float64(states[state]), state) } pidM, err := readUintFromFile(procFilePath("sys/kernel/pid_max")) if err != nil { return fmt.Errorf("unable to retrieve limit number of maximum pids alloved: %q", err) } ch <- prometheus.MustNewConstMetric(c.pidUsed, prometheus.GaugeValue, float64(pids)) ch <- prometheus.MustNewConstMetric(c.pidMax, prometheus.GaugeValue, float64(pidM)) return nil } func (c *processCollector) getAllocatedThreads() (int, map[string]int32, int, error) { p, err := c.fs.AllProcs() if err != nil { return 0, nil, 0, err } pids := 0 thread := 0 procStates := make(map[string]int32) for _, pid := range p { stat, err := pid.NewStat() // PIDs can vanish between getting the list and getting stats. if os.IsNotExist(err) { log.Debugf("file not found when retrieving stats: %q", err) continue } if err != nil { return 0, nil, 0, err } pids++ procStates[stat.State]++ thread += stat.NumThreads } return pids, procStates, thread, nil } prometheus-node-exporter-0.18.1+ds/collector/processes_linux_test.go000066400000000000000000000032171350016654700260020ustar00rootroot00000000000000// Copyright 2018 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 !noprocesses package collector import ( "testing" "github.com/prometheus/procfs" kingpin "gopkg.in/alecthomas/kingpin.v2" ) func TestReadProcessStatus(t *testing.T) { if _, err := kingpin.CommandLine.Parse([]string{"--path.procfs", "fixtures/proc"}); err != nil { t.Fatal(err) } want := 1 fs, err := procfs.NewFS(*procPath) if err != nil { t.Errorf("failed to open procfs: %v", err) } c := processCollector{fs: fs} pids, states, threads, err := c.getAllocatedThreads() if err != nil { t.Fatalf("Cannot retrieve data from procfs getAllocatedThreads function: %v ", err) } if threads < want { t.Fatalf("Current threads: %d Shouldn't be less than wanted %d", threads, want) } if states == nil { t.Fatalf("Process states cannot be nil %v:", states) } maxPid, err := readUintFromFile(procFilePath("sys/kernel/pid_max")) if err != nil { t.Fatalf("Unable to retrieve limit number of maximum pids alloved %v\n", err) } if uint64(pids) > maxPid || pids == 0 { t.Fatalf("Total running pids cannot be greater than %d or equals to 0", maxPid) } } prometheus-node-exporter-0.18.1+ds/collector/qdisc_linux.go000066400000000000000000000066411350016654700240440ustar00rootroot00000000000000// 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) } // NewQdiscStatCollector returns a new Collector exposing queuing discipline statistics. 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.18.1+ds/collector/runit.go000066400000000000000000000060471350016654700226630ustar00rootroot00000000000000// 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.18.1+ds/collector/sockstat_linux.go000066400000000000000000000065331350016654700245740ustar00rootroot00000000000000// 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.18.1+ds/collector/sockstat_linux_test.go000066400000000000000000000034561350016654700256340ustar00rootroot00000000000000// 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.18.1+ds/collector/stat_linux.go000066400000000000000000000060111350016654700237030ustar00rootroot00000000000000// 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 { fs procfs.FS 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) { fs, err := procfs.NewFS(*procPath) if err != nil { return nil, fmt.Errorf("failed to open procfs: %v", err) } return &statCollector{ fs: fs, intr: prometheus.NewDesc( prometheus.BuildFQName(namespace, "", "intr_total"), "Total number of interrupts serviced.", nil, nil, ), ctxt: prometheus.NewDesc( prometheus.BuildFQName(namespace, "", "context_switches_total"), "Total number of context switches.", nil, nil, ), forks: prometheus.NewDesc( prometheus.BuildFQName(namespace, "", "forks_total"), "Total number of forks.", nil, nil, ), btime: prometheus.NewDesc( prometheus.BuildFQName(namespace, "", "boot_time_seconds"), "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 { stats, err := c.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.18.1+ds/collector/supervisord.go000066400000000000000000000104171350016654700241030ustar00rootroot00000000000000// 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 ( "fmt" "github.com/mattn/go-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 { upDesc *prometheus.Desc stateDesc *prometheus.Desc exitStatusDesc *prometheus.Desc startTimeDesc *prometheus.Desc } func init() { registerCollector("supervisord", defaultDisabled, NewSupervisordCollector) } // NewSupervisordCollector returns a new Collector exposing supervisord statistics. func NewSupervisordCollector() (Collector, error) { var ( subsystem = "supervisord" labelNames = []string{"name", "group"} ) return &supervisordCollector{ 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, ), startTimeDesc: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "start_time_seconds"), "Process start time", 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 info 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"` } res, err := xmlrpc.Call(*supervisordURL, "supervisor.getAllProcessInfo") if err != nil { return fmt.Errorf("unable to call supervisord: %s", err) } for _, p := range res.(xmlrpc.Array) { for k, v := range p.(xmlrpc.Struct) { switch k { case "name": info.Name = v.(string) case "group": info.Group = v.(string) case "start": info.Start = v.(int) case "stop": info.Stop = v.(int) case "now": info.Now = v.(int) case "state": info.State = v.(int) case "statename": info.StateName = v.(string) case "exitstatus": info.ExitStatus = v.(int) case "pid": info.PID = v.(int) } } labels := []string{info.Name, info.Group} ch <- prometheus.MustNewConstMetric(c.stateDesc, prometheus.GaugeValue, float64(info.State), labels...) ch <- prometheus.MustNewConstMetric(c.exitStatusDesc, prometheus.GaugeValue, float64(info.ExitStatus), labels...) if c.isRunning(info.State) { ch <- prometheus.MustNewConstMetric(c.upDesc, prometheus.GaugeValue, 1, labels...) ch <- prometheus.MustNewConstMetric(c.startTimeDesc, prometheus.CounterValue, float64(info.Start), labels...) } else { ch <- prometheus.MustNewConstMetric(c.upDesc, prometheus.GaugeValue, 0, labels...) } log.Debugf("%s:%s is %s on pid %d", info.Group, info.Name, info.StateName, info.PID) } return nil } prometheus-node-exporter-0.18.1+ds/collector/sysctl_bsd.go000066400000000000000000000066531350016654700236760ustar00rootroot00000000000000// 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 openbsd netbsd darwin // +build !nomeminfo package collector import ( "fmt" "syscall" "unsafe" "github.com/prometheus/client_golang/prometheus" "golang.org/x/sys/unix" ) // #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 } if len(raw) != int(unsafe.Sizeof(syscall.Timeval{})) { // Shouldn't get here. return 0, fmt.Errorf( "length of bytes received from sysctl (%d) does not match expected bytes (%d)", len(raw), unsafe.Sizeof(syscall.Timeval{}), ) } tv := *(*syscall.Timeval)(unsafe.Pointer(&raw[0])) // This conversion maintains the usec precision. Using the time // package did not. return (float64(tv.Sec) + (float64(tv.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.18.1+ds/collector/systemd_linux.go000066400000000000000000000353731350016654700244350ustar00rootroot00000000000000// 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" "math" "regexp" "strings" "sync" "time" "github.com/coreos/go-systemd/dbus" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" kingpin "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(".+\\.(automount|device|mount|scope|slice)").String() systemdPrivate = kingpin.Flag("collector.systemd.private", "Establish a private, direct connection to systemd without dbus.").Bool() enableTaskMetrics = kingpin.Flag("collector.systemd.enable-task-metrics", "Enables service unit tasks metrics unit_tasks_current and unit_tasks_max").Bool() enableRestartsMetrics = kingpin.Flag("collector.systemd.enable-restarts-metrics", "Enables service unit metric service_restart_total").Bool() enableStartTimeMetrics = kingpin.Flag("collector.systemd.enable-start-time-metrics", "Enables service unit metric unit_start_time_seconds").Bool() ) type systemdCollector struct { unitDesc *prometheus.Desc unitStartTimeDesc *prometheus.Desc unitTasksCurrentDesc *prometheus.Desc unitTasksMaxDesc *prometheus.Desc systemRunningDesc *prometheus.Desc summaryDesc *prometheus.Desc nRestartsDesc *prometheus.Desc timerLastTriggerDesc *prometheus.Desc socketAcceptedConnectionsDesc *prometheus.Desc socketCurrentConnectionsDesc *prometheus.Desc socketRefusedConnectionsDesc *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", "type"}, nil, ) unitStartTimeDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "unit_start_time_seconds"), "Start time of the unit since unix epoch in seconds.", []string{"name"}, nil, ) unitTasksCurrentDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "unit_tasks_current"), "Current number of tasks per Systemd unit", []string{"name"}, nil, ) unitTasksMaxDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "unit_tasks_max"), "Maximum number of tasks per Systemd unit", []string{"name"}, nil, ) systemRunningDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "system_running"), "Whether the system is operational (see 'systemctl is-system-running')", nil, nil, ) summaryDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "units"), "Summary of systemd unit states", []string{"state"}, nil) nRestartsDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "service_restart_total"), "Service unit count of Restart triggers", []string{"state"}, nil) timerLastTriggerDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "timer_last_trigger_seconds"), "Seconds since epoch of last trigger.", []string{"name"}, nil) socketAcceptedConnectionsDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "socket_accepted_connections_total"), "Total number of accepted socket connections", []string{"name"}, nil) socketCurrentConnectionsDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "socket_current_connections"), "Current number of socket connections", []string{"name"}, nil) socketRefusedConnectionsDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "socket_refused_connections_total"), "Total number of refused socket connections", []string{"name"}, nil) unitWhitelistPattern := regexp.MustCompile(fmt.Sprintf("^(?:%s)$", *unitWhitelist)) unitBlacklistPattern := regexp.MustCompile(fmt.Sprintf("^(?:%s)$", *unitBlacklist)) return &systemdCollector{ unitDesc: unitDesc, unitStartTimeDesc: unitStartTimeDesc, unitTasksCurrentDesc: unitTasksCurrentDesc, unitTasksMaxDesc: unitTasksMaxDesc, systemRunningDesc: systemRunningDesc, summaryDesc: summaryDesc, nRestartsDesc: nRestartsDesc, timerLastTriggerDesc: timerLastTriggerDesc, socketAcceptedConnectionsDesc: socketAcceptedConnectionsDesc, socketCurrentConnectionsDesc: socketCurrentConnectionsDesc, socketRefusedConnectionsDesc: socketRefusedConnectionsDesc, unitWhitelistPattern: unitWhitelistPattern, unitBlacklistPattern: unitBlacklistPattern, }, nil } // Update gathers metrics from systemd. Dbus collection is done in parallel // to reduce wait time for responses. func (c *systemdCollector) Update(ch chan<- prometheus.Metric) error { begin := time.Now() conn, err := c.newDbus() if err != nil { return fmt.Errorf("couldn't get dbus connection: %s", err) } defer conn.Close() allUnits, err := c.getAllUnits(conn) if err != nil { return fmt.Errorf("couldn't get units: %s", err) } log.Debugf("systemd getAllUnits took %f", time.Since(begin).Seconds()) begin = time.Now() summary := summarizeUnits(allUnits) c.collectSummaryMetrics(ch, summary) log.Debugf("systemd collectSummaryMetrics took %f", time.Since(begin).Seconds()) begin = time.Now() units := filterUnits(allUnits, c.unitWhitelistPattern, c.unitBlacklistPattern) log.Debugf("systemd filterUnits took %f", time.Since(begin).Seconds()) var wg sync.WaitGroup defer wg.Wait() wg.Add(1) go func() { defer wg.Done() begin = time.Now() c.collectUnitStatusMetrics(conn, ch, units) log.Debugf("systemd collectUnitStatusMetrics took %f", time.Since(begin).Seconds()) }() if *enableStartTimeMetrics { wg.Add(1) go func() { defer wg.Done() begin = time.Now() c.collectUnitStartTimeMetrics(conn, ch, units) log.Debugf("systemd collectUnitStartTimeMetrics took %f", time.Since(begin).Seconds()) }() } if *enableTaskMetrics { wg.Add(1) go func() { defer wg.Done() begin = time.Now() c.collectUnitTasksMetrics(conn, ch, units) log.Debugf("systemd collectUnitTasksMetrics took %f", time.Since(begin).Seconds()) }() } wg.Add(1) go func() { defer wg.Done() begin = time.Now() c.collectTimers(conn, ch, units) log.Debugf("systemd collectTimers took %f", time.Since(begin).Seconds()) }() wg.Add(1) go func() { defer wg.Done() begin = time.Now() c.collectSockets(conn, ch, units) log.Debugf("systemd collectSockets took %f", time.Since(begin).Seconds()) }() begin = time.Now() err = c.collectSystemState(conn, ch) log.Debugf("systemd collectSystemState took %f", time.Since(begin).Seconds()) return err } func (c *systemdCollector) collectUnitStatusMetrics(conn *dbus.Conn, ch chan<- prometheus.Metric, units []unit) { for _, unit := range units { serviceType := "" if strings.HasSuffix(unit.Name, ".service") { serviceTypeProperty, err := conn.GetUnitTypeProperty(unit.Name, "Service", "Type") if err != nil { log.Debugf("couldn't get unit '%s' Type: %s", unit.Name, err) } else { serviceType = serviceTypeProperty.Value.Value().(string) } } else if strings.HasSuffix(unit.Name, ".mount") { serviceTypeProperty, err := conn.GetUnitTypeProperty(unit.Name, "Mount", "Type") if err != nil { log.Debugf("couldn't get unit '%s' Type: %s", unit.Name, err) } else { serviceType = serviceTypeProperty.Value.Value().(string) } } 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, serviceType) } if *enableRestartsMetrics && strings.HasSuffix(unit.Name, ".service") { // NRestarts wasn't added until systemd 235. restartsCount, err := conn.GetUnitTypeProperty(unit.Name, "Service", "NRestarts") if err != nil { log.Debugf("couldn't get unit '%s' NRestarts: %s", unit.Name, err) } else { ch <- prometheus.MustNewConstMetric( c.nRestartsDesc, prometheus.CounterValue, float64(restartsCount.Value.Value().(uint32)), unit.Name) } } } } func (c *systemdCollector) collectSockets(conn *dbus.Conn, ch chan<- prometheus.Metric, units []unit) { for _, unit := range units { if !strings.HasSuffix(unit.Name, ".socket") { continue } acceptedConnectionCount, err := conn.GetUnitTypeProperty(unit.Name, "Socket", "NAccepted") if err != nil { log.Debugf("couldn't get unit '%s' NAccepted: %s", unit.Name, err) continue } ch <- prometheus.MustNewConstMetric( c.socketAcceptedConnectionsDesc, prometheus.CounterValue, float64(acceptedConnectionCount.Value.Value().(uint32)), unit.Name) currentConnectionCount, err := conn.GetUnitTypeProperty(unit.Name, "Socket", "NConnections") if err != nil { log.Debugf("couldn't get unit '%s' NConnections: %s", unit.Name, err) continue } ch <- prometheus.MustNewConstMetric( c.socketCurrentConnectionsDesc, prometheus.GaugeValue, float64(currentConnectionCount.Value.Value().(uint32)), unit.Name) // NRefused wasn't added until systemd 239. refusedConnectionCount, err := conn.GetUnitTypeProperty(unit.Name, "Socket", "NRefused") if err != nil { //log.Debugf("couldn't get unit '%s' NRefused: %s", unit.Name, err) } else { ch <- prometheus.MustNewConstMetric( c.socketRefusedConnectionsDesc, prometheus.GaugeValue, float64(refusedConnectionCount.Value.Value().(uint32)), unit.Name) } } } func (c *systemdCollector) collectUnitStartTimeMetrics(conn *dbus.Conn, ch chan<- prometheus.Metric, units []unit) { var startTimeUsec uint64 for _, unit := range units { if unit.ActiveState != "active" { startTimeUsec = 0 } else { timestampValue, err := conn.GetUnitProperty(unit.Name, "ActiveEnterTimestamp") if err != nil { log.Debugf("couldn't get unit '%s' StartTimeUsec: %s", unit.Name, err) continue } startTimeUsec = timestampValue.Value.Value().(uint64) } ch <- prometheus.MustNewConstMetric( c.unitStartTimeDesc, prometheus.GaugeValue, float64(startTimeUsec)/1e6, unit.Name) } } func (c *systemdCollector) collectUnitTasksMetrics(conn *dbus.Conn, ch chan<- prometheus.Metric, units []unit) { var val uint64 for _, unit := range units { if strings.HasSuffix(unit.Name, ".service") { tasksCurrentCount, err := conn.GetUnitTypeProperty(unit.Name, "Service", "TasksCurrent") if err != nil { log.Debugf("couldn't get unit '%s' TasksCurrent: %s", unit.Name, err) } else { val = tasksCurrentCount.Value.Value().(uint64) // Don't set if tasksCurrent if dbus reports MaxUint64. if val != math.MaxUint64 { ch <- prometheus.MustNewConstMetric( c.unitTasksCurrentDesc, prometheus.GaugeValue, float64(val), unit.Name) } } tasksMaxCount, err := conn.GetUnitTypeProperty(unit.Name, "Service", "TasksMax") if err != nil { log.Debugf("couldn't get unit '%s' TasksMax: %s", unit.Name, err) } else { val = tasksMaxCount.Value.Value().(uint64) // Don't set if tasksMax if dbus reports MaxUint64. if val != math.MaxUint64 { ch <- prometheus.MustNewConstMetric( c.unitTasksMaxDesc, prometheus.GaugeValue, float64(val), unit.Name) } } } } } func (c *systemdCollector) collectTimers(conn *dbus.Conn, ch chan<- prometheus.Metric, units []unit) { for _, unit := range units { if !strings.HasSuffix(unit.Name, ".timer") { continue } lastTriggerValue, err := conn.GetUnitTypeProperty(unit.Name, "Timer", "LastTriggerUSec") if err != nil { log.Debugf("couldn't get unit '%s' LastTriggerUSec: %s", unit.Name, err) continue } ch <- prometheus.MustNewConstMetric( c.timerLastTriggerDesc, prometheus.GaugeValue, float64(lastTriggerValue.Value.Value().(uint64))/1e6, unit.Name) } } func (c *systemdCollector) collectSummaryMetrics(ch chan<- prometheus.Metric, summary map[string]float64) { for stateName, count := range summary { ch <- prometheus.MustNewConstMetric( c.summaryDesc, prometheus.GaugeValue, count, stateName) } } func (c *systemdCollector) collectSystemState(conn *dbus.Conn, ch chan<- prometheus.Metric) error { systemState, err := conn.GetManagerProperty("SystemState") if err != nil { return fmt.Errorf("couldn't get system state: %s", err) } isSystemRunning := 0.0 if systemState == `"running"` { isSystemRunning = 1.0 } ch <- prometheus.MustNewConstMetric(c.systemRunningDesc, prometheus.GaugeValue, isSystemRunning) return nil } func (c *systemdCollector) newDbus() (*dbus.Conn, error) { if *systemdPrivate { return dbus.NewSystemdConnection() } return dbus.New() } type unit struct { dbus.UnitStatus } func (c *systemdCollector) getAllUnits(conn *dbus.Conn) ([]unit, error) { allUnits, err := conn.ListUnits() if err != nil { return nil, err } result := make([]unit, 0, len(allUnits)) for _, status := range allUnits { unit := unit{ UnitStatus: status, } result = append(result, unit) } return result, nil } func summarizeUnits(units []unit) map[string]float64 { summarized := make(map[string]float64) for _, unitStateName := range unitStatesName { summarized[unitStateName] = 0.0 } for _, unit := range units { summarized[unit.ActiveState] += 1.0 } return summarized } func filterUnits(units []unit, whitelistPattern, blacklistPattern *regexp.Regexp) []unit { filtered := make([]unit, 0, len(units)) for _, unit := range units { if whitelistPattern.MatchString(unit.Name) && !blacklistPattern.MatchString(unit.Name) && unit.LoadState == "loaded" { log.Debugf("Adding unit: %s", unit.Name) filtered = append(filtered, unit) } else { log.Debugf("Ignoring unit: %s", unit.Name) } } return filtered } prometheus-node-exporter-0.18.1+ds/collector/systemd_linux_test.go000066400000000000000000000070531350016654700254660ustar00rootroot00000000000000// 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" ) // Creates mock UnitLists func getUnitListFixtures() [][]unit { fixture1 := []unit{ { UnitStatus: dbus.UnitStatus{ Name: "foo", Description: "foo desc", LoadState: "loaded", ActiveState: "active", SubState: "running", Followed: "", Path: "/org/freedesktop/systemd1/unit/foo", JobId: 0, JobType: "", JobPath: "/", }, }, { UnitStatus: dbus.UnitStatus{ Name: "bar", Description: "bar desc", LoadState: "not-found", ActiveState: "inactive", SubState: "dead", Followed: "", Path: "/org/freedesktop/systemd1/unit/bar", JobId: 0, JobType: "", JobPath: "/", }, }, { UnitStatus: dbus.UnitStatus{ Name: "foobar", Description: "bar desc", LoadState: "not-found", ActiveState: "inactive", SubState: "dead", Followed: "", Path: "/org/freedesktop/systemd1/unit/bar", JobId: 0, JobType: "", JobPath: "/", }, }, { UnitStatus: dbus.UnitStatus{ Name: "baz", Description: "bar desc", LoadState: "not-found", ActiveState: "inactive", SubState: "dead", Followed: "", Path: "/org/freedesktop/systemd1/unit/bar", JobId: 0, JobType: "", JobPath: "/", }, }, } fixture2 := []unit{} return [][]unit{fixture1, fixture2} } 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) // Adjust fixtures by 3 "not-found" units. if len(filtered) != len(fixtures[0])-3 { t.Error("Default filters removed units") } } func TestSystemdSummary(t *testing.T) { fixtures := getUnitListFixtures() summary := summarizeUnits(fixtures[0]) for _, state := range unitStatesName { if state == "inactive" { testSummaryHelper(t, state, summary[state], 3.0) } else if state == "active" { testSummaryHelper(t, state, summary[state], 1.0) } else { testSummaryHelper(t, state, summary[state], 0.0) } } } func testSummaryHelper(t *testing.T, state string, actual float64, expected float64) { if actual != expected { t.Errorf("Summary mode didn't count %s jobs correctly. Actual: %f, expected: %f", state, actual, expected) } } prometheus-node-exporter-0.18.1+ds/collector/tcpstat_linux.go000066400000000000000000000067451350016654700244300ustar00rootroot00000000000000// 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 len(parts) < 4 { return nil, fmt.Errorf("invalid TCP stats line: %q", scanner.Text()) } 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.18.1+ds/collector/tcpstat_linux_test.go000066400000000000000000000027531350016654700254620ustar00rootroot00000000000000// 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" "strings" "testing" ) func Test_parseTCPStatsError(t *testing.T) { tests := []struct { name string in string }{ { name: "too few fields", in: "hello world", }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { if _, err := parseTCPStats(strings.NewReader(tt.in)); err == nil { t.Fatal("expected an error, but none occurred") } }) } } 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.18.1+ds/collector/textfile.go000066400000000000000000000154771350016654700233550ustar00rootroot00000000000000// 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/prometheus/client_golang/prometheus" dto "github.com/prometheus/client_model/go" "github.com/prometheus/common/expfmt" "github.com/prometheus/common/log" kingpin "gopkg.in/alecthomas/kingpin.v2" ) var ( textFileDirectory = kingpin.Flag("collector.textfile.directory", "Directory to read text files with metrics from.").Default("").String() mtimeDesc = prometheus.NewDesc( "node_textfile_mtime_seconds", "Unixtime mtime of textfiles successfully read.", []string{"file"}, nil, ) ) type textFileCollector struct { path string // Only set for testing to get predictable output. mtime *float64 } 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, } return c, nil } func convertMetricFamily(metricFamily *dto.MetricFamily, ch chan<- prometheus.Metric) { var valType prometheus.ValueType var val float64 allLabelNames := map[string]struct{}{} for _, metric := range metricFamily.Metric { labels := metric.GetLabel() for _, label := range labels { if _, ok := allLabelNames[label.GetName()]; !ok { allLabelNames[label.GetName()] = struct{}{} } } } for _, metric := range metricFamily.Metric { if metric.TimestampMs != nil { log.Warnf("Ignoring unsupported custom timestamp on textfile collector metric %v", metric) } labels := metric.GetLabel() var names []string var values []string for _, label := range labels { names = append(names, label.GetName()) values = append(values, label.GetValue()) } for k := range allLabelNames { present := false for _, name := range names { if k == name { present = true break } } if !present { names = append(names, k) values = append(values, "") } } metricType := metricFamily.GetType() switch metricType { case dto.MetricType_COUNTER: valType = prometheus.CounterValue val = metric.Counter.GetValue() case dto.MetricType_GAUGE: valType = prometheus.GaugeValue val = metric.Gauge.GetValue() case dto.MetricType_UNTYPED: valType = prometheus.UntypedValue val = metric.Untyped.GetValue() case dto.MetricType_SUMMARY: quantiles := map[float64]float64{} for _, q := range metric.Summary.Quantile { quantiles[q.GetQuantile()] = q.GetValue() } ch <- prometheus.MustNewConstSummary( prometheus.NewDesc( *metricFamily.Name, metricFamily.GetHelp(), names, nil, ), metric.Summary.GetSampleCount(), metric.Summary.GetSampleSum(), quantiles, values..., ) case dto.MetricType_HISTOGRAM: buckets := map[float64]uint64{} for _, b := range metric.Histogram.Bucket { buckets[b.GetUpperBound()] = b.GetCumulativeCount() } ch <- prometheus.MustNewConstHistogram( prometheus.NewDesc( *metricFamily.Name, metricFamily.GetHelp(), names, nil, ), metric.Histogram.GetSampleCount(), metric.Histogram.GetSampleSum(), buckets, values..., ) default: panic("unknown metric type") } if metricType == dto.MetricType_GAUGE || metricType == dto.MetricType_COUNTER || metricType == dto.MetricType_UNTYPED { ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( *metricFamily.Name, metricFamily.GetHelp(), names, nil, ), valType, val, values..., ) } } } func (c *textFileCollector) exportMTimes(mtimes map[string]time.Time, ch chan<- prometheus.Metric) { // Export the mtimes of the successful files. if len(mtimes) > 0 { // 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 { mtime := float64(mtimes[filename].UnixNano() / 1e9) if c.mtime != nil { mtime = *c.mtime } ch <- prometheus.MustNewConstMetric(mtimeDesc, prometheus.GaugeValue, mtime, filename) } } } // Update implements the Collector interface. func (c *textFileCollector) Update(ch chan<- prometheus.Metric) error { error := 0.0 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 %q: %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 %q: %v", path, err) error = 1.0 continue } defer file.Close() var parser expfmt.TextParser parsedFamilies, err := parser.TextToMetricFamilies(file) if err != nil { log.Errorf("Error parsing %q: %v", path, err) error = 1.0 continue } if hasTimestamps(parsedFamilies) { log.Errorf("Textfile %q contains unsupported client-side timestamps, skipping entire file", path) error = 1.0 continue } for _, mf := range parsedFamilies { if mf.Help == nil { help := fmt.Sprintf("Metric read from %s", path) mf.Help = &help } } // Only set this once it has been parsed and validated, so that // a failure does not appear fresh. stat, err := file.Stat() if err != nil { log.Errorf("Error stat'ing %q: %v", path, err) error = 1.0 continue } mtimes[f.Name()] = stat.ModTime() for _, mf := range parsedFamilies { convertMetricFamily(mf, ch) } } c.exportMTimes(mtimes, ch) // Export if there were errors. ch <- prometheus.MustNewConstMetric( prometheus.NewDesc( "node_textfile_scrape_error", "1 if there was an error opening or reading a file, 0 otherwise", nil, nil, ), prometheus.GaugeValue, error, ) return nil } // hasTimestamps returns true when metrics contain unsupported timestamps. func hasTimestamps(parsedFamilies map[string]*dto.MetricFamily) bool { for _, mf := range parsedFamilies { for _, m := range mf.Metric { if m.TimestampMs != nil { return true } } } return false } prometheus-node-exporter-0.18.1+ds/collector/textfile_test.go000066400000000000000000000067261350016654700244110ustar00rootroot00000000000000// 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" "testing" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/common/log" kingpin "gopkg.in/alecthomas/kingpin.v2" ) type collectorAdapter struct { Collector } // Describe implements the prometheus.Collector interface. func (a collectorAdapter) Describe(ch chan<- *prometheus.Desc) { // We have to send *some* metric in Describe, but we don't know which ones // we're going to get, so just send a dummy metric. ch <- prometheus.NewDesc("dummy_metric", "Dummy metric.", nil, nil) } // Collect implements the prometheus.Collector interface. func (a collectorAdapter) Collect(ch chan<- prometheus.Metric) { err := a.Update(ch) if err != nil { panic(fmt.Sprintf("failed to update collector: %v", err)) } } func TestTextfileCollector(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", }, { path: "fixtures/textfile/client_side_timestamp", out: "fixtures/textfile/client_side_timestamp.out", }, { path: "fixtures/textfile/different_metric_types", out: "fixtures/textfile/different_metric_types.out", }, { path: "fixtures/textfile/inconsistent_metrics", out: "fixtures/textfile/inconsistent_metrics.out", }, { path: "fixtures/textfile/histogram", out: "fixtures/textfile/histogram.out", }, { path: "fixtures/textfile/histogram_extra_dimension", out: "fixtures/textfile/histogram_extra_dimension.out", }, { path: "fixtures/textfile/summary", out: "fixtures/textfile/summary.out", }, { path: "fixtures/textfile/summary_extra_dimension", out: "fixtures/textfile/summary_extra_dimension.out", }, } for i, test := range tests { mtime := 1.0 c := &textFileCollector{ path: test.path, mtime: &mtime, } // 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) } registry := prometheus.NewRegistry() registry.MustRegister(collectorAdapter{c}) rw := httptest.NewRecorder() promhttp.HandlerFor(registry, promhttp.HandlerOpts{}).ServeHTTP(rw, &http.Request{}) got := string(rw.Body.String()) 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.%q want:\n\n%s\n\ngot:\n\n%s", i, test.path, string(want), got) } } } prometheus-node-exporter-0.18.1+ds/collector/time.go000066400000000000000000000026071350016654700224560ustar00rootroot00000000000000// 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_seconds", "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.18.1+ds/collector/timex.go000066400000000000000000000145331350016654700226470ustar00rootroot00000000000000// 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 import ( "fmt" "syscall" "github.com/prometheus/client_golang/prometheus" ) const ( // The system clock is not synchronized to a reliable // server (TIME_ERROR). timeError = 5 // The timex.Status time resolution bit (STA_NANO), // 0 = microsecond, 1 = nanoseconds. staNano = 0x2000 // 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_ratio"), "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_hertz"), "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_hertz"), "Pulse per second stability, average of recent frequency changes.", nil, nil, ), prometheus.GaugeValue}, jitcnt: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "pps_jitter_total"), "Pulse per second count of jitter limit exceeded events.", nil, nil, ), prometheus.CounterValue}, calcnt: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "pps_calibration_total"), "Pulse per second count of calibration intervals.", nil, nil, ), prometheus.CounterValue}, errcnt: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "pps_error_total"), "Pulse per second count of calibration errors.", nil, nil, ), prometheus.CounterValue}, stbcnt: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "pps_stability_exceeded_total"), "Pulse per second count of stability limit exceeded events.", nil, nil, ), prometheus.CounterValue}, tai: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "tai_offset_seconds"), "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 } // See NOTES in adjtimex(2). const ppm16frac = 1000000.0 * 65536.0 ch <- c.syncStatus.mustNewConstMetric(syncStatus) ch <- c.offset.mustNewConstMetric(float64(timex.Offset) / divisor) ch <- c.freq.mustNewConstMetric(1 + float64(timex.Freq)/ppm16frac) 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) / ppm16frac) ch <- c.jitter.mustNewConstMetric(float64(timex.Jitter) / divisor) ch <- c.shift.mustNewConstMetric(float64(timex.Shift)) ch <- c.stabil.mustNewConstMetric(float64(timex.Stabil) / ppm16frac) 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.18.1+ds/collector/uname.go000066400000000000000000000032231350016654700226200ustar00rootroot00000000000000// Copyright 2019 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 linux // +build !nouname package collector import ( "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{} type uname struct { SysName string Release string Version string Machine string NodeName string DomainName string } 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 { uname, err := getUname() if err != nil { return err } ch <- prometheus.MustNewConstMetric(unameDesc, prometheus.GaugeValue, 1, uname.SysName, uname.Release, uname.Version, uname.Machine, uname.NodeName, uname.DomainName, ) return nil } prometheus-node-exporter-0.18.1+ds/collector/uname_freebsd.go000066400000000000000000000034201350016654700243110ustar00rootroot00000000000000// Copyright 2019 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 ( "bytes" "strings" "golang.org/x/sys/unix" ) func getUname() (uname, error) { var utsname unix.Utsname if err := unix.Uname(&utsname); err != nil { return uname{}, err } // We do a little bit of work here to emulate what happens in the Linux // uname calls since FreeBSD uname doesn't have a Domainname. nodename := string(utsname.Nodename[:bytes.IndexByte(utsname.Nodename[:], 0)]) split := strings.SplitN(nodename, ".", 2) // We'll always have at least a single element in the array. We assume this // is the hostname. hostname := split[0] // If we have more than one element, we assume this is the domainname. // Otherwise leave it to "(none)" like Linux. domainname := "(none)" if len(split) > 1 { domainname = split[1] } output := uname{ SysName: string(utsname.Sysname[:bytes.IndexByte(utsname.Sysname[:], 0)]), Release: string(utsname.Release[:bytes.IndexByte(utsname.Release[:], 0)]), Version: string(utsname.Version[:bytes.IndexByte(utsname.Version[:], 0)]), Machine: string(utsname.Machine[:bytes.IndexByte(utsname.Machine[:], 0)]), NodeName: hostname, DomainName: domainname, } return output, nil } prometheus-node-exporter-0.18.1+ds/collector/uname_linux.go000066400000000000000000000024761350016654700240500ustar00rootroot00000000000000// 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 ( "bytes" "golang.org/x/sys/unix" ) func getUname() (uname, error) { var utsname unix.Utsname if err := unix.Uname(&utsname); err != nil { return uname{}, err } output := uname{ SysName: string(utsname.Sysname[:bytes.IndexByte(utsname.Sysname[:], 0)]), Release: string(utsname.Release[:bytes.IndexByte(utsname.Release[:], 0)]), Version: string(utsname.Version[:bytes.IndexByte(utsname.Version[:], 0)]), Machine: string(utsname.Machine[:bytes.IndexByte(utsname.Machine[:], 0)]), NodeName: string(utsname.Nodename[:bytes.IndexByte(utsname.Nodename[:], 0)]), DomainName: string(utsname.Domainname[:bytes.IndexByte(utsname.Domainname[:], 0)]), } return output, nil } prometheus-node-exporter-0.18.1+ds/collector/vmstat_linux.go000066400000000000000000000040071350016654700242510ustar00rootroot00000000000000// 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" "regexp" "strconv" "strings" "github.com/prometheus/client_golang/prometheus" "gopkg.in/alecthomas/kingpin.v2" ) const ( vmStatSubsystem = "vmstat" ) var ( vmStatFields = kingpin.Flag("collector.vmstat.fields", "Regexp of fields to return for vmstat collector.").Default("^(oom_kill|pgpg|pswp|pg.*fault).*").String() ) type vmStatCollector struct { fieldPattern *regexp.Regexp } func init() { registerCollector("vmstat", defaultEnabled, NewvmStatCollector) } // NewvmStatCollector returns a new Collector exposing vmstat stats. func NewvmStatCollector() (Collector, error) { pattern := regexp.MustCompile(*vmStatFields) return &vmStatCollector{ fieldPattern: pattern, }, 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 } if !c.fieldPattern.MatchString(parts[0]) { continue } 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.18.1+ds/collector/wifi_linux.go000066400000000000000000000250511350016654700236730ustar00rootroot00000000000000// 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 stationReceiveBytesTotal *prometheus.Desc stationTransmitBytesTotal *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", defaultDisabled, 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", "mac_address"} ) return &wifiCollector{ interfaceFrequencyHertz: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "interface_frequency_hertz"), "The current frequency a WiFi interface is operating at, in hertz.", []string{"device"}, 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, ), stationReceiveBytesTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "station_receive_bytes_total"), "The total number of bytes received by a WiFi station.", labels, nil, ), stationTransmitBytesTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "station_transmit_bytes_total"), "The total number of bytes transmitted by a WiFi station.", 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) } stations, err := stat.StationInfo(ifi) switch { case err == nil: for _, station := range stations { c.updateStationStats(ch, ifi.Name, station) } 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, info.HardwareAddr.String(), ) ch <- prometheus.MustNewConstMetric( c.stationInactiveSeconds, prometheus.GaugeValue, info.Inactive.Seconds(), device, info.HardwareAddr.String(), ) ch <- prometheus.MustNewConstMetric( c.stationReceiveBitsPerSecond, prometheus.GaugeValue, float64(info.ReceiveBitrate), device, info.HardwareAddr.String(), ) ch <- prometheus.MustNewConstMetric( c.stationTransmitBitsPerSecond, prometheus.GaugeValue, float64(info.TransmitBitrate), device, info.HardwareAddr.String(), ) ch <- prometheus.MustNewConstMetric( c.stationReceiveBytesTotal, prometheus.CounterValue, float64(info.ReceivedBytes), device, info.HardwareAddr.String(), ) ch <- prometheus.MustNewConstMetric( c.stationTransmitBytesTotal, prometheus.CounterValue, float64(info.TransmittedBytes), device, info.HardwareAddr.String(), ) ch <- prometheus.MustNewConstMetric( c.stationSignalDBM, prometheus.GaugeValue, float64(info.Signal), device, info.HardwareAddr.String(), ) ch <- prometheus.MustNewConstMetric( c.stationTransmitRetriesTotal, prometheus.CounterValue, float64(info.TransmitRetries), device, info.HardwareAddr.String(), ) ch <- prometheus.MustNewConstMetric( c.stationTransmitFailedTotal, prometheus.CounterValue, float64(info.TransmitFailed), device, info.HardwareAddr.String(), ) ch <- prometheus.MustNewConstMetric( c.stationBeaconLossTotal, prometheus.CounterValue, float64(info.BeaconLoss), device, info.HardwareAddr.String(), ) } 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 stations []*wifi.StationInfo if err := s.unmarshalJSONFile(p, &stations); err != nil { return nil, err } return stations, nil } prometheus-node-exporter-0.18.1+ds/collector/xfs_linux.go000066400000000000000000000131501350016654700235320ustar00rootroot00000000000000// 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/xfs" ) // An xfsCollector is a Collector which gathers metrics from XFS filesystems. type xfsCollector struct { fs xfs.FS } func init() { registerCollector("xfs", defaultEnabled, NewXFSCollector) } // NewXFSCollector returns a new Collector exposing XFS statistics. func NewXFSCollector() (Collector, error) { fs, err := xfs.NewFS(*procPath, *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.SysStats() 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.18.1+ds/collector/zfs.go000066400000000000000000000057761350016654700223340ustar00rootroot00000000000000// 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_abd": "abdstats", "zfs_arc": "arcstats", "zfs_dbuf": "dbuf_stats", "zfs_dmu_tx": "dmu_tx", "zfs_dnode": "dnodestats", "zfs_fm": "fm", "zfs_vdev_cache": "vdev_cache_stats", // vdev_cache is deprecated "zfs_vdev_mirror": "vdev_mirror_stats", "zfs_xuio": "xuio_stats", // no known consumers of the XUIO interface on Linux exist "zfs_zfetch": "zfetchstats", "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) // ZFS /proc files are added as new features to ZFS arrive, it is ok to continue continue } 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 uint64) 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 uint64) 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.18.1+ds/collector/zfs_linux.go000066400000000000000000000113261350016654700235370ustar00rootroot00000000000000// 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" ) // constants from https://github.com/zfsonlinux/zfs/blob/master/lib/libspl/include/sys/kstat.h // kept as strings for comparison thus avoiding conversion to int const ( // kstatDataChar = "0" // kstatDataInt32 = "1" // kstatDataUint32 = "2" // kstatDataInt64 = "3" kstatDataUint64 = "4" // kstatDataLong = "5" // kstatDataUlong = "6" // kstatDataString = "7" ) func (c *zfsCollector) openProcFile(path string) (*os.File, error) { file, err := os.Open(procFilePath(path)) if err != nil { // file not found error can occur if: // 1. zfs module is not loaded // 2. zfs version does not have the feature with metrics -- ok to ignore log.Debugf("Cannot open %q for reading", 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 uint64) { 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 { // this file should exist, but there is a race where an exporting pool can remove the files -- ok to ignore log.Debugf("Cannot open %q for reading", zpoolPath) return errZFSNotAvailable } err = c.parsePoolProcfsFile(file, zpoolPath, func(poolName string, s zfsSysctl, v uint64) { 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, uint64)) 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 } // kstat data type (column 2) should be KSTAT_DATA_UINT64, otherwise ignore // TODO: when other KSTAT_DATA_* types arrive, much of this will need to be restructured if parts[1] == kstatDataUint64 { key := fmt.Sprintf("kstat.zfs.misc.%s.%s", fmtExt, parts[0]) value, err := strconv.ParseUint(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, uint64)) 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.ParseUint(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.18.1+ds/collector/zfs_linux_test.go000066400000000000000000000214201350016654700245720ustar00rootroot00000000000000// 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 uint64) { if s != zfsSysctl("kstat.zfs.misc.arcstats.hits") { return } handlerCalled = true if v != uint64(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 uint64) { if s != zfsSysctl("kstat.zfs.misc.zfetchstats.hits") { return } handlerCalled = true if v != uint64(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 uint64) { if s != zfsSysctl("kstat.zfs.misc.zil.zil_commit_count") { return } handlerCalled = true if v != uint64(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 uint64) { if s != zfsSysctl("kstat.zfs.misc.vdev_cache_stats.delegations") { return } handlerCalled = true if v != uint64(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 uint64) { if s != zfsSysctl("kstat.zfs.misc.xuio_stats.onloan_read_buf") { return } handlerCalled = true if v != uint64(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 uint64) { if s != zfsSysctl("kstat.zfs.misc.fm.erpt-dropped") { return } handlerCalled = true if v != uint64(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 uint64) { if s != zfsSysctl("kstat.zfs.misc.dmu_tx.dmu_tx_assigned") { return } handlerCalled = true if v != uint64(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 uint64) { if s != zfsSysctl("kstat.zfs.misc.io.nread") { return } handlerCalled = true if v != uint64(1884160) && v != uint64(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") } } func TestAbdstatsParsing(t *testing.T) { abdstatsFile, err := os.Open("fixtures/proc/spl/kstat/zfs/abdstats") if err != nil { t.Fatal(err) } defer abdstatsFile.Close() c := zfsCollector{} if err != nil { t.Fatal(err) } handlerCalled := false err = c.parseProcfsFile(abdstatsFile, "abdstats", func(s zfsSysctl, v uint64) { if s != zfsSysctl("kstat.zfs.misc.abdstats.linear_data_size") { return } handlerCalled = true if v != uint64(223232) { t.Fatalf("Incorrect value parsed from procfs abdstats data") } }) if err != nil { t.Fatal(err) } if !handlerCalled { t.Fatal("ABDStats parsing handler was not called for some expected sysctls") } } func TestDbufstatsParsing(t *testing.T) { dbufstatsFile, err := os.Open("fixtures/proc/spl/kstat/zfs/dbuf_stats") if err != nil { t.Fatal(err) } defer dbufstatsFile.Close() c := zfsCollector{} if err != nil { t.Fatal(err) } handlerCalled := false err = c.parseProcfsFile(dbufstatsFile, "dbufstats", func(s zfsSysctl, v uint64) { if s != zfsSysctl("kstat.zfs.misc.dbufstats.hash_hits") { return } handlerCalled = true if v != uint64(108807) { t.Fatalf("Incorrect value parsed from procfs dbufstats data") } }) if err != nil { t.Fatal(err) } if !handlerCalled { t.Fatal("DbufStats parsing handler was not called for some expected sysctls") } } func TestDnodestatsParsing(t *testing.T) { dnodestatsFile, err := os.Open("fixtures/proc/spl/kstat/zfs/dnodestats") if err != nil { t.Fatal(err) } defer dnodestatsFile.Close() c := zfsCollector{} if err != nil { t.Fatal(err) } handlerCalled := false err = c.parseProcfsFile(dnodestatsFile, "dnodestats", func(s zfsSysctl, v uint64) { if s != zfsSysctl("kstat.zfs.misc.dnodestats.dnode_hold_alloc_hits") { return } handlerCalled = true if v != uint64(37617) { t.Fatalf("Incorrect value parsed from procfs dnodestats data") } }) if err != nil { t.Fatal(err) } if !handlerCalled { t.Fatal("Dnodestats parsing handler was not called for some expected sysctls") } } func TestVdevMirrorstatsParsing(t *testing.T) { vdevMirrorStatsFile, err := os.Open("fixtures/proc/spl/kstat/zfs/vdev_mirror_stats") if err != nil { t.Fatal(err) } defer vdevMirrorStatsFile.Close() c := zfsCollector{} if err != nil { t.Fatal(err) } handlerCalled := false err = c.parseProcfsFile(vdevMirrorStatsFile, "vdev_mirror_stats", func(s zfsSysctl, v uint64) { if s != zfsSysctl("kstat.zfs.misc.vdev_mirror_stats.preferred_not_found") { return } handlerCalled = true if v != uint64(94) { t.Fatalf("Incorrect value parsed from procfs vdev_mirror_stats data") } }) if err != nil { t.Fatal(err) } if !handlerCalled { t.Fatal("VdevMirrorStats parsing handler was not called for some expected sysctls") } } prometheus-node-exporter-0.18.1+ds/collector/zfs_solaris.go000066400000000000000000000253121350016654700240540ustar00rootroot00000000000000// Copyright 2018 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 solaris package collector import ( "strings" "github.com/prometheus/client_golang/prometheus" "github.com/siebenmann/go-kstat" ) type zfsCollector struct { abdstatsLinearCount *prometheus.Desc abdstatsLinearDataSize *prometheus.Desc abdstatsScatterChunkWaste *prometheus.Desc abdstatsScatterCount *prometheus.Desc abdstatsScatterDataSize *prometheus.Desc abdstatsStructSize *prometheus.Desc arcstatsAnonSize *prometheus.Desc arcstatsC *prometheus.Desc arcstatsCMax *prometheus.Desc arcstatsCMin *prometheus.Desc arcstatsDataSize *prometheus.Desc arcstatsDemandDataHits *prometheus.Desc arcstatsDemandDataMisses *prometheus.Desc arcstatsDemandMetadataHits *prometheus.Desc arcstatsDemandMetadataMisses *prometheus.Desc arcstatsHeaderSize *prometheus.Desc arcstatsHits *prometheus.Desc arcstatsMisses *prometheus.Desc arcstatsMFUGhostHits *prometheus.Desc arcstatsMFUGhostSize *prometheus.Desc arcstatsMFUSize *prometheus.Desc arcstatsMRUGhostHits *prometheus.Desc arcstatsMRUGhostSize *prometheus.Desc arcstatsMRUSize *prometheus.Desc arcstatsOtherSize *prometheus.Desc arcstatsP *prometheus.Desc arcstatsSize *prometheus.Desc zfetchstatsHits *prometheus.Desc zfetchstatsMisses *prometheus.Desc } const ( zfsCollectorSubsystem = "zfs" ) func init() { registerCollector("zfs", defaultEnabled, NewZfsCollector) } func NewZfsCollector() (Collector, error) { return &zfsCollector{ abdstatsLinearCount: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "abdstats_linear_count_total"), "ZFS ARC buffer data linear count", nil, nil, ), abdstatsLinearDataSize: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "abdstats_linear_data_bytes"), "ZFS ARC buffer data linear data size", nil, nil, ), abdstatsScatterChunkWaste: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "abdstats_scatter_chunk_waste_bytes"), "ZFS ARC buffer data scatter chunk waste", nil, nil, ), abdstatsScatterCount: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "abdstats_scatter_count_total"), "ZFS ARC buffer data scatter count", nil, nil, ), abdstatsScatterDataSize: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "abdstats_scatter_data_bytes"), "ZFS ARC buffer data scatter data size", nil, nil, ), abdstatsStructSize: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "abdstats_struct_bytes"), "ZFS ARC buffer data struct size", nil, nil, ), arcstatsAnonSize: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "arcstats_anon_bytes"), "ZFS ARC anon size", nil, nil, ), arcstatsC: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "arcstats_c_bytes"), "ZFS ARC target size", nil, nil, ), arcstatsCMax: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "arcstats_c_max_bytes"), "ZFS ARC maximum size", nil, nil, ), arcstatsCMin: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "arcstats_c_min_bytes"), "ZFS ARC minimum size", nil, nil, ), arcstatsDataSize: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "arcstats_data_bytes"), "ZFS ARC data size", nil, nil, ), arcstatsDemandDataHits: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "arcstats_demand_data_hits_total"), "ZFS ARC demand data hits", nil, nil, ), arcstatsDemandDataMisses: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "arcstats_demand_data_misses_total"), "ZFS ARC demand data misses", nil, nil, ), arcstatsDemandMetadataHits: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "arcstats_demand_metadata_hits_total"), "ZFS ARC demand metadata hits", nil, nil, ), arcstatsDemandMetadataMisses: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "arcstats_demand_metadata_misses_total"), "ZFS ARC demand metadata misses", nil, nil, ), arcstatsHeaderSize: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "arcstats_hdr_bytes"), "ZFS ARC header size", nil, nil, ), arcstatsHits: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "arcstats_hits_total"), "ZFS ARC hits", nil, nil, ), arcstatsMisses: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "arcstats_misses_total"), "ZFS ARC misses", nil, nil, ), arcstatsMFUGhostHits: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "arcstats_mfu_ghost_hits_total"), "ZFS ARC MFU ghost hits", nil, nil, ), arcstatsMFUGhostSize: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "arcstats_mfu_ghost_size"), "ZFS ARC MFU ghost size", nil, nil, ), arcstatsMFUSize: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "arcstats_mfu_bytes"), "ZFS ARC MFU size", nil, nil, ), arcstatsMRUGhostHits: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "arcstats_mru_ghost_hits_total"), "ZFS ARC MRU ghost hits", nil, nil, ), arcstatsMRUGhostSize: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "arcstats_mru_ghost_bytes"), "ZFS ARC MRU ghost size", nil, nil, ), arcstatsMRUSize: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "arcstats_mru_bytes"), "ZFS ARC MRU size", nil, nil, ), arcstatsOtherSize: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "arcstats_other_bytes"), "ZFS ARC other size", nil, nil, ), arcstatsP: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "arcstats_p_bytes"), "ZFS ARC MRU target size", nil, nil, ), arcstatsSize: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "arcstats_size_bytes"), "ZFS ARC size", nil, nil, ), zfetchstatsHits: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "zfetchstats_hits_total"), "ZFS cache fetch hits", nil, nil, ), zfetchstatsMisses: prometheus.NewDesc( prometheus.BuildFQName(namespace, zfsCollectorSubsystem, "zfetchstats_misses_total"), "ZFS cache fetch misses", nil, nil, ), }, nil } func (c *zfsCollector) updateZfsAbdStats(ch chan<- prometheus.Metric) error { var metricType prometheus.ValueType tok, err := kstat.Open() if err != nil { return err } defer tok.Close() ksZFSInfo, err := tok.Lookup("zfs", 0, "abdstats") if err != nil { return err } for k, v := range map[string]*prometheus.Desc{ "linear_cnt": c.abdstatsLinearCount, "linear_data_size": c.abdstatsLinearDataSize, "scatter_chunk_waste": c.abdstatsScatterChunkWaste, "scatter_cnt": c.abdstatsScatterCount, "scatter_data_size": c.abdstatsScatterDataSize, "struct_size": c.abdstatsStructSize, } { ksZFSInfoValue, err := ksZFSInfo.GetNamed(k) if err != nil { return err } if strings.HasSuffix(k, "_cnt") { metricType = prometheus.CounterValue } else { metricType = prometheus.GaugeValue } ch <- prometheus.MustNewConstMetric( v, metricType, float64(ksZFSInfoValue.UintVal), ) } return nil } func (c *zfsCollector) updateZfsArcStats(ch chan<- prometheus.Metric) error { var metricType prometheus.ValueType tok, err := kstat.Open() if err != nil { return err } defer tok.Close() ksZFSInfo, err := tok.Lookup("zfs", 0, "arcstats") if err != nil { return err } for k, v := range map[string]*prometheus.Desc{ "anon_size": c.arcstatsAnonSize, "c": c.arcstatsC, "c_max": c.arcstatsCMax, "c_min": c.arcstatsCMin, "data_size": c.arcstatsDataSize, "demand_data_hits": c.arcstatsDemandDataHits, "demand_data_misses": c.arcstatsDemandDataMisses, "demand_metadata_hits": c.arcstatsDemandMetadataHits, "demand_metadata_misses": c.arcstatsDemandMetadataMisses, "hdr_size": c.arcstatsHeaderSize, "hits": c.arcstatsHits, "misses": c.arcstatsMisses, "mfu_ghost_hits": c.arcstatsMFUGhostHits, "mfu_ghost_size": c.arcstatsMFUGhostSize, "mfu_size": c.arcstatsMFUSize, "mru_ghost_hits": c.arcstatsMRUGhostHits, "mru_ghost_size": c.arcstatsMRUGhostSize, "mru_size": c.arcstatsMRUSize, "other_size": c.arcstatsOtherSize, "p": c.arcstatsP, "size": c.arcstatsSize, } { ksZFSInfoValue, err := ksZFSInfo.GetNamed(k) if err != nil { return err } if strings.HasSuffix(k, "_hits") || strings.HasSuffix(k, "_misses") { metricType = prometheus.CounterValue } else { metricType = prometheus.GaugeValue } ch <- prometheus.MustNewConstMetric( v, metricType, float64(ksZFSInfoValue.UintVal), ) } return nil } func (c *zfsCollector) updateZfsFetchStats(ch chan<- prometheus.Metric) error { tok, err := kstat.Open() if err != nil { return err } defer tok.Close() ksZFSInfo, err := tok.Lookup("zfs", 0, "zfetchstats") for k, v := range map[string]*prometheus.Desc{ "hits": c.zfetchstatsHits, "misses": c.zfetchstatsMisses, } { ksZFSInfoValue, err := ksZFSInfo.GetNamed(k) if err != nil { return err } ch <- prometheus.MustNewConstMetric( v, prometheus.CounterValue, float64(ksZFSInfoValue.UintVal), ) } return nil } func (c *zfsCollector) Update(ch chan<- prometheus.Metric) error { if err := c.updateZfsAbdStats(ch); err != nil { return err } if err := c.updateZfsArcStats(ch); err != nil { return err } if err := c.updateZfsFetchStats(ch); err != nil { return err } return nil } prometheus-node-exporter-0.18.1+ds/docs/000077500000000000000000000000001350016654700201265ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/docs/TIME.md000066400000000000000000000067251350016654700212200ustar00rootroot00000000000000# 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_seconds - 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.18.1+ds/docs/V0_16_UPGRADE_GUIDE.md000066400000000000000000000023231350016654700233270ustar00rootroot00000000000000# Version 0.16.0 Upgrade Guide The `node_exporter` 0.16.0 and newer renamed many metrics in order to conform with Prometheus [naming best practices]. In order to allow easy upgrades, there are several options. ## Update dashboards Grafana users can add multiple queries in order to display both the old and new data simultaneously. ## Use recording rules We have provided a [sample recording rule set that translates old metrics to new ones] and the [one that translates new metrics format to old one] to create duplicate metrics (it translates "old" metrics format to new one). This has a minor disadvantage that it creates a lot of extra data, and re-aligns the timestamps of the data. ## Run both old and new versions simultaneously. It's possible to run both the old and new exporter on different ports, and include an additional scrape job in Prometheus. It's recommended to enable only the collectors that have name changes that you care about. [naming best practices]: https://prometheus.io/docs/practices/naming/ [sample recording rule set that translates old metrics to new ones]: example-16-compatibility-rules.yml [one that translates new metrics format to old one]: example-16-compatibility-rules-new-to-old.yml prometheus-node-exporter-0.18.1+ds/docs/example-16-compatibility-rules-new-to-old.yml000066400000000000000000000157611350016654700305240ustar00rootroot00000000000000groups: - name: node_exporter-16-bcache rules: - expr: node_bcache_cache_read_races record: node_bcache_cache_read_races_total - name: node_exporter-16-buddyinfo rules: - expr: node_buddyinfo_blocks record: node_buddyinfo_count - name: node_exporter-16-stat rules: - expr: node_boot_time_seconds record: node_boot_time - expr: node_context_switches_total record: node_context_switches - expr: node_forks_total record: node_forks - expr: node_intr_total record: node_intr - name: node_exporter-16-cpu rules: - expr: label_replace(node_cpu_seconds_total, "cpu", "$1", "cpu", "cpu(.+)") record: node_cpu - name: node_exporter-16-diskstats rules: - expr: node_disk_read_bytes_total record: node_disk_bytes_read - expr: node_disk_written_bytes_total record: node_disk_bytes_written - expr: node_disk_io_time_seconds_total * 1000 record: node_disk_io_time_ms - expr: node_disk_io_time_weighted_seconds_total record: node_disk_io_time_weighted - expr: node_disk_reads_completed_total record: node_disk_reads_completed - expr: node_disk_reads_merged_total record: node_disk_reads_merged - expr: node_disk_read_time_seconds_total * 1000 record: node_disk_read_time_ms - expr: node_disk_writes_completed_total record: node_disk_writes_completed - expr: node_disk_writes_merged_total record: node_disk_writes_merged - expr: node_disk_write_time_seconds_total * 1000 record: node_disk_write_time_ms - name: node_exporter-16-filesystem rules: - expr: node_filesystem_free_bytes record: node_filesystem_free - expr: node_filesystem_avail_bytes record: node_filesystem_avail - expr: node_filesystem_size_bytes record: node_filesystem_size - name: node_exporter-16-infiniband rules: - expr: node_infiniband_port_data_received_bytes_total record: node_infiniband_port_data_received_bytes - expr: node_infiniband_port_data_transmitted_bytes_total record: node_infiniband_port_data_transmitted_bytes - name: node_exporter-16-interrupts rules: - expr: node_interrupts_total record: node_interrupts - name: node_exporter-16-memory rules: - expr: node_memory_Active_bytes record: node_memory_Active - expr: node_memory_Active_anon_bytes record: node_memory_Active_anon - expr: node_memory_Active_file_bytes record: node_memory_Active_file - expr: node_memory_AnonHugePages_bytes record: node_memory_AnonHugePages - expr: node_memory_AnonPages_bytes record: node_memory_AnonPages - expr: node_memory_Bounce_bytes record: node_memory_Bounce - expr: node_memory_Buffers_bytes record: node_memory_Buffers - expr: node_memory_Cached_bytes record: node_memory_Cached - expr: node_memory_CommitLimit_bytes record: node_memory_CommitLimit - expr: node_memory_Committed_AS_bytes record: node_memory_Committed_AS - expr: node_memory_DirectMap2M_bytes record: node_memory_DirectMap2M - expr: node_memory_DirectMap4k_bytes record: node_memory_DirectMap4k - expr: node_memory_Dirty_bytes record: node_memory_Dirty - expr: node_memory_HardwareCorrupted_bytes record: node_memory_HardwareCorrupted - expr: node_memory_Hugepagesize_bytes record: node_memory_Hugepagesize - expr: node_memory_Inactive_bytes record: node_memory_Inactive - expr: node_memory_Inactive_anon_bytes record: node_memory_Inactive_anon - expr: node_memory_Inactive_file_bytes record: node_memory_Inactive_file - expr: node_memory_KernelStack_bytes record: node_memory_KernelStack - expr: node_memory_Mapped_bytes record: node_memory_Mapped - expr: node_memory_MemAvailable_bytes record: node_memory_MemAvailable - expr: node_memory_MemFree_bytes record: node_memory_MemFree - expr: node_memory_MemTotal_bytes record: node_memory_MemTotal - expr: node_memory_Mlocked_bytes record: node_memory_Mlocked - expr: node_memory_NFS_Unstable_bytes record: node_memory_NFS_Unstable - expr: node_memory_PageTables_bytes record: node_memory_PageTables - expr: node_memory_Shmem_bytes record: node_memory_Shmem - expr: node_memory_Slab_bytes record: node_memory_Slab - expr: node_memory_SReclaimable_bytes record: node_memory_SReclaimable - expr: node_memory_SUnreclaim_bytes record: node_memory_SUnreclaim - expr: node_memory_SwapCached_bytes record: node_memory_SwapCached - expr: node_memory_SwapFree_bytes record: node_memory_SwapFree - expr: node_memory_SwapTotal_bytes record: node_memory_SwapTotal - expr: node_memory_Unevictable_bytes record: node_memory_Unevictable - expr: node_memory_VmallocChunk_bytes record: node_memory_VmallocChunk - expr: node_memory_VmallocTotal_bytes record: node_memory_VmallocTotal - expr: node_memory_VmallocUsed_bytes record: node_memory_VmallocUsed - expr: node_memory_Writeback_bytes record: node_memory_Writeback - expr: node_memory_WritebackTmp_bytes record: node_memory_WritebackTmp - name: node_exporter-16-network rules: - expr: node_network_receive_bytes_total record: node_network_receive_bytes - expr: node_network_receive_compressed_total record: node_network_receive_compressed - expr: node_network_receive_drop_total record: node_network_receive_drop - expr: node_network_receive_errs_total record: node_network_receive_errs - expr: node_network_receive_fifo_total record: node_network_receive_fifo - expr: node_network_receive_frame_total record: node_network_receive_frame - expr: node_network_receive_multicast_total record: node_network_receive_multicast - expr: node_network_receive_packets_total record: node_network_receive_packets - expr: node_network_transmit_bytes_total record: node_network_transmit_bytes - expr: node_network_transmit_compressed_total record: node_network_transmit_compressed - expr: node_network_transmit_drop_total record: node_network_transmit_drop - expr: node_network_transmit_errs_total record: node_network_transmit_errs - expr: node_network_transmit_fifo_total record: node_network_transmit_fifo - expr: node_network_transmit_frame_total record: node_network_transmit_frame - expr: node_network_transmit_multicast_total record: node_network_transmit_multicast - expr: node_network_transmit_packets_total record: node_network_transmit_packets - name: node_exporter-16-nfs rules: - expr: node_nfs_connections_total record: node_nfs_net_connections - expr: node_nfs_packets_total record: node_nfs_net_reads - expr: label_replace(label_replace(node_nfs_requests_total, "proto", "$1", "version", "(.+)"), "method", "$1", "procedure", "(.+)") record: node_nfs_procedures - expr: node_nfs_rpc_authentication_refreshes_total record: node_nfs_rpc_authentication_refreshes - expr: node_nfs_rpcs_total record: node_nfs_rpc_operations - expr: node_nfs_rpc_retransmissions_total record: node_nfs_rpc_retransmissions - name: node_exporter-16-textfile rules: - expr: node_textfile_mtime_seconds record: node_textfile_mtime prometheus-node-exporter-0.18.1+ds/docs/example-16-compatibility-rules.yml000066400000000000000000000163071350016654700265360ustar00rootroot00000000000000groups: - name: node_exporter-16-bcache rules: - record: node_bcache_cache_read_races expr: node_bcache_cache_read_races_total - name: node_exporter-16-buddyinfo rules: - record: node_buddyinfo_blocks expr: node_buddyinfo_count - name: node_exporter-16-stat rules: - record: node_boot_time_seconds expr: node_boot_time - record: node_time_seconds expr: node_time - record: node_context_switches_total expr: node_context_switches - record: node_forks_total expr: node_forks - record: node_intr_total expr: node_intr - name: node_exporter-16-cpu rules: - record: node_cpu_seconds_total expr: label_replace(node_cpu, "cpu", "$1", "cpu", "cpu(.+)") - name: node_exporter-16-diskstats rules: - record: node_disk_read_bytes_total expr: node_disk_bytes_read - record: node_disk_written_bytes_total expr: node_disk_bytes_written - record: node_disk_io_time_seconds_total expr: node_disk_io_time_ms / 1000 - record: node_disk_io_time_weighted_seconds_total expr: node_disk_io_time_weighted - record: node_disk_reads_completed_total expr: node_disk_reads_completed - record: node_disk_reads_merged_total expr: node_disk_reads_merged - record: node_disk_read_time_seconds_total expr: node_disk_read_time_ms / 1000 - record: node_disk_writes_completed_total expr: node_disk_writes_completed - record: node_disk_writes_merged_total expr: node_disk_writes_merged - record: node_disk_write_time_seconds_total expr: node_disk_write_time_ms / 1000 - name: node_exporter-16-filesystem rules: - record: node_filesystem_free_bytes expr: node_filesystem_free - record: node_filesystem_avail_bytes expr: node_filesystem_avail - record: node_filesystem_size_bytes expr: node_filesystem_size - name: node_exporter-16-infiniband rules: - record: node_infiniband_port_data_received_bytes_total expr: node_infiniband_port_data_received_bytes - record: node_infiniband_port_data_transmitted_bytes_total expr: node_infiniband_port_data_transmitted_bytes - name: node_exporter-16-interrupts rules: - record: node_interrupts_total expr: node_interrupts - name: node_exporter-16-memory rules: - record: node_memory_Active_bytes expr: node_memory_Active - record: node_memory_Active_anon_bytes expr: node_memory_Active_anon - record: node_memory_Active_file_bytes expr: node_memory_Active_file - record: node_memory_AnonHugePages_bytes expr: node_memory_AnonHugePages - record: node_memory_AnonPages_bytes expr: node_memory_AnonPages - record: node_memory_Bounce_bytes expr: node_memory_Bounce - record: node_memory_Buffers_bytes expr: node_memory_Buffers - record: node_memory_Cached_bytes expr: node_memory_Cached - record: node_memory_CommitLimit_bytes expr: node_memory_CommitLimit - record: node_memory_Committed_AS_bytes expr: node_memory_Committed_AS - record: node_memory_DirectMap2M_bytes expr: node_memory_DirectMap2M - record: node_memory_DirectMap4k_bytes expr: node_memory_DirectMap4k - record: node_memory_Dirty_bytes expr: node_memory_Dirty - record: node_memory_HardwareCorrupted_bytes expr: node_memory_HardwareCorrupted - record: node_memory_Hugepagesize_bytes expr: node_memory_Hugepagesize - record: node_memory_Inactive_bytes expr: node_memory_Inactive - record: node_memory_Inactive_anon_bytes expr: node_memory_Inactive_anon - record: node_memory_Inactive_file_bytes expr: node_memory_Inactive_file - record: node_memory_KernelStack_bytes expr: node_memory_KernelStack - record: node_memory_Mapped_bytes expr: node_memory_Mapped - record: node_memory_MemAvailable_bytes expr: node_memory_MemAvailable - record: node_memory_MemFree_bytes expr: node_memory_MemFree - record: node_memory_MemTotal_bytes expr: node_memory_MemTotal - record: node_memory_Mlocked_bytes expr: node_memory_Mlocked - record: node_memory_NFS_Unstable_bytes expr: node_memory_NFS_Unstable - record: node_memory_PageTables_bytes expr: node_memory_PageTables - record: node_memory_Shmem_bytes expr: node_memory_Shmem - record: node_memory_ShmemHugePages_bytes expr: node_memory_ShmemHugePages - record: node_memory_ShmemPmdMapped_bytes expr: node_memory_ShmemPmdMapped - record: node_memory_Slab_bytes expr: node_memory_Slab - record: node_memory_SReclaimable_bytes expr: node_memory_SReclaimable - record: node_memory_SUnreclaim_bytes expr: node_memory_SUnreclaim - record: node_memory_SwapCached_bytes expr: node_memory_SwapCached - record: node_memory_SwapFree_bytes expr: node_memory_SwapFree - record: node_memory_SwapTotal_bytes expr: node_memory_SwapTotal - record: node_memory_Unevictable_bytes expr: node_memory_Unevictable - record: node_memory_VmallocChunk_bytes expr: node_memory_VmallocChunk - record: node_memory_VmallocTotal_bytes expr: node_memory_VmallocTotal - record: node_memory_VmallocUsed_bytes expr: node_memory_VmallocUsed - record: node_memory_Writeback_bytes expr: node_memory_Writeback - record: node_memory_WritebackTmp_bytes expr: node_memory_WritebackTmp - name: node_exporter-16-network rules: - record: node_network_receive_bytes_total expr: node_network_receive_bytes - record: node_network_receive_compressed_total expr: node_network_receive_compressed - record: node_network_receive_drop_total expr: node_network_receive_drop - record: node_network_receive_errs_total expr: node_network_receive_errs - record: node_network_receive_fifo_total expr: node_network_receive_fifo - record: node_network_receive_frame_total expr: node_network_receive_frame - record: node_network_receive_multicast_total expr: node_network_receive_multicast - record: node_network_receive_packets_total expr: node_network_receive_packets - record: node_network_transmit_bytes_total expr: node_network_transmit_bytes - record: node_network_transmit_compressed_total expr: node_network_transmit_compressed - record: node_network_transmit_drop_total expr: node_network_transmit_drop - record: node_network_transmit_errs_total expr: node_network_transmit_errs - record: node_network_transmit_fifo_total expr: node_network_transmit_fifo - record: node_network_transmit_frame_total expr: node_network_transmit_frame - record: node_network_transmit_multicast_total expr: node_network_transmit_multicast - record: node_network_transmit_packets_total expr: node_network_transmit_packets - name: node_exporter-16-nfs rules: - record: node_nfs_connections_total expr: node_nfs_net_connections - record: node_nfs_packets_total expr: node_nfs_net_reads - record: node_nfs_requests_total expr: label_replace(label_replace(node_nfs_procedures, "proto", "$1", "version", "(.+)"), "method", "$1", "procedure", "(.+)") - record: node_nfs_rpc_authentication_refreshes_total expr: node_nfs_rpc_authentication_refreshes - record: node_nfs_rpcs_total expr: node_nfs_rpc_operations - record: node_nfs_rpc_retransmissions_total expr: node_nfs_rpc_retransmissions - name: node_exporter-16-textfile rules: - record: node_textfile_mtime_seconds expr: node_textfile_mtime prometheus-node-exporter-0.18.1+ds/docs/example-17-compatibility-rules-new-to-old.yml000066400000000000000000000002211350016654700305060ustar00rootroot00000000000000groups: - name: node_exporter-17-supervisord rules: - record: node_supervisord_start_time_seconds expr: node_supervisord_uptime + time() prometheus-node-exporter-0.18.1+ds/docs/example-17-compatibility-rules.yml000066400000000000000000000002211350016654700265230ustar00rootroot00000000000000groups: - name: node_exporter-17-supervisord rules: - record: node_supervisord_uptime expr: time() - node_supervisord_start_time_seconds prometheus-node-exporter-0.18.1+ds/end-to-end-test.sh000077500000000000000000000056201350016654700224470ustar00rootroot00000000000000#!/usr/bin/env bash set -euf -o pipefail enabled_collectors=$(cat << COLLECTORS arp bcache buddyinfo conntrack cpu cpufreq diskstats drbd edac entropy filefd hwmon infiniband interrupts ipvs ksmd loadavg mdadm meminfo meminfo_numa mountstats netdev netstat nfs nfsd pressure qdisc sockstat stat textfile bonding vmstat wifi xfs zfs processes COLLECTORS ) disabled_collectors=$(cat << COLLECTORS filesystem time timex uname 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_seconds)" arch="$(uname -m)" case "${arch}" in aarch64|ppc64le) fixture='collector/fixtures/e2e-64k-page-output.txt' ;; *) fixture='collector/fixtures/e2e-output.txt' ;; esac 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.wifi.fixtures="collector/fixtures/wifi" \ --collector.qdisc.fixtures="collector/fixtures/qdisc/" \ --collector.netclass.ignored-devices="(bond0|dmz|int)" \ --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" "${fixture}" 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 \ "${fixture}" \ "${tmpdir}/e2e-output.txt" prometheus-node-exporter-0.18.1+ds/example-rules.yml000066400000000000000000000013211350016654700225010ustar00rootroot00000000000000groups: - name: example-node-exporter-rules rules: # The count of CPUs per node, useful for getting CPU time as a percent of total. - record: instance:node_cpus:count expr: count(node_cpu_seconds_total{mode="idle"}) without (cpu,mode) # CPU in use by CPU. - record: instance_cpu:node_cpu_seconds_not_idle:rate5m expr: sum(rate(node_cpu_seconds_total{mode!="idle"}[5m])) without (mode) # CPU in use by mode. - record: instance_mode:node_cpu_seconds:rate5m expr: sum(rate(node_cpu_seconds_total[5m])) without (cpu) # CPU in use ratio. - record: instance:node_cpu_utilization:ratio expr: sum(instance_mode:node_cpu_seconds:rate5m{mode!="idle"}) without (mode) / instance:node_cpus:count prometheus-node-exporter-0.18.1+ds/examples/000077500000000000000000000000001350016654700210145ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/examples/init.d/000077500000000000000000000000001350016654700222015ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/examples/init.d/node_exporter000077500000000000000000000017271350016654700250130ustar00rootroot00000000000000#!/bin/bash RETVAL=0 PROG="node_exporter" EXEC="/etc/node_exporter/node_exporter" LOCKFILE="/var/lock/subsys/$PROG" OPTIONS="--web.listen-address=:9100" # Source function library. if [ -f /etc/rc.d/init.d/functions ]; then . /etc/rc.d/init.d/functions else echo "/etc/rc.d/init.d/functions is not exists" exit 0 fi start() { if [ -f $LOCKFILE ] then echo "$PROG is already running!" else echo -n "Starting $PROG: " nohup $EXEC $OPTIONS >/dev/null 2>&1 & RETVAL=$? [ $RETVAL -eq 0 ] && touch $LOCKFILE && success || failure echo return $RETVAL fi } stop() { echo -n "Stopping $PROG: " killproc $EXEC RETVAL=$? [ $RETVAL -eq 0 ] && rm -r $LOCKFILE && success || failure echo } restart () { stop sleep 1 start } case "$1" in start) start ;; stop) stop ;; status) status $PROG ;; restart) restart ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 esac exit $RETVAL prometheus-node-exporter-0.18.1+ds/examples/launchctl/000077500000000000000000000000001350016654700227715ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/examples/launchctl/README.md000066400000000000000000000015651350016654700242570ustar00rootroot00000000000000# MacOS LaunchDaemon If you're installing through a package manager, you probably don't need to deal with this file. The `plist` file should be put in `/Library/LaunchDaemons/` (user defined daemons), and the binary installed at `/usr/local/bin/node_exporter`. Ex. install globally by sudo cp -n node_exporter /usr/local/bin/ sudo cp -n examples/launchctl/io.prometheus.node_exporter.plist /Library/LaunchDaemons/ sudo launchctl bootstrap system/ /Library/LaunchDaemons/io.prometheus.node_exporter.plist # Optionally configure by dropping CLI arguments in a file echo -- '--web.listen-address=:9101' | sudo tee /usr/local/etc/node_exporter.args # Check it's running sudo launchctl list | grep node_exporter # See full process state sudo launchctl print system/io.prometheus.node_exporter # View logs sudo tail /tmp/node_exporter.log prometheus-node-exporter-0.18.1+ds/examples/launchctl/io.prometheus.node_exporter.plist000066400000000000000000000020051350016654700315200ustar00rootroot00000000000000 Label io.prometheus.node_exporter ProgramArguments sh -c /usr/local/bin/node_exporter $(< /usr/local/etc/node_exporter.args) UserName nobody GroupName nobody RunAtLoad KeepAlive WorkingDirectory /usr/local StandardErrorPath /tmp/node_exporter.log StandardOutPath /tmp/node_exporter.log HardResourceLimits NumberOfFiles 4096 SoftResourceLimits NumberOfFiles 4096 prometheus-node-exporter-0.18.1+ds/examples/openbsd-rc.d/000077500000000000000000000000001350016654700232725ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/examples/openbsd-rc.d/node_exporter000077500000000000000000000001721350016654700260750ustar00rootroot00000000000000#!/bin/ksh # Shawn Craver, 2019-04-02 daemon="/usr/local/bin/node_exporter" . /etc/rc.d/rc.subr rc_bg=YES rc_cmd $1 prometheus-node-exporter-0.18.1+ds/examples/systemd/000077500000000000000000000000001350016654700225045ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/examples/systemd/README.md000066400000000000000000000006611350016654700237660ustar00rootroot00000000000000# 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.18.1+ds/examples/systemd/node_exporter.service000066400000000000000000000002751350016654700267470ustar00rootroot00000000000000[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.18.1+ds/examples/systemd/sysconfig.node_exporter000066400000000000000000000001231350016654700273030ustar00rootroot00000000000000OPTIONS="--collector.textfile.directory /var/lib/node_exporter/textfile_collector" prometheus-node-exporter-0.18.1+ds/go.mod000066400000000000000000000030441350016654700203050ustar00rootroot00000000000000module github.com/prometheus/node_exporter require ( github.com/beevik/ntp v0.2.0 github.com/beorn7/perks v1.0.0 // indirect github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e github.com/ema/qdisc v0.0.0-20180104102928-b307c22d3ce7 github.com/godbus/dbus v0.0.0-20190402143921-271e53dc4968 github.com/golang/protobuf v1.3.1 // indirect github.com/google/go-cmp v0.3.0 // indirect github.com/hodgesds/perf-utils v0.0.7 github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect github.com/lufia/iostat v0.0.0-20170605150913-9f7362b77ad3 github.com/mattn/go-xmlrpc v0.0.1 github.com/mdlayher/genetlink v0.0.0-20181016160152-e97704c1b795 // indirect github.com/mdlayher/netlink v0.0.0-20181210160939-e069752bc835 // indirect github.com/mdlayher/wifi v0.0.0-20180727163819-efdf3f4195d9 github.com/prometheus/client_golang v0.9.2 github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 github.com/prometheus/common v0.3.0 github.com/prometheus/procfs v0.0.0-20190529155944-65bdadfa96ae github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745 github.com/sirupsen/logrus v1.4.1 // indirect github.com/soundcloud/go-runit v0.0.0-20150630195641-06ad41a06c4a github.com/stretchr/testify v1.3.0 // indirect go.uber.org/atomic v1.3.2 // indirect go.uber.org/multierr v1.1.0 // indirect golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c // indirect golang.org/x/sync v0.0.0-20190423024810-112230192c58 // indirect golang.org/x/sys v0.0.0-20190507053917-2953c62de483 gopkg.in/alecthomas/kingpin.v2 v2.2.6 ) prometheus-node-exporter-0.18.1+ds/go.sum000066400000000000000000000250701350016654700203350ustar00rootroot00000000000000github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/beevik/ntp v0.2.0 h1:sGsd+kAXzT0bfVfzJfce04g+dSRfrs+tbQW8lweuYgw= github.com/beevik/ntp v0.2.0/go.mod h1:hIHWr+l3+/clUnF44zdK+CWW7fO8dR5cIylAQ76NRpg= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/ema/qdisc v0.0.0-20180104102928-b307c22d3ce7 h1:jzWRD7cjz7ditpwbTbQdnHzFFW3KIFAVw9Ia5C0n/zs= github.com/ema/qdisc v0.0.0-20180104102928-b307c22d3ce7/go.mod h1:kXuKAameaga9ciOgiYWAM85FQP+wt5aN4uX+9OHVJe4= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/godbus/dbus v0.0.0-20190402143921-271e53dc4968 h1:s+PDl6lozQ+dEUtUtQnO7+A2iPG3sK1pI4liU+jxn90= github.com/godbus/dbus v0.0.0-20190402143921-271e53dc4968/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/hodgesds/perf-utils v0.0.7 h1:V/5aRKeXn/membOpFdzAgd+fFvmtvTYD6moDuZ7K7SM= github.com/hodgesds/perf-utils v0.0.7/go.mod h1:F6TfvsbtrF88i++hou29dTXlI2sfsJv+gRZDtmTJkAs= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/lufia/iostat v0.0.0-20170605150913-9f7362b77ad3 h1:XGhvld9vIpj929Gri5ybjukYZeyZwKkFkqgATqBQiOs= github.com/lufia/iostat v0.0.0-20170605150913-9f7362b77ad3/go.mod h1:lRgtFVamD7L7GaXOSwBiuXMwU3Aicfn5h66LVs4u2SA= github.com/mattn/go-xmlrpc v0.0.1 h1:JY8G+sH4jcjzZvxAY5P+wNrWA2WYC+aK+2bsYOl4z0Q= github.com/mattn/go-xmlrpc v0.0.1/go.mod h1:mqc2dz7tP5x5BKlCahN/n+hs7OSZKJkS9JsHNBRlrxA= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mdlayher/genetlink v0.0.0-20181016160152-e97704c1b795 h1:2uvgdCvQ/MUubxqVhOFkeTaI0EZLcjPLVIwgZGWPgxs= github.com/mdlayher/genetlink v0.0.0-20181016160152-e97704c1b795/go.mod h1:EOrmeik1bDMaRduo2B+uAYe1HmTq6yF2IMDmJi1GoWk= github.com/mdlayher/netlink v0.0.0-20181210160939-e069752bc835 h1:WpZONc7LNdfPrld0YIt2aOiy9T66FfRCqZDrsDkWJX0= github.com/mdlayher/netlink v0.0.0-20181210160939-e069752bc835/go.mod h1:a3TlQHkJH2m32RF224Z7LhD5N4mpyR8eUbCoYHywrwg= github.com/mdlayher/wifi v0.0.0-20180727163819-efdf3f4195d9 h1:ag57ienknXLMhoSbkYvaZLF9Taxu9GtBHUJ4jP5ER8s= github.com/mdlayher/wifi v0.0.0-20180727163819-efdf3f4195d9/go.mod h1:Evt/EIne46u9PtQbeTx2NTcqURpr5K4SvKtGmBuDPN8= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1 h1:K47Rk0v/fkEfwfQet2KWhscE0cJzjgCCDBG2KHZoVno= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.2 h1:awm861/B8OKDd2I/6o1dy3ra4BamzKhYOiGItCeZ740= github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 h1:idejC8f05m9MGOsuEi1ATq9shN03HrxNkD/luQvxCv8= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.3.0 h1:taZ4h8Tkxv2kNyoSctBvfXEHmBmxrwmIidZTIaHons4= github.com/prometheus/common v0.3.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190529155944-65bdadfa96ae h1:kF6Y/ES9NQmW3t400V0XH+lO1jqvCpXBC1XoLDkvuMM= github.com/prometheus/procfs v0.0.0-20190529155944-65bdadfa96ae/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745 h1:IuH7WumZNax0D+rEqmy2TyhKCzrtMGqbZO0b8rO00JA= github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745/go.mod h1:G81aIFAMS9ECrwBYR9YxhlPjWgrItd+Kje78O6+uqm8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/soundcloud/go-runit v0.0.0-20150630195641-06ad41a06c4a h1:os5OBNhwOwybXZMNLqT96XqtjdTtwRFw2w08uluvNeI= github.com/soundcloud/go-runit v0.0.0-20150630195641-06ad41a06c4a/go.mod h1:LeFCbQYJ3KJlPs/FvPz2dy1tkpxyeNESVyCNNzRXFR0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c h1:uOCk1iQW6Vc18bnC13MfzScl+wdKBmM9Y9kU7Z83/lw= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190507053917-2953c62de483 h1:0pONs62zZ8ED8kUnSCsv4RWjmwM6ideAalXGTybpo2s= golang.org/x/sys v0.0.0-20190507053917-2953c62de483/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= prometheus-node-exporter-0.18.1+ds/node_exporter.go000066400000000000000000000126761350016654700224160ustar00rootroot00000000000000// 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 ( "fmt" "net/http" _ "net/http/pprof" "sort" "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" ) // handler wraps an unfiltered http.Handler but uses a filtered handler, // created on the fly, if filtering is requested. Create instances with // newHandler. type handler struct { unfilteredHandler http.Handler // exporterMetricsRegistry is a separate registry for the metrics about // the exporter itself. exporterMetricsRegistry *prometheus.Registry includeExporterMetrics bool maxRequests int } func newHandler(includeExporterMetrics bool, maxRequests int) *handler { h := &handler{ exporterMetricsRegistry: prometheus.NewRegistry(), includeExporterMetrics: includeExporterMetrics, maxRequests: maxRequests, } if h.includeExporterMetrics { h.exporterMetricsRegistry.MustRegister( prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}), prometheus.NewGoCollector(), ) } if innerHandler, err := h.innerHandler(); err != nil { log.Fatalf("Couldn't create metrics handler: %s", err) } else { h.unfilteredHandler = innerHandler } return h } // ServeHTTP implements http.Handler. func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { filters := r.URL.Query()["collect[]"] log.Debugln("collect query:", filters) if len(filters) == 0 { // No filters, use the prepared unfiltered handler. h.unfilteredHandler.ServeHTTP(w, r) return } // To serve filtered metrics, we create a filtering handler on the fly. filteredHandler, err := h.innerHandler(filters...) if err != nil { log.Warnln("Couldn't create filtered metrics handler:", err) w.WriteHeader(http.StatusBadRequest) w.Write([]byte(fmt.Sprintf("Couldn't create filtered metrics handler: %s", err))) return } filteredHandler.ServeHTTP(w, r) } // innerHandler is used to create buth the one unfiltered http.Handler to be // wrapped by the outer handler and also the filtered handlers created on the // fly. The former is accomplished by calling innerHandler without any arguments // (in which case it will log all the collectors enabled via command-line // flags). func (h *handler) innerHandler(filters ...string) (http.Handler, error) { nc, err := collector.NewNodeCollector(filters...) if err != nil { return nil, fmt.Errorf("couldn't create collector: %s", err) } // Only log the creation of an unfiltered handler, which should happen // only once upon startup. if len(filters) == 0 { log.Infof("Enabled collectors:") collectors := []string{} for n := range nc.Collectors { collectors = append(collectors, n) } sort.Strings(collectors) for _, n := range collectors { log.Infof(" - %s", n) } } r := prometheus.NewRegistry() r.MustRegister(version.NewCollector("node_exporter")) if err := r.Register(nc); err != nil { return nil, fmt.Errorf("couldn't register node collector: %s", err) } handler := promhttp.HandlerFor( prometheus.Gatherers{h.exporterMetricsRegistry, r}, promhttp.HandlerOpts{ ErrorLog: log.NewErrorLogger(), ErrorHandling: promhttp.ContinueOnError, MaxRequestsInFlight: h.maxRequests, }, ) if h.includeExporterMetrics { // Note that we have to use h.exporterMetricsRegistry here to // use the same promhttp metrics for all expositions. handler = promhttp.InstrumentMetricHandler( h.exporterMetricsRegistry, handler, ) } return handler, nil } 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() disableExporterMetrics = kingpin.Flag( "web.disable-exporter-metrics", "Exclude metrics about the exporter itself (promhttp_*, process_*, go_*).", ).Bool() maxRequests = kingpin.Flag( "web.max-requests", "Maximum number of parallel scrape requests. Use 0 to disable.", ).Default("40").Int() ) 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()) http.Handle(*metricsPath, newHandler(!*disableExporterMetrics, *maxRequests)) http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Write([]byte(` Node Exporter

Node Exporter

Metrics

`)) }) log.Infoln("Listening on", *listenAddress) if err := http.ListenAndServe(*listenAddress, nil); err != nil { log.Fatal(err) } } prometheus-node-exporter-0.18.1+ds/node_exporter_test.go000066400000000000000000000073431350016654700234500ustar00rootroot00000000000000// 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 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) err := <-errc if cmd.Process != nil { cmd.Process.Kill() } return err } prometheus-node-exporter-0.18.1+ds/scripts/000077500000000000000000000000001350016654700206655ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/scripts/errcheck_excludes.txt000066400000000000000000000001451350016654700251100ustar00rootroot00000000000000// Used in HTTP handlers, any error is handled by the server itself. (net/http.ResponseWriter).Write prometheus-node-exporter-0.18.1+ds/staticcheck.conf000066400000000000000000000000331350016654700223260ustar00rootroot00000000000000checks = ["all", "ST1003"] prometheus-node-exporter-0.18.1+ds/test_image.sh000077500000000000000000000011361350016654700216570ustar00rootroot00000000000000#!/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.18.1+ds/text_collector_examples/000077500000000000000000000000001350016654700241265ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/text_collector_examples/README.md000066400000000000000000000011631350016654700254060ustar00rootroot00000000000000# Text collector example scripts These scripts are examples to be used with the Node Exporter Textfile Collector. To use these scripts, we recommend using a `sponge` to atomically write the output. | sponge Sponge comes from [moreutils](https://joeyh.name/code/moreutils/) * [brew install moreutils](http://brewformulas.org/Moreutil) * [apt install moreutils](https://packages.debian.org/search?keywords=moreutils) * [pkg install moreutils](https://www.freshports.org/sysutils/moreutils/) For more information see: https://github.com/prometheus/node_exporter#textfile-collector prometheus-node-exporter-0.18.1+ds/text_collector_examples/apt.sh000077500000000000000000000017751350016654700252630ustar00rootroot00000000000000#!/bin/bash # # Description: Expose metrics from apt updates. # # Author: Ben Kochie upgrades="$(/usr/bin/apt-get --just-print upgrade \ | /usr/bin/awk -F'[()]' \ '/^Inst/ { sub("^[^ ]+ ", "", $2); sub("\\[", " ", $2); sub(" ", "", $2); sub("\\]", "", $2); print $2 }' \ | /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.18.1+ds/text_collector_examples/btrfs_stats.py000077500000000000000000000072271350016654700270510ustar00rootroot00000000000000#!/usr/bin/env python # Collect per-device btrfs filesystem errors. # Designed to work on Debian and Centos 6 (with python2.6). import collections import glob import os import re import subprocess def get_btrfs_mount_points(): """List all btrfs mount points. Yields: (string) filesystem mount points. """ with open("/proc/mounts") as f: for line in f: parts = line.split() if parts[2] == "btrfs": yield parts[1] def get_btrfs_errors(mountpoint): """Get per-device errors for a btrfs mount point. Args: mountpoint: (string) path to a mount point. Yields: (device, error_type, error_count) tuples, where: device: (string) path to block device. error_type: (string) type of btrfs error. error_count: (int) number of btrfs errors of a given type. """ p = subprocess.Popen(["btrfs", "device", "stats", mountpoint], stdout=subprocess.PIPE) (stdout, stderr) = p.communicate() if p.returncode != 0: raise RuntimeError("btrfs returned exit code %d" % p.returncode) for line in stdout.splitlines(): if line == '': continue # Sample line: # [/dev/vdb1].flush_io_errs 0 m = re.search(r"^\[([^\]]+)\]\.(\S+)\s+(\d+)$", line.decode("utf-8")) if not m: raise RuntimeError("unexpected output from btrfs: '%s'" % line) yield m.group(1), m.group(2), int(m.group(3)) def btrfs_error_metrics(): """Collect btrfs error metrics. Returns: a list of strings to be exposed as Prometheus metrics. """ metric = "node_btrfs_errors_total" contents = [ "# TYPE %s counter" % metric, "# HELP %s number of btrfs errors" % metric, ] errors_by_device = collections.defaultdict(dict) for mountpoint in get_btrfs_mount_points(): for device, error_type, error_count in get_btrfs_errors(mountpoint): contents.append( '%s{mountpoint="%s",device="%s",type="%s"} %d' % (metric, mountpoint, device, error_type, error_count)) if len(contents) > 2: # return metrics if there are actual btrfs filesystems found # (i.e. `contents` contains more than just TYPE and HELP). return contents def btrfs_allocation_metrics(): """Collect btrfs allocation metrics. Returns: a list of strings to be exposed as Prometheus metrics. """ prefix = 'node_btrfs_allocation' metric_to_filename = { 'size_bytes': 'total_bytes', 'used_bytes': 'bytes_used', 'reserved_bytes': 'bytes_reserved', 'pinned_bytes': 'bytes_pinned', 'disk_size_bytes': 'disk_total', 'disk_used_bytes': 'disk_used', } contents = [] for m, f in metric_to_filename.items(): contents += [ "# TYPE %s_%s gauge" % (prefix, m), "# HELP %s_%s btrfs allocation data (%s)" % (prefix, m, f), ] for alloc in glob.glob("/sys/fs/btrfs/*/allocation"): fs = alloc.split('/')[4] for type_ in ('data', 'metadata', 'system'): for m, f in metric_to_filename.items(): filename = os.path.join(alloc, type_, f) with open(filename) as f: value = int(f.read().strip()) contents.append('%s_%s{fs="%s",type="%s"} %d' % ( prefix, m, fs, type_, value)) if len(contents) > 2*len(metric_to_filename): return contents if __name__ == "__main__": contents = ((btrfs_error_metrics() or []) + (btrfs_allocation_metrics() or [])) print("\n".join(contents)) prometheus-node-exporter-0.18.1+ds/text_collector_examples/deleted_libraries.py000077500000000000000000000050631350016654700301510ustar00rootroot00000000000000#!/usr/bin/env python3 """ Script to count the number of deleted libraries that are linked by running processes and expose a summary as Prometheus metrics. The aim is to discover processes that are still using libraries that have since been updated, perhaps due security vulnerabilities. """ import errno import glob import os import sys def main(): processes_linking_deleted_libraries = {} for path in glob.glob('/proc/*/maps'): try: with open(path, 'rb') as file: for line in file: part = line.decode().strip().split() if len(part) == 7: library = part[5] comment = part[6] if '/lib/' in library and '(deleted)' in comment: if path not in processes_linking_deleted_libraries: processes_linking_deleted_libraries[path] = {} if library in processes_linking_deleted_libraries[path]: processes_linking_deleted_libraries[path][library] += 1 else: processes_linking_deleted_libraries[path][library] = 1 except EnvironmentError as e: # Ignore non-existent files, since the files may have changed since # we globbed. if e.errno != errno.ENOENT: sys.exit('Failed to open file: {0}'.format(path)) num_processes_per_library = {} for process, library_count in processes_linking_deleted_libraries.items(): libraries_seen = set() for library, count in library_count.items(): if library in libraries_seen: continue libraries_seen.add(library) if library in num_processes_per_library: num_processes_per_library[library] += 1 else: num_processes_per_library[library] = 1 metric_name = 'node_processes_linking_deleted_libraries' description = 'Count of running processes that link a deleted library' print('# HELP {0} {1}'.format(metric_name, description)) print('# TYPE {0} gauge'.format(metric_name)) for library, count in num_processes_per_library.items(): dir_path, basename = os.path.split(library) basename = basename.replace('"', '\\"') dir_path = dir_path.replace('"', '\\"') print('{0}{{library_path="{1}", library_name="{2}"}} {3}'.format(metric_name, dir_path, basename, count)) if __name__ == "__main__": main() prometheus-node-exporter-0.18.1+ds/text_collector_examples/directory-size.sh000077500000000000000000000012101350016654700274330ustar00rootroot00000000000000#!/bin/sh # # Expose directory usage metrics, passed as an argument. # # Usage: add this to crontab: # # */5 * * * * prometheus directory-size.sh /var/lib/prometheus | sponge /var/lib/node_exporter/directory_size.prom # # sed pattern taken from https://www.robustperception.io/monitoring-directory-sizes-with-the-textfile-collector/ # # Author: Antoine Beaupré echo "# HELP node_directory_size_bytes Disk space used by some directories" echo "# TYPE node_directory_size_bytes gauge" du --block-size=1 --summarize "$@" \ | sed -ne 's/\\/\\\\/;s/"/\\"/g;s/^\([0-9]\+\)\t\(.*\)$/node_directory_size_bytes{directory="\2"} \1/p' prometheus-node-exporter-0.18.1+ds/text_collector_examples/inotify-instances000077500000000000000000000066561350016654700275370ustar00rootroot00000000000000#!/usr/bin/env python3 """ Expose Linux inotify(7) instance resource consumption. Operational properties: - This script may be invoked as an unprivileged user; in this case, metrics will only be exposed for processes owned by that unprivileged user. - No metrics will be exposed for processes that do not hold any inotify fds. Requires Python 3.5 or later. """ import collections import os import sys class Error(Exception): pass class _PIDGoneError(Error): pass _Process = collections.namedtuple( "Process", ["pid", "uid", "command", "inotify_instances"]) def _read_bytes(name): with open(name, mode='rb') as f: return f.read() def _pids(): for n in os.listdir("/proc"): if not n.isdigit(): continue yield int(n) def _pid_uid(pid): try: s = os.stat("/proc/{}".format(pid)) except FileNotFoundError: raise _PIDGoneError() return s.st_uid def _pid_command(pid): # Avoid GNU ps(1) for it truncates comm. # https://bugs.launchpad.net/ubuntu/+source/procps/+bug/295876/comments/3 try: cmdline = _read_bytes("/proc/{}/cmdline".format(pid)) except FileNotFoundError: raise _PIDGoneError() if not len(cmdline): return "" try: prog = cmdline[0:cmdline.index(0x00)] except ValueError: prog = cmdline return os.path.basename(prog).decode(encoding="ascii", errors="surrogateescape") def _pid_inotify_instances(pid): instances = 0 try: for fd in os.listdir("/proc/{}/fd".format(pid)): try: target = os.readlink("/proc/{}/fd/{}".format(pid, fd)) except FileNotFoundError: continue if target == "anon_inode:inotify": instances += 1 except FileNotFoundError: raise _PIDGoneError() return instances def _get_processes(): for p in _pids(): try: yield _Process(p, _pid_uid(p), _pid_command(p), _pid_inotify_instances(p)) except (PermissionError, _PIDGoneError): continue def _get_processes_nontrivial(): return (p for p in _get_processes() if p.inotify_instances > 0) def _format_gauge_metric(metric_name, metric_help, samples, value_func, tags_func=None, stream=sys.stdout): def _println(*args, **kwargs): if "file" not in kwargs: kwargs["file"] = stream print(*args, **kwargs) def _print(*args, **kwargs): if "end" not in kwargs: kwargs["end"] = "" _println(*args, **kwargs) _println("# HELP {} {}".format(metric_name, metric_help)) _println("# TYPE {} gauge".format(metric_name)) for s in samples: value = value_func(s) tags = None if tags_func: tags = tags_func(s) _print(metric_name) if tags: _print("{") _print(",".join(["{}=\"{}\"".format(k, v) for k, v in tags])) _print("}") _print(" ") _println(value) def main(args_unused=None): _format_gauge_metric( "inotify_instances", "Total number of inotify instances held open by a process.", _get_processes_nontrivial(), lambda s: s.inotify_instances, lambda s: [("pid", s.pid), ("uid", s.uid), ("command", s.command)]) if __name__ == "__main__": sys.exit(main(sys.argv)) prometheus-node-exporter-0.18.1+ds/text_collector_examples/ipmitool000077500000000000000000000033131350016654700257100ustar00rootroot00000000000000#!/usr/bin/awk -f # # Converts output of `ipmitool sensor` to prometheus format. # # With GNU awk: # ipmitool sensor | ./ipmitool > ipmitool.prom # # With BSD awk: # ipmitool sensor | awk -f ./ipmitool > ipmitool.prom # function export(values, name) { if (values["metric_count"] < 1) { return } delete values["metric_count"] printf("# HELP %s%s %s sensor reading from ipmitool\n", namespace, name, help[name]); printf("# TYPE %s%s gauge\n", namespace, name); for (sensor in values) { printf("%s%s{sensor=\"%s\"} %f\n", namespace, name, sensor, values[sensor]); } } # Fields are Bar separated, with space padding. BEGIN { FS = "[ ]*[|][ ]*"; namespace = "node_ipmi_"; # Friendly description of the type of sensor for HELP. help["temperature_celsius"] = "Temperature"; help["volts"] = "Voltage"; help["power_watts"] = "Power"; help["speed_rpm"] = "Fan"; help["status"] = "Chassis status"; temperature_celsius["metric_count"] = 0; volts["metric_count"] = 0; power_watts["metric_count"] = 0; speed_rpm["metric_count"] = 0; status["metric_count"] = 0; } # Not a valid line. { if (NF < 3) { next } } # $2 is value field. $2 ~ /na/ { next } # $3 is type field. $3 ~ /degrees C/ { temperature_celsius[$1] = $2; temperature_celsius["metric_count"]++; } $3 ~ /Volts/ { volts[$1] = $2; volts["metric_count"]++; } $3 ~ /Watts/ { power_watts[$1] = $2; power_watts["metric_count"]++; } $3 ~ /RPM/ { speed_rpm[$1] = $2; speed_rpm["metric_count"]++; } $3 ~ /discrete/ { status[$1] = $2; status["metric_count"]++; } END { export(temperature_celsius, "temperature_celsius"); export(volts, "volts"); export(power_watts, "power_watts"); export(speed_rpm, "speed_rpm"); export(status, "status"); } prometheus-node-exporter-0.18.1+ds/text_collector_examples/md_info.sh000077500000000000000000000041051350016654700261000ustar00rootroot00000000000000#!/usr/bin/env bash set -eu for MD_DEVICE in /dev/md/*; do # Subshell to avoid eval'd variables from leaking between iterations ( # Resolve symlink to discover device, e.g. /dev/md127 MD_DEVICE_NUM=$(readlink -f "${MD_DEVICE}") # Remove /dev/ prefix MD_DEVICE_NUM=${MD_DEVICE_NUM#/dev/} MD_DEVICE=${MD_DEVICE#/dev/md/} # Query sysfs for info about md device SYSFS_BASE="/sys/devices/virtual/block/${MD_DEVICE_NUM}/md" MD_LAYOUT=$(cat "${SYSFS_BASE}/layout") MD_LEVEL=$(cat "${SYSFS_BASE}/level") MD_METADATA_VERSION=$(cat "${SYSFS_BASE}/metadata_version") MD_NUM_RAID_DISKS=$(cat "${SYSFS_BASE}/raid_disks") # Remove 'raid' prefix from RAID level MD_LEVEL=${MD_LEVEL#raid} # Output disk metrics for RAID_DISK in ${SYSFS_BASE}/rd[0-9]*; do DISK=$(readlink -f "${RAID_DISK}/block") DISK_DEVICE=$(basename "${DISK}") RAID_DISK_DEVICE=$(basename "${RAID_DISK}") RAID_DISK_INDEX=${RAID_DISK_DEVICE#rd} RAID_DISK_STATE=$(cat "${RAID_DISK}/state") DISK_SET="" # Determine disk set using logic from mdadm: https://github.com/neilbrown/mdadm/commit/2c096ebe4b if [[ ${RAID_DISK_STATE} == "in_sync" && ${MD_LEVEL} == 10 && $((MD_LAYOUT & ~0x1ffff)) ]]; then NEAR_COPIES=$((MD_LAYOUT & 0xff)) FAR_COPIES=$(((MD_LAYOUT >> 8) & 0xff)) COPIES=$((NEAR_COPIES * FAR_COPIES)) if [[ $((MD_NUM_RAID_DISKS % COPIES == 0)) && $((COPIES <= 26)) ]]; then DISK_SET=$((RAID_DISK_INDEX % COPIES)) fi fi echo -n "node_md_disk_info{disk_device=\"${DISK_DEVICE}\", md_device=\"${MD_DEVICE_NUM}\"" if [[ -n ${DISK_SET} ]]; then SET_LETTERS=({A..Z}) echo -n ", md_set=\"${SET_LETTERS[${DISK_SET}]}\"" fi echo "} 1" done # Output RAID array metrics # NOTE: Metadata version is a label rather than a separate metric because the version can be a string echo "node_md_info{md_device=\"${MD_DEVICE_NUM}\", md_name=\"${MD_DEVICE}\", raid_level=\"${MD_LEVEL}\", md_metadata_version=\"${MD_METADATA_VERSION}\"} 1" ) done prometheus-node-exporter-0.18.1+ds/text_collector_examples/md_info_detail.sh000077500000000000000000000103061350016654700274220ustar00rootroot00000000000000#!/usr/bin/env bash # Note: This script uses "mdadm --detail" to get some of the metrics, so it must be run as root. # It is designed to be run periodically in a cronjob, and output to /var/lib/node_exporter/textfile_collector/md_info_detail.prom # $ cat /etc/cron.d/prometheus_md_info_detail # * * * * * bash /var/lib/node_exporter/md_info_detail.sh > /var/lib/node_exporter/md_info_detail.prom.$$ && mv /var/lib/node_exporter/md_info_detail.prom.$$ /var/lib/node_exporter/md_info_detail.prom set -eu for MD_DEVICE in /dev/md/*; do # Subshell to avoid eval'd variables from leaking between iterations ( # Resolve symlink to discover device, e.g. /dev/md127 MD_DEVICE_NUM=$(readlink -f "${MD_DEVICE}") # Remove /dev/ prefix MD_DEVICE_NUM=${MD_DEVICE_NUM#/dev/} MD_DEVICE=${MD_DEVICE#/dev/md/} # Query sysfs for info about md device SYSFS_BASE="/sys/devices/virtual/block/${MD_DEVICE_NUM}/md" MD_LAYOUT=$(cat "${SYSFS_BASE}/layout") MD_LEVEL=$(cat "${SYSFS_BASE}/level") MD_METADATA_VERSION=$(cat "${SYSFS_BASE}/metadata_version") MD_NUM_RAID_DISKS=$(cat "${SYSFS_BASE}/raid_disks") # Remove 'raid' prefix from RAID level MD_LEVEL=${MD_LEVEL#raid} # Output disk metrics for RAID_DISK in ${SYSFS_BASE}/rd[0-9]*; do DISK=$(readlink -f "${RAID_DISK}/block") DISK_DEVICE=$(basename "${DISK}") RAID_DISK_DEVICE=$(basename "${RAID_DISK}") RAID_DISK_INDEX=${RAID_DISK_DEVICE#rd} RAID_DISK_STATE=$(cat "${RAID_DISK}/state") DISK_SET="" # Determine disk set using logic from mdadm: https://github.com/neilbrown/mdadm/commit/2c096ebe4b if [[ ${RAID_DISK_STATE} == "in_sync" && ${MD_LEVEL} == 10 && $((MD_LAYOUT & ~0x1ffff)) ]]; then NEAR_COPIES=$((MD_LAYOUT & 0xff)) FAR_COPIES=$(((MD_LAYOUT >> 8) & 0xff)) COPIES=$((NEAR_COPIES * FAR_COPIES)) if [[ $((MD_NUM_RAID_DISKS % COPIES == 0)) && $((COPIES <= 26)) ]]; then DISK_SET=$((RAID_DISK_INDEX % COPIES)) fi fi echo -n "node_md_disk_info{disk_device=\"${DISK_DEVICE}\", md_device=\"${MD_DEVICE_NUM}\"" if [[ -n ${DISK_SET} ]]; then SET_LETTERS=({A..Z}) echo -n ", md_set=\"${SET_LETTERS[${DISK_SET}]}\"" fi echo "} 1" done # Get output from mdadm --detail (Note: root/sudo required) MDADM_DETAIL_OUTPUT=$(mdadm --detail /dev/"${MD_DEVICE_NUM}") # Output RAID "Devices", "Size" and "Event" metrics, from the output of "mdadm --detail" while IFS= read -r line ; do # Filter out these keys that have numeric values that increment up if echo "$line" | grep -E -q "Devices :|Array Size :| Used Dev Size :|Events :"; then MDADM_DETAIL_KEY=$(echo "$line" | cut -d ":" -f 1 | tr -cd '[a-zA-Z0-9]._-') MDADM_DETAIL_VALUE=$(echo "$line" | cut -d ":" -f 2 | cut -d " " -f 2 | sed 's:^ ::') echo "node_md_info_${MDADM_DETAIL_KEY}{md_device=\"${MD_DEVICE_NUM}\", md_name=\"${MD_DEVICE}\", raid_level=\"${MD_LEVEL}\", md_num_raid_disks=\"${MD_NUM_RAID_DISKS}\", md_metadata_version=\"${MD_METADATA_VERSION}\"} ${MDADM_DETAIL_VALUE}" fi done <<< "$MDADM_DETAIL_OUTPUT" # Output RAID detail metrics info from the output of "mdadm --detail" # NOTE: Sending this info as labels rather than separate metrics, because some of them can be strings. echo -n "node_md_info{md_device=\"${MD_DEVICE_NUM}\", md_name=\"${MD_DEVICE}\", raid_level=\"${MD_LEVEL}\", md_num_raid_disks=\"${MD_NUM_RAID_DISKS}\", md_metadata_version=\"${MD_METADATA_VERSION}\"" while IFS= read -r line ; do # Filter for lines with a ":", to use for Key/Value pairs in labels if echo "$line" | grep -E -q ":" ; then # Exclude lines with these keys, as they're values are numbers that increment up and captured in individual metrics above if echo "$line" | grep -E -qv "Array Size|Used Dev Size|Events|Update Time" ; then echo -n ", " MDADM_DETAIL_KEY=$(echo "$line" | cut -d ":" -f 1 | tr -cd '[a-zA-Z0-9]._-') MDADM_DETAIL_VALUE=$(echo "$line" | cut -d ":" -f 2- | sed 's:^ ::') echo -n "${MDADM_DETAIL_KEY}=\"${MDADM_DETAIL_VALUE}\"" fi fi done <<< "$MDADM_DETAIL_OUTPUT" echo "} 1" ) done prometheus-node-exporter-0.18.1+ds/text_collector_examples/mellanox_hca_temp000077500000000000000000000033611350016654700275360ustar00rootroot00000000000000#!/bin/bash set -eu # Script to read Mellanox HCA temperature using the Mellanox mget_temp_ext tool # Copyright 2018 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. # # Author: Jan Phillip Greimann # check if root if [ "$EUID" -ne 0 ]; then echo "${0##*/}: Please run as root!" >&2 exit 1 fi # check if programs are installed if ! command -v mget_temp_ext >/dev/null 2>&1; then echo "${0##*/}: mget_temp_ext is not installed. Aborting." >&2 exit 1 fi cat <&2 fi done # if device is empty, no device was found if [ -z "${device-}" ]; then echo "${0##*/}: No InfiniBand HCA device found!" >&2 exit 1 fi prometheus-node-exporter-0.18.1+ds/text_collector_examples/ntpd_metrics.py000077500000000000000000000066461350016654700272120ustar00rootroot00000000000000#!/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.18.1+ds/text_collector_examples/nvme_metrics.sh000066400000000000000000000070401350016654700271560ustar00rootroot00000000000000#!/usr/bin/env bash set -eu # Dependencies: nvme-cli, jq (packages) # Based on code from # - https://github.com/prometheus/node_exporter/blob/master/text_collector_examples/smartmon.sh # - https://github.com/prometheus/node_exporter/blob/master/text_collector_examples/mellanox_hca_temp # - https://github.com/vorlon/check_nvme/blob/master/check_nvme.sh # # Author: Henk # Check if we are root if [ "$EUID" -ne 0 ]; then echo "${0##*/}: Please run as root!" >&2 exit 1 fi # Check if programs are installed if ! command -v nvme >/dev/null 2>&1; then echo "${0##*/}: nvme is not installed. Aborting." >&2 exit 1 fi output_format_awk="$( cat <<'OUTPUTAWK' BEGIN { v = "" } v != $1 { print "# HELP nvme_" $1 " SMART metric " $1; if ($1 ~ /_total$/) print "# TYPE nvme_" $1 " counter"; else print "# TYPE nvme_" $1 " gauge"; v = $1 } {print "nvme_" $0} OUTPUTAWK )" format_output() { sort | awk -F'{' "${output_format_awk}" } # Get the nvme-cli version nvme_version="$(nvme version | awk '$1 == "nvme" {print $3}')" echo "nvmecli{version=\"${nvme_version}\"} 1" | format_output # Get devices device_list="$(nvme list | awk '/^\/dev/{print $1}')" # Loop through the NVMe devices for device in ${device_list}; do json_check="$(nvme smart-log -o json "${device}")" disk="$(echo "${device}" | cut -c6-10)" # The temperature value in JSON is in Kelvin, we want Celsius value_temperature="$(echo "$json_check" | jq '.temperature - 273')" echo "temperature_celcius{device=\"${disk}\"} ${value_temperature}" value_available_spare="$(echo "$json_check" | jq '.avail_spare / 100')" echo "available_spare_ratio{device=\"${disk}\"} ${value_available_spare}" value_available_spare_threshold="$(echo "$json_check" | jq '.spare_thresh / 100')" echo "available_spare_threshold_ratio{device=\"${disk}\"} ${value_available_spare_threshold}" value_percentage_used="$(echo "$json_check" | jq '.percent_used / 100')" echo "percentage_used_ratio{device=\"${disk}\"} ${value_percentage_used}" value_critical_warning="$(echo "$json_check" | jq '.critical_warning')" echo "critical_warning_total{device=\"${disk}\"} ${value_critical_warning}" value_media_errors="$(echo "$json_check" | jq '.media_errors')" echo "media_errors_total{device=\"${disk}\"} ${value_media_errors}" value_num_err_log_entries="$(echo "$json_check" | jq '.num_err_log_entries')" echo "num_err_log_entries_total{device=\"${disk}\"} ${value_num_err_log_entries}" value_power_cycles="$(echo "$json_check" | jq '.power_cycles')" echo "power_cycles_total{device=\"${disk}\"} ${value_power_cycles}" value_power_on_hours="$(echo "$json_check" | jq '.power_on_hours')" echo "power_on_hours_total{device=\"${disk}\"} ${value_power_on_hours}" value_controller_busy_time="$(echo "$json_check" | jq '.controller_busy_time')" echo "controller_busy_time_seconds{device=\"${disk}\"} ${value_controller_busy_time}" value_data_units_written="$(echo "$json_check" | jq '.data_units_written')" echo "data_units_written_total{device=\"${disk}\"} ${value_data_units_written}" value_data_units_read="$(echo "$json_check" | jq '.data_units_read')" echo "data_units_read_total{device=\"${disk}\"} ${value_data_units_read}" value_host_read_commands="$(echo "$json_check" | jq '.host_read_commands')" echo "host_read_commands_total{device=\"${disk}\"} ${value_host_read_commands}" value_host_write_commands="$(echo "$json_check" | jq '.host_write_commands')" echo "host_write_commands_total{device=\"${disk}\"} ${value_host_write_commands}" done | format_output prometheus-node-exporter-0.18.1+ds/text_collector_examples/pacman.sh000077500000000000000000000015641350016654700257320ustar00rootroot00000000000000#!/bin/bash # # # Description: Expose metrics from pacman updates # If installed The bash script *checkupdates*, included with the # *pacman-contrib* package, is used to calculate the number of pending updates. # Otherwise *pacman* is used for calculation. # # Author: Sven Haardiek set -o errexit set -o nounset set -o pipefail if [ -x /usr/bin/checkupdates ] then updates=$(/usr/bin/checkupdates | wc -l) cache=0 else if ! updates=$(/usr/bin/pacman -Qu | wc -l) then updates=0 fi cache=1 fi echo "# HELP updates_pending number of pending updates from pacman" echo "# TYPE updates_pending gauge" echo "pacman_updates_pending $updates" echo "# HELP pacman_updates_pending_from_cache pending updates information are from cache" echo "# TYPE pacman_updates_pending_from_cache gauge" echo "pacman_updates_pending_from_cache $cache" prometheus-node-exporter-0.18.1+ds/text_collector_examples/smartmon.py000077500000000000000000000242511350016654700263470ustar00rootroot00000000000000#!/usr/bin/env python3 import argparse import collections import csv import datetime import decimal import re import shlex import subprocess device_info_re = re.compile(r'^(?P[^:]+?)(?:(?:\sis|):)\s*(?P.*)$') ata_error_count_re = re.compile( r'^Error (\d+) \[\d+\] occurred', re.MULTILINE) self_test_re = re.compile(r'^SMART.*(PASSED|OK)$', re.MULTILINE) device_info_map = { 'Vendor': 'vendor', 'Product': 'product', 'Revision': 'revision', 'Logical Unit id': 'lun_id', 'Model Family': 'model_family', 'Device Model': 'device_model', 'Serial Number': 'serial_number', 'Firmware Version': 'firmware_version', } smart_attributes_whitelist = { 'airflow_temperature_cel', 'command_timeout', 'current_pending_sector', 'end_to_end_error', 'erase_fail_count_total', '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', 'wear_leveling_count', 'nand_writes_1gib', 'offline_uncorrectable', 'power_cycle_count', 'power_on_hours', 'program_fail_count', 'raw_read_error_rate', 'reallocated_event_count', 'reallocated_sector_ct', 'reported_uncorrect', 'sata_downshift_count', 'seek_error_rate', 'spin_retry_count', 'spin_up_time', 'start_stop_count', 'temperature_case', 'temperature_celsius', 'temperature_internal', 'total_lbas_read', 'total_lbas_written', 'udma_crc_error_count', 'unsafe_shutdown_count', 'workld_host_reads_perc', 'workld_media_wear_indic', 'workload_minutes', } Metric = collections.namedtuple('Metric', 'name labels value') SmartAttribute = collections.namedtuple('SmartAttribute', [ 'id', 'name', 'flag', 'value', 'worst', 'threshold', 'type', 'updated', 'when_failed', 'raw_value', ]) class Device(collections.namedtuple('DeviceBase', 'path opts')): """Representation of a device as found by smartctl --scan output.""" @property def type(self): return self.opts.type @property def base_labels(self): return {'disk': self.path} def smartctl_select(self): return ['--device', self.type, self.path] def metric_key(metric, prefix=''): return '{prefix}{metric.name}'.format(prefix=prefix, metric=metric) def metric_format(metric, prefix=''): key = metric_key(metric, prefix) labels = ','.join( '{k}="{v}"'.format(k=k, v=v) for k, v in metric.labels.items()) value = decimal.Decimal(metric.value) return '{key}{{{labels}}} {value}'.format( key=key, labels=labels, value=value) def metric_print_meta(metric, prefix=''): key = metric_key(metric, prefix) print('# HELP {key} SMART metric {metric.name}'.format( key=key, metric=metric)) print('# TYPE {key} gauge'.format(key=key, metric=metric)) def metric_print(metric, prefix=''): print(metric_format(metric, prefix)) def smart_ctl(*args, check=True): """Wrapper around invoking the smartctl binary. Returns: (str) Data piped to stdout by the smartctl subprocess. """ try: return subprocess.run( ['smartctl', *args], stdout=subprocess.PIPE, check=check ).stdout.decode('utf-8') except subprocess.CalledProcessError as e: return e.output.decode('utf-8') def smart_ctl_version(): return smart_ctl('-V').split('\n')[0].split()[1] def find_devices(): """Find SMART devices. Yields: (Device) Single device found by smartctl. """ parser = argparse.ArgumentParser() parser.add_argument('-d', '--device', dest='type') devices = smart_ctl('--scan-open') for device in devices.split('\n'): device = device.strip() if not device: continue tokens = shlex.split(device, comments=True) if not tokens: continue yield Device(tokens[0], parser.parse_args(tokens[1:])) def device_is_active(device): """Returns whenever the given device is currently active or not. Args: device: (Device) Device in question. Returns: (bool) True if the device is active and False otherwise. """ try: smart_ctl('--nocheck', 'standby', *device.smartctl_select()) except subprocess.CalledProcessError: return False return True def device_info(device): """Query device for basic model information. Args: device: (Device) Device in question. Returns: (generator): Generator yielding: key (str): Key describing the value. value (str): Actual value. """ info_lines = smart_ctl( '--info', *device.smartctl_select() ).strip().split('\n')[3:] matches = (device_info_re.match(l) for l in info_lines) return (m.groups() for m in matches if m is not None) def device_smart_capabilities(device): """Returns SMART capabilities of the given device. Args: device: (Device) Device in question. Returns: (tuple): tuple containing: (bool): True whenever SMART is available, False otherwise. (bool): True whenever SMART is enabled, False otherwise. """ groups = device_info(device) state = { g[1].split(' ', 1)[0] for g in groups if g[0] == 'SMART support'} smart_available = 'Available' in state smart_enabled = 'Enabled' in state return smart_available, smart_enabled def collect_device_info(device): """Collect basic device information. Args: device: (Device) Device in question. Yields: (Metric) metrics describing general device information. """ values = dict(device_info(device)) yield Metric('device_info', { **device.base_labels, **{v: values[k] for k, v in device_info_map.items() if k in values} }, True) def collect_device_health_self_assessment(device): """Collect metric about the device health self assessment. Args: device: (Device) Device in question. Yields: (Metric) Device health self assessment. """ out = smart_ctl('--health', *device.smartctl_select()) if self_test_re.search(out): self_assessment_passed = True else: self_assessment_passed = False yield Metric( 'device_smart_healthy', device.base_labels, self_assessment_passed) def collect_ata_metrics(device): # Fetch SMART attributes for the given device. attributes = smart_ctl( '--attributes', *device.smartctl_select() ) # replace multiple occurrences of whitespace with a single whitespace # so that the CSV Parser recognizes individual columns properly. attributes = re.sub(r'[\t\x20]+', ' ', attributes) # Turn smartctl output into a list of lines and skip to the table of # SMART attributes. attribute_lines = attributes.strip().split('\n')[7:] reader = csv.DictReader( (l.strip() for l in attribute_lines), fieldnames=SmartAttribute._fields[:-1], restkey=SmartAttribute._fields[-1], delimiter=' ') for entry in reader: # We're only interested in the SMART attributes that are # whitelisted here. entry['name'] = entry['name'].lower() if entry['name'] not in smart_attributes_whitelist: continue # Ensure that only the numeric parts are fetched from the raw_value. # Attributes such as 194 Temperature_Celsius reported by my SSD # are in the format of "36 (Min/Max 24/40)" which can't be expressed # properly as a prometheus metric. m = re.match('^(\d+)', ' '.join(entry['raw_value'])) if not m: continue entry['raw_value'] = m.group(1) if entry['name'] in smart_attributes_whitelist: labels = { 'name': entry['name'], **device.base_labels, } for col in 'value', 'worst', 'threshold': yield Metric( 'attr_{col}'.format(name=entry["name"], col=col), labels, entry[col]) def collect_ata_error_count(device): """Inspect the device error log and report the amount of entries. Args: device: (Device) Device in question. Yields: (Metric) Device error count. """ error_log = smart_ctl( '-l', 'xerror,1', *device.smartctl_select(), check=False) m = ata_error_count_re.search(error_log) error_count = m.group(1) if m is not None else 0 yield Metric('device_errors', device.base_labels, error_count) def collect_disks_smart_metrics(): now = int(datetime.datetime.utcnow().timestamp()) for device in find_devices(): yield Metric('smartctl_run', device.base_labels, now) is_active = device_is_active(device) yield Metric('device_active', device.base_labels, is_active) # Skip further metrics collection to prevent the disk from # spinning up. if not is_active: continue yield from collect_device_info(device) smart_available, smart_enabled = device_smart_capabilities(device) yield Metric( 'device_smart_available', device.base_labels, smart_available) yield Metric( 'device_smart_enabled', device.base_labels, smart_enabled) # Skip further metrics collection here if SMART is disabled # on the device. Further smartctl invocations would fail # anyways. if not smart_available: continue yield from collect_device_health_self_assessment(device) if device.type.startswith('sat'): yield from collect_ata_metrics(device) yield from collect_ata_error_count(device) def main(): version_metric = Metric('smartctl_version', { 'version': smart_ctl_version() }, True) metric_print_meta(version_metric, 'smartmon_') metric_print(version_metric, 'smartmon_') metrics = list(collect_disks_smart_metrics()) metrics.sort(key=lambda i: i.name) previous_name = None for m in metrics: if m.name != previous_name: metric_print_meta(m, 'smartmon_') previous_name = m.name metric_print(m, 'smartmon_') if __name__ == '__main__': main() prometheus-node-exporter-0.18.1+ds/text_collector_examples/smartmon.sh000066400000000000000000000160761350016654700263340ustar00rootroot00000000000000#!/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 # Formatting done via shfmt -i 2 # https://github.com/mvdan/sh 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 wear_leveling_count nand_writes_1gib offline_uncorrectable power_cycle_count power_on_hours program_fail_count raw_read_error_rate reallocated_event_count reallocated_sector_ct reported_uncorrect sata_downshift_count seek_error_rate spin_retry_count spin_up_time start_stop_count temperature_case temperature_celsius temperature_internal 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_scsi_attributes() { local disk="$1" local disk_type="$2" local labels="disk=\"${disk}\",type=\"${disk_type}\"" while read line; do attr_type="$(echo "${line}" | tr '=' ':' | cut -f1 -d: | sed 's/^ \+//g' | tr ' ' '_')" attr_value="$(echo "${line}" | tr '=' ':' | cut -f2 -d: | sed 's/^ \+//g')" case "${attr_type}" in number_of_hours_powered_up_) power_on="$(echo "${attr_value}" | awk '{ printf "%e\n", $1 }')" ;; Current_Drive_Temperature) temp_cel="$(echo ${attr_value} | cut -f1 -d' ' | awk '{ printf "%e\n", $1 }')" ;; Blocks_read_from_cache_and_sent_to_initiator_) lbas_read="$(echo ${attr_value} | awk '{ printf "%e\n", $1 }')" ;; Accumulated_start-stop_cycles) power_cycle="$(echo ${attr_value} | awk '{ printf "%e\n", $1 }')" ;; Elements_in_grown_defect_list) grown_defects="$(echo ${attr_value} | awk '{ printf "%e\n", $1 }')" ;; esac done [ ! -z "$power_on" ] && echo "power_on_hours_raw_value{${labels},smart_id=\"9\"} ${power_on}" [ ! -z "$temp_cel" ] && echo "temperature_celsius_raw_value{${labels},smart_id=\"194\"} ${temp_cel}" [ ! -z "$lbas_read" ] && echo "total_lbas_read_raw_value{${labels},smart_id=\"242\"} ${lbas_read}" [ ! -z "$power_cycle" ] && echo "power_cycle_count_raw_value{${labels},smart_id=\"12\"} ${power_cycle}" [ ! -z "$grown_defects" ] && echo "grown_defects_count_raw_value{${labels},smart_id=\"12\"} ${grown_defects}" } parse_smartctl_info() { local -i smart_available=0 smart_enabled=0 smart_healthy=0 local disk="$1" disk_type="$2" local model_family='' device_model='' serial_number='' fw_version='' vendor='' product='' revision='' lun_id='' while read line; do info_type="$(echo "${line}" | cut -f1 -d: | tr ' ' '_')" info_value="$(echo "${line}" | cut -f2- -d: | sed 's/^ \+//g' | sed 's/"/\\"/')" 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 echo "device_info{disk=\"${disk}\",type=\"${disk_type}\",vendor=\"${vendor}\",product=\"${product}\",revision=\"${revision}\",lun_id=\"${lun_id}\",model_family=\"${model_family}\",device_model=\"${device_model}\",serial_number=\"${serial_number}\",firmware_version=\"${fw_version}\"} 1" 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 '/^\/dev/{print $1 "|" $3}')" for device in ${device_list}; do disk="$(echo ${device} | cut -f1 -d'|')" type="$(echo ${device} | cut -f2 -d'|')" active=1 echo "smartctl_run{disk=\"${disk}\",type=\"${type}\"}" "$(TZ=UTC date '+%s')" # Check if the device is in a low-power mode /usr/sbin/smartctl -n standby -d "${type}" "${disk}" > /dev/null || active=0 echo "device_active{disk=\"${disk}\",type=\"${type}\"}" "${active}" # Skip further metrics to prevent the disk from spinning up test ${active} -eq 0 && continue # Get the SMART information and health /usr/sbin/smartctl -i -H -d "${type}" "${disk}" | parse_smartctl_info "${disk}" "${type}" # Get the SMART attributes case ${type} in sat) /usr/sbin/smartctl -A -d "${type}" "${disk}" | parse_smartctl_attributes "${disk}" "${type}" ;; sat+megaraid*) /usr/sbin/smartctl -A -d "${type}" "${disk}" | parse_smartctl_attributes "${disk}" "${type}" ;; scsi) /usr/sbin/smartctl -A -d "${type}" "${disk}" | parse_smartctl_scsi_attributes "${disk}" "${type}" ;; megaraid*) /usr/sbin/smartctl -A -d "${type}" "${disk}" | parse_smartctl_scsi_attributes "${disk}" "${type}" ;; *) echo "disk type is not sat, scsi or megaraid but ${type}" exit ;; esac done | format_output prometheus-node-exporter-0.18.1+ds/text_collector_examples/storcli.py000077500000000000000000000237671350016654700262010ustar00rootroot00000000000000#!/usr/bin/env python3 """ 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. Formatting done with YAPF: $ yapf -i --style '{COLUMN_LIMIT: 99}' storcli.py """ from __future__ import print_function from datetime import datetime import argparse import collections import json import os import shlex import subprocess DESCRIPTION = """Parses StorCLI's JSON output and exposes MegaRAID health as Prometheus metrics.""" VERSION = '0.0.3' storcli_path = '' metric_prefix = 'megaraid_' metric_list = {} metric_list = collections.defaultdict(list) def main(args): """ main """ global storcli_path storcli_path = args.storcli_path data = get_storcli_json('/cALL show all J') try: # All the information is collected underneath the Controllers key data = data['Controllers'] for controller in data: response = controller['Response Data'] if response['Version']['Driver Name'] == 'megaraid_sas': handle_megaraid_controller(response) elif response['Version']['Driver Name'] == 'mpt3sas': handle_sas_controller(response) except KeyError: pass print_all_metrics(metric_list) def handle_sas_controller(response): (controller_index, baselabel) = get_basic_controller_info(response) add_metric('healthy', baselabel, int(response['Status']['Controller Status'] == 'OK')) add_metric('ports', baselabel, response['HwCfg']['Backend Port Count']) try: # The number of physical disks is half of the number of items in this dict # Every disk is listed twice - once for basic info, again for detailed info add_metric('physical_drives', baselabel, len(response['Physical Device Information'].keys()) / 2) except AttributeError: pass # Split up string to not trigger CodeSpell issues add_metric('temperature', baselabel, int(response['HwCfg']['ROC temperature(Degree Celc' + 'ius)'])) for key, basic_disk_info in response['Physical Device Information'].items(): if 'Detailed Information' in key: continue create_metrcis_of_physical_drive(basic_disk_info[0], response['Physical Device Information'], controller_index) def handle_megaraid_controller(response): (controller_index, baselabel) = get_basic_controller_info(response) # BBU Status Optimal value is 0 for cachevault and 32 for BBU add_metric('battery_backup_healthy', baselabel, int(response['Status']['BBU Status'] in [0, 32])) add_metric('degraded', baselabel, int(response['Status']['Controller Status'] == 'Degraded')) add_metric('failed', baselabel, int(response['Status']['Controller Status'] == 'Failed')) add_metric('healthy', baselabel, int(response['Status']['Controller Status'] == 'Optimal')) add_metric('drive_groups', baselabel, response['Drive Groups']) add_metric('virtual_drives', baselabel, response['Virtual Drives']) add_metric('physical_drives', baselabel, response['Physical Drives']) add_metric('ports', baselabel, response['HwCfg']['Backend Port Count']) add_metric('scheduled_patrol_read', baselabel, int('hrs' in response['Scheduled Tasks']['Patrol Read Reoccurrence'])) add_metric('temperature', baselabel, int(response['HwCfg']['ROC temperature(Degree Celsius)'])) for cvidx, cvinfo in enumerate(response['Cachevault_Info']): add_metric('cv_temperature', baselabel + ',cvidx="' + str(cvidx) + '"', int(cvinfo['Temp'].replace('C',''))) time_difference_seconds = -1 system_time = datetime.strptime(response['Basics'].get('Current System Date/time'), "%m/%d/%Y, %H:%M:%S") controller_time = datetime.strptime(response['Basics'].get('Current Controller Date/Time'), "%m/%d/%Y, %H:%M:%S") if system_time and controller_time: time_difference_seconds = abs(system_time - controller_time).seconds add_metric('time_difference', baselabel, time_difference_seconds) for virtual_drive in response['VD LIST']: vd_position = virtual_drive.get('DG/VD') drive_group, volume_group = -1, -1 if vd_position: drive_group = vd_position.split('/')[0] volume_group = vd_position.split('/')[1] vd_baselabel = 'controller="{}",DG="{}",VG="{}"'.format(controller_index, drive_group, volume_group) vd_info_label = vd_baselabel + ',name="{}",cache="{}",type="{}",state="{}"'.format( str(virtual_drive.get('Name')).strip(), str(virtual_drive.get('Cache')).strip(), str(virtual_drive.get('TYPE')).strip(), str(virtual_drive.get('State')).strip()) add_metric('vd_info', vd_info_label, 1) if response['Physical Drives'] > 0: data = get_storcli_json('/cALL/eALL/sALL show all J') drive_info = data['Controllers'][controller_index]['Response Data'] for physical_drive in response['PD LIST']: create_metrcis_of_physical_drive(physical_drive, drive_info, controller_index) def get_basic_controller_info(response): controller_index = response['Basics']['Controller'] baselabel = 'controller="{}"'.format(controller_index) controller_info_label = baselabel + ',model="{}",serial="{}",fwversion="{}"'.format( str(response['Basics']['Model']).strip(), str(response['Basics']['Serial Number']).strip(), str(response['Version']['Firmware Version']).strip(), ) add_metric('controller_info', controller_info_label, 1) return (controller_index, baselabel) def create_metrcis_of_physical_drive(physical_drive, detailed_info_array, controller_index): enclosure = physical_drive.get('EID:Slt').split(':')[0] slot = physical_drive.get('EID:Slt').split(':')[1] pd_baselabel = 'controller="{}",enclosure="{}",slot="{}"'.format(controller_index, enclosure, slot) pd_info_label = pd_baselabel + \ ',disk_id="{}",interface="{}",media="{}",model="{}",DG="{}",state="{}"'.format( str(physical_drive.get('DID')).strip(), str(physical_drive.get('Intf')).strip(), str(physical_drive.get('Med')).strip(), str(physical_drive.get('Model')).strip(), str(physical_drive.get('DG')).strip(), str(physical_drive.get('State')).strip()) drive_identifier = 'Drive /c' + str(controller_index) + '/e' + str(enclosure) + '/s' + str( slot) if enclosure == ' ': drive_identifier = 'Drive /c' + str(controller_index) + '/s' + str(slot) try: info = detailed_info_array[drive_identifier + ' - Detailed Information'] state = info[drive_identifier + ' State'] attributes = info[drive_identifier + ' Device attributes'] settings = info[drive_identifier + ' Policies/Settings'] add_metric('pd_shield_counter', pd_baselabel, state['Shield Counter']) add_metric('pd_media_errors', pd_baselabel, state['Media Error Count']) add_metric('pd_other_errors', pd_baselabel, state['Other Error Count']) add_metric('pd_predictive_errors', pd_baselabel, state['Predictive Failure Count']) add_metric('pd_smart_alerted', pd_baselabel, int(state['S.M.A.R.T alert flagged by drive'] == 'Yes')) add_metric('pd_link_speed_gbps', pd_baselabel, attributes['Link Speed'].split('.')[0]) add_metric('pd_device_speed_gbps', pd_baselabel, attributes['Device Speed'].split('.')[0]) add_metric('pd_commissioned_spare', pd_baselabel, int(settings['Commissioned Spare'] == 'Yes')) add_metric('pd_emergency_spare', pd_baselabel, int(settings['Emergency Spare'] == 'Yes')) pd_info_label += ',firmware="{}"'.format(attributes['Firmware Revision'].strip()) except KeyError: pass add_metric('pd_info', pd_info_label, 1) def add_metric(name, labels, value): global metric_list try: metric_list[name].append({ 'labels': labels, 'value': float(value), }) except ValueError: pass def print_all_metrics(metrics): for metric, measurements in metrics.items(): print('# HELP {}{} MegaRAID {}'.format(metric_prefix, metric, metric.replace('_', ' '))) print('# TYPE {}{} gauge'.format(metric_prefix, metric)) for measurement in measurements: if measurement['value'] != 'Unknown': print('{}{}{} {}'.format(metric_prefix, metric, '{' + measurement['labels'] + '}', measurement['value'])) def get_storcli_json(storcli_args): """Get storcli output in JSON format.""" # Check if storcli is installed and executable if not (os.path.isfile(storcli_path) and os.access(storcli_path, os.X_OK)): SystemExit(1) storcli_cmd = shlex.split(storcli_path + ' ' + storcli_args) proc = subprocess.Popen( storcli_cmd, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) output_json = proc.communicate()[0] data = json.loads(output_json.decode("utf-8")) if data["Controllers"][0]["Command Status"]["Status"] != "Success": SystemExit(1) return data 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.18.1+ds/text_collector_examples/yum.sh000077500000000000000000000011501350016654700252740ustar00rootroot00000000000000#!/bin/bash # # Description: Expose metrics from yum updates. # # Author: Slawomir Gonet # # Based on apt.sh by Ben Kochie upgrades=$(/usr/bin/yum -q check-updates | awk 'BEGIN { mute=1 } /Obsoleting Packages/ { mute=0 } mute { print }' | egrep '^\w+\.\w+' | awk '{print $3}' | sort | uniq -c | awk '{print "yum_upgrades_pending{origin=\""$2"\"} "$1}') echo '# HELP yum_upgrades_pending Yum package pending updates by origin.' echo '# TYPE yum_upgrades_pending gauge' if [[ -n "${upgrades}" ]] ; then echo "${upgrades}" else echo 'yum_upgrades_pending{origin=""} 0' fi prometheus-node-exporter-0.18.1+ds/ttar000077500000000000000000000254571350016654700201130ustar00rootroot00000000000000#!/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) # Copyright 2017 Roger Luethi # # 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. set -o errexit -o nounset # Sanitize environment (for instance, standard sorting of glob matches) export LC_ALL=C path="" CMD="" ARG_STRING="$*" #------------------------------------------------------------------------------ # Not all sed implementations can work on null bytes. In order to make ttar # work out of the box on macOS, use Python as a stream editor. USE_PYTHON=0 PYTHON_CREATE_FILTER=$(cat << 'PCF' #!/usr/bin/env python import re import sys for line in sys.stdin: line = re.sub(r'EOF', r'\EOF', line) line = re.sub(r'NULLBYTE', r'\NULLBYTE', line) line = re.sub('\x00', r'NULLBYTE', line) sys.stdout.write(line) PCF ) PYTHON_EXTRACT_FILTER=$(cat << 'PEF' #!/usr/bin/env python import re import sys for line in sys.stdin: line = re.sub(r'(?/dev/null; then echo "ERROR Python not found. Aborting." exit 2 fi USE_PYTHON=1 fi } #------------------------------------------------------------------------------ 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) -v (verbose) 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 } unset VERBOSE 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 )) local eof_without_newline if [ "$size" -gt 0 ]; then if [[ "$line" =~ [^\\]EOF ]]; then # An EOF not preceeded by a backslash indicates that the line # does not end with a newline eof_without_newline=1 else eof_without_newline=0 fi # Replace NULLBYTE with null byte if at beginning of line # Replace NULLBYTE with null byte unless preceeded by backslash # Remove one backslash in front of NULLBYTE (if any) # Remove EOF unless preceeded by backslash # Remove one backslash in front of EOF if [ $USE_PYTHON -eq 1 ]; then echo -n "$line" | python -c "$PYTHON_EXTRACT_FILTER" >> "$path" else # The repeated pattern makes up for sed's lack of negative # lookbehind assertions (for consecutive null bytes). echo -n "$line" | \ sed -e 's/^NULLBYTE/\x0/g; s/\([^\\]\)NULLBYTE/\1\x0/g; s/\([^\\]\)NULLBYTE/\1\x0/g; s/\\NULLBYTE/NULLBYTE/g; s/\([^\\]\)EOF/\1/g; s/\\EOF/EOF/g; ' >> "$path" fi if [[ "$eof_without_newline" -eq 0 ]]; then echo >> "$path" fi 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 # GNU stat STAT_OPTION='-c' STAT_FORMAT='%a' else # BSD stat STAT_OPTION='-f' # Octal output, user/group/other (omit file type, sticky bit) STAT_FORMAT='%OLp' fi fi stat "${STAT_OPTION}" "${STAT_FORMAT}" "$mfile" } function _create { shopt -s nullglob local mode local eof_without_newline 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}') eof_without_newline=0 if [[ "$(wc -c "$file"|awk '{print $1}')" -gt 0 ]] && \ [[ "$(tail -c 1 "$file" | wc -l)" -eq 0 ]]; then eof_without_newline=1 lines=$((lines+1)) fi echo "Lines: $lines" # Add backslash in front of EOF # Add backslash in front of NULLBYTE # Replace null byte with NULLBYTE if [ $USE_PYTHON -eq 1 ]; then < "$file" python -c "$PYTHON_CREATE_FILTER" else < "$file" \ sed 's/EOF/\\EOF/g; s/NULLBYTE/\\NULLBYTE/g; s/\x0/NULLBYTE/g; ' fi if [[ "$eof_without_newline" -eq 1 ]]; then # Finish line with EOF to indicate that the original line did # not end with a linefeed echo "EOF" fi 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 "$@" } test_environment 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.18.1+ds/vendor/000077500000000000000000000000001350016654700204735ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/000077500000000000000000000000001350016654700225325ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/beevik/000077500000000000000000000000001350016654700237775ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/beevik/ntp/000077500000000000000000000000001350016654700246005ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/beevik/ntp/.travis.yml000066400000000000000000000002131350016654700267050ustar00rootroot00000000000000language: go sudo: false go: - 1.7.x - 1.8.x - 1.9.x - tip matrix: allow_failures: - go: tip script: - go test -v ./... prometheus-node-exporter-0.18.1+ds/vendor/github.com/beevik/ntp/CONTRIBUTORS000066400000000000000000000002511350016654700264560ustar00rootroot00000000000000Brett 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.18.1+ds/vendor/github.com/beevik/ntp/LICENSE000066400000000000000000000024151350016654700256070ustar00rootroot00000000000000Copyright 2015-2017 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.18.1+ds/vendor/github.com/beevik/ntp/README.md000066400000000000000000000067111350016654700260640ustar00rootroot00000000000000[![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 information about the current time. ## Querying the current time If all you care about is the current time according to a remote NTP server, simply use the `Time` function: ```go time, err := ntp.Time("0.beevik-ntp.pool.ntp.org") ``` ## Querying time metadata To obtain the current time as well as some additional metadata about the time, use the `Query` function: ```go response, err := ntp.Query("0.beevik-ntp.pool.ntp.org") time := time.Now().Add(response.ClockOffset) ``` Alternatively, use the `QueryWithOptions` function if you want to change the default behavior used by the `Query` function: ```go options := ntp.QueryOptions{ Timeout: 30*time.Second, TTL: 5 } response, err := ntp.QueryWithOptions("0.beevik-ntp.pool.ntp.org", options) time := time.Now().Add(response.ClockOffset) ``` The `Response` structure returned by `Query` includes the following information: * `Time`: The time the server transmitted its response, according to its own clock. * `ClockOffset`: The estimated offset of the local system clock relative to the server's clock. For a more accurate time reading, you may add this offset to any subsequent system clock reading. * `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 server's stratum, which indicates the number of hops from the server to the reference clock. A stratum 1 server is directly attached to the reference clock. If the stratum is zero, the server has responded with the "kiss of death". * `ReferenceID`: A unique identifier for the consulted reference clock. * `ReferenceTime`: The time at which the server last updated its local clock setting. * `RootDelay`: The server's aggregate round-trip-time delay to the stratum 1 server. * `RootDispersion`: The server's estimated maximum measurement error relative to the reference clock. * `RootDistance`: An estimate of the root synchronization distance between the client and the stratum 1 server. * `Leap`: The leap second indicator, indicating whether a second should be added to or removed from the current month's last minute. * `MinError`: A lower bound on the clock error between the client and the server. * `KissCode`: A 4-character string describing the reason for a "kiss of death" response (stratum=0). * `Poll`: The maximum polling interval between successive messages to the server. The `Response` structure's `Validate` method performs additional sanity checks to determine whether the response is suitable for time synchronization purposes. ```go err := response.Validate() if err == nil { // response data is suitable for synchronization purposes } ``` ## Using the NTP pool The NTP pool is a shared resource used by people all over the world. To prevent it from becoming overloaded, please avoid querying the standard `pool.ntp.org` zone names in your applications. Instead, consider requesting your own [vendor zone](http://www.pool.ntp.org/en/vendors.html) or [joining the pool](http://www.pool.ntp.org/join.html). prometheus-node-exporter-0.18.1+ds/vendor/github.com/beevik/ntp/RELEASE_NOTES.md000066400000000000000000000046111350016654700271540ustar00rootroot00000000000000Release v0.2.0 ============== There are no breaking changes or further deprecations in this release. **Changes** * Added `KissCode` to the `Response` structure. Release 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.18.1+ds/vendor/github.com/beevik/ntp/ntp.go000066400000000000000000000415331350016654700257360ustar00rootroot00000000000000// 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" "fmt" "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 // KissCode is a 4-character string describing the reason for a // "kiss of death" response (stratum = 0). For a list of standard kiss // codes, see https://tools.ietf.org/html/rfc5905#section-7.4. KissCode string // 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 fmt.Errorf("kiss of death received: %s", r.KissCode) } 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 transmitted. bits := make([]byte, 8) _, err = rand.Read(bits) var xmitTime time.Time if err == nil { xmitMsg.TransmitTime = ntpTime(binary.BigEndian.Uint64(bits)) xmitTime = time.Now() } else { xmitTime = time.Now() xmitMsg.TransmitTime = toNtpTime(xmitTime) } // 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(xmitTime) if delta < 0 { // The local system may have had its clock adjusted since it // sent the query. In go 1.9 and later, time.Since ensures // that a monotonic clock is used, so delta can never be less // than zero. In versions before 1.9, a monotonic clock is // not used, so we have to check. return nil, 0, errors.New("client clock ticked backwards") } recvTime := toNtpTime(xmitTime.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 // transmit time. recvMsg.OriginTime = toNtpTime(xmitTime) 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) // If a kiss of death was received, interpret the reference ID as // a kiss code. if r.Stratum == 0 { r.KissCode = kissCode(r.ReferenceID) } 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 } } func kissCode(id uint32) string { isPrintable := func(ch byte) bool { return ch >= 32 && ch <= 126 } b := []byte{ byte(id >> 24), byte(id >> 16), byte(id >> 8), byte(id), } for _, ch := range b { if !isPrintable(ch) { return "" } } return string(b) } prometheus-node-exporter-0.18.1+ds/vendor/github.com/ema/000077500000000000000000000000001350016654700232745ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/ema/qdisc/000077500000000000000000000000001350016654700243775ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/ema/qdisc/.travis.yml000066400000000000000000000005201350016654700265050ustar00rootroot00000000000000language: go go: - 1.x os: - linux sudo: required before_install: - go get github.com/golang/lint/golint - go get honnef.co/go/tools/cmd/staticcheck - go get -d ./... script: - go build -tags=gofuzz ./... - go vet ./... - staticcheck ./... #- golint -set_exit_status ./... - go test -v -race -tags=integration ./... prometheus-node-exporter-0.18.1+ds/vendor/github.com/ema/qdisc/LICENSE.md000066400000000000000000000020731350016654700260050ustar00rootroot00000000000000MIT 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.18.1+ds/vendor/github.com/ema/qdisc/Makefile000066400000000000000000000002721350016654700260400ustar00rootroot00000000000000build: 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.18.1+ds/vendor/github.com/ema/qdisc/README.md000066400000000000000000000010241350016654700256530ustar00rootroot00000000000000qdisc [![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.18.1+ds/vendor/github.com/ema/qdisc/get.go000066400000000000000000000136241350016654700255130ustar00rootroot00000000000000package 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, error) { var stats TC_Fq_Qd_Stats nested, err := netlink.UnmarshalAttributes(attr.Data) if err != nil { return stats, err } pts := []*uint64{ &stats.GcFlows, &stats.HighprioPackets, &stats.TcpRetrans, &stats.Throttled, &stats.FlowsPlimit, &stats.PktsTooLong, &stats.AllocationErrors, } for _, a := range nested { switch a.Type { case TCA_STATS_APP: for i := 0; i < len(pts) && (i+1)*8 <= len(a.Data); i++ { *pts[i] = nlenc.Uint64(a.Data[i*8 : (i+1)*8]) } default: } } return stats, nil } 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: s_fq, err = parseTC_Fq_Qd_Stats(attr) if err != nil { return m, err } 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 } s2 = parseTCAStats2(attr) 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.18.1+ds/vendor/github.com/hodgesds/000077500000000000000000000000001350016654700243325ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/hodgesds/perf-utils/000077500000000000000000000000001350016654700264245ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/hodgesds/perf-utils/.gitignore000066400000000000000000000000151350016654700304100ustar00rootroot00000000000000*.swp vendor prometheus-node-exporter-0.18.1+ds/vendor/github.com/hodgesds/perf-utils/Gopkg.lock000066400000000000000000000006521350016654700303500ustar00rootroot00000000000000# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. [[projects]] branch = "master" name = "golang.org/x/sys" packages = ["unix"] revision = "90b0e4468f9980bf79a2290394adaf7f045c5d24" [solve-meta] analyzer-name = "dep" analyzer-version = 1 inputs-digest = "c188619af29e454f9af8a4b24b5d13720a55a70615395ba2ded3a628fa51776a" solver-name = "gps-cdcl" solver-version = 1 prometheus-node-exporter-0.18.1+ds/vendor/github.com/hodgesds/perf-utils/Gopkg.toml000066400000000000000000000013321350016654700303670ustar00rootroot00000000000000# Gopkg.toml example # # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md # for detailed Gopkg.toml documentation. # # required = ["github.com/user/thing/cmd/thing"] # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] # # [[constraint]] # name = "github.com/user/project" # version = "1.0.0" # # [[constraint]] # name = "github.com/user/project2" # branch = "dev" # source = "github.com/myfork/project2" # # [[override]] # name = "github.com/x/y" # version = "2.4.0" # # [prune] # non-go = false # go-tests = true # unused-packages = true [[constraint]] branch = "master" name = "golang.org/x/sys" [prune] go-tests = true unused-packages = true prometheus-node-exporter-0.18.1+ds/vendor/github.com/hodgesds/perf-utils/LICENSE000066400000000000000000000020711350016654700274310ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) 2019 Daniel Hodges 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.18.1+ds/vendor/github.com/hodgesds/perf-utils/README.md000066400000000000000000000104631350016654700277070ustar00rootroot00000000000000# Perf [![GoDoc](https://godoc.org/github.com/hodgesds/perf-utils?status.svg)](https://godoc.org/github.com/hodgesds/perf-utils) This package is a go library for interacting with the `perf` subsystem in Linux. It allows you to do things like see how many CPU instructions a function takes, profile a process for various hardware events, and other interesting things. The library is by no means finalized and should be considered pre-alpha at best. # Use Cases A majority of the utility methods in this package should only be used for testing and/or debugging performance issues. Due to the nature of the go runtime profiling on the goroutine level is extremely tricky, with the exception of a long running worker goroutine locked to an OS thread. Eventually this library could be used to implement many of the features of `perf` but in accessible via Go directly. ## Caveats * Some utility functions will call [`runtime.LockOSThread`](https://golang.org/pkg/runtime/#LockOSThread) for you, they will also unlock the thread after profiling. ***Note*** using these utility functions will incur significant overhead. * Overflow handling is not implemented. # Setup Most likely you will need to tweak some system settings unless you are running as root. From `man perf_event_open`: ``` perf_event related configuration files Files in /proc/sys/kernel/ /proc/sys/kernel/perf_event_paranoid The perf_event_paranoid file can be set to restrict access to the performance counters. 2 allow only user-space measurements (default since Linux 4.6). 1 allow both kernel and user measurements (default before Linux 4.6). 0 allow access to CPU-specific data but not raw tracepoint samples. -1 no restrictions. The existence of the perf_event_paranoid file is the official method for determining if a kernel supports perf_event_open(). /proc/sys/kernel/perf_event_max_sample_rate This sets the maximum sample rate. Setting this too high can allow users to sample at a rate that impacts overall machine performance and potentially lock up the machine. The default value is 100000 (samples per second). /proc/sys/kernel/perf_event_max_stack This file sets the maximum depth of stack frame entries reported when generating a call trace. /proc/sys/kernel/perf_event_mlock_kb Maximum number of pages an unprivileged user can mlock(2). The default is 516 (kB). ``` # Example Say you wanted to see how many CPU instructions a particular function took: ``` package main import ( "fmt" "log" "github.com/hodgesds/perf-utils" ) func foo() error { var total int for i:=0;i<1000;i++ { total++ } return nil } func main() { profileValue, err := perf.CPUInstructions(foo) if err != nil { log.Fatal(err) } fmt.Printf("CPU instructions: %+v\n", profileValue) } ``` # Benchmarks To profile a single function call there is an overhead of ~0.4ms. ``` $ go test -bench=BenchmarkCPUCycles . goos: linux goarch: amd64 pkg: github.com/hodgesds/perf-utils BenchmarkCPUCycles-8 3000 397924 ns/op 32 B/op 1 allocs/op PASS ok github.com/hodgesds/perf-utils 1.255s ``` The `Profiler` interface has low overhead and suitable for many use cases: ``` $ go test -bench=BenchmarkProfiler . goos: linux goarch: amd64 pkg: github.com/hodgesds/perf-utils BenchmarkProfiler-8 3000000 488 ns/op 32 B/op 1 allocs/op PASS ok github.com/hodgesds/perf-utils 1.981s ``` # BPF Support BPF is supported by using the `BPFProfiler` which is available via the `ProfileTracepoint` function. To use BPF you need to create the BPF program and then call `AttachBPF` with the file descriptor of the BPF program. This is not well tested so use at your own peril. # Misc Originally I set out to use `go generate` to build Go structs that were compatible with perf, I found a really good [article](https://utcc.utoronto.ca/~cks/space/blog/programming/GoCGoCompatibleStructs) on how to do so. Eventually, after digging through some of the `/x/sys/unix` code I found pretty much what I was needed. However, I think if you are interested in interacting with the kernel it is a worthwhile read. prometheus-node-exporter-0.18.1+ds/vendor/github.com/hodgesds/perf-utils/bpf.go000066400000000000000000000011141350016654700275170ustar00rootroot00000000000000// +build linux package perf import ( "golang.org/x/sys/unix" ) // BPFProfiler is a Profiler that allows attaching a Berkeley // Packet Filter (BPF) program to an existing kprobe tracepoint event. // You need CAP_SYS_ADMIN privileges to use this interface. See: // https://lwn.net/Articles/683504/ type BPFProfiler interface { Profiler AttachBPF(int) error } // AttachBPF is used to attach a BPF program to a profiler by using the file // descriptor of the BPF program. func (p *profiler) AttachBPF(fd int) error { return unix.IoctlSetInt(p.fd, unix.PERF_EVENT_IOC_SET_BPF, fd) } prometheus-node-exporter-0.18.1+ds/vendor/github.com/hodgesds/perf-utils/cache_profiler.go000066400000000000000000000275521350016654700317330ustar00rootroot00000000000000// +build linux package perf import ( "go.uber.org/multierr" "golang.org/x/sys/unix" ) const ( // L1DataReadHit is a constant... L1DataReadHit = (unix.PERF_COUNT_HW_CACHE_L1D) | (unix.PERF_COUNT_HW_CACHE_OP_READ << 8) | (unix.PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) // L1DataReadMiss is a constant... L1DataReadMiss = (unix.PERF_COUNT_HW_CACHE_L1D) | (unix.PERF_COUNT_HW_CACHE_OP_READ << 8) | (unix.PERF_COUNT_HW_CACHE_RESULT_MISS << 16) // L1DataWriteHit is a constant... L1DataWriteHit = (unix.PERF_COUNT_HW_CACHE_L1D) | (unix.PERF_COUNT_HW_CACHE_OP_WRITE << 8) | (unix.PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) // L1InstrReadMiss is a constant... L1InstrReadMiss = (unix.PERF_COUNT_HW_CACHE_L1I) | (unix.PERF_COUNT_HW_CACHE_OP_READ << 8) | (unix.PERF_COUNT_HW_CACHE_RESULT_MISS << 16) // LLReadHit is a constant... LLReadHit = (unix.PERF_COUNT_HW_CACHE_LL) | (unix.PERF_COUNT_HW_CACHE_OP_READ << 8) | (unix.PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) // LLReadMiss is a constant... LLReadMiss = (unix.PERF_COUNT_HW_CACHE_LL) | (unix.PERF_COUNT_HW_CACHE_OP_READ << 8) | (unix.PERF_COUNT_HW_CACHE_RESULT_MISS << 16) // LLWriteHit is a constant... LLWriteHit = (unix.PERF_COUNT_HW_CACHE_LL) | (unix.PERF_COUNT_HW_CACHE_OP_WRITE << 8) | (unix.PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) // LLWriteMiss is a constant... LLWriteMiss = (unix.PERF_COUNT_HW_CACHE_LL) | (unix.PERF_COUNT_HW_CACHE_OP_WRITE << 8) | (unix.PERF_COUNT_HW_CACHE_RESULT_MISS << 16) // DataTLBReadHit is a constant... DataTLBReadHit = (unix.PERF_COUNT_HW_CACHE_DTLB) | (unix.PERF_COUNT_HW_CACHE_OP_READ << 8) | (unix.PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) // DataTLBReadMiss is a constant... DataTLBReadMiss = (unix.PERF_COUNT_HW_CACHE_DTLB) | (unix.PERF_COUNT_HW_CACHE_OP_READ << 8) | (unix.PERF_COUNT_HW_CACHE_RESULT_MISS << 16) // DataTLBWriteHit is a constant... DataTLBWriteHit = (unix.PERF_COUNT_HW_CACHE_DTLB) | (unix.PERF_COUNT_HW_CACHE_OP_WRITE << 8) | (unix.PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) // DataTLBWriteMiss is a constant... DataTLBWriteMiss = (unix.PERF_COUNT_HW_CACHE_DTLB) | (unix.PERF_COUNT_HW_CACHE_OP_WRITE << 8) | (unix.PERF_COUNT_HW_CACHE_RESULT_MISS << 16) // InstrTLBReadHit is a constant... InstrTLBReadHit = (unix.PERF_COUNT_HW_CACHE_ITLB) | (unix.PERF_COUNT_HW_CACHE_OP_READ << 8) | (unix.PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) // InstrTLBReadMiss is a constant... InstrTLBReadMiss = (unix.PERF_COUNT_HW_CACHE_ITLB) | (unix.PERF_COUNT_HW_CACHE_OP_READ << 8) | (unix.PERF_COUNT_HW_CACHE_RESULT_MISS << 16) // BPUReadHit is a constant... BPUReadHit = (unix.PERF_COUNT_HW_CACHE_BPU) | (unix.PERF_COUNT_HW_CACHE_OP_READ << 8) | (unix.PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) // BPUReadMiss is a constant... BPUReadMiss = (unix.PERF_COUNT_HW_CACHE_BPU) | (unix.PERF_COUNT_HW_CACHE_OP_READ << 8) | (unix.PERF_COUNT_HW_CACHE_RESULT_MISS << 16) // NodeCacheReadHit is a constant... NodeCacheReadHit = (unix.PERF_COUNT_HW_CACHE_NODE) | (unix.PERF_COUNT_HW_CACHE_OP_READ << 8) | (unix.PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) // NodeCacheReadMiss is a constant... NodeCacheReadMiss = (unix.PERF_COUNT_HW_CACHE_NODE) | (unix.PERF_COUNT_HW_CACHE_OP_READ << 8) | (unix.PERF_COUNT_HW_CACHE_RESULT_MISS << 16) // NodeCacheWriteHit is a constant... NodeCacheWriteHit = (unix.PERF_COUNT_HW_CACHE_NODE) | (unix.PERF_COUNT_HW_CACHE_OP_WRITE << 8) | (unix.PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) // NodeCacheWriteMiss is a constant... NodeCacheWriteMiss = (unix.PERF_COUNT_HW_CACHE_NODE) | (unix.PERF_COUNT_HW_CACHE_OP_WRITE << 8) | (unix.PERF_COUNT_HW_CACHE_RESULT_MISS << 16) ) type cacheProfiler struct { // map of perf counter type to file descriptor profilers map[int]Profiler } // NewCacheProfiler returns a new cache profiler. func NewCacheProfiler(pid, cpu int, opts ...int) CacheProfiler { profilers := map[int]Profiler{} // L1 data op := unix.PERF_COUNT_HW_CACHE_OP_READ result := unix.PERF_COUNT_HW_CACHE_RESULT_ACCESS l1dataReadHit, err := NewL1DataProfiler(pid, cpu, op, result, opts...) if err == nil { profilers[L1DataReadHit] = l1dataReadHit } op = unix.PERF_COUNT_HW_CACHE_OP_READ result = unix.PERF_COUNT_HW_CACHE_RESULT_MISS l1dataReadMiss, err := NewL1DataProfiler(pid, cpu, op, result, opts...) if err == nil { profilers[L1DataReadMiss] = l1dataReadMiss } op = unix.PERF_COUNT_HW_CACHE_OP_WRITE result = unix.PERF_COUNT_HW_CACHE_RESULT_ACCESS l1dataWriteHit, err := NewL1DataProfiler(pid, cpu, op, result, opts...) if err == nil { profilers[L1DataWriteHit] = l1dataWriteHit } // L1 instruction op = unix.PERF_COUNT_HW_CACHE_OP_READ result = unix.PERF_COUNT_HW_CACHE_RESULT_MISS l1InstrReadMiss, err := NewL1InstrProfiler(pid, cpu, op, result, opts...) if err == nil { profilers[L1InstrReadMiss] = l1InstrReadMiss } // Last Level op = unix.PERF_COUNT_HW_CACHE_OP_READ result = unix.PERF_COUNT_HW_CACHE_RESULT_ACCESS llReadHit, err := NewLLCacheProfiler(pid, cpu, op, result, opts...) if err == nil { profilers[LLReadHit] = llReadHit } op = unix.PERF_COUNT_HW_CACHE_OP_READ result = unix.PERF_COUNT_HW_CACHE_RESULT_MISS llReadMiss, err := NewLLCacheProfiler(pid, cpu, op, result, opts...) if err == nil { profilers[LLReadMiss] = llReadMiss } op = unix.PERF_COUNT_HW_CACHE_OP_WRITE result = unix.PERF_COUNT_HW_CACHE_RESULT_ACCESS llWriteHit, err := NewLLCacheProfiler(pid, cpu, op, result, opts...) if err == nil { profilers[LLWriteHit] = llWriteHit } op = unix.PERF_COUNT_HW_CACHE_OP_WRITE result = unix.PERF_COUNT_HW_CACHE_RESULT_MISS llWriteMiss, err := NewLLCacheProfiler(pid, cpu, op, result, opts...) if err == nil { profilers[LLWriteMiss] = llWriteMiss } // dTLB op = unix.PERF_COUNT_HW_CACHE_OP_READ result = unix.PERF_COUNT_HW_CACHE_RESULT_ACCESS dTLBReadHit, err := NewDataTLBProfiler(pid, cpu, op, result, opts...) if err == nil { profilers[DataTLBReadHit] = dTLBReadHit } op = unix.PERF_COUNT_HW_CACHE_OP_READ result = unix.PERF_COUNT_HW_CACHE_RESULT_MISS dTLBReadMiss, err := NewDataTLBProfiler(pid, cpu, op, result, opts...) if err == nil { profilers[DataTLBReadMiss] = dTLBReadMiss } op = unix.PERF_COUNT_HW_CACHE_OP_WRITE result = unix.PERF_COUNT_HW_CACHE_RESULT_ACCESS dTLBWriteHit, err := NewDataTLBProfiler(pid, cpu, op, result, opts...) if err == nil { profilers[DataTLBWriteHit] = dTLBWriteHit } op = unix.PERF_COUNT_HW_CACHE_OP_WRITE result = unix.PERF_COUNT_HW_CACHE_RESULT_MISS dTLBWriteMiss, err := NewDataTLBProfiler(pid, cpu, op, result, opts...) if err == nil { profilers[DataTLBWriteMiss] = dTLBWriteMiss } // iTLB op = unix.PERF_COUNT_HW_CACHE_OP_READ result = unix.PERF_COUNT_HW_CACHE_RESULT_ACCESS iTLBReadHit, err := NewInstrTLBProfiler(pid, cpu, op, result, opts...) if err == nil { profilers[InstrTLBReadHit] = iTLBReadHit } op = unix.PERF_COUNT_HW_CACHE_OP_READ result = unix.PERF_COUNT_HW_CACHE_RESULT_MISS iTLBReadMiss, err := NewInstrTLBProfiler(pid, cpu, op, result, opts...) if err == nil { profilers[InstrTLBReadMiss] = iTLBReadMiss } // BPU op = unix.PERF_COUNT_HW_CACHE_OP_READ result = unix.PERF_COUNT_HW_CACHE_RESULT_ACCESS bpuReadHit, err := NewBPUProfiler(pid, cpu, op, result, opts...) if err == nil { profilers[BPUReadHit] = bpuReadHit } op = unix.PERF_COUNT_HW_CACHE_OP_READ result = unix.PERF_COUNT_HW_CACHE_RESULT_MISS bpuReadMiss, err := NewBPUProfiler(pid, cpu, op, result, opts...) if err == nil { profilers[BPUReadMiss] = bpuReadMiss } // Node op = unix.PERF_COUNT_HW_CACHE_OP_READ result = unix.PERF_COUNT_HW_CACHE_RESULT_ACCESS nodeReadHit, err := NewNodeCacheProfiler(pid, cpu, op, result, opts...) if err == nil { profilers[NodeCacheReadHit] = nodeReadHit } op = unix.PERF_COUNT_HW_CACHE_OP_READ result = unix.PERF_COUNT_HW_CACHE_RESULT_MISS nodeReadMiss, err := NewNodeCacheProfiler(pid, cpu, op, result, opts...) if err == nil { profilers[NodeCacheReadMiss] = nodeReadMiss } op = unix.PERF_COUNT_HW_CACHE_OP_WRITE result = unix.PERF_COUNT_HW_CACHE_RESULT_ACCESS nodeWriteHit, err := NewNodeCacheProfiler(pid, cpu, op, result, opts...) if err == nil { profilers[NodeCacheWriteHit] = nodeWriteHit } op = unix.PERF_COUNT_HW_CACHE_OP_WRITE result = unix.PERF_COUNT_HW_CACHE_RESULT_MISS nodeWriteMiss, err := NewNodeCacheProfiler(pid, cpu, op, result, opts...) if err == nil { profilers[NodeCacheWriteMiss] = nodeWriteMiss } return &cacheProfiler{ profilers: profilers, } } // Start is used to start the CacheProfiler, it will return an error if no // profilers are configured. func (p *cacheProfiler) Start() error { if len(p.profilers) == 0 { return ErrNoProfiler } var err error for _, profiler := range p.profilers { err = multierr.Append(err, profiler.Start()) } return err } // Reset is used to reset the CacheProfiler. func (p *cacheProfiler) Reset() error { var err error for _, profiler := range p.profilers { err = multierr.Append(err, profiler.Reset()) } return err } // Stop is used to reset the CacheProfiler. func (p *cacheProfiler) Stop() error { var err error for _, profiler := range p.profilers { err = multierr.Append(err, profiler.Stop()) } return err } // Close is used to reset the CacheProfiler. func (p *cacheProfiler) Close() error { var err error for _, profiler := range p.profilers { err = multierr.Append(err, profiler.Close()) } return err } // Profile is used to read the CacheProfiler CacheProfile it returns an // error only if all profiles fail. func (p *cacheProfiler) Profile() (*CacheProfile, error) { var err error cacheProfile := &CacheProfile{} for profilerType, profiler := range p.profilers { profileVal, err2 := profiler.Profile() err = multierr.Append(err, err2) if err2 == nil { if cacheProfile.TimeEnabled == nil { cacheProfile.TimeEnabled = &profileVal.TimeEnabled } if cacheProfile.TimeRunning == nil { cacheProfile.TimeRunning = &profileVal.TimeRunning } switch { // L1 data case (profilerType ^ L1DataReadHit) == 0: cacheProfile.L1DataReadHit = &profileVal.Value case (profilerType ^ L1DataReadMiss) == 0: cacheProfile.L1DataReadMiss = &profileVal.Value case (profilerType ^ L1DataWriteHit) == 0: cacheProfile.L1DataWriteHit = &profileVal.Value // L1 instruction case (profilerType ^ L1InstrReadMiss) == 0: cacheProfile.L1InstrReadMiss = &profileVal.Value // Last Level case (profilerType ^ LLReadHit) == 0: cacheProfile.LastLevelReadHit = &profileVal.Value case (profilerType ^ LLReadMiss) == 0: cacheProfile.LastLevelReadMiss = &profileVal.Value case (profilerType ^ LLWriteHit) == 0: cacheProfile.LastLevelWriteHit = &profileVal.Value case (profilerType ^ LLWriteMiss) == 0: cacheProfile.LastLevelWriteMiss = &profileVal.Value // dTLB case (profilerType ^ DataTLBReadHit) == 0: cacheProfile.DataTLBReadHit = &profileVal.Value case (profilerType ^ DataTLBReadMiss) == 0: cacheProfile.DataTLBReadMiss = &profileVal.Value case (profilerType ^ DataTLBWriteHit) == 0: cacheProfile.DataTLBWriteHit = &profileVal.Value case (profilerType ^ DataTLBWriteMiss) == 0: cacheProfile.DataTLBWriteMiss = &profileVal.Value // iTLB case (profilerType ^ InstrTLBReadHit) == 0: cacheProfile.InstrTLBReadHit = &profileVal.Value case (profilerType ^ InstrTLBReadMiss) == 0: cacheProfile.InstrTLBReadMiss = &profileVal.Value // BPU case (profilerType ^ BPUReadHit) == 0: cacheProfile.BPUReadHit = &profileVal.Value case (profilerType ^ BPUReadMiss) == 0: cacheProfile.BPUReadMiss = &profileVal.Value // node case (profilerType ^ NodeCacheReadHit) == 0: cacheProfile.NodeReadHit = &profileVal.Value case (profilerType ^ NodeCacheReadMiss) == 0: cacheProfile.NodeReadMiss = &profileVal.Value case (profilerType ^ NodeCacheWriteHit) == 0: cacheProfile.NodeWriteHit = &profileVal.Value case (profilerType ^ NodeCacheWriteMiss) == 0: cacheProfile.NodeWriteMiss = &profileVal.Value } } } if len(multierr.Errors(err)) == len(p.profilers) { return nil, err } return cacheProfile, nil } prometheus-node-exporter-0.18.1+ds/vendor/github.com/hodgesds/perf-utils/events.go000066400000000000000000000074351350016654700302700ustar00rootroot00000000000000// +build linux package perf import ( "fmt" "strconv" "strings" "unsafe" "golang.org/x/sys/unix" ) const ( // PERF_TYPE_TRACEPOINT is a kernel tracepoint. PERF_TYPE_TRACEPOINT = 2 ) // AvailableEvents returns a mapping of available subsystems and their // corresponding list of available events. func AvailableEvents() (map[string][]string, error) { events := map[string][]string{} // BUG(hodgesds): this should ideally check mounts for debugfs rawEvents, err := fileToStrings(TracingDir + "/available_events") // Events are colon delimited by type so parse the type and add sub // events appropriately. if err != nil { return events, err } for _, rawEvent := range rawEvents { splits := strings.Split(rawEvent, ":") if len(splits) <= 1 { continue } eventTypeEvents, found := events[splits[0]] if found { events[splits[0]] = append(eventTypeEvents, splits[1]) continue } events[splits[0]] = []string{splits[1]} } return events, err } // AvailableSubsystems returns a slice of available subsystems. func AvailableSubsystems() ([]string, error) { subsystems := []string{} // BUG(hodgesds): this should ideally check mounts for debugfs rawEvents, err := fileToStrings(TracingDir + "/available_events") // Events are colon delimited by type so parse the type and add sub // events appropriately. if err != nil { return subsystems, err } for _, rawEvent := range rawEvents { splits := strings.Split(rawEvent, ":") if len(splits) <= 1 { continue } subsystems = append(subsystems, splits[0]) } return subsystems, nil } // AvailableTracers returns the list of available tracers. func AvailableTracers() ([]string, error) { return fileToStrings(TracingDir + "/available_tracers") } // CurrentTracer returns the current tracer. func CurrentTracer() (string, error) { res, err := fileToStrings(TracingDir + "/current_tracer") return res[0], err } // GetTracepointConfig is used to get the configuration for a trace event. func GetTracepointConfig(subsystem, event string) (uint64, error) { res, err := fileToStrings( TracingDir + fmt.Sprintf("/events/%s/%s/id", subsystem, event)) if err != nil { return 0, err } return strconv.ParseUint(res[0], 10, 64) } // ProfileTracepoint is used to profile a kernel tracepoint event for a // specific PID. Events can be listed with `perf list` for Tracepoint Events or // in the /sys/kernel/debug/tracing/events directory with the kind being the // directory and the event being the subdirectory. func ProfileTracepoint(subsystem, event string, pid, cpu int, opts ...int) (BPFProfiler, error) { config, err := GetTracepointConfig(subsystem, event) if err != nil { return nil, err } eventAttr := &unix.PerfEventAttr{ Type: PERF_TYPE_TRACEPOINT, Config: config, Size: uint32(unsafe.Sizeof(unix.PerfEventAttr{})), Bits: unix.PerfBitDisabled | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, Sample_type: PERF_SAMPLE_IDENTIFIER, } var eventOps int if len(opts) > 0 { eventOps = opts[0] } fd, err := unix.PerfEventOpen( eventAttr, pid, cpu, -1, eventOps, ) if err != nil { return nil, err } return &profiler{ fd: fd, }, nil } // TracepointEventAttr is used to return an PerfEventAttr for a trace event. func TracepointEventAttr(subsystem, event string) (*unix.PerfEventAttr, error) { config, err := GetTracepointConfig(subsystem, event) if err != nil { return nil, err } return &unix.PerfEventAttr{ Type: PERF_TYPE_TRACEPOINT, Config: config, Size: uint32(unsafe.Sizeof(unix.PerfEventAttr{})), Bits: unix.PerfBitDisabled | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, Sample_type: PERF_SAMPLE_IDENTIFIER, }, nil } prometheus-node-exporter-0.18.1+ds/vendor/github.com/hodgesds/perf-utils/fs_utils.go000066400000000000000000000045331350016654700306100ustar00rootroot00000000000000// +build linux package perf import ( "bufio" "fmt" "os" "strings" ) const ( // DebugFS is the filesystem type for debugfs. DebugFS = "debugfs" // TraceFS is the filesystem type for tracefs. TraceFS = "tracefs" // ProcMounts is the mount point for file systems in procfs. ProcMounts = "/proc/mounts" // PerfMaxStack is the mount point for the max perf event size. PerfMaxStack = "/proc/sys/kernel/perf_event_max_stack" // PerfMaxContexts is a sysfs mount that contains the max perf contexts. PerfMaxContexts = "/proc/sys/kernel/perf_event_max_contexts_per_stack" // SyscallsDir is a constant of the default tracing event syscalls directory. SyscallsDir = "/sys/kernel/debug/tracing/events/syscalls/" // TracingDir is a constant of the default tracing directory. TracingDir = "/sys/kernel/debug/tracing" ) var ( // ErrNoMount is when there is no such mount. ErrNoMount = fmt.Errorf("no such mount") ) // TraceFSMount returns the first found mount point of a tracefs file system. func TraceFSMount() (string, error) { mounts, err := GetFSMount(TraceFS) if err != nil { return "", err } if len(mounts) == 0 { return "", ErrNoMount } return mounts[0], nil } // DebugFSMount returns the first found mount point of a debugfs file system. func DebugFSMount() (string, error) { mounts, err := GetFSMount(DebugFS) if err != nil { return "", err } if len(mounts) == 0 { return "", ErrNoMount } return mounts[0], nil } // GetFSMount is a helper function to get a mount file system type. func GetFSMount(mountType string) ([]string, error) { mounts := []string{} file, err := os.Open(ProcMounts) if err != nil { return mounts, err } scanner := bufio.NewScanner(file) for scanner.Scan() { mountInfo := strings.Split(scanner.Text(), " ") if len(mountInfo) > 3 && mountInfo[2] == mountType { mounts = append(mounts, mountInfo[1]) } } if err := scanner.Err(); err != nil { return mounts, err } return mounts, file.Close() } // fileToStrings is a helper method that reads a line line by line and returns // a slice of strings. func fileToStrings(path string) ([]string, error) { res := []string{} f, err := os.Open(path) if err != nil { return res, err } scanner := bufio.NewScanner(f) for scanner.Scan() { res = append(res, scanner.Text()) } if err := scanner.Err(); err != nil { return res, err } return res, nil } prometheus-node-exporter-0.18.1+ds/vendor/github.com/hodgesds/perf-utils/group_profiler.go000066400000000000000000000075151350016654700320210ustar00rootroot00000000000000// +build linux package perf import ( "encoding/binary" "fmt" "syscall" "go.uber.org/multierr" "golang.org/x/sys/unix" ) // ErrNoLeader is returned when a leader of a GroupProfiler is not defined. var ErrNoLeader = fmt.Errorf("No leader defined") // GroupProfileValue is returned from a GroupProfiler. type GroupProfileValue struct { Events uint64 TimeEnabled uint64 TimeRunning uint64 Values []uint64 } // GroupProfiler is used to setup a group profiler. type GroupProfiler interface { Start() error Reset() error Stop() error Close() error Profile() (*GroupProfileValue, error) } // groupProfiler implements the GroupProfiler interface. type groupProfiler struct { fds []int // leader is always element 0 } // NewGroupProfiler returns a GroupProfiler. func NewGroupProfiler(pid, cpu, opts int, eventAttrs ...unix.PerfEventAttr) (GroupProfiler, error) { fds := make([]int, len(eventAttrs)) for i, eventAttr := range eventAttrs { // common configs eventAttr.Size = EventAttrSize eventAttr.Sample_type = PERF_SAMPLE_IDENTIFIER // Leader fd must be opened first if i == 0 { // leader specific configs eventAttr.Bits = unix.PerfBitDisabled | unix.PerfBitExcludeHv eventAttr.Read_format = unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED | unix.PERF_FORMAT_GROUP fd, err := unix.PerfEventOpen( &eventAttr, pid, cpu, -1, opts, ) if err != nil { return nil, err } fds[i] = fd continue } // non leader configs eventAttr.Read_format = unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED | unix.PERF_FORMAT_GROUP eventAttr.Bits = unix.PerfBitExcludeHv fd, err := unix.PerfEventOpen( &eventAttr, pid, cpu, fds[0], opts, ) if err != nil { // cleanup any old Fds for ii, fd2 := range fds { if ii == i { break } err = multierr.Append(err, unix.Close(fd2)) } return nil, err } fds[i] = fd } return &groupProfiler{ fds: fds, }, nil } // Start is used to start the GroupProfiler. func (p *groupProfiler) Start() error { if len(p.fds) == 0 { return ErrNoLeader } return unix.IoctlSetInt(p.fds[0], unix.PERF_EVENT_IOC_ENABLE, 0) } // Reset is used to reset the GroupProfiler. func (p *groupProfiler) Reset() error { if len(p.fds) == 0 { return ErrNoLeader } return unix.IoctlSetInt(p.fds[0], unix.PERF_EVENT_IOC_RESET, 0) } // Stop is used to stop the GroupProfiler. func (p *groupProfiler) Stop() error { if len(p.fds) == 0 { return ErrNoLeader } return unix.IoctlSetInt(p.fds[0], unix.PERF_EVENT_IOC_DISABLE, 0) } // Close is used to close the GroupProfiler. func (p *groupProfiler) Close() error { var err error for _, fd := range p.fds { err = multierr.Append(err, unix.Close(fd)) } return err } // Profile is used to return the GroupProfileValue of the GroupProfiler. func (p *groupProfiler) Profile() (*GroupProfileValue, error) { nEvents := len(p.fds) if nEvents == 0 { return nil, ErrNoLeader } // read format of the raw event looks like this: /* struct read_format { u64 nr; // The number of events / u64 time_enabled; // if PERF_FORMAT_TOTAL_TIME_ENABLED u64 time_running; // if PERF_FORMAT_TOTAL_TIME_RUNNING struct { u64 value; // The value of the event u64 id; // if PERF_FORMAT_ID } values[nr]; }; */ buf := make([]byte, 24+8*nEvents) _, err := syscall.Read(p.fds[0], buf) if err != nil { return nil, err } val := &GroupProfileValue{ Events: binary.LittleEndian.Uint64(buf[0:8]), TimeEnabled: binary.LittleEndian.Uint64(buf[8:16]), TimeRunning: binary.LittleEndian.Uint64(buf[16:24]), Values: make([]uint64, len(p.fds)), } offset := 24 for i := range p.fds { val.Values[i] = binary.LittleEndian.Uint64(buf[offset : offset+8]) offset += 8 } return val, nil } prometheus-node-exporter-0.18.1+ds/vendor/github.com/hodgesds/perf-utils/hardware_profiler.go000066400000000000000000000107111350016654700324520ustar00rootroot00000000000000// +build linux package perf import ( "go.uber.org/multierr" "golang.org/x/sys/unix" ) type hardwareProfiler struct { // map of perf counter type to file descriptor profilers map[int]Profiler } // NewHardwareProfiler returns a new hardware profiler. func NewHardwareProfiler(pid, cpu int, opts ...int) HardwareProfiler { profilers := map[int]Profiler{} cpuCycleProfiler, err := NewCPUCycleProfiler(pid, cpu, opts...) if err == nil { profilers[unix.PERF_COUNT_HW_CPU_CYCLES] = cpuCycleProfiler } instrProfiler, err := NewInstrProfiler(pid, cpu, opts...) if err == nil { profilers[unix.PERF_COUNT_HW_INSTRUCTIONS] = instrProfiler } cacheRefProfiler, err := NewCacheRefProfiler(pid, cpu, opts...) if err == nil { profilers[unix.PERF_COUNT_HW_CACHE_REFERENCES] = cacheRefProfiler } cacheMissesProfiler, err := NewCacheMissesProfiler(pid, cpu, opts...) if err == nil { profilers[unix.PERF_COUNT_HW_CACHE_MISSES] = cacheMissesProfiler } branchInstrProfiler, err := NewBranchInstrProfiler(pid, cpu, opts...) if err == nil { profilers[unix.PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = branchInstrProfiler } branchMissesProfiler, err := NewBranchMissesProfiler(pid, cpu, opts...) if err == nil { profilers[unix.PERF_COUNT_HW_BRANCH_MISSES] = branchMissesProfiler } busCyclesProfiler, err := NewBusCyclesProfiler(pid, cpu, opts...) if err == nil { profilers[unix.PERF_COUNT_HW_BUS_CYCLES] = busCyclesProfiler } stalledCyclesFrontProfiler, err := NewStalledCyclesFrontProfiler(pid, cpu, opts...) if err == nil { profilers[unix.PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = stalledCyclesFrontProfiler } stalledCyclesBackProfiler, err := NewStalledCyclesBackProfiler(pid, cpu, opts...) if err == nil { profilers[unix.PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = stalledCyclesBackProfiler } refCPUCyclesProfiler, err := NewRefCPUCyclesProfiler(pid, cpu, opts...) if err == nil { profilers[unix.PERF_COUNT_HW_REF_CPU_CYCLES] = refCPUCyclesProfiler } return &hardwareProfiler{ profilers: profilers, } } // Start is used to start the HardwareProfiler. func (p *hardwareProfiler) Start() error { if len(p.profilers) == 0 { return ErrNoProfiler } var err error for _, profiler := range p.profilers { err = multierr.Append(err, profiler.Start()) } return err } // Reset is used to reset the HardwareProfiler. func (p *hardwareProfiler) Reset() error { var err error for _, profiler := range p.profilers { err = multierr.Append(err, profiler.Reset()) } return err } // Stop is used to reset the HardwareProfiler. func (p *hardwareProfiler) Stop() error { var err error for _, profiler := range p.profilers { err = multierr.Append(err, profiler.Stop()) } return err } // Close is used to reset the HardwareProfiler. func (p *hardwareProfiler) Close() error { var err error for _, profiler := range p.profilers { err = multierr.Append(err, profiler.Close()) } return err } // Profile is used to read the HardwareProfiler HardwareProfile it returns an // error only if all profiles fail. func (p *hardwareProfiler) Profile() (*HardwareProfile, error) { var err error hwProfile := &HardwareProfile{} for profilerType, profiler := range p.profilers { profileVal, err2 := profiler.Profile() err = multierr.Append(err, err2) if err2 == nil { if hwProfile.TimeEnabled == nil { hwProfile.TimeEnabled = &profileVal.TimeEnabled } if hwProfile.TimeRunning == nil { hwProfile.TimeRunning = &profileVal.TimeRunning } switch profilerType { case unix.PERF_COUNT_HW_CPU_CYCLES: hwProfile.CPUCycles = &profileVal.Value case unix.PERF_COUNT_HW_INSTRUCTIONS: hwProfile.Instructions = &profileVal.Value case unix.PERF_COUNT_HW_CACHE_REFERENCES: hwProfile.CacheRefs = &profileVal.Value case unix.PERF_COUNT_HW_CACHE_MISSES: hwProfile.CacheMisses = &profileVal.Value case unix.PERF_COUNT_HW_BRANCH_INSTRUCTIONS: hwProfile.BranchInstr = &profileVal.Value case unix.PERF_COUNT_HW_BRANCH_MISSES: hwProfile.BranchMisses = &profileVal.Value case unix.PERF_COUNT_HW_BUS_CYCLES: hwProfile.BusCycles = &profileVal.Value case unix.PERF_COUNT_HW_STALLED_CYCLES_FRONTEND: hwProfile.StalledCyclesFrontend = &profileVal.Value case unix.PERF_COUNT_HW_STALLED_CYCLES_BACKEND: hwProfile.StalledCyclesBackend = &profileVal.Value case unix.PERF_COUNT_HW_REF_CPU_CYCLES: hwProfile.RefCPUCycles = &profileVal.Value } } } if len(multierr.Errors(err)) == len(p.profilers) { return nil, err } return hwProfile, nil } prometheus-node-exporter-0.18.1+ds/vendor/github.com/hodgesds/perf-utils/process_profile.go000066400000000000000000000333401350016654700321540ustar00rootroot00000000000000// +build linux package perf import ( "encoding/binary" "fmt" "syscall" "unsafe" "golang.org/x/sys/unix" ) const ( // PERF_SAMPLE_IDENTIFIER is not defined in x/sys/unix. PERF_SAMPLE_IDENTIFIER = 1 << 16 // PERF_IOC_FLAG_GROUP is not defined in x/sys/unix. PERF_IOC_FLAG_GROUP = 1 << 0 ) var ( // ErrNoProfiler is returned when no profiler is available for profiling. ErrNoProfiler = fmt.Errorf("No profiler available") ) // Profiler is a profiler. type Profiler interface { Start() error Reset() error Stop() error Close() error Profile() (*ProfileValue, error) } // HardwareProfiler is a hardware profiler. type HardwareProfiler interface { Start() error Reset() error Stop() error Close() error Profile() (*HardwareProfile, error) } // HardwareProfile is returned by a HardwareProfiler. Depending on kernel // configuration some fields may return nil. type HardwareProfile struct { CPUCycles *uint64 `json:"cpu_cycles,omitempty"` Instructions *uint64 `json:"instructions,omitempty"` CacheRefs *uint64 `json:"cache_refs,omitempty"` CacheMisses *uint64 `json:"cache_misses,omitempty"` BranchInstr *uint64 `json:"branch_instr,omitempty"` BranchMisses *uint64 `json:"branch_misses,omitempty"` BusCycles *uint64 `json:"bus_cycles,omitempty"` StalledCyclesFrontend *uint64 `json:"stalled_cycles_frontend,omitempty"` StalledCyclesBackend *uint64 `json:"stalled_cycles_backend,omitempty"` RefCPUCycles *uint64 `json:"ref_cpu_cycles,omitempty"` TimeEnabled *uint64 `json:"time_enabled,omitempty"` TimeRunning *uint64 `json:"time_running,omitempty"` } // SoftwareProfiler is a software profiler. type SoftwareProfiler interface { Start() error Reset() error Stop() error Close() error Profile() (*SoftwareProfile, error) } // SoftwareProfile is returned by a SoftwareProfiler. type SoftwareProfile struct { CPUClock *uint64 `json:"cpu_clock,omitempty"` TaskClock *uint64 `json:"task_clock,omitempty"` PageFaults *uint64 `json:"page_faults,omitempty"` ContextSwitches *uint64 `json:"context_switches,omitempty"` CPUMigrations *uint64 `json:"cpu_migrations,omitempty"` MinorPageFaults *uint64 `json:"minor_page_faults,omitempty"` MajorPageFaults *uint64 `json:"major_page_faults,omitempty"` AlignmentFaults *uint64 `json:"alignment_faults,omitempty"` EmulationFaults *uint64 `json:"emulation_faults,omitempty"` TimeEnabled *uint64 `json:"time_enabled,omitempty"` TimeRunning *uint64 `json:"time_running,omitempty"` } // CacheProfiler is a cache profiler. type CacheProfiler interface { Start() error Reset() error Stop() error Close() error Profile() (*CacheProfile, error) } // CacheProfile is returned by a CacheProfiler. type CacheProfile struct { L1DataReadHit *uint64 `json:"l1_data_read_hit,omitempty"` L1DataReadMiss *uint64 `json:"l1_data_read_miss,omitempty"` L1DataWriteHit *uint64 `json:"l1_data_write_hit,omitempty"` L1InstrReadMiss *uint64 `json:"l1_instr_read_miss,omitempty"` LastLevelReadHit *uint64 `json:"last_level_read_hit,omitempty"` LastLevelReadMiss *uint64 `json:"last_level_read_miss,omitempty"` LastLevelWriteHit *uint64 `json:"last_level_write_hit,omitempty"` LastLevelWriteMiss *uint64 `json:"last_level_write_miss,omitempty"` DataTLBReadHit *uint64 `json:"data_tlb_read_hit,omitempty"` DataTLBReadMiss *uint64 `json:"data_tlb_read_miss,omitempty"` DataTLBWriteHit *uint64 `json:"data_tlb_write_hit,omitempty"` DataTLBWriteMiss *uint64 `json:"data_tlb_write_miss,omitempty"` InstrTLBReadHit *uint64 `json:"instr_tlb_read_hit,omitempty"` InstrTLBReadMiss *uint64 `json:"instr_tlb_read_miss,omitempty"` BPUReadHit *uint64 `json:"bpu_read_hit,omitempty"` BPUReadMiss *uint64 `json:"bpu_read_miss,omitempty"` NodeReadHit *uint64 `json:"node_read_hit,omitempty"` NodeReadMiss *uint64 `json:"node_read_miss,omitempty"` NodeWriteHit *uint64 `json:"node_write_hit,omitempty"` NodeWriteMiss *uint64 `json:"node_write_miss,omitempty"` TimeEnabled *uint64 `json:"time_enabled,omitempty"` TimeRunning *uint64 `json:"time_running,omitempty"` } // ProfileValue is a value returned by a profiler. type ProfileValue struct { Value uint64 TimeEnabled uint64 TimeRunning uint64 } // profiler is used to profile a process. type profiler struct { fd int } // NewProfiler creates a new hardware profiler. It does not support grouping. func NewProfiler(profilerType uint32, config uint64, pid, cpu int, opts ...int) (Profiler, error) { eventAttr := &unix.PerfEventAttr{ Type: profilerType, Config: config, Size: uint32(unsafe.Sizeof(unix.PerfEventAttr{})), Bits: unix.PerfBitDisabled | unix.PerfBitExcludeHv | unix.PerfBitInherit, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, Sample_type: PERF_SAMPLE_IDENTIFIER, } var eventOps int if len(opts) > 0 { eventOps = opts[0] } fd, err := unix.PerfEventOpen( eventAttr, pid, cpu, -1, eventOps, ) if err != nil { return nil, err } return &profiler{ fd: fd, }, nil } // NewCPUCycleProfiler returns a Profiler that profiles CPU cycles. func NewCPUCycleProfiler(pid, cpu int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_HARDWARE, unix.PERF_COUNT_HW_CPU_CYCLES, pid, cpu, opts..., ) } // NewInstrProfiler returns a Profiler that profiles CPU instructions. func NewInstrProfiler(pid, cpu int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_HARDWARE, unix.PERF_COUNT_HW_INSTRUCTIONS, pid, cpu, opts..., ) } // NewCacheRefProfiler returns a Profiler that profiles cache references. func NewCacheRefProfiler(pid, cpu int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_HARDWARE, unix.PERF_COUNT_HW_CACHE_REFERENCES, pid, cpu, opts..., ) } // NewCacheMissesProfiler returns a Profiler that profiles cache misses. func NewCacheMissesProfiler(pid, cpu int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_HARDWARE, unix.PERF_COUNT_HW_CACHE_MISSES, pid, cpu, opts..., ) } // NewBranchInstrProfiler returns a Profiler that profiles branch instructions. func NewBranchInstrProfiler(pid, cpu int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_HARDWARE, unix.PERF_COUNT_HW_BRANCH_INSTRUCTIONS, pid, cpu, opts..., ) } // NewBranchMissesProfiler returns a Profiler that profiles branch misses. func NewBranchMissesProfiler(pid, cpu int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_HARDWARE, unix.PERF_COUNT_HW_BRANCH_MISSES, pid, cpu, opts..., ) } // NewBusCyclesProfiler returns a Profiler that profiles bus cycles. func NewBusCyclesProfiler(pid, cpu int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_HARDWARE, unix.PERF_COUNT_HW_BUS_CYCLES, pid, cpu, opts..., ) } // NewStalledCyclesFrontProfiler returns a Profiler that profiles stalled // frontend cycles. func NewStalledCyclesFrontProfiler(pid, cpu int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_HARDWARE, unix.PERF_COUNT_HW_STALLED_CYCLES_FRONTEND, pid, cpu, opts..., ) } // NewStalledCyclesBackProfiler returns a Profiler that profiles stalled // backend cycles. func NewStalledCyclesBackProfiler(pid, cpu int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_HARDWARE, unix.PERF_COUNT_HW_STALLED_CYCLES_BACKEND, pid, cpu, opts..., ) } // NewRefCPUCyclesProfiler returns a Profiler that profiles CPU cycles, it // is not affected by frequency scaling. func NewRefCPUCyclesProfiler(pid, cpu int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_HARDWARE, unix.PERF_COUNT_HW_REF_CPU_CYCLES, pid, cpu, opts..., ) } // NewCPUClockProfiler returns a Profiler that profiles CPU clock speed. func NewCPUClockProfiler(pid, cpu int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_SOFTWARE, unix.PERF_COUNT_SW_CPU_CLOCK, pid, cpu, opts..., ) } // NewTaskClockProfiler returns a Profiler that profiles clock count of the // running task. func NewTaskClockProfiler(pid, cpu int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_SOFTWARE, unix.PERF_COUNT_SW_TASK_CLOCK, pid, cpu, opts..., ) } // NewPageFaultProfiler returns a Profiler that profiles the number of page // faults. func NewPageFaultProfiler(pid, cpu int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_SOFTWARE, unix.PERF_COUNT_SW_PAGE_FAULTS, pid, cpu, opts..., ) } // NewCtxSwitchesProfiler returns a Profiler that profiles the number of context // switches. func NewCtxSwitchesProfiler(pid, cpu int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_SOFTWARE, unix.PERF_COUNT_SW_CONTEXT_SWITCHES, pid, cpu, opts..., ) } // NewCPUMigrationsProfiler returns a Profiler that profiles the number of times // the process has migrated to a new CPU. func NewCPUMigrationsProfiler(pid, cpu int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_SOFTWARE, unix.PERF_COUNT_SW_CPU_MIGRATIONS, pid, cpu, opts..., ) } // NewMinorFaultsProfiler returns a Profiler that profiles the number of minor // page faults. func NewMinorFaultsProfiler(pid, cpu int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_SOFTWARE, unix.PERF_COUNT_SW_PAGE_FAULTS_MIN, pid, cpu, opts..., ) } // NewMajorFaultsProfiler returns a Profiler that profiles the number of major // page faults. func NewMajorFaultsProfiler(pid, cpu int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_SOFTWARE, unix.PERF_COUNT_SW_PAGE_FAULTS_MAJ, pid, cpu, opts..., ) } // NewAlignFaultsProfiler returns a Profiler that profiles the number of // alignment faults. func NewAlignFaultsProfiler(pid, cpu int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_SOFTWARE, unix.PERF_COUNT_SW_ALIGNMENT_FAULTS, pid, cpu, opts..., ) } // NewEmulationFaultsProfiler returns a Profiler that profiles the number of // alignment faults. func NewEmulationFaultsProfiler(pid, cpu int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_SOFTWARE, unix.PERF_COUNT_SW_EMULATION_FAULTS, pid, cpu, opts..., ) } // NewL1DataProfiler returns a Profiler that profiles L1 cache data. func NewL1DataProfiler(pid, cpu, op, result int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_HW_CACHE, uint64((unix.PERF_COUNT_HW_CACHE_L1D)|(op<<8)|(result<<16)), pid, cpu, opts..., ) } // NewL1InstrProfiler returns a Profiler that profiles L1 instruction data. func NewL1InstrProfiler(pid, cpu, op, result int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_HW_CACHE, uint64((unix.PERF_COUNT_HW_CACHE_L1I)|(op<<8)|(result<<16)), pid, cpu, opts..., ) } // NewLLCacheProfiler returns a Profiler that profiles last level cache. func NewLLCacheProfiler(pid, cpu, op, result int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_HW_CACHE, uint64((unix.PERF_COUNT_HW_CACHE_LL)|(op<<8)|(result<<16)), pid, cpu, opts..., ) } // NewDataTLBProfiler returns a Profiler that profiles the data TLB. func NewDataTLBProfiler(pid, cpu, op, result int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_HW_CACHE, uint64((unix.PERF_COUNT_HW_CACHE_DTLB)|(op<<8)|(result<<16)), pid, cpu, opts..., ) } // NewInstrTLBProfiler returns a Profiler that profiles the instruction TLB. func NewInstrTLBProfiler(pid, cpu, op, result int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_HW_CACHE, uint64((unix.PERF_COUNT_HW_CACHE_ITLB)|(op<<8)|(result<<16)), pid, cpu, opts..., ) } // NewBPUProfiler returns a Profiler that profiles the BPU (branch prediction unit). func NewBPUProfiler(pid, cpu, op, result int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_HW_CACHE, uint64((unix.PERF_COUNT_HW_CACHE_BPU)|(op<<8)|(result<<16)), pid, cpu, opts..., ) } // NewNodeCacheProfiler returns a Profiler that profiles the node cache accesses. func NewNodeCacheProfiler(pid, cpu, op, result int, opts ...int) (Profiler, error) { return NewProfiler( unix.PERF_TYPE_HW_CACHE, uint64((unix.PERF_COUNT_HW_CACHE_NODE)|(op<<8)|(result<<16)), pid, cpu, opts..., ) } // Reset is used to reset the counters of the profiler. func (p *profiler) Reset() error { return unix.IoctlSetInt(p.fd, unix.PERF_EVENT_IOC_RESET, 0) } // Start is used to Start the profiler. func (p *profiler) Start() error { return unix.IoctlSetInt(p.fd, unix.PERF_EVENT_IOC_ENABLE, 0) } // Stop is used to stop the profiler. func (p *profiler) Stop() error { return unix.IoctlSetInt(p.fd, unix.PERF_EVENT_IOC_DISABLE, 0) } // Profile returns the current Profile. func (p *profiler) Profile() (*ProfileValue, error) { // The underlying struct that gets read from the profiler looks like: /* struct read_format { u64 value; // The value of the event u64 time_enabled; // if PERF_FORMAT_TOTAL_TIME_ENABLED u64 time_running; // if PERF_FORMAT_TOTAL_TIME_RUNNING u64 id; // if PERF_FORMAT_ID }; */ // read 24 bytes since PERF_FORMAT_TOTAL_TIME_ENABLED and // PERF_FORMAT_TOTAL_TIME_RUNNING are always set. // XXX: allow profile ids? buf := make([]byte, 24, 24) _, err := syscall.Read(p.fd, buf) if err != nil { return nil, err } return &ProfileValue{ Value: binary.LittleEndian.Uint64(buf[0:8]), TimeEnabled: binary.LittleEndian.Uint64(buf[8:16]), TimeRunning: binary.LittleEndian.Uint64(buf[16:24]), }, nil } // Close is used to close the perf context. func (p *profiler) Close() error { return unix.Close(p.fd) } prometheus-node-exporter-0.18.1+ds/vendor/github.com/hodgesds/perf-utils/software_profiler.go000066400000000000000000000102571350016654700325140ustar00rootroot00000000000000// +build linux package perf import ( "go.uber.org/multierr" "golang.org/x/sys/unix" ) type softwareProfiler struct { // map of perf counter type to file descriptor profilers map[int]Profiler } // NewSoftwareProfiler returns a new software profiler. func NewSoftwareProfiler(pid, cpu int, opts ...int) SoftwareProfiler { profilers := map[int]Profiler{} cpuClockProfiler, err := NewCPUClockProfiler(pid, cpu, opts...) if err == nil { profilers[unix.PERF_COUNT_SW_CPU_CLOCK] = cpuClockProfiler } taskClockProfiler, err := NewTaskClockProfiler(pid, cpu, opts...) if err == nil { profilers[unix.PERF_COUNT_SW_TASK_CLOCK] = taskClockProfiler } pageFaultProfiler, err := NewPageFaultProfiler(pid, cpu, opts...) if err == nil { profilers[unix.PERF_COUNT_SW_PAGE_FAULTS] = pageFaultProfiler } ctxSwitchesProfiler, err := NewCtxSwitchesProfiler(pid, cpu, opts...) if err == nil { profilers[unix.PERF_COUNT_SW_CONTEXT_SWITCHES] = ctxSwitchesProfiler } cpuMigrationsProfiler, err := NewCPUMigrationsProfiler(pid, cpu, opts...) if err == nil { profilers[unix.PERF_COUNT_SW_CPU_MIGRATIONS] = cpuMigrationsProfiler } minorFaultProfiler, err := NewMinorFaultsProfiler(pid, cpu, opts...) if err == nil { profilers[unix.PERF_COUNT_SW_PAGE_FAULTS_MIN] = minorFaultProfiler } majorFaultProfiler, err := NewMajorFaultsProfiler(pid, cpu, opts...) if err == nil { profilers[unix.PERF_COUNT_SW_PAGE_FAULTS_MAJ] = majorFaultProfiler } alignFaultsFrontProfiler, err := NewAlignFaultsProfiler(pid, cpu, opts...) if err == nil { profilers[unix.PERF_COUNT_SW_ALIGNMENT_FAULTS] = alignFaultsFrontProfiler } emuFaultProfiler, err := NewEmulationFaultsProfiler(pid, cpu, opts...) if err == nil { profilers[unix.PERF_COUNT_SW_EMULATION_FAULTS] = emuFaultProfiler } return &softwareProfiler{ profilers: profilers, } } // Start is used to start the SoftwareProfiler. func (p *softwareProfiler) Start() error { if len(p.profilers) == 0 { return ErrNoProfiler } var err error for _, profiler := range p.profilers { err = multierr.Append(err, profiler.Start()) } return err } // Reset is used to reset the SoftwareProfiler. func (p *softwareProfiler) Reset() error { var err error for _, profiler := range p.profilers { err = multierr.Append(err, profiler.Reset()) } return err } // Stop is used to reset the SoftwareProfiler. func (p *softwareProfiler) Stop() error { var err error for _, profiler := range p.profilers { err = multierr.Append(err, profiler.Stop()) } return err } // Close is used to reset the SoftwareProfiler. func (p *softwareProfiler) Close() error { var err error for _, profiler := range p.profilers { err = multierr.Append(err, profiler.Close()) } return err } // Profile is used to read the SoftwareProfiler SoftwareProfile it returns an // error only if all profiles fail. func (p *softwareProfiler) Profile() (*SoftwareProfile, error) { var err error swProfile := &SoftwareProfile{} for profilerType, profiler := range p.profilers { profileVal, err2 := profiler.Profile() err = multierr.Append(err, err2) if err2 == nil { if swProfile.TimeEnabled == nil { swProfile.TimeEnabled = &profileVal.TimeEnabled } if swProfile.TimeRunning == nil { swProfile.TimeRunning = &profileVal.TimeRunning } switch profilerType { case unix.PERF_COUNT_SW_CPU_CLOCK: swProfile.CPUClock = &profileVal.Value case unix.PERF_COUNT_SW_TASK_CLOCK: swProfile.TaskClock = &profileVal.Value case unix.PERF_COUNT_SW_PAGE_FAULTS: swProfile.PageFaults = &profileVal.Value case unix.PERF_COUNT_SW_CONTEXT_SWITCHES: swProfile.ContextSwitches = &profileVal.Value case unix.PERF_COUNT_SW_CPU_MIGRATIONS: swProfile.CPUMigrations = &profileVal.Value case unix.PERF_COUNT_SW_PAGE_FAULTS_MIN: swProfile.MinorPageFaults = &profileVal.Value case unix.PERF_COUNT_SW_PAGE_FAULTS_MAJ: swProfile.MajorPageFaults = &profileVal.Value case unix.PERF_COUNT_SW_ALIGNMENT_FAULTS: swProfile.AlignmentFaults = &profileVal.Value case unix.PERF_COUNT_SW_EMULATION_FAULTS: swProfile.EmulationFaults = &profileVal.Value default: } } } if len(multierr.Errors(err)) == len(p.profilers) { return nil, err } return swProfile, nil } prometheus-node-exporter-0.18.1+ds/vendor/github.com/hodgesds/perf-utils/utils.go000066400000000000000000000672261350016654700301300ustar00rootroot00000000000000// +build linux package perf import ( "encoding/binary" "runtime" "syscall" "unsafe" "golang.org/x/sys/unix" ) var ( // EventAttrSize is the size of a PerfEventAttr EventAttrSize = uint32(unsafe.Sizeof(unix.PerfEventAttr{})) ) // profileFn is a helper function to profile a function. func profileFn(eventAttr *unix.PerfEventAttr, f func() error) (*ProfileValue, error) { runtime.LockOSThread() defer runtime.UnlockOSThread() fd, err := unix.PerfEventOpen( eventAttr, unix.Gettid(), -1, -1, 0, ) if err != nil { return nil, err } if err := unix.IoctlSetInt(fd, unix.PERF_EVENT_IOC_RESET, 0); err != nil { return nil, err } if err := unix.IoctlSetInt(fd, unix.PERF_EVENT_IOC_ENABLE, 0); err != nil { return nil, err } if err := f(); err != nil { return nil, err } if err := unix.IoctlSetInt(fd, unix.PERF_EVENT_IOC_DISABLE, 0); err != nil { return nil, err } buf := make([]byte, 24) if _, err := syscall.Read(fd, buf); err != nil { return nil, err } return &ProfileValue{ Value: binary.LittleEndian.Uint64(buf[0:8]), TimeEnabled: binary.LittleEndian.Uint64(buf[8:16]), TimeRunning: binary.LittleEndian.Uint64(buf[16:24]), }, unix.Close(fd) } // CPUInstructions is used to profile a function and return the number of CPU instructions. // Note that it will call runtime.LockOSThread to ensure accurate profilng. func CPUInstructions(f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_HARDWARE, Config: unix.PERF_COUNT_HW_INSTRUCTIONS, Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // CPUInstructionsEventAttr returns a unix.PerfEventAttr configured for CPUInstructions. func CPUInstructionsEventAttr() unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_HARDWARE, Config: unix.PERF_COUNT_HW_INSTRUCTIONS, Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // CPUCycles is used to profile a function and return the number of CPU cycles. // Note that it will call runtime.LockOSThread to ensure accurate profilng. func CPUCycles(f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_HARDWARE, Config: unix.PERF_COUNT_HW_CPU_CYCLES, Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // CPUCyclesEventAttr returns a unix.PerfEventAttr configured for CPUCycles. func CPUCyclesEventAttr() unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_HARDWARE, Config: unix.PERF_COUNT_HW_CPU_CYCLES, Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // CacheRef is used to profile a function and return the number of cache // references. Note that it will call runtime.LockOSThread to ensure accurate // profilng. func CacheRef(f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_HARDWARE, Config: unix.PERF_COUNT_HW_CACHE_REFERENCES, Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // CacheRefEventAttr returns a unix.PerfEventAttr configured for CacheRef. func CacheRefEventAttr() unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_HARDWARE, Config: unix.PERF_COUNT_HW_CACHE_REFERENCES, Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // CacheMiss is used to profile a function and return the number of cache // misses. Note that it will call runtime.LockOSThread to ensure accurate // profilng. func CacheMiss(f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_HARDWARE, Config: unix.PERF_COUNT_HW_CACHE_MISSES, Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // CacheMissEventAttr returns a unix.PerfEventAttr configured for CacheMisses. func CacheMissEventAttr() unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_HARDWARE, Config: unix.PERF_COUNT_HW_CACHE_MISSES, Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // BusCycles is used to profile a function and return the number of bus // cycles. Note that it will call runtime.LockOSThread to ensure accurate // profilng. func BusCycles(f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_HARDWARE, Config: unix.PERF_COUNT_HW_BUS_CYCLES, Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // BusCyclesEventAttr returns a unix.PerfEventAttr configured for BusCycles. func BusCyclesEventAttr() unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_HARDWARE, Config: unix.PERF_COUNT_HW_BUS_CYCLES, Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // StalledFrontendCycles is used to profile a function and return the number of // stalled frontend cycles. Note that it will call runtime.LockOSThread to // ensure accurate profilng. func StalledFrontendCycles(f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_HARDWARE, Config: unix.PERF_COUNT_HW_STALLED_CYCLES_FRONTEND, Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // StalledFrontendCyclesEventAttr returns a unix.PerfEventAttr configured for StalledFrontendCycles. func StalledFrontendCyclesEventAttr() unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_HARDWARE, Config: unix.PERF_COUNT_HW_STALLED_CYCLES_FRONTEND, Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // StalledBackendCycles is used to profile a function and return the number of // stalled backend cycles. Note that it will call runtime.LockOSThread to // ensure accurate profilng. func StalledBackendCycles(f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_HARDWARE, Config: unix.PERF_COUNT_HW_STALLED_CYCLES_BACKEND, Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // StalledBackendCyclesEventAttr returns a unix.PerfEventAttr configured for StalledBackendCycles. func StalledBackendCyclesEventAttr() unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_HARDWARE, Config: unix.PERF_COUNT_HW_STALLED_CYCLES_BACKEND, Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // CPURefCycles is used to profile a function and return the number of CPU // references cycles which are not affected by frequency scaling. Note that it // will call runtime.LockOSThread to ensure accurate profilng. func CPURefCycles(f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_HARDWARE, Config: unix.PERF_COUNT_HW_REF_CPU_CYCLES, Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // CPURefCyclesEventAttr returns a unix.PerfEventAttr configured for CPURefCycles. func CPURefCyclesEventAttr() unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_HARDWARE, Config: unix.PERF_COUNT_HW_REF_CPU_CYCLES, Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // CPUClock is used to profile a function and return the CPU clock timer. Note // that it will call runtime.LockOSThread to ensure accurate profilng. func CPUClock(f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_SOFTWARE, Config: unix.PERF_COUNT_SW_CPU_CLOCK, Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // CPUClockEventAttr returns a unix.PerfEventAttr configured for CPUClock. func CPUClockEventAttr() unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_SOFTWARE, Config: unix.PERF_COUNT_SW_CPU_CLOCK, Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // CPUTaskClock is used to profile a function and return the CPU clock timer // for the running task. Note that it will call runtime.LockOSThread to ensure // accurate profilng. func CPUTaskClock(f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_SOFTWARE, Config: unix.PERF_COUNT_SW_TASK_CLOCK, Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // CPUTaskClockEventAttr returns a unix.PerfEventAttr configured for CPUTaskClock. func CPUTaskClockEventAttr() unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_SOFTWARE, Config: unix.PERF_COUNT_SW_TASK_CLOCK, Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // PageFaults is used to profile a function and return the number of page // faults. Note that it will call runtime.LockOSThread to ensure accurate // profilng. func PageFaults(f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_SOFTWARE, Config: unix.PERF_COUNT_SW_PAGE_FAULTS, Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // PageFaultsEventAttr returns a unix.PerfEventAttr configured for PageFaults. func PageFaultsEventAttr() unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_SOFTWARE, Config: unix.PERF_COUNT_SW_PAGE_FAULTS, Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // ContextSwitches is used to profile a function and return the number of // context switches. Note that it will call runtime.LockOSThread to ensure // accurate profilng. func ContextSwitches(f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_SOFTWARE, Config: unix.PERF_COUNT_SW_CONTEXT_SWITCHES, Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // ContextSwitchesEventAttr returns a unix.PerfEventAttr configured for ContextSwitches. func ContextSwitchesEventAttr() unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_SOFTWARE, Config: unix.PERF_COUNT_SW_CONTEXT_SWITCHES, Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // CPUMigrations is used to profile a function and return the number of times // the thread has been migrated to a new CPU. Note that it will call // runtime.LockOSThread to ensure accurate profilng. func CPUMigrations(f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_SOFTWARE, Config: unix.PERF_COUNT_SW_CPU_MIGRATIONS, Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // CPUMigrationsEventAttr returns a unix.PerfEventAttr configured for CPUMigrations. func CPUMigrationsEventAttr() unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_SOFTWARE, Config: unix.PERF_COUNT_SW_CPU_MIGRATIONS, Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // MinorPageFaults is used to profile a function and return the number of minor // page faults. Note that it will call runtime.LockOSThread to ensure accurate // profilng. func MinorPageFaults(f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_SOFTWARE, Config: unix.PERF_COUNT_SW_PAGE_FAULTS_MIN, Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // MinorPageFaultsEventAttr returns a unix.PerfEventAttr configured for MinorPageFaults. func MinorPageFaultsEventAttr() unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_SOFTWARE, Config: unix.PERF_COUNT_SW_PAGE_FAULTS_MIN, Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // MajorPageFaults is used to profile a function and return the number of major // page faults. Note that it will call runtime.LockOSThread to ensure accurate // profilng. func MajorPageFaults(f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_SOFTWARE, Config: unix.PERF_COUNT_SW_PAGE_FAULTS_MAJ, Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // MajorPageFaultsEventAttr returns a unix.PerfEventAttr configured for MajorPageFaults. func MajorPageFaultsEventAttr() unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_SOFTWARE, Config: unix.PERF_COUNT_SW_PAGE_FAULTS_MAJ, Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // AlignmentFaults is used to profile a function and return the number of alignment // faults. Note that it will call runtime.LockOSThread to ensure accurate // profilng. func AlignmentFaults(f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_SOFTWARE, Config: unix.PERF_COUNT_SW_ALIGNMENT_FAULTS, Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // AlignmentFaultsEventAttr returns a unix.PerfEventAttr configured for AlignmentFaults. func AlignmentFaultsEventAttr() unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_SOFTWARE, Config: unix.PERF_COUNT_SW_ALIGNMENT_FAULTS, Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // EmulationFaults is used to profile a function and return the number of emulation // faults. Note that it will call runtime.LockOSThread to ensure accurate // profilng. func EmulationFaults(f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_SOFTWARE, Config: unix.PERF_COUNT_SW_EMULATION_FAULTS, Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // EmulationFaultsEventAttr returns a unix.PerfEventAttr configured for EmulationFaults. func EmulationFaultsEventAttr() unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_SOFTWARE, Config: unix.PERF_COUNT_SW_EMULATION_FAULTS, Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // L1Data is used to profile a function and the L1 data cache faults. Use // PERF_COUNT_HW_CACHE_OP_READ, PERF_COUNT_HW_CACHE_OP_WRITE, or // PERF_COUNT_HW_CACHE_OP_PREFETCH for the opt and // PERF_COUNT_HW_CACHE_RESULT_ACCESS or PERF_COUNT_HW_CACHE_RESULT_MISS for the // result. Note that it will call runtime.LockOSThread to ensure accurate // profilng. func L1Data(op, result int, f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_HW_CACHE, Config: uint64((unix.PERF_COUNT_HW_CACHE_L1D) | (op << 8) | (result << 16)), Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // L1DataEventAttr returns a unix.PerfEventAttr configured for L1Data. func L1DataEventAttr(op, result int) unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_HW_CACHE, Config: uint64((unix.PERF_COUNT_HW_CACHE_L1D) | (op << 8) | (result << 16)), Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // L1Instructions is used to profile a function for the instruction level L1 // cache. Use PERF_COUNT_HW_CACHE_OP_READ, PERF_COUNT_HW_CACHE_OP_WRITE, or // PERF_COUNT_HW_CACHE_OP_PREFETCH for the opt and // PERF_COUNT_HW_CACHE_RESULT_ACCESS or PERF_COUNT_HW_CACHE_RESULT_MISS for the // result. Note that it will call runtime.LockOSThread to ensure accurate // profilng. func L1Instructions(op, result int, f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_HW_CACHE, Config: uint64((unix.PERF_COUNT_HW_CACHE_L1I) | (op << 8) | (result << 16)), Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // L1InstructionsEventAttr returns a unix.PerfEventAttr configured for L1Instructions. func L1InstructionsEventAttr(op, result int) unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_HW_CACHE, Config: uint64((unix.PERF_COUNT_HW_CACHE_L1I) | (op << 8) | (result << 16)), Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // LLCache is used to profile a function and return the number of emulation // PERF_COUNT_HW_CACHE_OP_READ, PERF_COUNT_HW_CACHE_OP_WRITE, or // PERF_COUNT_HW_CACHE_OP_PREFETCH for the opt and // PERF_COUNT_HW_CACHE_RESULT_ACCESS or PERF_COUNT_HW_CACHE_RESULT_MISS for the // result. Note that it will call runtime.LockOSThread to ensure accurate // profilng. func LLCache(op, result int, f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_HW_CACHE, Config: uint64((unix.PERF_COUNT_HW_CACHE_LL) | (op << 8) | (result << 16)), Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // LLCacheEventAttr returns a unix.PerfEventAttr configured for LLCache. func LLCacheEventAttr(op, result int) unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_HW_CACHE, Config: uint64((unix.PERF_COUNT_HW_CACHE_LL) | (op << 8) | (result << 16)), Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // DataTLB is used to profile the data TLB. Use PERF_COUNT_HW_CACHE_OP_READ, // PERF_COUNT_HW_CACHE_OP_WRITE, or PERF_COUNT_HW_CACHE_OP_PREFETCH for the opt // and PERF_COUNT_HW_CACHE_RESULT_ACCESS or PERF_COUNT_HW_CACHE_RESULT_MISS for // the result. Note that it will call runtime.LockOSThread to ensure accurate // profilng. func DataTLB(op, result int, f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_HW_CACHE, Config: uint64((unix.PERF_COUNT_HW_CACHE_DTLB) | (op << 8) | (result << 16)), Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // DataTLBEventAttr returns a unix.PerfEventAttr configured for DataTLB. func DataTLBEventAttr(op, result int) unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_HW_CACHE, Config: uint64((unix.PERF_COUNT_HW_CACHE_DTLB) | (op << 8) | (result << 16)), Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // InstructionTLB is used to profile the instruction TLB. Use // PERF_COUNT_HW_CACHE_OP_READ, PERF_COUNT_HW_CACHE_OP_WRITE, or // PERF_COUNT_HW_CACHE_OP_PREFETCH for the opt and // PERF_COUNT_HW_CACHE_RESULT_ACCESS or PERF_COUNT_HW_CACHE_RESULT_MISS for the // result. Note that it will call runtime.LockOSThread to ensure accurate // profilng. func InstructionTLB(op, result int, f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_HW_CACHE, Config: uint64((unix.PERF_COUNT_HW_CACHE_ITLB) | (op << 8) | (result << 16)), Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // InstructionTLBEventAttr returns a unix.PerfEventAttr configured for InstructionTLB. func InstructionTLBEventAttr(op, result int) unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_HW_CACHE, Config: uint64((unix.PERF_COUNT_HW_CACHE_ITLB) | (op << 8) | (result << 16)), Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // BPU is used to profile a function for the Branch Predictor Unit. // Use PERF_COUNT_HW_CACHE_OP_READ, PERF_COUNT_HW_CACHE_OP_WRITE, or // PERF_COUNT_HW_CACHE_OP_PREFETCH for the opt and // PERF_COUNT_HW_CACHE_RESULT_ACCESS or PERF_COUNT_HW_CACHE_RESULT_MISS for the // result. Note that it will call runtime.LockOSThread to ensure accurate // profilng. func BPU(op, result int, f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_HW_CACHE, Config: uint64((unix.PERF_COUNT_HW_CACHE_BPU) | (op << 8) | (result << 16)), Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // BPUEventAttr returns a unix.PerfEventAttr configured for BPU events. func BPUEventAttr(op, result int) unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_HW_CACHE, Config: uint64((unix.PERF_COUNT_HW_CACHE_BPU) | (op << 8) | (result << 16)), Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } // NodeCache is used to profile a function for NUMA operations. Use Use // PERF_COUNT_HW_CACHE_OP_READ, PERF_COUNT_HW_CACHE_OP_WRITE, or // PERF_COUNT_HW_CACHE_OP_PREFETCH for the opt and // PERF_COUNT_HW_CACHE_RESULT_ACCESS or PERF_COUNT_HW_CACHE_RESULT_MISS for the // result. Note that it will call runtime.LockOSThread to ensure accurate // profilng. func NodeCache(op, result int, f func() error) (*ProfileValue, error) { eventAttr := &unix.PerfEventAttr{ Type: unix.PERF_TYPE_HW_CACHE, Config: uint64((unix.PERF_COUNT_HW_CACHE_NODE) | (op << 8) | (result << 16)), Size: EventAttrSize, Bits: unix.PerfBitDisabled | unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } return profileFn(eventAttr, f) } // NodeCacheEventAttr returns a unix.PerfEventAttr configured for NUMA cache operations. func NodeCacheEventAttr(op, result int) unix.PerfEventAttr { return unix.PerfEventAttr{ Type: unix.PERF_TYPE_HW_CACHE, Config: uint64((unix.PERF_COUNT_HW_CACHE_NODE) | (op << 8) | (result << 16)), Size: EventAttrSize, Bits: unix.PerfBitExcludeKernel | unix.PerfBitExcludeHv, Read_format: unix.PERF_FORMAT_TOTAL_TIME_RUNNING | unix.PERF_FORMAT_TOTAL_TIME_ENABLED, } } prometheus-node-exporter-0.18.1+ds/vendor/github.com/lufia/000077500000000000000000000000001350016654700236325ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/lufia/iostat/000077500000000000000000000000001350016654700251355ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/lufia/iostat/.gitignore000066400000000000000000000004231350016654700271240ustar00rootroot00000000000000# Binaries for programs and plugins *.exe *.dll *.so *.dylib # Test binary, build with `go test -c` *.test # Output of the go coverage tool, specifically when used with LiteIDE *.out # Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 .glide/ prometheus-node-exporter-0.18.1+ds/vendor/github.com/mattn/000077500000000000000000000000001350016654700236555ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/mattn/go-xmlrpc/000077500000000000000000000000001350016654700255655ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/mattn/go-xmlrpc/.travis.yml000066400000000000000000000000651350016654700276770ustar00rootroot00000000000000language: go go: - tip before_install: - go test prometheus-node-exporter-0.18.1+ds/vendor/github.com/mattn/go-xmlrpc/LICENSE000066400000000000000000000020751350016654700265760ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) 2017 Yasuhiro Matsumoto 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.18.1+ds/vendor/github.com/mattn/go-xmlrpc/README.md000066400000000000000000000011061350016654700270420ustar00rootroot00000000000000# go-xmlrpc xmlrpc interface for go ## Usage ```go package main import ( "github.com/mattn/go-xmlrpc" "fmt" "log" ) func main() { res, e := xmlrpc.Call( "http://your-blog.example.com/xmlrpc.php", "metaWeblog.getRecentPosts", "blog-id", "user-id", "password", 10) if e != nil { log.Fatal(e) } for _, p := range res.(xmlrpc.Array) { for k, v := range p.(xmlrpc.Struct) { fmt.Printf("%s=%v\n", k, v) } fmt.Println() } } ``` ## Installation ``` $ go get github.com/mattn/go-xmlrpc ``` ## License MIT ## Author Yasuhiro Matsumoto (a.k.a. mattn) prometheus-node-exporter-0.18.1+ds/vendor/github.com/mattn/go-xmlrpc/go.mod000066400000000000000000000000531350016654700266710ustar00rootroot00000000000000module github.com/mattn/go-xmlrpc go 1.10 prometheus-node-exporter-0.18.1+ds/vendor/github.com/mattn/go-xmlrpc/xmlrpc.go000066400000000000000000000203431350016654700274230ustar00rootroot00000000000000package xmlrpc import ( "bytes" "encoding/base64" "encoding/xml" "errors" "fmt" "io" "io/ioutil" "net/http" "reflect" "strconv" "strings" "time" ) type Array []interface{} type Struct map[string]interface{} var xmlSpecial = map[byte]string{ '<': "<", '>': ">", '"': """, '\'': "'", '&': "&", } func xmlEscape(s string) string { var b bytes.Buffer for i := 0; i < len(s); i++ { c := s[i] if s, ok := xmlSpecial[c]; ok { b.WriteString(s) } else { b.WriteByte(c) } } return b.String() } type valueNode struct { Type string `xml:"attr"` Body string `xml:"chardata"` } func next(p *xml.Decoder) (xml.Name, interface{}, error) { se, e := nextStart(p) if e != nil { return xml.Name{}, nil, e } var nv interface{} switch se.Name.Local { case "string": var s string if e = p.DecodeElement(&s, &se); e != nil { return xml.Name{}, nil, e } return xml.Name{}, s, nil case "boolean": var s string if e = p.DecodeElement(&s, &se); e != nil { return xml.Name{}, nil, e } s = strings.TrimSpace(s) var b bool switch s { case "true", "1": b = true case "false", "0": b = false default: e = errors.New("invalid boolean value") } return xml.Name{}, b, e case "int", "i1", "i2", "i4", "i8": var s string var i int if e = p.DecodeElement(&s, &se); e != nil { return xml.Name{}, nil, e } i, e = strconv.Atoi(strings.TrimSpace(s)) return xml.Name{}, i, e case "double": var s string var f float64 if e = p.DecodeElement(&s, &se); e != nil { return xml.Name{}, nil, e } f, e = strconv.ParseFloat(strings.TrimSpace(s), 64) return xml.Name{}, f, e case "dateTime.iso8601": var s string if e = p.DecodeElement(&s, &se); e != nil { return xml.Name{}, nil, e } t, e := time.Parse("20060102T15:04:05", s) if e != nil { t, e = time.Parse("2006-01-02T15:04:05-07:00", s) if e != nil { t, e = time.Parse("2006-01-02T15:04:05", s) } } return xml.Name{}, t, e case "base64": var s string if e = p.DecodeElement(&s, &se); e != nil { return xml.Name{}, nil, e } if b, e := base64.StdEncoding.DecodeString(s); e != nil { return xml.Name{}, nil, e } else { return xml.Name{}, b, nil } case "member": nextStart(p) return next(p) case "value": nextStart(p) return next(p) case "name": nextStart(p) return next(p) case "struct": st := Struct{} se, e = nextStart(p) for e == nil && se.Name.Local == "member" { // name se, e = nextStart(p) if se.Name.Local != "name" { return xml.Name{}, nil, errors.New("invalid response") } if e != nil { break } var name string if e = p.DecodeElement(&name, &se); e != nil { return xml.Name{}, nil, e } se, e = nextStart(p) if e != nil { break } // value _, value, e := next(p) if se.Name.Local != "value" { return xml.Name{}, nil, errors.New("invalid response") } if e != nil { break } st[name] = value se, e = nextStart(p) if e != nil { break } } return xml.Name{}, st, nil case "array": var ar Array nextStart(p) // data nextStart(p) // top of value for { _, value, e := next(p) if e != nil { break } ar = append(ar, value) if reflect.ValueOf(value).Kind() != reflect.Map { nextStart(p) } } return xml.Name{}, ar, nil case "nil": return xml.Name{}, nil, nil } if e = p.DecodeElement(nv, &se); e != nil { return xml.Name{}, nil, e } return se.Name, nv, e } func nextStart(p *xml.Decoder) (xml.StartElement, error) { for { t, e := p.Token() if e != nil { return xml.StartElement{}, e } switch t := t.(type) { case xml.StartElement: return t, nil } } panic("unreachable") } func toXml(v interface{}, typ bool) (s string) { if v == nil { return "" } r := reflect.ValueOf(v) t := r.Type() k := t.Kind() if b, ok := v.([]byte); ok { return "" + base64.StdEncoding.EncodeToString(b) + "" } switch k { case reflect.Invalid: panic("unsupported type") case reflect.Bool: return fmt.Sprintf("%v", v) case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: if typ { return fmt.Sprintf("%v", v) } return fmt.Sprintf("%v", v) case reflect.Uintptr: panic("unsupported type") case reflect.Float32, reflect.Float64: if typ { return fmt.Sprintf("%v", v) } return fmt.Sprintf("%v", v) case reflect.Complex64, reflect.Complex128: panic("unsupported type") case reflect.Array: s = "" for n := 0; n < r.Len(); n++ { s += "" s += toXml(r.Index(n).Interface(), typ) s += "" } s += "" return s case reflect.Chan: panic("unsupported type") case reflect.Func: panic("unsupported type") case reflect.Interface: return toXml(r.Elem(), typ) case reflect.Map: s = "" for _, key := range r.MapKeys() { s += "" s += "" + xmlEscape(key.Interface().(string)) + "" s += "" + toXml(r.MapIndex(key).Interface(), typ) + "" s += "" } s += "" return s case reflect.Ptr: panic("unsupported type") case reflect.Slice: s = "" for n := 0; n < r.Len(); n++ { s += "" s += toXml(r.Index(n).Interface(), typ) s += "" } s += "" return s case reflect.String: if typ { return fmt.Sprintf("%v", xmlEscape(v.(string))) } return xmlEscape(v.(string)) case reflect.Struct: s = "" for n := 0; n < r.NumField(); n++ { s += "" s += "" + t.Field(n).Name + "" s += "" + toXml(r.FieldByIndex([]int{n}).Interface(), true) + "" s += "" } s += "" return s case reflect.UnsafePointer: return toXml(r.Elem(), typ) } return } // Client is client of XMLRPC type Client struct { HttpClient *http.Client url string } // NewClient create new Client func NewClient(url string) *Client { return &Client{ HttpClient: &http.Client{Transport: http.DefaultTransport, Timeout: 10 * time.Second}, url: url, } } func makeRequest(name string, args ...interface{}) *bytes.Buffer { buf := new(bytes.Buffer) buf.WriteString(``) buf.WriteString("" + xmlEscape(name) + "") buf.WriteString("") for _, arg := range args { buf.WriteString("") buf.WriteString(toXml(arg, true)) buf.WriteString("") } buf.WriteString("") return buf } func call(client *http.Client, url, name string, args ...interface{}) (v interface{}, e error) { r, e := httpClient.Post(url, "text/xml", makeRequest(name, args...)) if e != nil { return nil, e } // Since we do not always read the entire body, discard the rest, which // allows the http transport to reuse the connection. defer io.Copy(ioutil.Discard, r.Body) defer r.Body.Close() if r.StatusCode/100 != 2 { return nil, errors.New(http.StatusText(http.StatusBadRequest)) } p := xml.NewDecoder(r.Body) se, e := nextStart(p) // methodResponse if se.Name.Local != "methodResponse" { return nil, errors.New("invalid response: missing methodResponse") } se, e = nextStart(p) // params if se.Name.Local != "params" { return nil, errors.New("invalid response: missing params") } se, e = nextStart(p) // param if se.Name.Local != "param" { return nil, errors.New("invalid response: missing param") } se, e = nextStart(p) // value if se.Name.Local != "value" { return nil, errors.New("invalid response: missing value") } _, v, e = next(p) return v, e } // Call call remote procedures function name with args func (c *Client) Call(name string, args ...interface{}) (v interface{}, e error) { return call(c.HttpClient, c.url, name, args...) } // Global httpClient allows us to pool/reuse connections and not wastefully // re-create transports for each request. var httpClient = &http.Client{Transport: http.DefaultTransport, Timeout: 10 * time.Second} // Call call remote procedures function name with args func Call(url, name string, args ...interface{}) (v interface{}, e error) { return call(httpClient, url, name, args...) } prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/000077500000000000000000000000001350016654700243375ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/genetlink/000077500000000000000000000000001350016654700263175ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/genetlink/.travis.yml000066400000000000000000000005121350016654700304260ustar00rootroot00000000000000language: go go: - 1.x os: - linux sudo: required before_install: - go get golang.org/x/lint/golint - go get honnef.co/go/tools/cmd/staticcheck - go get -d ./... script: - go build -tags=gofuzz ./... - go vet ./... - staticcheck ./... - golint -set_exit_status ./... - go test -v -race -tags=integration ./... prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/genetlink/LICENSE.md000066400000000000000000000020751350016654700277270ustar00rootroot00000000000000MIT License =========== Copyright (C) 2016-2017 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.18.1+ds/vendor/github.com/mdlayher/genetlink/README.md000066400000000000000000000012661350016654700276030ustar00rootroot00000000000000genetlink [![Build Status](https://travis-ci.org/mdlayher/genetlink.svg?branch=master)](https://travis-ci.org/mdlayher/genetlink) [![GoDoc](https://godoc.org/github.com/mdlayher/genetlink?status.svg)](https://godoc.org/github.com/mdlayher/genetlink) [![Go Report Card](https://goreportcard.com/badge/github.com/mdlayher/genetlink)](https://goreportcard.com/report/github.com/mdlayher/genetlink) ========= Package `genetlink` implements generic netlink interactions and data types. MIT Licensed. For more information about how netlink and generic netlink work, check out my blog series on [Linux, Netlink, and Go](https://medium.com/@mdlayher/linux-netlink-and-go-part-1-netlink-4781aaeeaca8).prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/genetlink/conn.go000066400000000000000000000116461350016654700276130ustar00rootroot00000000000000package genetlink import ( "syscall" "github.com/mdlayher/netlink" "golang.org/x/net/bpf" ) // Protocol is the netlink protocol constant used to specify generic netlink. const Protocol = 0x10 // unix.NETLINK_GENERIC // 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 { // Operating system-specific netlink connection. c *netlink.Conn } // 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 creates a Conn that wraps an existing *netlink.Conn for // generic netlink communications. // // NewConn is primarily useful for tests. Most applications should use // Dial instead. func NewConn(c *netlink.Conn) *Conn { return &Conn{c: c} } // Close closes the connection. func (c *Conn) Close() error { return c.c.Close() } // GetFamily 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 (c *Conn) GetFamily(name string) (Family, error) { return c.getFamily(name) } // ListFamilies retrieves all registered generic netlink families. func (c *Conn) ListFamilies() ([]Family, error) { return c.listFamilies() } // 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) } // RemoveBPF removes a BPF filter from a Conn. func (c *Conn) RemoveBPF() error { return c.c.RemoveBPF() } // SetOption enables or disables a netlink socket option for the Conn. func (c *Conn) SetOption(option netlink.ConnOption, enable bool) error { return c.c.SetOption(option, enable) } // SetReadBuffer sets the size of the operating system's receive buffer // associated with the Conn. func (c *Conn) SetReadBuffer(bytes int) error { return c.c.SetReadBuffer(bytes) } // SetWriteBuffer sets the size of the operating system's transmit buffer // associated with the Conn. func (c *Conn) SetWriteBuffer(bytes int) error { return c.c.SetWriteBuffer(bytes) } // SyscallConn returns a raw network connection. This implements the // syscall.Conn interface. // // Only the Control method of the returned syscall.RawConn is currently // implemented. // // SyscallConn is intended for advanced use cases, such as getting and setting // arbitrary socket options using the netlink socket's file descriptor. // // Once invoked, it is the caller's responsibility to ensure that operations // performed using Conn and the syscall.RawConn do not conflict with // each other. func (c *Conn) SyscallConn() (syscall.RawConn, error) { return c.c.SyscallConn() } // 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.18.1+ds/vendor/github.com/mdlayher/genetlink/doc.go000066400000000000000000000001371350016654700274140ustar00rootroot00000000000000// Package genetlink implements generic netlink interactions and data types. package genetlink prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/genetlink/family.go000066400000000000000000000005731350016654700301340ustar00rootroot00000000000000package genetlink // 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 } prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/genetlink/family_linux.go000066400000000000000000000071221350016654700313500ustar00rootroot00000000000000//+build linux package genetlink import ( "errors" "fmt" "math" "github.com/mdlayher/netlink" "github.com/mdlayher/netlink/nlenc" "golang.org/x/sys/unix" ) var ( // errInvalidFamilyVersion is returned when a family's version is greater // than an 8-bit integer. errInvalidFamilyVersion = errors.New("invalid family version attribute") ) // getFamily retrieves a generic netlink family with the specified name. func (c *Conn) getFamily(name string) (Family, error) { b, err := netlink.MarshalAttributes([]netlink.Attribute{{ Type: unix.CTRL_ATTR_FAMILY_NAME, Data: nlenc.Bytes(name), }}) if err != nil { return Family{}, err } req := Message{ Header: Header{ Command: unix.CTRL_CMD_GETFAMILY, // TODO(mdlayher): grab nlctrl version? Version: 1, }, Data: b, } msgs, err := c.Execute(req, unix.GENL_ID_CTRL, 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 } // listFamilies retrieves all registered generic netlink families. func (c *Conn) listFamilies() ([]Family, error) { req := Message{ Header: Header{ Command: unix.CTRL_CMD_GETFAMILY, // TODO(mdlayher): grab nlctrl version? Version: 1, }, } flags := netlink.HeaderFlagsRequest | netlink.HeaderFlagsDump msgs, err := c.Execute(req, unix.GENL_ID_CTRL, 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 { var f Family if err := (&f).parseAttributes(m.Data); err != nil { return nil, err } families = append(families, f) } return families, nil } // parseAttributes decodes netlink attributes into a Family's fields. func (f *Family) parseAttributes(b []byte) error { ad, err := netlink.NewAttributeDecoder(b) if err != nil { return err } for ad.Next() { switch ad.Type() { case unix.CTRL_ATTR_FAMILY_ID: f.ID = ad.Uint16() case unix.CTRL_ATTR_FAMILY_NAME: f.Name = ad.String() case unix.CTRL_ATTR_VERSION: v := ad.Uint32() if v > math.MaxUint8 { return errInvalidFamilyVersion } f.Version = uint8(v) case unix.CTRL_ATTR_MCAST_GROUPS: ad.Do(func(b []byte) error { groups, err := parseMulticastGroups(b) if err != nil { return err } f.Groups = groups return nil }) } } return ad.Err() } // parseMulticastGroups parses an array of multicast group nested attributes // into a slice of MulticastGroups. func parseMulticastGroups(b []byte) ([]MulticastGroup, error) { ad, err := netlink.NewAttributeDecoder(b) if err != nil { return nil, err } var groups []MulticastGroup for ad.Next() { ad.Do(func(b []byte) error { adi, err := netlink.NewAttributeDecoder(b) if err != nil { return err } var g MulticastGroup for adi.Next() { switch adi.Type() { case unix.CTRL_ATTR_MCAST_GRP_NAME: g.Name = adi.String() case unix.CTRL_ATTR_MCAST_GRP_ID: g.ID = adi.Uint32() } } if err := ad.Err(); err != nil { return err } groups = append(groups, g) return nil }) } if err := ad.Err(); err != nil { return nil, err } return groups, nil } prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/genetlink/family_others.go000066400000000000000000000010411350016654700315070ustar00rootroot00000000000000//+build !linux package genetlink import ( "fmt" "runtime" ) var ( // errUnimplemented is returned by all functions on platforms that // cannot make use of generic netlink. errUnimplemented = fmt.Errorf("generic netlink not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) ) // getFamily always returns an error. func (c *Conn) getFamily(name string) (Family, error) { return Family{}, errUnimplemented } // listFamilies always returns an error. func (c *Conn) listFamilies() ([]Family, error) { return nil, errUnimplemented } prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/genetlink/fuzz.go000066400000000000000000000004371350016654700276500ustar00rootroot00000000000000//+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.18.1+ds/vendor/github.com/mdlayher/genetlink/message.go000066400000000000000000000031141350016654700302710ustar00rootroot00000000000000package 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 // unix.GENL_HDRLEN // 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.18.1+ds/vendor/github.com/mdlayher/netlink/000077500000000000000000000000001350016654700260035ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/netlink/.gitignore000066400000000000000000000000261350016654700277710ustar00rootroot00000000000000cmd/nlstress/nlstress prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/netlink/.travis.yml000066400000000000000000000005241350016654700301150ustar00rootroot00000000000000language: go go: - "1.x" os: - linux - osx sudo: required before_install: - go get golang.org/x/lint/golint - go get honnef.co/go/tools/cmd/staticcheck - go get -d ./... script: - go build -tags=gofuzz ./... - go vet ./... - staticcheck ./... - golint -set_exit_status ./... - go test -v -race -tags=integration ./... prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/netlink/LICENSE.md000066400000000000000000000020751350016654700274130ustar00rootroot00000000000000MIT License =========== Copyright (C) 2016-2017 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.18.1+ds/vendor/github.com/mdlayher/netlink/README.md000066400000000000000000000023141350016654700272620ustar00rootroot00000000000000netlink [![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. For more information about how netlink works, check out my blog series on [Linux, Netlink, and Go](https://medium.com/@mdlayher/linux-netlink-and-go-part-1-netlink-4781aaeeaca8). If you're looking for package `genetlink`, it's been moved to its own repository at [`github.com/mdlayher/genetlink`](https://github.com/mdlayher/genetlink). 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 family packages. prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/netlink/align.go000066400000000000000000000022041350016654700274220ustar00rootroot00000000000000package 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.18.1+ds/vendor/github.com/mdlayher/netlink/attribute.go000066400000000000000000000253531350016654700303450ustar00rootroot00000000000000package netlink import ( "encoding/binary" "errors" "fmt" "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 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 } // marshal marshals the contents of a into b and returns the number of bytes // written to b, including attribute alignment padding. func (a *Attribute) marshal(b []byte) (int, error) { if int(a.Length) < nlaHeaderLen { return 0, errInvalidAttribute } nlenc.PutUint16(b[0:2], a.Length) nlenc.PutUint16(b[2:4], a.Type) n := copy(b[nlaHeaderLen:], a.Data) return nlaHeaderLen + nlaAlign(n), nil } // unmarshal unmarshals the contents of a byte slice into an Attribute. func (a *Attribute) unmarshal(b []byte) error { if len(b) < nlaHeaderLen { return errInvalidAttribute } a.Length = nlenc.Uint16(b[0:2]) a.Type = nlenc.Uint16(b[2:4]) if 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 int(a.Length) < nlaHeaderLen: return errInvalidAttribute // Data present case int(a.Length) >= nlaHeaderLen: a.Data = make([]byte, len(b[nlaHeaderLen:a.Length])) copy(a.Data, b[nlaHeaderLen: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) { // Count how many bytes we should allocate to store each attribute's contents. var c int for _, a := range attrs { c += nlaHeaderLen + nlaAlign(len(a.Data)) } // Advance through b with idx to place attribute data at the correct offset. var idx int b := make([]byte, c) for _, a := range attrs { // Infer the length of attribute if zero. if a.Length == 0 { a.Length = uint16(nlaHeaderLen + len(a.Data)) } // Marshal a into b and advance idx to show many bytes are occupied. n, err := a.marshal(b[idx:]) if err != nil { return nil, err } idx += n } return b, nil } // UnmarshalAttributes unpacks a slice of Attributes from a single byte slice. // // It is recommend to use the AttributeDecoder type where possible instead of calling // UnmarshalAttributes and using package nlenc functions directly. func UnmarshalAttributes(b []byte) ([]Attribute, error) { var attrs []Attribute var i int for { if i > len(b) || len(b[i:]) == 0 { break } var a Attribute if err := (&a).unmarshal(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 } // An AttributeDecoder provides a safe, iterator-like, API around attribute // decoding. // // It is recommend to use an AttributeDecoder where possible instead of calling // UnmarshalAttributes and using package nlenc functions directly. // // The Err method must be called after the Next method returns false to determine // if any errors occurred during iteration. type AttributeDecoder struct { // ByteOrder defines a specific byte order to use when processing integer // attributes. ByteOrder should be set immediately after creating the // AttributeDecoder: before any attributes are parsed. // // If not set, the native byte order will be used. ByteOrder binary.ByteOrder // The attributes being worked on, and the iterator index into the slice of // attributes. attrs []Attribute i int // Any error encountered while decoding attributes. err error } // NewAttributeDecoder creates an AttributeDecoder that unpacks Attributes // from b and prepares the decoder for iteration. func NewAttributeDecoder(b []byte) (*AttributeDecoder, error) { attrs, err := UnmarshalAttributes(b) if err != nil { return nil, err } return &AttributeDecoder{ // By default, use native byte order. ByteOrder: nlenc.NativeEndian(), attrs: attrs, }, nil } // Next advances the decoder to the next netlink attribute. It returns false // when no more attributes are present, or an error was encountered. func (ad *AttributeDecoder) Next() bool { if ad.err != nil { // Hit an error, stop iteration. return false } ad.i++ if len(ad.attrs) < ad.i { // No more attributes, stop iteration. return false } return true } // Type returns the Attribute.Type field of the current netlink attribute // pointed to by the decoder. func (ad *AttributeDecoder) Type() uint16 { return ad.attr().Type } // attr returns the current Attribute pointed to by the decoder. func (ad *AttributeDecoder) attr() Attribute { return ad.attrs[ad.i-1] } // data returns the Data field of the current Attribute pointed to by the decoder. func (ad *AttributeDecoder) data() []byte { return ad.attr().Data } // Err returns the first error encountered by the decoder. func (ad *AttributeDecoder) Err() error { return ad.err } // Bytes returns the raw bytes of the current Attribute's data. func (ad *AttributeDecoder) Bytes() []byte { src := ad.data() dest := make([]byte, len(src)) copy(dest, src) return dest } // String returns the string representation of the current Attribute's data. func (ad *AttributeDecoder) String() string { if ad.err != nil { return "" } return nlenc.String(ad.data()) } // Uint8 returns the uint8 representation of the current Attribute's data. func (ad *AttributeDecoder) Uint8() uint8 { if ad.err != nil { return 0 } b := ad.data() if len(b) != 1 { ad.err = fmt.Errorf("netlink: attribute %d is not a uint8; length: %d", ad.Type(), len(b)) return 0 } return uint8(b[0]) } // Uint16 returns the uint16 representation of the current Attribute's data. func (ad *AttributeDecoder) Uint16() uint16 { if ad.err != nil { return 0 } b := ad.data() if len(b) != 2 { ad.err = fmt.Errorf("netlink: attribute %d is not a uint16; length: %d", ad.Type(), len(b)) return 0 } return ad.ByteOrder.Uint16(b) } // Uint32 returns the uint32 representation of the current Attribute's data. func (ad *AttributeDecoder) Uint32() uint32 { if ad.err != nil { return 0 } b := ad.data() if len(b) != 4 { ad.err = fmt.Errorf("netlink: attribute %d is not a uint32; length: %d", ad.Type(), len(b)) return 0 } return ad.ByteOrder.Uint32(b) } // Uint64 returns the uint64 representation of the current Attribute's data. func (ad *AttributeDecoder) Uint64() uint64 { if ad.err != nil { return 0 } b := ad.data() if len(b) != 8 { ad.err = fmt.Errorf("netlink: attribute %d is not a uint64; length: %d", ad.Type(), len(b)) return 0 } return ad.ByteOrder.Uint64(b) } // Do is a general purpose function which allows access to the current data // pointed to by the AttributeDecoder. // // Do can be used to allow parsing arbitrary data within the context of the // decoder. Do is most useful when dealing with nested attributes, attribute // arrays, or decoding arbitrary types (such as C structures) which don't fit // cleanly into a typical unsigned integer value. // // The function fn should not retain any reference to the data b outside of the // scope of the function. func (ad *AttributeDecoder) Do(fn func(b []byte) error) { if ad.err != nil { return } b := ad.data() if err := fn(b); err != nil { ad.err = err } } // An AttributeEncoder provides a safe way to encode attributes. // // It is recommended to use an AttributeEncoder where possible instead of // calling MarshalAttributes or using package nlenc directly. // // Errors from intermediate encoding steps are returned in the call to // Encode. type AttributeEncoder struct { // ByteOrder defines a specific byte order to use when processing integer // attributes. ByteOrder should be set immediately after creating the // AttributeEncoder: before any attributes are encoded. // // If not set, the native byte order will be used. ByteOrder binary.ByteOrder attrs []Attribute err error } // NewAttributeEncoder creates an AttributeEncoder that encodes Attributes. func NewAttributeEncoder() *AttributeEncoder { return &AttributeEncoder{ ByteOrder: nlenc.NativeEndian(), } } // Uint8 encodes uint8 data into an Attribute specified by typ. func (ae *AttributeEncoder) Uint8(typ uint16, v uint8) { if ae.err != nil { return } ae.attrs = append(ae.attrs, Attribute{ Type: typ, Data: []byte{v}, }) } // Uint16 encodes uint16 data into an Attribute specified by typ. func (ae *AttributeEncoder) Uint16(typ uint16, v uint16) { if ae.err != nil { return } b := make([]byte, 2) ae.ByteOrder.PutUint16(b, v) ae.attrs = append(ae.attrs, Attribute{ Type: typ, Data: b, }) } // Uint32 encodes uint32 data into an Attribute specified by typ. func (ae *AttributeEncoder) Uint32(typ uint16, v uint32) { if ae.err != nil { return } b := make([]byte, 4) ae.ByteOrder.PutUint32(b, v) ae.attrs = append(ae.attrs, Attribute{ Type: typ, Data: b, }) } // Uint64 encodes uint64 data into an Attribute specified by typ. func (ae *AttributeEncoder) Uint64(typ uint16, v uint64) { if ae.err != nil { return } b := make([]byte, 8) ae.ByteOrder.PutUint64(b, v) ae.attrs = append(ae.attrs, Attribute{ Type: typ, Data: b, }) } // String encodes string s as a null-terminated string into an Attribute // specified by typ. func (ae *AttributeEncoder) String(typ uint16, s string) { if ae.err != nil { return } ae.attrs = append(ae.attrs, Attribute{ Type: typ, Data: nlenc.Bytes(s), }) } // Bytes embeds raw byte data into an Attribute specified by typ. func (ae *AttributeEncoder) Bytes(typ uint16, b []byte) { if ae.err != nil { return } ae.attrs = append(ae.attrs, Attribute{ Type: typ, Data: b, }) } // Do is a general purpose function to encode arbitrary data into an attribute // specified by typ. // // Do is especially helpful in encoding nested attributes, attribute arrays, // or encoding arbitrary types (such as C structures) which don't fit cleanly // into an unsigned integer value. func (ae *AttributeEncoder) Do(typ uint16, fn func() ([]byte, error)) { if ae.err != nil { return } b, err := fn() if err != nil { ae.err = err return } ae.attrs = append(ae.attrs, Attribute{ Type: typ, Data: b, }) } // Encode returns the encoded bytes representing the attributes. func (ae *AttributeEncoder) Encode() ([]byte, error) { if ae.err != nil { return nil, ae.err } return MarshalAttributes(ae.attrs) } prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/netlink/conn.go000066400000000000000000000342531350016654700272760ustar00rootroot00000000000000package netlink import ( "errors" "io" "math/rand" "os" "sync/atomic" "syscall" "time" "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") ) // Errors which can be returned by a Socket that does not implement // all exposed methods of Conn. var ( errReadWriteCloserNotSupported = errors.New("raw read/write/closer not supported") errMulticastGroupsNotSupported = errors.New("multicast groups not supported") errBPFFiltersNotSupported = errors.New("BPF filters not supported") errOptionsNotSupported = errors.New("options not supported") errSetBufferNotSupported = errors.New("setting buffer sizes not supported") errSyscallConnNotSupported = errors.New("syscall.RawConn operation not supported") ) // A Conn is a connection to netlink. A Conn can be used to send and // receives messages to and from netlink. // // A Conn is safe for concurrent use, but to avoid contention in // high-throughput applications, the caller should almost certainly create a // pool of Conns and distribute them among workers. type Conn struct { // sock is the operating system-specific implementation of // a netlink sockets connection. sock Socket // 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 // d provides debugging capabilities for a Conn if not nil. d *debugger } // A Socket is an operating-system specific implementation of netlink // sockets used by Conn. type Socket interface { Close() error Send(m Message) error SendMessages(m []Message) error Receive() ([]Message, error) } // Dial dials a connection to netlink, using the specified netlink family. // Config specifies optional configuration for Conn. If config is nil, a default // configuration will be used. func Dial(family int, config *Config) (*Conn, error) { // Use OS-specific dial() to create Socket c, pid, err := dial(family, config) if err != nil { return nil, err } return NewConn(c, pid), nil } // NewConn creates a Conn using the specified Socket and PID for netlink // communications. // // NewConn is primarily useful for tests. Most applications should use // Dial instead. func NewConn(sock Socket, pid uint32) *Conn { // Seed the sequence number using a random number generator. r := rand.New(rand.NewSource(time.Now().UnixNano())) seq := r.Uint32() // Configure a debugger if arguments are set. var d *debugger if len(debugArgs) > 0 { d = newDebugger(debugArgs) } return &Conn{ sock: sock, seq: &seq, pid: pid, d: d, } } // debug executes fn with the debugger if the debugger is not nil. func (c *Conn) debug(fn func(d *debugger)) { if c.d == nil { return } fn(c.d) } // Close closes the connection. func (c *Conn) Close() error { return c.sock.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(message Message) ([]Message, error) { req, err := c.Send(message) 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 } func (c *Conn) fixMsg(m *Message, ml int) { 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 } } // SendMessages sends multiple Messages to netlink. The handling of // a Header's Length, Sequence and PID fields is the same as when // calling Send. func (c *Conn) SendMessages(messages []Message) ([]Message, error) { for idx, m := range messages { ml := nlmsgLength(len(m.Data)) // TODO(mdlayher): fine-tune this limit. if ml > (1024 * 32) { return nil, errors.New("netlink message data too large") } c.fixMsg(&messages[idx], ml) } c.debug(func(d *debugger) { for _, m := range messages { d.debugf(1, "send msgs: %+v", m) } }) if err := c.sock.SendMessages(messages); err != nil { c.debug(func(d *debugger) { d.debugf(1, "send msgs: err: %v", err) }) return nil, err } return messages, nil } // Send sends a single Message to netlink. In most cases, a 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 Header.Length is 0, it will be automatically populated using the // correct length for the Message, including its payload. // // If Header.Sequence is 0, it will be automatically populated using the // next sequence number for this connection. // // If Header.PID is 0, it will be automatically populated using a PID // assigned by netlink. func (c *Conn) Send(message Message) (Message, error) { ml := nlmsgLength(len(message.Data)) // TODO(mdlayher): fine-tune this limit. if ml > (1024 * 32) { return Message{}, errors.New("netlink message data too large") } c.fixMsg(&message, ml) c.debug(func(d *debugger) { d.debugf(1, "send: %+v", message) }) if err := c.sock.Send(message); err != nil { c.debug(func(d *debugger) { d.debugf(1, "send: err: %v", err) }) return Message{}, err } return message, 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 { c.debug(func(d *debugger) { d.debugf(1, "recv: err: %v", err) }) return nil, err } c.debug(func(d *debugger) { for _, m := range msgs { d.debugf(1, "recv: %+v", m) } }) // When using nltest, it's possible for zero messages to be returned by receive. if len(msgs) == 0 { return msgs, nil } // 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) { var res []Message for { msgs, err := c.sock.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 { if err := checkMessage(m); err != nil { return nil, err } // Does this message indicate a multi-part message? if m.Header.Flags&HeaderFlagsMulti == 0 { // No, check the next messages. continue } // Does this message indicate the last message in a series of // multi-part messages from a single read? multi = m.Header.Type != HeaderTypeDone } res = append(res, msgs...) if !multi { // No more messages coming. return res, nil } } } // An fder is a Socket that supports retrieving its raw file descriptor. type fder interface { Socket FD() int } var _ io.ReadWriteCloser = &fileReadWriteCloser{} // A fileReadWriteCloser is a limited *os.File which only allows access to its // Read and Write methods. type fileReadWriteCloser struct { f *os.File } // Read implements io.ReadWriteCloser. func (rwc *fileReadWriteCloser) Read(b []byte) (int, error) { return rwc.f.Read(b) } // Write implements io.ReadWriteCloser. func (rwc *fileReadWriteCloser) Write(b []byte) (int, error) { return rwc.f.Write(b) } // Close implements io.ReadWriteCloser. func (rwc *fileReadWriteCloser) Close() error { return rwc.f.Close() } // ReadWriteCloser returns a raw io.ReadWriteCloser backed by the connection // of the Conn. // // ReadWriteCloser is intended for advanced use cases, such as those that do // not involve standard netlink message passing. // // Once invoked, it is the caller's responsibility to ensure that operations // performed using Conn and the raw io.ReadWriteCloser do not conflict with // each other. In almost all scenarios, only one of the two should be used. func (c *Conn) ReadWriteCloser() (io.ReadWriteCloser, error) { fc, ok := c.sock.(fder) if !ok { return nil, errReadWriteCloserNotSupported } return &fileReadWriteCloser{ // Backing the io.ReadWriteCloser with an *os.File enables easy reading // and writing without more system call boilerplate. f: os.NewFile(uintptr(fc.FD()), "netlink"), }, nil } // A groupJoinLeaver is a Socket that supports joining and leaving // netlink multicast groups. type groupJoinLeaver interface { Socket JoinGroup(group uint32) error LeaveGroup(group uint32) error } // JoinGroup joins a netlink multicast group by its ID. func (c *Conn) JoinGroup(group uint32) error { gc, ok := c.sock.(groupJoinLeaver) if !ok { return errMulticastGroupsNotSupported } return gc.JoinGroup(group) } // LeaveGroup leaves a netlink multicast group by its ID. func (c *Conn) LeaveGroup(group uint32) error { gc, ok := c.sock.(groupJoinLeaver) if !ok { return errMulticastGroupsNotSupported } return gc.LeaveGroup(group) } // A bpfSetter is a Socket that supports setting and removing BPF filters. type bpfSetter interface { Socket bpf.Setter RemoveBPF() error } // SetBPF attaches an assembled BPF program to a Conn. func (c *Conn) SetBPF(filter []bpf.RawInstruction) error { bc, ok := c.sock.(bpfSetter) if !ok { return errBPFFiltersNotSupported } return bc.SetBPF(filter) } // RemoveBPF removes a BPF filter from a Conn. func (c *Conn) RemoveBPF() error { s, ok := c.sock.(bpfSetter) if !ok { return errBPFFiltersNotSupported } return s.RemoveBPF() } // A ConnOption is a boolean option that may be set for a Conn. type ConnOption int // Possible ConnOption values. These constants are equivalent to the Linux // setsockopt boolean options for netlink sockets. const ( PacketInfo ConnOption = iota BroadcastError NoENOBUFS ListenAllNSID CapAcknowledge ) // An optionSetter is a Socket that supports setting netlink options. type optionSetter interface { Socket SetOption(option ConnOption, enable bool) error } // SetOption enables or disables a netlink socket option for the Conn. func (c *Conn) SetOption(option ConnOption, enable bool) error { fc, ok := c.sock.(optionSetter) if !ok { return errOptionsNotSupported } return fc.SetOption(option, enable) } // A bufferSetter is a Socket that supports setting connection buffer sizes. type bufferSetter interface { Socket SetReadBuffer(bytes int) error SetWriteBuffer(bytes int) error } // SetReadBuffer sets the size of the operating system's receive buffer // associated with the Conn. func (c *Conn) SetReadBuffer(bytes int) error { conn, ok := c.sock.(bufferSetter) if !ok { return errSetBufferNotSupported } return conn.SetReadBuffer(bytes) } // SetWriteBuffer sets the size of the operating system's transmit buffer // associated with the Conn. func (c *Conn) SetWriteBuffer(bytes int) error { conn, ok := c.sock.(bufferSetter) if !ok { return errSetBufferNotSupported } return conn.SetWriteBuffer(bytes) } var _ syscall.Conn = &Conn{} // TODO(mdlayher): mutex or similar to enforce syscall.RawConn contract of // FD remaining valid for duration of calls? // SyscallConn returns a raw network connection. This implements the // syscall.Conn interface. // // Only the Control method of the returned syscall.RawConn is currently // implemented. // // SyscallConn is intended for advanced use cases, such as getting and setting // arbitrary socket options using the netlink socket's file descriptor. // // Once invoked, it is the caller's responsibility to ensure that operations // performed using Conn and the syscall.RawConn do not conflict with // each other. func (c *Conn) SyscallConn() (syscall.RawConn, error) { conn, ok := c.sock.(fder) if !ok { return nil, errSyscallConnNotSupported } return &rawConn{ fd: uintptr(conn.FD()), }, nil } var _ syscall.RawConn = &rawConn{} // A rawConn is a syscall.RawConn. type rawConn struct { fd uintptr } func (rc *rawConn) Control(f func(fd uintptr)) error { f(rc.fd) return nil } // TODO(mdlayher): implement Read and Write? func (rc *rawConn) Read(_ func(fd uintptr) (done bool)) error { return errSyscallConnNotSupported } func (rc *rawConn) Write(_ func(fd uintptr) (done bool)) error { return errSyscallConnNotSupported } // 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 // Network namespace the Conn needs to operate in. If set to 0, // no network namespace will be entered. NetNS int } prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/netlink/conn_linux.go000066400000000000000000000300121350016654700305020ustar00rootroot00000000000000//+build linux package netlink import ( "errors" "os" "runtime" "sync" "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 _ Socket = &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 FD() int 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) { // Prepare sysSocket's internal loop and create the socket. // // The conditional is inverted because a zero value of false is desired // if no config, but it's easier to interpret within this code when the // value is inverted. if config == nil { config = &Config{} } sock, err := newSysSocket(config) if err != nil { return nil, 0, err } if err := sock.Socket(family); err != nil { return nil, 0, err } return bind(sock, 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 } // SendMessages serializes multiple Messages and sends them to netlink. func (c *conn) SendMessages(messages []Message) error { var buf []byte for _, m := range messages { b, err := m.MarshalBinary() if err != nil { return err } buf = append(buf, b...) } addr := &unix.SockaddrNetlink{ Family: unix.AF_NETLINK, } return c.s.Sendmsg(buf, nil, addr, 0) } // 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. // // TODO(mdlayher): deal with OOB message data if available, such as // when PacketInfo ConnOption is true. 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 } n = nlmsgAlign(n) 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() } // FD retrieves the file descriptor of the Conn. func (c *conn) FD() int { return c.s.FD() } // 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)), ) } // RemoveBPF removes a BPF filter from a conn. func (c *conn) RemoveBPF() error { // dummy is ignored as argument to SO_DETACH_FILTER // but SetSockopt requires it as an argument var dummy uint32 return c.s.SetSockopt( unix.SOL_SOCKET, unix.SO_DETACH_FILTER, unsafe.Pointer(&dummy), uint32(unsafe.Sizeof(dummy)), ) } // SetOption enables or disables a netlink socket option for the Conn. func (c *conn) SetOption(option ConnOption, enable bool) error { o, ok := linuxOption(option) if !ok { // Return the typical Linux error for an unknown ConnOption. return unix.ENOPROTOOPT } var v uint32 if enable { v = 1 } return c.s.SetSockopt( unix.SOL_NETLINK, o, unsafe.Pointer(&v), uint32(unsafe.Sizeof(v)), ) } // SetReadBuffer sets the size of the operating system's receive buffer // associated with the Conn. func (c *conn) SetReadBuffer(bytes int) error { v := uint32(bytes) return c.s.SetSockopt( unix.SOL_SOCKET, unix.SO_RCVBUF, unsafe.Pointer(&v), uint32(unsafe.Sizeof(v)), ) } // SetReadBuffer sets the size of the operating system's transmit buffer // associated with the Conn. func (c *conn) SetWriteBuffer(bytes int) error { v := uint32(bytes) return c.s.SetSockopt( unix.SOL_SOCKET, unix.SO_SNDBUF, unsafe.Pointer(&v), uint32(unsafe.Sizeof(v)), ) } // linuxOption converts a ConnOption to its Linux value. func linuxOption(o ConnOption) (int, bool) { switch o { case PacketInfo: return unix.NETLINK_PKTINFO, true case BroadcastError: return unix.NETLINK_BROADCAST_ERROR, true case NoENOBUFS: return unix.NETLINK_NO_ENOBUFS, true case ListenAllNSID: return unix.NETLINK_LISTEN_ALL_NSID, true case CapAcknowledge: return unix.NETLINK_CAP_ACK, true default: return 0, false } } // 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 wg *sync.WaitGroup funcC chan<- func() mu sync.RWMutex done bool doneC chan<- bool } // newSysSocket creates a sysSocket that optionally locks its internal goroutine // to a single thread. func newSysSocket(config *Config) (*sysSocket, error) { var wg sync.WaitGroup wg.Add(1) // This system call loop strategy was inspired by: // https://github.com/golang/go/wiki/LockOSThread. Thanks to squeed on // Gophers Slack for providing this useful link. funcC := make(chan func()) doneC := make(chan bool) errC := make(chan error) go func() { // It is important to lock this goroutine to its OS thread for the duration // of the netlink socket being used, or else the kernel may end up routing // messages to the wrong places. // See: http://lists.infradead.org/pipermail/libnl/2017-February/002293.html. // // The intent is to never unlock the OS thread, so that the thread // will terminate when the goroutine exits starting in Go 1.10: // https://go-review.googlesource.com/c/go/+/46038. // // However, due to recent instability and a potential bad interaction // with the Go runtime for threads which are not unlocked, we have // elected to temporarily unlock the thread when the goroutine terminates: // https://github.com/golang/go/issues/25128#issuecomment-410764489. runtime.LockOSThread() defer runtime.UnlockOSThread() defer wg.Done() // The user requested the Conn to operate in a non-default network namespace. if config.NetNS != 0 { // Get the current namespace of the thread the goroutine is locked to. origNetNS, err := getThreadNetNS() if err != nil { errC <- err return } // Set the network namespace of the current thread using // the file descriptor provided by the user. err = setThreadNetNS(config.NetNS) if err != nil { errC <- err return } // Once the thread's namespace has been successfully manipulated, // make sure we change it back when the goroutine returns. defer setThreadNetNS(origNetNS) } // Signal to caller that initialization was successful. errC <- nil for { select { case <-doneC: return case f := <-funcC: f() } } }() // Wait for the goroutine to return err or nil. if err := <-errC; err != nil { return nil, err } return &sysSocket{ wg: &wg, funcC: funcC, doneC: doneC, }, nil } // do runs f in a worker goroutine which can be locked to one thread. func (s *sysSocket) do(f func()) error { done := make(chan bool, 1) // All operations handled by this function are assumed to only // read from s.done. s.mu.RLock() if s.done { s.mu.RUnlock() return syscall.EBADF } s.funcC <- func() { f() done <- true } <-done s.mu.RUnlock() return nil } func (s *sysSocket) Socket(family int) error { var ( fd int err error ) doErr := s.do(func() { fd, err = unix.Socket( unix.AF_NETLINK, unix.SOCK_RAW, family, ) }) if doErr != nil { return doErr } if err != nil { return err } s.fd = fd return nil } func (s *sysSocket) Bind(sa unix.Sockaddr) error { var err error doErr := s.do(func() { err = unix.Bind(s.fd, sa) }) if doErr != nil { return doErr } return err } func (s *sysSocket) Close() error { // Be sure to acquire a write lock because we need to stop any other // goroutines from sending system call requests after close. // Any invocation of do() after this write lock unlocks is guaranteed // to find s.done being true. s.mu.Lock() defer s.mu.Unlock() // Close the socket from the main thread, this operation has no risk // of routing data to the wrong socket. err := unix.Close(s.fd) s.done = true // Signal the syscall worker to exit, wait for the WaitGroup to join, // and close the job channel only when the worker is guaranteed to have stopped. close(s.doneC) s.wg.Wait() close(s.funcC) return err } func (s *sysSocket) FD() int { return s.fd } func (s *sysSocket) Getsockname() (unix.Sockaddr, error) { var ( sa unix.Sockaddr err error ) doErr := s.do(func() { sa, err = unix.Getsockname(s.fd) }) if doErr != nil { return nil, doErr } return sa, err } func (s *sysSocket) Recvmsg(p, oob []byte, flags int) (int, int, int, unix.Sockaddr, error) { var ( n, oobn, recvflags int from unix.Sockaddr err error ) doErr := s.do(func() { n, oobn, recvflags, from, err = unix.Recvmsg(s.fd, p, oob, flags) }) if doErr != nil { return 0, 0, 0, nil, doErr } return n, oobn, recvflags, from, err } func (s *sysSocket) Sendmsg(p, oob []byte, to unix.Sockaddr, flags int) error { var err error doErr := s.do(func() { err = unix.Sendmsg(s.fd, p, oob, to, flags) }) if doErr != nil { return doErr } return err } func (s *sysSocket) SetSockopt(level, name int, v unsafe.Pointer, l uint32) error { var err error doErr := s.do(func() { err = setsockopt(s.fd, level, name, v, l) }) if doErr != nil { return doErr } return err } prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/netlink/conn_others.go000066400000000000000000000016771350016654700306660ustar00rootroot00000000000000//+build !linux package netlink import ( "fmt" "runtime" ) var ( // errUnimplemented is returned by all functions on platforms that // cannot make use of netlink sockets. errUnimplemented = fmt.Errorf("netlink: not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) ) var _ Socket = &conn{} // A conn is the no-op implementation of a netlink sockets connection. type conn struct{} // All cross-platform functions and Socket methods are unimplemented outside // of Linux. func dial(_ int, _ *Config) (*conn, uint32, error) { return nil, 0, errUnimplemented } func newError(_ int) error { return errUnimplemented } func (c *conn) Send(_ Message) error { return errUnimplemented } func (c *conn) SendMessages(_ []Message) error { return errUnimplemented } func (c *conn) Receive() ([]Message, error) { return nil, errUnimplemented } func (c *conn) Close() error { return errUnimplemented } prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/netlink/debug.go000066400000000000000000000024461350016654700274260ustar00rootroot00000000000000package netlink import ( "fmt" "log" "os" "strconv" "strings" ) var ( // Arguments used to create a debugger. debugArgs []string ) func init() { // Is netlink debugging enabled? s := os.Getenv("NLDEBUG") if s == "" { return } debugArgs = strings.Split(s, ",") } // A debugger is used to provide debugging information about a netlink connection. type debugger struct { Log *log.Logger Level int } // newDebugger creates a debugger by parsing key=value arguments. func newDebugger(args []string) *debugger { d := &debugger{ Log: log.New(os.Stderr, "nl: ", 0), Level: 1, } for _, a := range args { kv := strings.Split(a, "=") if len(kv) != 2 { // Ignore malformed pairs and assume callers wants defaults. continue } switch kv[0] { // Select the log level for the debugger. case "level": level, err := strconv.Atoi(kv[1]) if err != nil { panicf("netlink: invalid NLDEBUG level: %q", a) } d.Level = level } } return d } // debugf prints debugging information at the specified level, if d.Level is // high enough to print the message. func (d *debugger) debugf(level int, format string, v ...interface{}) { if d.Level >= level { d.Log.Printf(format, v...) } } func panicf(format string, a ...interface{}) { panic(fmt.Sprintf(format, a...)) } prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/netlink/doc.go000066400000000000000000000012251350016654700270770ustar00rootroot00000000000000// Package netlink provides low-level access to Linux netlink sockets. // // // Debugging // // This package supports rudimentary netlink connection debugging support. // To enable this, run your binary with the NLDEBUG environment variable set. // Debugging information will be output to stderr with a prefix of "nl:". // // To use the debugging defaults, use: // // $ NLDEBUG=1 ./nlctl // // To configure individual aspects of the debugger, pass key/value options such // as: // // $ NLDEBUG=level=1 ./nlctl // // Available key/value debugger options include: // // level=N: specify the debugging level (only "1" is currently supported) package netlink prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/netlink/fuzz.go000066400000000000000000000007771350016654700273430ustar00rootroot00000000000000//+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.18.1+ds/vendor/github.com/mdlayher/netlink/message.go000066400000000000000000000155521350016654700277660ustar00rootroot00000000000000package 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 // Flags used to create objects. // HeaderFlagsReplace indicates request replaces an existing matching object. HeaderFlagsReplace HeaderFlags = 0x100 // HeaderFlagsExcl indicates request does not replace the object if it already exists. HeaderFlagsExcl HeaderFlags = 0x200 // HeaderFlagsCreate indicates request creates an object if it doesn't already exist. HeaderFlagsCreate HeaderFlags = 0x400 // HeaderFlagsAppend indicates request adds to the end of the object list. HeaderFlagsAppend HeaderFlags = 0x800 ) // String returns the string representation of a HeaderFlags. func (f HeaderFlags) String() string { names := []string{ "request", "multi", "acknowledge", "echo", "dumpinterrupted", "dumpfiltered", } var s string left := uint(f) for i, name := range names { if f&(1< 0 { if s != "" { s += "|" } s += fmt.Sprintf("%#x", left) } return s } // HeaderType specifies the type of a Header. type HeaderType uint16 const ( // HeaderTypeNoop indicates that no action was taken. HeaderTypeNoop HeaderType = 0x1 // HeaderTypeError indicates an error code is present, which is also // used to indicate success when the code is 0. HeaderTypeError HeaderType = 0x2 // HeaderTypeDone indicates the end of a multi-part message. HeaderTypeDone HeaderType = 0x3 // HeaderTypeOverrun indicates that data was lost from this message. HeaderTypeOverrun HeaderType = 0x4 ) // String returns the string representation of a HeaderType. func (t HeaderType) String() string { switch t { case HeaderTypeNoop: return "noop" case HeaderTypeError: return "error" case HeaderTypeDone: return "done" case HeaderTypeOverrun: return "overrun" default: return fmt.Sprintf("unknown(%d)", t) } } // NB: the memory layout of Header and Linux's syscall.NlMsgHdr must be // exactly the same. Cannot reorder, change data type, add, or remove fields. // Named types of the same size (e.g. HeaderFlags is a uint16) are okay. // A Header is a netlink header. A Header is sent and received with each // Message to indicate metadata regarding a Message. type Header struct { // Length of a Message, including this Header. Length uint32 // Contents of a Message. Type HeaderType // Flags which may be used to modify a request or response. Flags HeaderFlags // The sequence number of a Message. Sequence uint32 // The process ID of the sending process. PID uint32 } // A Message is a netlink message. It contains a Header and an arbitrary // byte payload, which may be decoded using information from the Header. // // Data is encoded in the native endianness of the host system. For easier // of encoding and decoding of integers, use package nlenc. type Message struct { Header Header Data []byte } // MarshalBinary marshals a Message into a byte slice. func (m Message) MarshalBinary() ([]byte, error) { ml := nlmsgAlign(int(m.Header.Length)) if ml < nlmsgHeaderLen || ml != int(m.Header.Length) { return nil, errIncorrectMessageLength } b := make([]byte, ml) nlenc.PutUint32(b[0:4], m.Header.Length) nlenc.PutUint16(b[4:6], uint16(m.Header.Type)) nlenc.PutUint16(b[6:8], uint16(m.Header.Flags)) nlenc.PutUint32(b[8:12], m.Header.Sequence) nlenc.PutUint32(b[12:16], m.Header.PID) copy(b[16:], m.Data) return b, nil } // UnmarshalBinary unmarshals the contents of a byte slice into a Message. func (m *Message) UnmarshalBinary(b []byte) error { if len(b) < nlmsgHeaderLen { return errShortMessage } if len(b) != nlmsgAlign(len(b)) { return errUnalignedMessage } // Don't allow misleading length m.Header.Length = nlenc.Uint32(b[0:4]) if int(m.Header.Length) != len(b) { return errShortMessage } m.Header.Type = HeaderType(nlenc.Uint16(b[4:6])) m.Header.Flags = HeaderFlags(nlenc.Uint16(b[6:8])) m.Header.Sequence = nlenc.Uint32(b[8:12]) m.Header.PID = nlenc.Uint32(b[12:16]) m.Data = b[16:] return nil } // checkMessage checks a single Message for netlink errors. func checkMessage(m Message) error { const success = 0 // Per libnl documentation, only messages that indicate type error can // contain error codes: // https://www.infradead.org/~tgr/libnl/doc/core.html#core_errmsg. // // However, at one point, this package checked both done and error for // error codes. Because there was no issue associated with the change, // it is unknown whether this change was correct or not. If you run into // a problem with your application because of this change, please file // an issue. if m.Header.Type != HeaderTypeError { return nil } if len(m.Data) < 4 { return errShortErrorMessage } if c := nlenc.Int32(m.Data[0:4]); c != success { // Error code is a negative integer, convert it into // an OS-specific system call error return newError(-1 * int(c)) } return nil } prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/netlink/netns_linux.go000066400000000000000000000013671350016654700307070ustar00rootroot00000000000000//+build linux package netlink import ( "fmt" "os" "golang.org/x/sys/unix" ) // getThreadNetNS gets the network namespace file descriptor of the thread the current goroutine // is running on. Make sure to call runtime.LockOSThread() before this so the goroutine does not // get scheduled on another thread in the meantime. func getThreadNetNS() (int, error) { file, err := os.Open(fmt.Sprintf("/proc/%d/task/%d/ns/net", unix.Getpid(), unix.Gettid())) if err != nil { return -1, err } return int(file.Fd()), nil } // setThreadNetNS sets the network namespace of the thread of the current goroutine to // the namespace described by the user-provided file descriptor. func setThreadNetNS(fd int) error { return unix.Setns(fd, unix.CLONE_NEWNET) } prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/netlink/nlenc/000077500000000000000000000000001350016654700271025ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/netlink/nlenc/doc.go000066400000000000000000000001621350016654700301750ustar00rootroot00000000000000// Package nlenc implements encoding and decoding functions for netlink // messages and attributes. package nlenc prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/netlink/nlenc/endian.go000066400000000000000000000004621350016654700306710ustar00rootroot00000000000000package nlenc import ( "encoding/binary" ) // NativeEndian returns the native byte order of this system. func NativeEndian() binary.ByteOrder { // Determine endianness by storing a uint16 in a byte slice. b := Uint16Bytes(1) if b[0] == 1 { return binary.LittleEndian } return binary.BigEndian } prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/netlink/nlenc/int.go000066400000000000000000000105211350016654700302220ustar00rootroot00000000000000package nlenc import ( "fmt" "unsafe" ) // PutUint8 encodes a uint8 into b. // If b is not exactly 1 byte in length, PutUint8 will panic. func PutUint8(b []byte, v uint8) { if l := len(b); l != 1 { panic(fmt.Sprintf("PutUint8: unexpected byte slice length: %d", l)) } b[0] = v } // PutUint16 encodes a uint16 into b using the host machine's native endianness. // If b is not exactly 2 bytes in length, PutUint16 will panic. func PutUint16(b []byte, v uint16) { if l := len(b); l != 2 { panic(fmt.Sprintf("PutUint16: unexpected byte slice length: %d", l)) } *(*uint16)(unsafe.Pointer(&b[0])) = v } // PutUint32 encodes a uint32 into b using the host machine's native endianness. // If b is not exactly 4 bytes in length, PutUint32 will panic. func PutUint32(b []byte, v uint32) { if l := len(b); l != 4 { panic(fmt.Sprintf("PutUint32: unexpected byte slice length: %d", l)) } *(*uint32)(unsafe.Pointer(&b[0])) = v } // PutUint64 encodes a uint64 into b using the host machine's native endianness. // If b is not exactly 8 bytes in length, PutUint64 will panic. func PutUint64(b []byte, v uint64) { if l := len(b); l != 8 { panic(fmt.Sprintf("PutUint64: unexpected byte slice length: %d", l)) } *(*uint64)(unsafe.Pointer(&b[0])) = v } // PutInt32 encodes a int32 into b using the host machine's native endianness. // If b is not exactly 4 bytes in length, PutInt32 will panic. func PutInt32(b []byte, v int32) { if l := len(b); l != 4 { panic(fmt.Sprintf("PutInt32: unexpected byte slice length: %d", l)) } *(*int32)(unsafe.Pointer(&b[0])) = v } // Uint8 decodes a uint8 from b. // If b is not exactly 1 byte in length, Uint8 will panic. func Uint8(b []byte) uint8 { if l := len(b); l != 1 { panic(fmt.Sprintf("Uint8: unexpected byte slice length: %d", l)) } return b[0] } // Uint16 decodes a uint16 from b using the host machine's native endianness. // If b is not exactly 2 bytes in length, Uint16 will panic. func Uint16(b []byte) uint16 { if l := len(b); l != 2 { panic(fmt.Sprintf("Uint16: unexpected byte slice length: %d", l)) } return *(*uint16)(unsafe.Pointer(&b[0])) } // Uint32 decodes a uint32 from b using the host machine's native endianness. // If b is not exactly 4 bytes in length, Uint32 will panic. func Uint32(b []byte) uint32 { if l := len(b); l != 4 { panic(fmt.Sprintf("Uint32: unexpected byte slice length: %d", l)) } return *(*uint32)(unsafe.Pointer(&b[0])) } // Uint64 decodes a uint64 from b using the host machine's native endianness. // If b is not exactly 8 bytes in length, Uint64 will panic. func Uint64(b []byte) uint64 { if l := len(b); l != 8 { panic(fmt.Sprintf("Uint64: unexpected byte slice length: %d", l)) } return *(*uint64)(unsafe.Pointer(&b[0])) } // Int32 decodes an int32 from b using the host machine's native endianness. // If b is not exactly 4 bytes in length, Int32 will panic. func Int32(b []byte) int32 { if l := len(b); l != 4 { panic(fmt.Sprintf("Int32: unexpected byte slice length: %d", l)) } return *(*int32)(unsafe.Pointer(&b[0])) } // Uint8Bytes encodes a uint8 into a newly-allocated byte slice. It is a // shortcut for allocating a new byte slice and filling it using PutUint8. func Uint8Bytes(v uint8) []byte { b := make([]byte, 1) PutUint8(b, v) return b } // Uint16Bytes encodes a uint16 into a newly-allocated byte slice using the // host machine's native endianness. It is a shortcut for allocating a new // byte slice and filling it using PutUint16. func Uint16Bytes(v uint16) []byte { b := make([]byte, 2) PutUint16(b, v) return b } // Uint32Bytes encodes a uint32 into a newly-allocated byte slice using the // host machine's native endianness. It is a shortcut for allocating a new // byte slice and filling it using PutUint32. func Uint32Bytes(v uint32) []byte { b := make([]byte, 4) PutUint32(b, v) return b } // Uint64Bytes encodes a uint64 into a newly-allocated byte slice using the // host machine's native endianness. It is a shortcut for allocating a new // byte slice and filling it using PutUint64. func Uint64Bytes(v uint64) []byte { b := make([]byte, 8) PutUint64(b, v) return b } // Int32Bytes encodes a int32 into a newly-allocated byte slice using the // host machine's native endianness. It is a shortcut for allocating a new // byte slice and filling it using PutInt32. func Int32Bytes(v int32) []byte { b := make([]byte, 4) PutInt32(b, v) return b } prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/netlink/nlenc/string.go000066400000000000000000000005211350016654700307350ustar00rootroot00000000000000package nlenc import "bytes" // Bytes returns a null-terminated byte slice with the contents of s. func Bytes(s string) []byte { return append([]byte(s), 0x00) } // String returns a string with the contents of b from a null-terminated // byte slice. func String(b []byte) string { return string(bytes.TrimSuffix(b, []byte{0x00})) } prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/netlink/sockopt_linux.go000066400000000000000000000006361350016654700312400ustar00rootroot00000000000000// +build linux,!386 package netlink import ( "unsafe" "golang.org/x/sys/unix" ) // setsockopt provides access to the setsockopt syscall. func setsockopt(fd, level, name int, v unsafe.Pointer, l uint32) error { _, _, errno := unix.Syscall6( unix.SYS_SETSOCKOPT, uintptr(fd), uintptr(level), uintptr(name), uintptr(v), uintptr(l), 0, ) if errno != 0 { return error(errno) } return nil } prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/netlink/sockopt_linux_386.go000066400000000000000000000012221350016654700316300ustar00rootroot00000000000000// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build linux,386 package netlink import ( "syscall" "unsafe" ) const ( sysSETSOCKOPT = 0xe ) func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) // setsockopt provides access to the setsockopt syscall. func setsockopt(fd, level, name int, v unsafe.Pointer, l uint32) error { _, errno := socketcall( sysSETSOCKOPT, uintptr(fd), uintptr(level), uintptr(name), uintptr(v), uintptr(l), 0, ) if errno != 0 { return error(errno) } return nil } prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/netlink/sockopt_linux_386.s000066400000000000000000000003331350016654700314670ustar00rootroot00000000000000// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. TEXT ·socketcall(SB),4,$0-36 JMP syscall·socketcall(SB) prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/wifi/000077500000000000000000000000001350016654700252755ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/wifi/.travis.yml000066400000000000000000000004511350016654700274060ustar00rootroot00000000000000language: go go: - 1.x os: - linux sudo: required before_install: - go get github.com/golang/lint/golint - go get honnef.co/go/tools/cmd/staticcheck - go get -d -t ./... script: - go build ./... - go vet ./... - staticcheck ./... - ./scripts/golint.sh - go test -race -v ./... prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/wifi/LICENSE.md000066400000000000000000000020701350016654700267000ustar00rootroot00000000000000MIT 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.18.1+ds/vendor/github.com/mdlayher/wifi/README.md000066400000000000000000000013651350016654700265610ustar00rootroot00000000000000wifi [![Build Status](https://travis-ci.org/mdlayher/wifi.svg?branch=master)](https://travis-ci.org/mdlayher/wifi) [![GoDoc](https://godoc.org/github.com/mdlayher/wifi?status.svg)](https://godoc.org/github.com/mdlayher/wifi) [![Go Report Card](https://goreportcard.com/badge/github.com/mdlayher/wifi)](https://goreportcard.com/report/github.com/mdlayher/wifi) ==== Package `wifi` provides access to IEEE 802.11 WiFi device actions and statistics. MIT Licensed. At this time, package `wifi` supports the following operating systems: - **Linux**: using netlink, generic netlink, and nl80211. If you would like to contribute support for another operating system, your contributions would be very welcome! Feel free to file an issue to discuss your plans. prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/wifi/client.go000066400000000000000000000025531350016654700271070ustar00rootroot00000000000000package wifi import ( "fmt" "runtime" ) var ( // errUnimplemented is returned by all functions on platforms that // do not have package wifi implemented. errUnimplemented = fmt.Errorf("package wifi not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) ) // A Client is a type which can access WiFi device actions and statistics // using operating system-specific operations. type Client struct { c osClient } // New creates a new Client. func New() (*Client, error) { c, err := newClient() if err != nil { return nil, err } return &Client{ c: c, }, nil } // Close releases resources used by a Client. func (c *Client) Close() error { return c.c.Close() } // Interfaces returns a list of the system's WiFi network interfaces. func (c *Client) Interfaces() ([]*Interface, error) { return c.c.Interfaces() } // BSS retrieves the BSS associated with a WiFi interface. func (c *Client) BSS(ifi *Interface) (*BSS, error) { return c.c.BSS(ifi) } // StationInfo retrieves all station statistics about a WiFi interface. func (c *Client) StationInfo(ifi *Interface) ([]*StationInfo, error) { return c.c.StationInfo(ifi) } // An osClient is the operating system-specific implementation of Client. type osClient interface { Close() error Interfaces() ([]*Interface, error) BSS(ifi *Interface) (*BSS, error) StationInfo(ifi *Interface) ([]*StationInfo, error) } prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/wifi/client_linux.go000066400000000000000000000307751350016654700303350ustar00rootroot00000000000000//+build linux package wifi import ( "bytes" "errors" "net" "os" "time" "unicode/utf8" "github.com/mdlayher/genetlink" "github.com/mdlayher/netlink" "github.com/mdlayher/netlink/nlenc" "github.com/mdlayher/wifi/internal/nl80211" ) // Errors which may occur when interacting with generic netlink. var ( errInvalidCommand = errors.New("invalid generic netlink response command") errInvalidFamilyVersion = errors.New("invalid generic netlink response family version") ) var _ osClient = &client{} // A client is the Linux implementation of osClient, which makes use of // netlink, generic netlink, and nl80211 to provide access to WiFi device // actions and statistics. type client struct { c *genetlink.Conn familyID uint16 familyVersion uint8 } // newClient dials a generic netlink connection and verifies that nl80211 // is available for use by this package. func newClient() (*client, error) { c, err := genetlink.Dial(nil) if err != nil { return nil, err } return initClient(c) } func initClient(c *genetlink.Conn) (*client, error) { family, err := c.GetFamily(nl80211.GenlName) if err != nil { // Ensure the genl socket is closed on error to avoid leaking file // descriptors. _ = c.Close() return nil, err } return &client{ c: c, familyID: family.ID, familyVersion: family.Version, }, nil } // Close closes the client's generic netlink connection. func (c *client) Close() error { return c.c.Close() } // Interfaces requests that nl80211 return a list of all WiFi interfaces present // on this system. func (c *client) Interfaces() ([]*Interface, error) { // Ask nl80211 to dump a list of all WiFi interfaces req := genetlink.Message{ Header: genetlink.Header{ Command: nl80211.CmdGetInterface, Version: c.familyVersion, }, } flags := netlink.HeaderFlagsRequest | netlink.HeaderFlagsDump msgs, err := c.c.Execute(req, c.familyID, flags) if err != nil { return nil, err } if err := c.checkMessages(msgs, nl80211.CmdNewInterface); err != nil { return nil, err } return parseInterfaces(msgs) } // BSS requests that nl80211 return the BSS for the specified Interface. func (c *client) BSS(ifi *Interface) (*BSS, error) { b, err := netlink.MarshalAttributes(ifi.idAttrs()) if err != nil { return nil, err } // Ask nl80211 to retrieve BSS information for the interface specified // by its attributes req := genetlink.Message{ Header: genetlink.Header{ Command: nl80211.CmdGetScan, Version: c.familyVersion, }, Data: b, } flags := netlink.HeaderFlagsRequest | netlink.HeaderFlagsDump msgs, err := c.c.Execute(req, c.familyID, flags) if err != nil { return nil, err } if err := c.checkMessages(msgs, nl80211.CmdNewScanResults); err != nil { return nil, err } return parseBSS(msgs) } // StationInfo requests that nl80211 return all station info for the specified // Interface. func (c *client) StationInfo(ifi *Interface) ([]*StationInfo, error) { b, err := netlink.MarshalAttributes(ifi.idAttrs()) if err != nil { return nil, err } // Ask nl80211 to retrieve station info for the interface specified // by its attributes req := genetlink.Message{ Header: genetlink.Header{ // From nl80211.h: // * @NL80211_CMD_GET_STATION: Get station attributes for station identified by // * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX. Command: nl80211.CmdGetStation, Version: c.familyVersion, }, Data: b, } flags := netlink.HeaderFlagsRequest | netlink.HeaderFlagsDump msgs, err := c.c.Execute(req, c.familyID, flags) if err != nil { return nil, err } if len(msgs) == 0 { return nil, os.ErrNotExist } stations := make([]*StationInfo, len(msgs)) for i := range msgs { if err := c.checkMessages(msgs, nl80211.CmdNewStation); err != nil { return nil, err } if stations[i], err = parseStationInfo(msgs[i].Data); err != nil { return nil, err } } return stations, nil } // checkMessages verifies that response messages from generic netlink contain // the command and family version we expect. func (c *client) checkMessages(msgs []genetlink.Message, command uint8) error { for _, m := range msgs { if m.Header.Command != command { return errInvalidCommand } if m.Header.Version != c.familyVersion { return errInvalidFamilyVersion } } return nil } // parseInterfaces parses zero or more Interfaces from nl80211 interface // messages. func parseInterfaces(msgs []genetlink.Message) ([]*Interface, error) { ifis := make([]*Interface, 0, len(msgs)) for _, m := range msgs { attrs, err := netlink.UnmarshalAttributes(m.Data) if err != nil { return nil, err } var ifi Interface if err := (&ifi).parseAttributes(attrs); err != nil { return nil, err } ifis = append(ifis, &ifi) } return ifis, nil } // idAttrs returns the netlink attributes required from an Interface to retrieve // more data about it. func (ifi *Interface) idAttrs() []netlink.Attribute { return []netlink.Attribute{ { Type: nl80211.AttrIfindex, Data: nlenc.Uint32Bytes(uint32(ifi.Index)), }, { Type: nl80211.AttrMac, Data: ifi.HardwareAddr, }, } } // parseAttributes parses netlink attributes into an Interface's fields. func (ifi *Interface) parseAttributes(attrs []netlink.Attribute) error { for _, a := range attrs { switch a.Type { case nl80211.AttrIfindex: ifi.Index = int(nlenc.Uint32(a.Data)) case nl80211.AttrIfname: ifi.Name = nlenc.String(a.Data) case nl80211.AttrMac: ifi.HardwareAddr = net.HardwareAddr(a.Data) case nl80211.AttrWiphy: ifi.PHY = int(nlenc.Uint32(a.Data)) case nl80211.AttrIftype: // NOTE: InterfaceType copies the ordering of nl80211's interface type // constants. This may not be the case on other operating systems. ifi.Type = InterfaceType(nlenc.Uint32(a.Data)) case nl80211.AttrWdev: ifi.Device = int(nlenc.Uint64(a.Data)) case nl80211.AttrWiphyFreq: ifi.Frequency = int(nlenc.Uint32(a.Data)) } } return nil } // parseBSS parses a single BSS with a status attribute from nl80211 BSS messages. func parseBSS(msgs []genetlink.Message) (*BSS, error) { for _, m := range msgs { attrs, err := netlink.UnmarshalAttributes(m.Data) if err != nil { return nil, err } for _, a := range attrs { if a.Type != nl80211.AttrBss { continue } nattrs, err := netlink.UnmarshalAttributes(a.Data) if err != nil { return nil, err } // The BSS which is associated with an interface will have a status // attribute if !attrsContain(nattrs, nl80211.BssStatus) { continue } var bss BSS if err := (&bss).parseAttributes(nattrs); err != nil { return nil, err } return &bss, nil } } return nil, os.ErrNotExist } // parseAttributes parses netlink attributes into a BSS's fields. func (b *BSS) parseAttributes(attrs []netlink.Attribute) error { for _, a := range attrs { switch a.Type { case nl80211.BssBssid: b.BSSID = net.HardwareAddr(a.Data) case nl80211.BssFrequency: b.Frequency = int(nlenc.Uint32(a.Data)) case nl80211.BssBeaconInterval: // Raw value is in "Time Units (TU)". See: // https://en.wikipedia.org/wiki/Beacon_frame b.BeaconInterval = time.Duration(nlenc.Uint16(a.Data)) * 1024 * time.Microsecond case nl80211.BssSeenMsAgo: // * @NL80211_BSS_SEEN_MS_AGO: age of this BSS entry in ms b.LastSeen = time.Duration(nlenc.Uint32(a.Data)) * time.Millisecond case nl80211.BssStatus: // NOTE: BSSStatus copies the ordering of nl80211's BSS status // constants. This may not be the case on other operating systems. b.Status = BSSStatus(nlenc.Uint32(a.Data)) case nl80211.BssInformationElements: ies, err := parseIEs(a.Data) if err != nil { return err } // TODO(mdlayher): return more IEs if they end up being generally useful for _, ie := range ies { switch ie.ID { case ieSSID: b.SSID = decodeSSID(ie.Data) } } } } return nil } // parseStationInfo parses StationInfo attributes from a byte slice of // netlink attributes. func parseStationInfo(b []byte) (*StationInfo, error) { attrs, err := netlink.UnmarshalAttributes(b) if err != nil { return nil, err } var info StationInfo for _, a := range attrs { switch a.Type { case nl80211.AttrMac: info.HardwareAddr = net.HardwareAddr(a.Data) case nl80211.AttrStaInfo: nattrs, err := netlink.UnmarshalAttributes(a.Data) if err != nil { return nil, err } if err := (&info).parseAttributes(nattrs); err != nil { return nil, err } // nl80211.AttrStaInfo is last attibute we are interested in return &info, nil default: // The other attributes that are returned here appear // nl80211.AttrIfindex, nl80211.AttrGeneration // No need to parse them for now. continue } } // No station info found return nil, os.ErrNotExist } // parseAttributes parses netlink attributes into a StationInfo's fields. func (info *StationInfo) parseAttributes(attrs []netlink.Attribute) error { for _, a := range attrs { switch a.Type { case nl80211.StaInfoConnectedTime: // Though nl80211 does not specify, this value appears to be in seconds: // * @NL80211_STA_INFO_CONNECTED_TIME: time since the station is last connected info.Connected = time.Duration(nlenc.Uint32(a.Data)) * time.Second case nl80211.StaInfoInactiveTime: // * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs) info.Inactive = time.Duration(nlenc.Uint32(a.Data)) * time.Millisecond case nl80211.StaInfoRxBytes64: info.ReceivedBytes = int(nlenc.Uint64(a.Data)) case nl80211.StaInfoTxBytes64: info.TransmittedBytes = int(nlenc.Uint64(a.Data)) case nl80211.StaInfoSignal: // * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm) // Should just be cast to int8, see code here: https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git/tree/station.c#n378 info.Signal = int(int8(a.Data[0])) case nl80211.StaInfoRxPackets: info.ReceivedPackets = int(nlenc.Uint32(a.Data)) case nl80211.StaInfoTxPackets: info.TransmittedPackets = int(nlenc.Uint32(a.Data)) case nl80211.StaInfoTxRetries: info.TransmitRetries = int(nlenc.Uint32(a.Data)) case nl80211.StaInfoTxFailed: info.TransmitFailed = int(nlenc.Uint32(a.Data)) case nl80211.StaInfoBeaconLoss: info.BeaconLoss = int(nlenc.Uint32(a.Data)) case nl80211.StaInfoRxBitrate, nl80211.StaInfoTxBitrate: rate, err := parseRateInfo(a.Data) if err != nil { return err } // TODO(mdlayher): return more statistics if they end up being // generally useful switch a.Type { case nl80211.StaInfoRxBitrate: info.ReceiveBitrate = rate.Bitrate case nl80211.StaInfoTxBitrate: info.TransmitBitrate = rate.Bitrate } } // Only use 32-bit counters if the 64-bit counters are not present. // If the 64-bit counters appear later in the slice, they will overwrite // these values. if info.ReceivedBytes == 0 && a.Type == nl80211.StaInfoRxBytes { info.ReceivedBytes = int(nlenc.Uint32(a.Data)) } if info.TransmittedBytes == 0 && a.Type == nl80211.StaInfoTxBytes { info.TransmittedBytes = int(nlenc.Uint32(a.Data)) } } return nil } // rateInfo provides statistics about the receive or transmit rate of // an interface. type rateInfo struct { // Bitrate in bits per second. Bitrate int } // parseRateInfo parses a rateInfo from netlink attributes. func parseRateInfo(b []byte) (*rateInfo, error) { attrs, err := netlink.UnmarshalAttributes(b) if err != nil { return nil, err } var info rateInfo for _, a := range attrs { switch a.Type { case nl80211.RateInfoBitrate32: info.Bitrate = int(nlenc.Uint32(a.Data)) } // Only use 16-bit counters if the 32-bit counters are not present. // If the 32-bit counters appear later in the slice, they will overwrite // these values. if info.Bitrate == 0 && a.Type == nl80211.RateInfoBitrate { info.Bitrate = int(nlenc.Uint16(a.Data)) } } // Scale bitrate to bits/second as base unit instead of 100kbits/second. // * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s) info.Bitrate *= 100 * 1000 return &info, nil } // attrsContain checks if a slice of netlink attributes contains an attribute // with the specified type. func attrsContain(attrs []netlink.Attribute, typ uint16) bool { for _, a := range attrs { if a.Type == typ { return true } } return false } // decodeSSID safely parses a byte slice into UTF-8 runes, and returns the // resulting string from the runes. func decodeSSID(b []byte) string { buf := bytes.NewBuffer(nil) for len(b) > 0 { r, size := utf8.DecodeRune(b) b = b[size:] buf.WriteRune(r) } return buf.String() } prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/wifi/client_others.go000066400000000000000000000013451350016654700304710ustar00rootroot00000000000000//+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.18.1+ds/vendor/github.com/mdlayher/wifi/doc.go000066400000000000000000000001401350016654700263640ustar00rootroot00000000000000// Package wifi provides access to IEEE 802.11 WiFi device actions and statistics. package wifi prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/wifi/internal/000077500000000000000000000000001350016654700271115ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/wifi/internal/nl80211/000077500000000000000000000000001350016654700301165ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/mdlayher/wifi/internal/nl80211/const.go000066400000000000000000001454721350016654700316100ustar00rootroot00000000000000// 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.18.1+ds/vendor/github.com/mdlayher/wifi/internal/nl80211/doc.go000066400000000000000000000010261350016654700312110ustar00rootroot00000000000000// 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.18.1+ds/vendor/github.com/mdlayher/wifi/internal/nl80211/nl80211.h000066400000000000000000006415571350016654700313160ustar00rootroot00000000000000#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.18.1+ds/vendor/github.com/mdlayher/wifi/internal/nl80211/nl80211.yml000066400000000000000000000006061350016654700316500ustar00rootroot00000000000000--- 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.18.1+ds/vendor/github.com/mdlayher/wifi/wifi.go000066400000000000000000000151151350016654700265650ustar00rootroot00000000000000package 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 hardware address of the station. HardwareAddr net.HardwareAddr // 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.18.1+ds/vendor/github.com/siebenmann/000077500000000000000000000000001350016654700246515ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/siebenmann/go-kstat/000077500000000000000000000000001350016654700264025ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/siebenmann/go-kstat/.gitignore000066400000000000000000000000031350016654700303630ustar00rootroot00000000000000*~ prometheus-node-exporter-0.18.1+ds/vendor/github.com/siebenmann/go-kstat/Makefile000066400000000000000000000002031350016654700300350ustar00rootroot00000000000000all: @echo "Use 'make doctext' on a Solaris/Illumos/etc machine" doctext: godoc github.com/siebenmann/go-kstat >kstat-godoc.txt prometheus-node-exporter-0.18.1+ds/vendor/github.com/siebenmann/go-kstat/README000066400000000000000000000027221350016654700272650ustar00rootroot00000000000000Go-kstat provides a Go API for the kstat kernel statistics system on Solaris, Illumos, OmniOS, and other Solaris derived systems. For general information on kstats, see the kstat(1) and kstat(3kstat) manpages. For more documentation on the details of the package, see doc.go, kstat_solaris.go, types_solaris_amd64.go, and raw_solaris.go. This package is quite young, so the API may well change as I and other people gain experience with using it. The API supports access to 'named' kstat statistics, IO statistics, and the most common and useful sorts of 'raw' kstat statistics (unix:0:sysinfo, unix:0:vminfo, unix:0:var, and mnt:*:mntinfo). Other raw kstat statistics are not explicitly supported, but the API provides some escape hatches for access to custom raw statistics. This is a cgo-based package so it can't be cross compiled like a regular Go package. It may also have bugs with memory management, since it interacts with the Solaris kstat library and holds references to memory that's been dynamically allocated in C. See kstat-godoc.txt for a text dump of the full godoc for the package. Unfortunately Go tool limitations appear to make it impossible to see full package documentat on anything except a Solaris machine (including https://godoc.org/, sadly). Bug reports and other contributions are highly welcome. Author: Chris Siebenmann https://github.com/siebenmann/go-kstat https://utcc.utoronto.ca/~cks/space/blog/ (and elsewhere) Copyright: standard Go copyright prometheus-node-exporter-0.18.1+ds/vendor/github.com/siebenmann/go-kstat/doc.go000066400000000000000000000120101350016654700274700ustar00rootroot00000000000000// // Package kstat provides a Go interface to the Solaris/OmniOS // kstat(s) system for user-level access to a lot of kernel // statistics. For more documentation on kstats, see kstat(1) and // kstat(3kstat). // // The package can retrieve what are called 'named' kstat statistics, // IO statistics, and the most common additional types of 'raw' // statistics, which covers almost all kstats you will normally find // in the kernel. You can see the names and types of other kstats, but // not currently retrieve data for them. Named statistics are the most // common type for general information; IO statistics are exported by // disks and some other things. Supported additional raw kstats are // unix:0:sysinfo, unix:0:vminfo, unix:0:var, and mnt:*:mntinfo. // // General usage for named statistics: call Open() to obtain a Token, // then call GetNamed() on it to obtain Named(s) for specific // statistics. Note that this always gives you the very latest value // for the statistic. If you want a number of statistics from the same // module:inst:name triplet (eg several network counters from the same // network interface) and you want them to all have been gathered at // the same time, you need to call .Lookup() to obtain a KStat and // then repeatedly call its .GetNamed() (this is also slightly more // efficient). // // The short version: a kstat is a collection of some related // statistics, eg various network counters for a particular network // interface. A Token is a handle for a collection of kstats. You go // collection (Token) -> kstat (KStat) -> specific statistic (Named) // in order to retrieve the value of a specific statistic. // // (IO stats are retrieved all at once with GetIO(), because they come // to us from the kernel as one single struct so that's what you get.) // // This is a cgo-based package. Cross compilation is up to you. // Goroutine safety is in no way guaranteed because the underlying // C kstat library is probably not thread or goroutine safe (and // there are some all-Go concurrency races involving .Close()). // // This package may leak memory, especially since the Solaris kstat // manpage is not clear on the requirements here. However I believe // it's reasonably memory safe. It's possible to totally corrupt // memory with use-after-free errors if you do operations on kstats // after calling Token.Close(), although we try to avoid that. // // NOTE: this package is quite young. The API may well change as // I (and other people) gain more experience with it. // // PERFORMANCE // // In general this is not going to be as lean and mean as calling // C directly, partly because of intrinsic CGo overheads and partly // because we do more memory allocation and deallocation than a C // program would (partly because we prioritize not leaking memory). // // SUPPORTED AND UNSUPPORTED KSTAT TYPES // // We support named kstats and IO kstats (KSTAT_TYPE_NAMED and // KSTAT_TYPE_IO / kstat_io_t respectively). kstat(1) also knows about // a number of magic specific 'raw' stats (which are generally custom // C structs); of these we support unix:0:sysinfo, unix:0:vminfo, // unix:0:var, and mnt:*:mntinfo for NFS filesystem mounts. // // In theory kstat supports general timer and interrupt stats. In // practice there is no use of KSTAT_TYPE_TIMER in the current Illumos // kernel source and very little use of KSTAT_TYPE_INTR (mostly by // very old hardware drivers, although the vioif driver uses it too). // Since I can't test KSTAT_TYPE_INTR stats, we don't currently // support it. // // There are also a few additional KSTAT_TYPE_RAW raw stats that we // don't support, mostly because they seem to be effectively obsolete. // These specific raw stats can be found listed in the Illumos source // code in cmd/stat/kstat/kstat.h in the ks_raw_lookup array. See // cmd/stat/kstat/kstat.c for how they're interpreted. If you need // access to one of these kstats, the KStat.CopyTo() and KStat.Raw() // methods give you an escape hatch to roll your own. You'll probably // need to use cgo to generate an appropriate Go struct that matches // the C struct you need. My notes on this process may be helpful: // // https://utcc.utoronto.ca/~cks/space/blog/programming/GoCGoCompatibleStructs // // Author: Chris Siebenmann // https://github.com/siebenmann/go-kstat // // Copyright: standard Go copyright. // // (If you're reading this documentation on a non-Solaris platform, // you're probably not seeing the detailed API documentation for // constants, types, and so on because of tooling limitations in godoc // et al.) // package kstat // // This exists in large part to give non-Solaris systems something // that makes the package name visible. Otherwise eg goimports thinks // that this is an empty package and deletes 'import ...' statements // for it if you process a Go file that imports the package on a // non-Solaris platform. // // Since this file exists, I've put the package-level documentation // here to increase the odds that tools running on non-Solaris systems // will be able to show you at least some documentation. // // This is a hack, and annoying. prometheus-node-exporter-0.18.1+ds/vendor/github.com/siebenmann/go-kstat/kstat-godoc.txt000066400000000000000000000416351350016654700313730ustar00rootroot00000000000000PACKAGE DOCUMENTATION package kstat import "github.com/siebenmann/go-kstat" Package kstat provides a Go interface to the Solaris/OmniOS kstat(s) system for user-level access to a lot of kernel statistics. For more documentation on kstats, see kstat(1) and kstat(3kstat). The package can retrieve what are called 'named' kstat statistics, IO statistics, and the most common additional types of 'raw' statistics, which covers almost all kstats you will normally find in the kernel. You can see the names and types of other kstats, but not currently retrieve data for them. Named statistics are the most common type for general information; IO statistics are exported by disks and some other things. Supported additional raw kstats are unix:0:sysinfo, unix:0:vminfo, unix:0:var, and mnt:*:mntinfo. General usage for named statistics: call Open() to obtain a Token, then call GetNamed() on it to obtain Named(s) for specific statistics. Note that this always gives you the very latest value for the statistic. If you want a number of statistics from the same module:inst:name triplet (eg several network counters from the same network interface) and you want them to all have been gathered at the same time, you need to call .Lookup() to obtain a KStat and then repeatedly call its .GetNamed() (this is also slightly more efficient). The short version: a kstat is a collection of some related statistics, eg various network counters for a particular network interface. A Token is a handle for a collection of kstats. You go collection (Token) -> kstat (KStat) -> specific statistic (Named) in order to retrieve the value of a specific statistic. (IO stats are retrieved all at once with GetIO(), because they come to us from the kernel as one single struct so that's what you get.) This is a cgo-based package. Cross compilation is up to you. Goroutine safety is in no way guaranteed because the underlying C kstat library is probably not thread or goroutine safe (and there are some all-Go concurrency races involving .Close()). This package may leak memory, especially since the Solaris kstat manpage is not clear on the requirements here. However I believe it's reasonably memory safe. It's possible to totally corrupt memory with use-after-free errors if you do operations on kstats after calling Token.Close(), although we try to avoid that. NOTE: this package is quite young. The API may well change as I (and other people) gain more experience with it. PERFORMANCE In general this is not going to be as lean and mean as calling C directly, partly because of intrinsic CGo overheads and partly because we do more memory allocation and deallocation than a C program would (partly because we prioritize not leaking memory). SUPPORTED AND UNSUPPORTED KSTAT TYPES We support named kstats and IO kstats (KSTAT_TYPE_NAMED and KSTAT_TYPE_IO / kstat_io_t respectively). kstat(1) also knows about a number of magic specific 'raw' stats (which are generally custom C structs); of these we support unix:0:sysinfo, unix:0:vminfo, unix:0:var, and mnt:*:mntinfo for NFS filesystem mounts. In theory kstat supports general timer and interrupt stats. In practice there is no use of KSTAT_TYPE_TIMER in the current Illumos kernel source and very little use of KSTAT_TYPE_INTR (mostly by very old hardware drivers, although the vioif driver uses it too). Since I can't test KSTAT_TYPE_INTR stats, we don't currently support it. There are also a few additional KSTAT_TYPE_RAW raw stats that we don't support, mostly because they seem to be effectively obsolete. These specific raw stats can be found listed in the Illumos source code in cmd/stat/kstat/kstat.h in the ks_raw_lookup array. See cmd/stat/kstat/kstat.c for how they're interpreted. If you need access to one of these kstats, the KStat.CopyTo() and KStat.Raw() methods give you an escape hatch to roll your own. You'll probably need to use cgo to generate an appropriate Go struct that matches the C struct you need. My notes on this process may be helpful: https://utcc.utoronto.ca/~cks/space/blog/programming/GoCGoCompatibleStructs Author: Chris Siebenmann https://github.com/siebenmann/go-kstat Copyright: standard Go copyright. (If you're reading this documentation on a non-Solaris platform, you're probably not seeing the detailed API documentation for constants, types, and so on because of tooling limitations in godoc et al.) FUNCTIONS func CFieldString(src []int8) string CFieldString converts a (null-terminated) C string embedded in an []int8 slice to a (Go) string. The []int8 slice is likely to come from an [N]int8 fixed-size field in a statistics struct. If there is no null in the slice, the entire slice is returned. (The no-null behavior is common in C APIs; a string is often allowed to exactly fill the field with no room for a trailing null.) TYPES type IO struct { Nread uint64 Nwritten uint64 Reads uint32 Writes uint32 Wtime int64 Wlentime int64 Wlastupdate int64 Rtime int64 Rlentime int64 Rlastupdate int64 Wcnt uint32 Rcnt uint32 } IO represents the entire collection of KStat (disk) IO statistics exposed by an IoStat type KStat. Because IO is an exact copy of the C kstat_io_t structure from the kernel, it does not have a Snaptime or KStat field. You must save that information separately if you need it, perhaps by embedded the IO struct as an anonymous struct in an additional struct of your own. type KSType int KSType is the type of the data in a KStat. const ( RawStat KSType = C.KSTAT_TYPE_RAW NamedStat KSType = C.KSTAT_TYPE_NAMED IntrStat KSType = C.KSTAT_TYPE_INTR IoStat KSType = C.KSTAT_TYPE_IO TimerStat KSType = C.KSTAT_TYPE_TIMER ) The different types of data that a KStat may contain, ie these are the value of a KStat.Type. We currently only support getting Named and IO statistics. func (tp KSType) String() string type KStat struct { Module string Instance int Name string // Class is eg 'net' or 'disk'. In kstat(1) it shows up as a // ':class' statistic. Class string // Type is the type of kstat. Type KSType // Creation time of a kstat in nanoseconds since sometime. // See gethrtime(3) and kstat(3kstat). Crtime int64 // Snaptime is what kstat(1) reports as 'snaptime', the time // that this data was obtained. As with Crtime, it is in // nanoseconds since some arbitrary point in time. // Snaptime may not be valid until .Refresh() or .GetNamed() // has been called. Snaptime int64 // contains filtered or unexported fields } KStat is the access handle for the collection of statistics for a particular module:instance:name kstat. func (k *KStat) AllNamed() ([]*Named, error) AllNamed returns an array of all named statistics for a particular named-type KStat. Entries are returned in no particular order. func (k *KStat) CopyTo(ptr interface{}) error CopyTo copies a RawStat KStat into a struct that you supply a pointer to. The size of the struct must exactly match the size of the RawStat's data. CopyStat imposes conditions on the struct that you are copying to: it must be composed entirely of primitive integer types with defined sizes (intN and uintN), or arrays and structs that ultimately only contain them. All fields should be exported. If you give CopyStat a bad argument, it generally panics. This API is provisional and may be changed or deleted. func (k *KStat) GetIO() (*IO, error) GetIO retrieves the IO statistics data from an IoStat type KStat. It always refreshes the KStat to provide current data. It corresponds to kstat_read() followed by getting a copy of ks_data (which is a kstat_io_t). func (k *KStat) GetMntinfo() (*Mntinfo, error) GetMntinfo retrieves a Mntinfo struct from a nfs:*:mntinfo KStat. It does not force a refresh of the KStat. func (k *KStat) GetNamed(name string) (*Named, error) GetNamed obtains a particular named statistic from a KStat. It does not refresh the KStat's statistics data, so multiple calls to GetNamed on a single KStat will get a coherent set of statistic values from it. It corresponds to kstat_data_lookup(). func (k *KStat) Raw() (*Raw, error) Raw returns the raw byte data of a KStat. It may be called on any KStat. It does not refresh the KStat's data. func (k *KStat) Refresh() error Refresh the statistics data for a KStat. Note that this does not update any existing Named objects for statistics from this KStat. You must re-do .GetNamed() to get new ones in order to see any updates. Under the hood this does a kstat_read(). You don't need to call it explicitly before obtaining statistics from a KStat. func (k *KStat) String() string func (k *KStat) Valid() bool Valid returns true if a KStat is still valid after a Token.Update() call has returned true. If a KStat becomes invalid after an update, its fields remain available but you can no longer call methods on it. You may be able to look it up again with token.Lookup(k.Module, k.Instance, k.Name), although it's possible that the module:instance:name now refers to something else. Even if it is still the same thing, there is no continuity in the actual statistics once Valid becomes false; you must restart tracking from scratch. (For example, if one disk is removed from the system and another is added, the new disk may use the same module:instance:name as some of the old disk's KStats. Your .Lookup() may succeed, but what you get back is not in any way a continuation of the old disk's information.) Valid also returns false after the KStat's token has been closed. type Mntinfo struct { RProto [128]int8 Vers uint32 Flags uint32 Secmod uint32 Curread uint32 Curwrite uint32 Timeo int32 Retrans int32 Acregmin uint32 Acregmax uint32 Acdirmin uint32 Acdirmax uint32 Timers [4]struct { Srtt uint32 Deviate uint32 Rtxcur uint32 } Noresponse uint32 Failover uint32 Remap uint32 RCurserver [257]int8 // contains filtered or unexported fields } Mntinfo is the kernel data from nfs:*:mntinfo, which is a 'struct mntinfo_kstat'. Use .Proto() and .Curserver() to get the RProto and RCurserver fields as strings instead of their awkward raw form. func (m Mntinfo) Curserver() string Curserver returns a Mntinfo RCurserver as a string. func (m Mntinfo) Proto() string Proto returns a Mntinfo RProto as a string. type Named struct { Name string Type NamedType // Only one of the following values is valid; the others are zero // values. // // StringVal holds the value for both CharData and String Type(s). StringVal string IntVal int64 UintVal uint64 // The Snaptime this Named was obtained. Note that while you // use the parent KStat's Crtime, you cannot use its Snaptime. // The KStat may have been refreshed since this Named was // created, which updates the Snaptime. Snaptime int64 // Pointer to the parent KStat, for access to the full name // and the crtime associated with this Named. KStat *KStat } Named represents a particular kstat named statistic, ie the full module:instance:name:statistic and its current value. Name and Type are always valid, but only one of StringVal, IntVal, or UintVal is valid for any particular statistic; which one is valid is determined by its Type. Generally you'll already know what type a given named kstat statistic is; I don't believe Solaris changes their type once they're defined. func (ks *Named) String() string type NamedType int NamedType represents the various types of named kstat statistics. const ( CharData NamedType = C.KSTAT_DATA_CHAR Int32 NamedType = C.KSTAT_DATA_INT32 Uint32 NamedType = C.KSTAT_DATA_UINT32 Int64 NamedType = C.KSTAT_DATA_INT64 Uint64 NamedType = C.KSTAT_DATA_UINT64 String NamedType = C.KSTAT_DATA_STRING ) The different types of data that a named kstat statistic can be (ie, these are the potential values of Named.Type). func (tp NamedType) String() string type Raw struct { Data []byte Ndata uint64 Snaptime int64 KStat *KStat } Raw is the raw data of a KStat. The actual bytes are in Data; Ndata is kstat_t.ks_ndata, and is not normally useful. Note that with RawStat KStats, it turns out that Ndata == len(Data). This is contrary to its meaning for other types of kstats. type Sysinfo struct { Updates uint32 Runque uint32 Runocc uint32 Swpque uint32 Swpocc uint32 Waiting uint32 } Sysinfo is the data from unix:0:sysinfo, which is a sysinfo_t. type Token struct { // contains filtered or unexported fields } Token is an access token for obtaining kstats. func Open() (*Token, error) Open returns a kstat Token that is used to obtain kstats. It corresponds to kstat_open(). You should call .Close() when you're done and then not use any KStats or Nameds obtained through this token. (Failing to call .Close() will cause memory leaks.) func (t *Token) All() []*KStat All returns an array of all available KStats. (It has no error return because due to how kstats are implemented, it cannot fail.) func (t *Token) Close() error Close a kstat access token. A closed token cannot be used for anything and cannot be reopened. After a Token has been closed it remains safe to look at fields on KStat and Named objects obtained through the Token, but it is not safe to call methods on them other than String(); doing so may cause memory corruption, although we try to avoid that. This corresponds to kstat_close(). func (t *Token) GetNamed(module string, instance int, name, stat string) (*Named, error) GetNamed obtains the Named representing a particular (named) kstat module:instance:name:statistic statistic. It always returns current data for the kstat statistic, even if it's called repeatedly for the same statistic. It is equivalent to .Lookup() then KStat.GetNamed(). func (t *Token) Lookup(module string, instance int, name string) (*KStat, error) Lookup looks up a particular kstat. module and name may be "" and instance may be -1 to mean 'the first one that kstats can find'. It also refreshes (or retrieves) the kstat's data and thus sets Snaptime. Lookup() corresponds to kstat_lookup() *plus kstat_read()*. func (tok *Token) Sysinfo() (*KStat, *Sysinfo, error) Sysinfo returns the KStat and the statistics from unix:0:sysinfo. It always returns a current, refreshed copy. func (t *Token) Update() (bool, error) Update synchronizes the Token to the current state of available kernel kstats, returning true if the kernel's list of available kstats changed and false otherwise. If there have been no changes in the kernel's kstat list, all KStats remain valid. If there was a kstat update, some or all of the KStats obtained through the Token may now be invalid. Some of the now-invalid KStats may still exist and be the same thing, but if so they will have to be looked up again. (This happens if, for example, a device disappears and then reappears. At the kernel level, the device's kstat is deleted when it disappears and then is recreated when it reappears; the kernel considers the recreated version to be a different kstat, although it has the same module:instance:name. Note that the same module:instance:name still existing does not guarantee that the kstat is for the same thing; one disk might have removed and then an entirely different new disk added.) Update corresponds to kstat_chain_update(). func (tok *Token) Var() (*KStat, *Var, error) Var returns the KStat and the statistics from unix:0:var. It always returns a current, refreshed copy. func (tok *Token) Vminfo() (*KStat, *Vminfo, error) Vminfo returns the KStat and the statistics from unix:0:vminfo. It always returns a current, refreshed copy. type Var struct { Buf int32 Call int32 Proc int32 Maxupttl int32 Nglobpris int32 Maxsyspri int32 Clist int32 Maxup int32 Hbuf int32 Hmask int32 Pbuf int32 Sptmap int32 Maxpmem int32 Autoup int32 Bufhwm int32 } Var is the data from unix:0:var, which is a 'struct var'. type Vminfo struct { Freemem uint64 Resv uint64 Alloc uint64 Avail uint64 Free uint64 Updates uint64 } Vminfo is the data from unix:0:vminfo, which is a vminfo_t. SUBDIRECTORIES cmd gen prometheus-node-exporter-0.18.1+ds/vendor/github.com/siebenmann/go-kstat/kstat_solaris.go000066400000000000000000000502021350016654700316120ustar00rootroot00000000000000// // The kstat package provides a Go interface to the Solaris/OmniOS // kstat(s) system for user-level access to a lot of kernel // statistics. For more documentation on kstats, see kstat(1) and // kstat(3kstat). // // In an ideal world the package documentation would go here. This is // not an ideal world, because any number of tools like godoc choke on // Go files that are not for their architecture (although I'll admit // it's a hard problem). So see doc.go for the actual package level // documentation. // // However, I refuse to push function level API documentation off to another // file, at least at the moment. It would be a horrible mess. // package kstat // #cgo LDFLAGS: -lkstat // // #include // #include // #include // #include // // /* We have to reach through unions, which cgo doesn't support. // So we have our own cheesy little routines for it. These assume // they are always being called on validly-typed named kstats. // */ // // char *get_named_char(kstat_named_t *knp) { // return knp->value.str.addr.ptr; // } // // uint64_t get_named_uint(kstat_named_t *knp) { // if (knp->data_type == KSTAT_DATA_UINT32) // return knp->value.ui32; // else // return knp->value.ui64; // } // // int64_t get_named_int(kstat_named_t *knp) { // if (knp->data_type == KSTAT_DATA_INT32) // return knp->value.i32; // else // return knp->value.i64; // } // // /* Let's not try to do C pointer arithmetic in Go and get it wrong */ // kstat_named_t *get_nth_named(kstat_t *ks, uint_t n) { // kstat_named_t *knp; // if (!ks || !ks->ks_data || ks->ks_type != KSTAT_TYPE_NAMED || n >= ks->ks_ndata) // return NULL; // knp = KSTAT_NAMED_PTR(ks); // return knp + n; // } // import "C" import ( "errors" "fmt" "runtime" "unsafe" ) // Token is an access token for obtaining kstats. type Token struct { kc *C.struct_kstat_ctl // ksm maps kstat_t pointers to our Go-level KStats for them. // kstat_t's stay constant over the lifetime of a token, so // we want to keep unique KStats. This holds some Go-level // memory down, but I wave my hands. ksm map[*C.struct_kstat]*KStat } // Open returns a kstat Token that is used to obtain kstats. It corresponds // to kstat_open(). You should call .Close() when you're done and then not // use any KStats or Nameds obtained through this token. // // (Failing to call .Close() will cause memory leaks.) func Open() (*Token, error) { r, err := C.kstat_open() if r == nil { return nil, err } t := Token{} t.kc = r t.ksm = make(map[*C.struct_kstat]*KStat) // A 'func (t *Token) Close()' is equivalent to // 'func Close(t *Token)'. The latter is what SetFinalizer() // needs. runtime.SetFinalizer(&t, (*Token).Close) return &t, nil } // Close a kstat access token. A closed token cannot be used for // anything and cannot be reopened. // // After a Token has been closed it remains safe to look at fields // on KStat and Named objects obtained through the Token, but it is // not safe to call methods on them other than String(); doing so // may cause memory corruption, although we try to avoid that. // // This corresponds to kstat_close(). func (t *Token) Close() error { if t == nil || t.kc == nil { return nil } // Go through our KStats and null out fields that are no longer // valid. We opt to do this before we actually destroy the memory // KStat.ksp is pointing to by calling kstat_close(). for _, v := range t.ksm { v.ksp = nil v.tok = nil } res, err := C.kstat_close(t.kc) t.kc = nil // clear the map to drop all references to KStats. t.ksm = make(map[*C.struct_kstat]*KStat) // cancel finalizer runtime.SetFinalizer(&t, nil) if res != 0 { return err } return nil } // Update synchronizes the Token to the current state of available // kernel kstats, returning true if the kernel's list of available // kstats changed and false otherwise. If there have been no changes // in the kernel's kstat list, all KStats remain valid. If there was a // kstat update, some or all of the KStats obtained through the Token // may now be invalid. Some of the now-invalid KStats may still exist // and be the same thing, but if so they will have to be looked up // again. // // (This happens if, for example, a device disappears and then // reappears. At the kernel level, the device's kstat is deleted when // it disappears and then is recreated when it reappears; the kernel // considers the recreated version to be a different kstat, although // it has the same module:instance:name. Note that the same // module:instance:name still existing does not guarantee that the // kstat is for the same thing; one disk might have removed and then // an entirely different new disk added.) // // Update corresponds to kstat_chain_update(). func (t *Token) Update() (bool, error) { if t == nil || t.kc == nil { return true, errors.New("token is closed") } oid := t.kc.kc_chain_id // NOTE that we can't assume err == nil on success and just // check for err != nil. The error return is set from errno, // and kstat_chain_update() does not guarantee that errno is // 0 if it succeeds. nid, err := C.kstat_chain_update(t.kc) switch { case nid < 0: // We generously assume that if there has been an // error, the chain is intact. Otherwise we should // invalidate all KStats in t.ksm, as in .Close(). // assumption: err != nil if n < 0. return false, err case nid == 0: // No change is good news. return false, nil case nid == oid: // Should never be the case, but... return false, fmt.Errorf("new KCID is old KCID: %d", nid) } // The simple approach to KStats after a chain update would be // to invalidate all existing KStats. However, we can do // better. kstat_chain_update() implicitly guarantees that it // will not reuse memory addresses of kstat_t structures for // different ones within a single call, so we can walk the // chain and look for addresses that we already know; the // KStats for those addresses are still valid. // Copy all valid chain entries that we have in the token ksm // map to a new map and delete them from the old (current) map. nksm := make(map[*C.struct_kstat]*KStat) for r := t.kc.kc_chain; r != nil; r = r.ks_next { if v, ok := t.ksm[r]; ok { nksm[r] = v delete(t.ksm, r) } } // Anything left in t.ksm is an old chain entry that was // removed by kstat_chain_update(). Explicitly zap their // KStat's references to make them invalid. for _, v := range t.ksm { v.ksp = nil v.tok = nil } // Make our new ksm map the current ksm map. t.ksm = nksm return true, nil } // All returns an array of all available KStats. // // (It has no error return because due to how kstats are implemented, // it cannot fail.) func (t *Token) All() []*KStat { n := []*KStat{} if t == nil || t.kc == nil { return n } for r := t.kc.kc_chain; r != nil; r = r.ks_next { n = append(n, newKStat(t, r)) } return n } // // allocate a C string for a non-blank string; otherwise return nil func maybeCString(src string) *C.char { if src == "" { return nil } return C.CString(src) } // free a non-nil C string func maybeFree(cs *C.char) { if cs != nil { C.free(unsafe.Pointer(cs)) } } // strndup behaves like the C function; given a *C.char and a len, it // returns a string that is up to len characters long at most. // Shorn of casts, it is: // C.GoStringN(p, C.strnlen(p, len)) // // strndup() is necessary to copy fields of the type 'char // name[SIZE];' where a string of exactly SIZE length will not be // null-terminated. GoStringN() will always copy trailing null bytes // and other garbage; GoString()'s internal strlen() may run off the // end of the 'name' field and either fault or copy too much. func strndup(cs *C.char, len C.size_t) string { // credit: Ian Lance Taylor in // https://github.com/golang/go/issues/12428 return C.GoStringN(cs, C.int(C.strnlen(cs, len))) } // Lookup looks up a particular kstat. module and name may be "" and // instance may be -1 to mean 'the first one that kstats can find'. // It also refreshes (or retrieves) the kstat's data and thus sets // Snaptime. // // Lookup() corresponds to kstat_lookup() *plus kstat_read()*. func (t *Token) Lookup(module string, instance int, name string) (*KStat, error) { if t == nil || t.kc == nil { return nil, errors.New("Token not valid or closed") } ms := maybeCString(module) ns := maybeCString(name) r, err := C.kstat_lookup(t.kc, ms, C.int(instance), ns) maybeFree(ms) maybeFree(ns) if r == nil { return nil, err } k := newKStat(t, r) // People rarely look up kstats to not use them, so we immediately // attempt to kstat_read() the data. If this fails, we don't return // the kstat. However, we don't scrub it from the kstat_t mapping // that the Token maintains; we have no reason to believe that it // needs to be remade. Our return of nil is a convenience to avoid // problems in callers. // TODO: this may be a mistake in the API. // // NOTE: this means that calling Lookup() on an existing KStat // (either directly or via tok.GetNamed()) has the effect of // updating its statistics data to the current time. Right now // we consider this a feature. err = k.Refresh() if err != nil { return nil, err } return k, nil } // GetNamed obtains the Named representing a particular (named) kstat // module:instance:name:statistic statistic. It always returns current // data for the kstat statistic, even if it's called repeatedly for the // same statistic. // // It is equivalent to .Lookup() then KStat.GetNamed(). func (t *Token) GetNamed(module string, instance int, name, stat string) (*Named, error) { stats, err := t.Lookup(module, instance, name) if err != nil { return nil, err } return stats.GetNamed(stat) } // ----- // KSType is the type of the data in a KStat. type KSType int // The different types of data that a KStat may contain, ie these // are the value of a KStat.Type. We currently only support getting // Named and IO statistics. const ( RawStat KSType = C.KSTAT_TYPE_RAW NamedStat KSType = C.KSTAT_TYPE_NAMED IntrStat KSType = C.KSTAT_TYPE_INTR IoStat KSType = C.KSTAT_TYPE_IO TimerStat KSType = C.KSTAT_TYPE_TIMER ) func (tp KSType) String() string { switch tp { case RawStat: return "raw" case NamedStat: return "named" case IntrStat: return "interrupt" case IoStat: return "io" case TimerStat: return "timer" default: return fmt.Sprintf("kstat_type:%d", tp) } } // KStat is the access handle for the collection of statistics for a // particular module:instance:name kstat. // type KStat struct { Module string Instance int Name string // Class is eg 'net' or 'disk'. In kstat(1) it shows up as a // ':class' statistic. Class string // Type is the type of kstat. Type KSType // Creation time of a kstat in nanoseconds since sometime. // See gethrtime(3) and kstat(3kstat). Crtime int64 // Snaptime is what kstat(1) reports as 'snaptime', the time // that this data was obtained. As with Crtime, it is in // nanoseconds since some arbitrary point in time. // Snaptime may not be valid until .Refresh() or .GetNamed() // has been called. Snaptime int64 ksp *C.struct_kstat // We need access to the token to refresh the data tok *Token } // newKStat is our internal KStat constructor. // // This also has the responsibility of maintaining (and using) the // kstat_t to KStat mapping cache, so that we don't recreate new // KStats for the same kstat_t all the time. func newKStat(tok *Token, ks *C.struct_kstat) *KStat { if kst, ok := tok.ksm[ks]; ok { return kst } kst := KStat{} kst.ksp = ks kst.tok = tok kst.Instance = int(ks.ks_instance) kst.Module = strndup((*C.char)(unsafe.Pointer(&ks.ks_module)), C.KSTAT_STRLEN) kst.Name = strndup((*C.char)(unsafe.Pointer(&ks.ks_name)), C.KSTAT_STRLEN) kst.Class = strndup((*C.char)(unsafe.Pointer(&ks.ks_class)), C.KSTAT_STRLEN) kst.Type = KSType(ks.ks_type) kst.Crtime = int64(ks.ks_crtime) // Inside the kernel, the ks_snaptime of a kstat is of course // a global thing. This 'global' snaptime is copied to user // level as part of the kstat header(s) on kstat_open(), which // means that kstats that have never been kstat_read() by us // are almost certain to have a non-zero ks_snaptime (because // someone, somewhere, will have read them since the system // booted, eg 'kstat -p | grep ...' reads all kstats). // Because this ks_snaptime is not useful, we don't copy it // to Snaptime; instead we leave Snaptime unset (zero) as // an explicit signal that this KStat has never had its data // read. // //kst.Snaptime = int64(ks.ks_snaptime) tok.ksm[ks] = &kst return &kst } // invalid is a desperate attempt to keep usage errors from causing // memory corruption. Don't count on it. func (k *KStat) invalid() bool { return k == nil || k.ksp == nil || k.tok == nil || k.tok.kc == nil } // setup does validity checks and setup, such as loading data via Refresh(). // It applies only to named kstats. // // TODO: setup() vs prep() is a code smell. func (k *KStat) setup() error { if k.invalid() { return errors.New("invalid KStat or closed token") } if k.ksp.ks_type != C.KSTAT_TYPE_NAMED { return fmt.Errorf("kstat %s (type %d) is not a named kstat", k, k.ksp.ks_type) } // Do the initial load of the data if necessary. if k.ksp.ks_data == nil { if err := k.Refresh(); err != nil { return err } } return nil } func (k *KStat) String() string { return fmt.Sprintf("%s:%d:%s (%s)", k.Module, k.Instance, k.Name, k.Class) } // Valid returns true if a KStat is still valid after a Token.Update() // call has returned true. If a KStat becomes invalid after an update, // its fields remain available but you can no longer call methods on // it. You may be able to look it up again with token.Lookup(k.Module, // k.Instance, k.Name), although it's possible that the // module:instance:name now refers to something else. Even if it is // still the same thing, there is no continuity in the actual // statistics once Valid becomes false; you must restart tracking from // scratch. // // (For example, if one disk is removed from the system and another is // added, the new disk may use the same module:instance:name as some // of the old disk's KStats. Your .Lookup() may succeed, but what you // get back is not in any way a continuation of the old disk's // information.) // // Valid also returns false after the KStat's token has been closed. func (k *KStat) Valid() bool { return !k.invalid() } // Refresh the statistics data for a KStat. // // Note that this does not update any existing Named objects for // statistics from this KStat. You must re-do .GetNamed() to get // new ones in order to see any updates. // // Under the hood this does a kstat_read(). You don't need to call it // explicitly before obtaining statistics from a KStat. func (k *KStat) Refresh() error { if k.invalid() { return errors.New("invalid KStat or closed token") } res, err := C.kstat_read(k.tok.kc, k.ksp, nil) if res == -1 { return err } k.Snaptime = int64(k.ksp.ks_snaptime) return nil } // GetIO retrieves the IO statistics data from an IoStat type // KStat. It always refreshes the KStat to provide current data. // // It corresponds to kstat_read() followed by getting a copy of // ks_data (which is a kstat_io_t). func (k *KStat) GetIO() (*IO, error) { if err := k.Refresh(); err != nil { return nil, err } if k.ksp.ks_type != C.KSTAT_TYPE_IO { return nil, fmt.Errorf("kstat %s (type %d) is not an IO kstat", k, k.ksp.ks_type) } // We make our own copy of ks_data (as an IO) so that we don't // point into C-owned memory. 'go tool cgo -godef' apparently // guarantees that the IO struct/type it creates has exactly // the same in-memory layout as the C struct, so we can safely // do this copy and expect to get good results. io := IO{} io = *((*IO)(k.ksp.ks_data)) return &io, nil } // GetNamed obtains a particular named statistic from a KStat. It does // not refresh the KStat's statistics data, so multiple calls to // GetNamed on a single KStat will get a coherent set of statistic // values from it. // // It corresponds to kstat_data_lookup(). func (k *KStat) GetNamed(name string) (*Named, error) { if err := k.setup(); err != nil { return nil, err } ns := C.CString(name) r, err := C.kstat_data_lookup(k.ksp, ns) C.free(unsafe.Pointer(ns)) if r == nil || err != nil { return nil, err } return newNamed(k, (*C.struct_kstat_named)(r)), err } // AllNamed returns an array of all named statistics for a particular // named-type KStat. Entries are returned in no particular order. func (k *KStat) AllNamed() ([]*Named, error) { if err := k.setup(); err != nil { return nil, err } lst := make([]*Named, k.ksp.ks_ndata) for i := C.uint_t(0); i < k.ksp.ks_ndata; i++ { ks := C.get_nth_named(k.ksp, i) if ks == nil { panic("get_nth_named returned surprise nil") } lst[i] = newNamed(k, ks) } return lst, nil } // Named represents a particular kstat named statistic, ie the full // module:instance:name:statistic // and its current value. // // Name and Type are always valid, but only one of StringVal, IntVal, // or UintVal is valid for any particular statistic; which one is // valid is determined by its Type. Generally you'll already know what // type a given named kstat statistic is; I don't believe Solaris // changes their type once they're defined. type Named struct { Name string Type NamedType // Only one of the following values is valid; the others are zero // values. // // StringVal holds the value for both CharData and String Type(s). StringVal string IntVal int64 UintVal uint64 // The Snaptime this Named was obtained. Note that while you // use the parent KStat's Crtime, you cannot use its Snaptime. // The KStat may have been refreshed since this Named was // created, which updates the Snaptime. Snaptime int64 // Pointer to the parent KStat, for access to the full name // and the crtime associated with this Named. KStat *KStat } func (ks *Named) String() string { return fmt.Sprintf("%s:%d:%s:%s", ks.KStat.Module, ks.KStat.Instance, ks.KStat.Name, ks.Name) } // NamedType represents the various types of named kstat statistics. type NamedType int // The different types of data that a named kstat statistic can be // (ie, these are the potential values of Named.Type). const ( CharData NamedType = C.KSTAT_DATA_CHAR Int32 NamedType = C.KSTAT_DATA_INT32 Uint32 NamedType = C.KSTAT_DATA_UINT32 Int64 NamedType = C.KSTAT_DATA_INT64 Uint64 NamedType = C.KSTAT_DATA_UINT64 String NamedType = C.KSTAT_DATA_STRING // CharData is found in StringVal. At the moment we assume that // it is a real string, because this matches how it seems to be // used for short strings in the Solaris kernel. Someday we may // find something that uses it as just a data dump for 16 bytes. // Solaris sys/kstat.h also has _FLOAT (5) and _DOUBLE (6) types, // but labels them as obsolete. ) func (tp NamedType) String() string { switch tp { case CharData: return "char" case Int32: return "int32" case Uint32: return "uint32" case Int64: return "int64" case Uint64: return "uint64" case String: return "string" default: return fmt.Sprintf("named_type-%d", tp) } } // Create a new Stat from the kstat_named_t // We set the appropriate *Value field. func newNamed(k *KStat, knp *C.struct_kstat_named) *Named { st := Named{} st.KStat = k st.Name = strndup((*C.char)(unsafe.Pointer(&knp.name)), C.KSTAT_STRLEN) st.Type = NamedType(knp.data_type) st.Snaptime = k.Snaptime switch st.Type { case String: // The comments in sys/kstat.h explicitly guarantee // that these strings are null-terminated, although // knp.value.str.len also holds the length. st.StringVal = C.GoString(C.get_named_char(knp)) case CharData: // Solaris/etc appears to use CharData for short strings // so that they can be embedded directly into // knp.value.c[16] instead of requiring an out of line // allocation. In theory we may find someone who is // using it as 128-bit ints or the like. // However I scanned the Illumos kernel source and // everyone using it appears to really be using it for // strings. st.StringVal = strndup((*C.char)(unsafe.Pointer(&knp.value)), 16) case Int32, Int64: st.IntVal = int64(C.get_named_int(knp)) case Uint32, Uint64: st.UintVal = uint64(C.get_named_uint(knp)) default: // TODO: should do better. panic(fmt.Sprintf("unknown stat type: %d", st.Type)) } return &st } prometheus-node-exporter-0.18.1+ds/vendor/github.com/siebenmann/go-kstat/raw_solaris.go000066400000000000000000000147271350016654700312710ustar00rootroot00000000000000// // Really raw access to KStat data package kstat // #cgo LDFLAGS: -lkstat // // #include // #include // #include // #include // #include // import "C" import ( "errors" "fmt" "reflect" "unsafe" ) // Raw is the raw data of a KStat. The actual bytes are in Data; // Ndata is kstat_t.ks_ndata, and is not normally useful. // // Note that with RawStat KStats, it turns out that Ndata == len(Data). // This is contrary to its meaning for other types of kstats. type Raw struct { Data []byte Ndata uint64 Snaptime int64 KStat *KStat } // TODO: better functionality split here func (k *KStat) prep() error { if k.invalid() { return errors.New("invalid KStat or closed token") } // Do the initial load of the data if necessary. if k.ksp.ks_data == nil { if err := k.Refresh(); err != nil { return err } } return nil } // Raw returns the raw byte data of a KStat. It may be called on any // KStat. It does not refresh the KStat's data. func (k *KStat) Raw() (*Raw, error) { if err := k.prep(); err != nil { return nil, err } r := Raw{} r.KStat = k r.Snaptime = k.Snaptime r.Ndata = uint64(k.ksp.ks_ndata) // The forced C.int() conversion is dangerous, because C.int // is not necessarily large enough to contain a // size_t. However this is the interface that Go gives us, so // we live with it. r.Data = C.GoBytes(unsafe.Pointer(k.ksp.ks_data), C.int(k.ksp.ks_data_size)) return &r, nil } func (tok *Token) prepunix(name string, size uintptr) (*KStat, error) { k, err := tok.Lookup("unix", 0, name) if err != nil { return nil, err } // TODO: handle better? if k.ksp.ks_type != C.KSTAT_TYPE_RAW { return nil, fmt.Errorf("%s is wrong type %s", k, k.Type) } if uintptr(k.ksp.ks_data_size) != size { return nil, fmt.Errorf("%s is wrong size %d (should be %d)", k, k.ksp.ks_data_size, size) } return k, nil } // Sysinfo returns the KStat and the statistics from unix:0:sysinfo. // It always returns a current, refreshed copy. func (tok *Token) Sysinfo() (*KStat, *Sysinfo, error) { var si Sysinfo k, err := tok.prepunix("sysinfo", unsafe.Sizeof(si)) if err != nil { return nil, nil, err } si = *((*Sysinfo)(k.ksp.ks_data)) return k, &si, nil } // Vminfo returns the KStat and the statistics from unix:0:vminfo. // It always returns a current, refreshed copy. func (tok *Token) Vminfo() (*KStat, *Vminfo, error) { var vi Vminfo k, err := tok.prepunix("vminfo", unsafe.Sizeof(vi)) if err != nil { return nil, nil, err } vi = *((*Vminfo)(k.ksp.ks_data)) return k, &vi, nil } // Var returns the KStat and the statistics from unix:0:var. // It always returns a current, refreshed copy. func (tok *Token) Var() (*KStat, *Var, error) { var vi Var k, err := tok.prepunix("var", unsafe.Sizeof(vi)) if err != nil { return nil, nil, err } vi = *((*Var)(k.ksp.ks_data)) return k, &vi, nil } // GetMntinfo retrieves a Mntinfo struct from a nfs:*:mntinfo KStat. // It does not force a refresh of the KStat. func (k *KStat) GetMntinfo() (*Mntinfo, error) { var mi Mntinfo if err := k.prep(); err != nil { return nil, err } if k.Type != RawStat || k.Module != "nfs" || k.Name != "mntinfo" { return nil, errors.New("KStat is not a Mntinfo kstat") } if uintptr(k.ksp.ks_data_size) != unsafe.Sizeof(mi) { return nil, fmt.Errorf("KStat is wrong size %d (should be %d)", k.ksp.ks_data_size, unsafe.Sizeof(mi)) } mi = *((*Mntinfo)(k.ksp.ks_data)) return &mi, nil } // // Support for copying semi-arbitrary structures out of raw // KStats. // // safeThing returns true if a given type is either a simple defined // size primitive integer type or an array and/or struct composed // entirely of safe things. A safe thing is entirely self contained // and may be initialized from random memory without breaking Go's // memory safety (although the values it contains may be garbage). // func safeThing(t reflect.Type) bool { switch t.Kind() { case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: return true case reflect.Array: // an array is safe if it's an array of something safe return safeThing(t.Elem()) case reflect.Struct: // a struct is safe if all its components are safe for i := 0; i < t.NumField(); i++ { if !safeThing(t.Field(i).Type) { return false } } return true default: // other things are not safe. return false } } // TODO: add floats to the supported list? It's unlikely to be needed // but it should just work. // CopyTo copies a RawStat KStat into a struct that you supply a // pointer to. The size of the struct must exactly match the size of // the RawStat's data. // // CopyStat imposes conditions on the struct that you are copying to: // it must be composed entirely of primitive integer types with defined // sizes (intN and uintN), or arrays and structs that ultimately only // contain them. All fields should be exported. // // If you give CopyStat a bad argument, it generally panics. // // This API is provisional and may be changed or deleted. func (k *KStat) CopyTo(ptr interface{}) error { if err := k.prep(); err != nil { return err } if k.Type != RawStat { return errors.New("KStat is not a RawStat") } // Validity checks: not nil value, not nil pointer value, // is a pointer to struct. if ptr == nil { panic("CopyTo given nil pointer") } vp := reflect.ValueOf(ptr) if vp.Kind() != reflect.Ptr { panic("CopyTo not given a pointer") } if vp.IsNil() { panic("CopyTo given nil pointer") } dst := vp.Elem() if dst.Kind() != reflect.Struct { panic("CopyTo: not pointer to struct") } // Is the struct safe to copy into, which means primitive types // and structs/arrays of primitive types? if !safeThing(dst.Type()) { panic("CopyTo: not a safe structure, contains unsupported fields") } if !dst.CanSet() { panic("CopyTo: struct cannot be set for some reason") } // Verify that the size of the target struct matches the size // of the raw KStat. if uintptr(k.ksp.ks_data_size) != dst.Type().Size() { return errors.New("struct size does not match KStat size") } // The following is exactly the magic that we performed for // specific types earlier. We take k.ksp.ks_data and turn // it into a typed pointer to the target object's type: // // src := ((*)(k.kps.ks_data)) src := reflect.NewAt(dst.Type(), unsafe.Pointer(k.ksp.ks_data)) // We now dereference that into the destination to copy the // data: // // dst = *src dst.Set(reflect.Indirect(src)) return nil } prometheus-node-exporter-0.18.1+ds/vendor/github.com/siebenmann/go-kstat/types_solaris_amd64.go000066400000000000000000000070471350016654700326340ustar00rootroot00000000000000// // Initially created by // cgo -godefs ctypes_solaris.go // // Now contains edits for documentation. This is considered okay by me // because these structs are not exactly likely to change any time // soon; that would break API compatibility. // // This is specific to amd64. It's unlikely that Go will support // 32-bit Solaris ('386'), but. package kstat // IO represents the entire collection of KStat (disk) IO statistics // exposed by an IoStat type KStat. // // Because IO is an exact copy of the C kstat_io_t structure from the // kernel, it does not have a Snaptime or KStat field. You must save // that information separately if you need it, perhaps by embedded the // IO struct as an anonymous struct in an additional struct of your // own. type IO struct { Nread uint64 Nwritten uint64 Reads uint32 Writes uint32 Wtime int64 Wlentime int64 Wlastupdate int64 Rtime int64 Rlentime int64 Rlastupdate int64 Wcnt uint32 Rcnt uint32 } // Sysinfo is the data from unix:0:sysinfo, which is a sysinfo_t. type Sysinfo struct { Updates uint32 Runque uint32 Runocc uint32 Swpque uint32 Swpocc uint32 Waiting uint32 } // Vminfo is the data from unix:0:vminfo, which is a vminfo_t. type Vminfo struct { Freemem uint64 Resv uint64 Alloc uint64 Avail uint64 Free uint64 Updates uint64 } // Var is the data from unix:0:var, which is a 'struct var'. type Var struct { Buf int32 Call int32 Proc int32 Maxupttl int32 Nglobpris int32 Maxsyspri int32 Clist int32 Maxup int32 Hbuf int32 Hmask int32 Pbuf int32 Sptmap int32 Maxpmem int32 Autoup int32 Bufhwm int32 } // Mntinfo is the kernel data from nfs:*:mntinfo, which is a 'struct // mntinfo_kstat'. Use .Proto() and .Curserver() to get the RProto // and RCurserver fields as strings instead of their awkward raw form. type Mntinfo struct { RProto [128]int8 Vers uint32 Flags uint32 Secmod uint32 Curread uint32 Curwrite uint32 Timeo int32 Retrans int32 Acregmin uint32 Acregmax uint32 Acdirmin uint32 Acdirmax uint32 Timers [4]struct { Srtt uint32 Deviate uint32 Rtxcur uint32 } Noresponse uint32 Failover uint32 Remap uint32 RCurserver [257]int8 pad0 [3]byte } // CFieldString converts a (null-terminated) C string embedded in an // []int8 slice to a (Go) string. The []int8 slice is likely to come // from an [N]int8 fixed-size field in a statistics struct. If there // is no null in the slice, the entire slice is returned. // // (The no-null behavior is common in C APIs; a string is often allowed // to exactly fill the field with no room for a trailing null.) func CFieldString(src []int8) string { slen := len(src) buf := make([]byte, slen) for i := 0; i < len(src); i++ { buf[i] = byte(src[i]) if src[i] == 0 { slen = i break } } return string(buf[:slen]) } // Proto returns a Mntinfo RProto as a string. func (m Mntinfo) Proto() string { return CFieldString(m.RProto[:]) } // Curserver returns a Mntinfo RCurserver as a string. func (m Mntinfo) Curserver() string { return CFieldString(m.RCurserver[:]) } // The Mntinfo type is not an exact conversion as produced by cgo; // because the original struct mntinfo_kstat contains an embedded // anonymously typed struct, it runs into // https://github.com/golang/go/issues/5253. This version is manually // produced from a cgo starting point and then verified to be the same // size. // It also has Proto and Curserver renamed so we can add methods to // get them as Go strings. prometheus-node-exporter-0.18.1+ds/vendor/github.com/soundcloud/000077500000000000000000000000001350016654700247115ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/soundcloud/go-runit/000077500000000000000000000000001350016654700264555ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/soundcloud/go-runit/LICENSE000066400000000000000000000020721350016654700274630ustar00rootroot00000000000000The 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.18.1+ds/vendor/github.com/soundcloud/go-runit/runit/000077500000000000000000000000001350016654700276165ustar00rootroot00000000000000prometheus-node-exporter-0.18.1+ds/vendor/github.com/soundcloud/go-runit/runit/runit.go000066400000000000000000000053431350016654700313130ustar00rootroot00000000000000package 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.18.1+ds/vendor/modules.txt000066400000000000000000000062021350016654700227040ustar00rootroot00000000000000# github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc github.com/alecthomas/template github.com/alecthomas/template/parse # github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf github.com/alecthomas/units # github.com/beevik/ntp v0.2.0 github.com/beevik/ntp # github.com/beorn7/perks v1.0.0 github.com/beorn7/perks/quantile # github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e github.com/coreos/go-systemd/dbus # github.com/ema/qdisc v0.0.0-20180104102928-b307c22d3ce7 github.com/ema/qdisc # github.com/godbus/dbus v0.0.0-20190402143921-271e53dc4968 github.com/godbus/dbus # github.com/golang/protobuf v1.3.1 github.com/golang/protobuf/proto # github.com/hodgesds/perf-utils v0.0.7 github.com/hodgesds/perf-utils # github.com/konsorten/go-windows-terminal-sequences v1.0.2 github.com/konsorten/go-windows-terminal-sequences # github.com/lufia/iostat v0.0.0-20170605150913-9f7362b77ad3 github.com/lufia/iostat # github.com/mattn/go-xmlrpc v0.0.1 github.com/mattn/go-xmlrpc # github.com/matttproud/golang_protobuf_extensions v1.0.1 github.com/matttproud/golang_protobuf_extensions/pbutil # github.com/mdlayher/genetlink v0.0.0-20181016160152-e97704c1b795 github.com/mdlayher/genetlink # github.com/mdlayher/netlink v0.0.0-20181210160939-e069752bc835 github.com/mdlayher/netlink github.com/mdlayher/netlink/nlenc # github.com/mdlayher/wifi v0.0.0-20180727163819-efdf3f4195d9 github.com/mdlayher/wifi github.com/mdlayher/wifi/internal/nl80211 # github.com/prometheus/client_golang v0.9.2 github.com/prometheus/client_golang/prometheus github.com/prometheus/client_golang/prometheus/promhttp github.com/prometheus/client_golang/prometheus/internal # github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 github.com/prometheus/client_model/go # github.com/prometheus/common v0.3.0 github.com/prometheus/common/log github.com/prometheus/common/version github.com/prometheus/common/expfmt github.com/prometheus/common/model github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg # github.com/prometheus/procfs v0.0.0-20190529155944-65bdadfa96ae github.com/prometheus/procfs github.com/prometheus/procfs/bcache github.com/prometheus/procfs/nfs github.com/prometheus/procfs/sysfs github.com/prometheus/procfs/xfs github.com/prometheus/procfs/internal/fs github.com/prometheus/procfs/internal/util # github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745 github.com/siebenmann/go-kstat # github.com/sirupsen/logrus v1.4.1 github.com/sirupsen/logrus # github.com/soundcloud/go-runit v0.0.0-20150630195641-06ad41a06c4a github.com/soundcloud/go-runit/runit # go.uber.org/atomic v1.3.2 go.uber.org/atomic # go.uber.org/multierr v1.1.0 go.uber.org/multierr # golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c golang.org/x/net/ipv4 golang.org/x/net/bpf golang.org/x/net/internal/iana golang.org/x/net/internal/socket # golang.org/x/sync v0.0.0-20190423024810-112230192c58 golang.org/x/sync/errgroup # golang.org/x/sys v0.0.0-20190507053917-2953c62de483 golang.org/x/sys/unix golang.org/x/sys/windows/svc/eventlog golang.org/x/sys/windows golang.org/x/sys/windows/registry # gopkg.in/alecthomas/kingpin.v2 v2.2.6 gopkg.in/alecthomas/kingpin.v2