plugins/inputs/nfsclient/README.md
This plugin collects metrics about operations on Network Filesystem mounts. By default, only a limited number of general system-level metrics are collected, including basic read/write counts but more detailed metrics can be enabled.
[!NOTE] Many of the metrics, even if tagged with a mount point, are really per-server. E.g. if you mount two shares:
nfs01:/vol/foo/barandnfs01:/vol/foo/baz, there will be two near identical entries in/proc/self/mountstats. This is a limitation of the metrics exposed by the kernel, not by this plugin.
⭐ Telegraf v1.18.0 🏷️ network, system 💻 all
Plugins support additional global and plugin configuration settings for tasks such as modifying metrics, tags, and fields, creating aliases, and configuring plugin ordering. See CONFIGURATION.md for more details.
# Read per-mount NFS client metrics from /proc/self/mountstats
[[inputs.nfsclient]]
## Read more low-level metrics (optional, defaults to false)
# fullstat = false
## List of mounts to explicitly include or exclude (optional)
## The pattern (Go regexp) is matched against the mount point (not the
## device being mounted). If include_mounts is set, all mounts are ignored
## unless present in the list. If a mount is listed in both include_mounts
## and exclude_mounts, it is excluded. Go regexp patterns can be used.
# include_mounts = []
# exclude_mounts = []
## List of operations to include or exclude from collecting. This applies
## only when fullstat=true. Semantics are similar to {include,exclude}_mounts:
## the default is to collect everything; when include_operations is set, only
## those OPs are collected; when exclude_operations is set, all are collected
## except those listed. If include and exclude are set, the OP is excluded.
## See /proc/self/mountstats for a list of valid operations; note that
## NFSv3 and NFSv4 have different lists. While it is not possible to
## have different include/exclude lists for NFSv3/4, unused elements
## in the list should be okay. It is possible to have different lists
## for different mountpoints: use multiple [[input.nfsclient]] stanzas,
## with their own lists. See "include_mounts" above, and be careful of
## duplicate metrics.
# include_operations = []
# exclude_operations = []
fullstat: Collect per-operation type metrics. Defaults to false.include_mounts: gather metrics for only these mounts. Default is to watch
all mounts.exclude_mounts: gather metrics for all mounts, except those listed in this
option. Excludes take precedence over includes.include_operations: List of specific NFS operations to track. See
/proc/self/mountstats (the "per-op statistics" section) for a complete
lists of valid options for NFSv3 and NFSV4. The default is to gather all
metrics, but this is almost certainly not what you want (there are
22 operations for NFSv3, and well over 50 for NFSv4). A suggested 'minimal'
list of operations to collect for basic usage:
['READ','WRITE','ACCESS','GETATTR','READDIR','LOOKUP','LOOKUP']exclude_operations: Gather all metrics, except those listed. Excludes take
precedence over includes.[!NOTE] The
include_mountsandexclude_mountsarguments are both applied to the local mount location (e.g. /mnt/NFS), not the server export (e.g. nfsserver:/vol/NFS). Go regexp patterns can be used in either.
If you have mounted the /proc file system in a container, to tell this plugin
where to find the new location, set the MOUNT_PROC environment variable. For
example, in a Docker compose file, if /proc is mounted to /host/proc, then
use:
MOUNT_PROC: /host/proc/self/mountstats
Fields:
bytes = OP_bytes_sent + OP_bytes_recv). See nfs_ops below.retried retrans = OP_trans - OP_ops). See nfs_ops below.In addition enabling fullstat will make many more metrics available.
Tags:
All measurements have the following tags:
Measurements nfsstat and nfs_ops will also include:
READ or WRITE for nfsstat,
but potentially one of ~20 or ~50, depending on NFS version. A
complete list of operations supported is visible in
/proc/self/mountstats.When fullstat is true, additional measurements are collected. Tags are the
same as above.
NFS Operations:
Most descriptions come from Reference and nfs_iostat.h. Field order
and names are the same as in /proc/self/mountstats and the Kernel source.
Please refer to /proc/self/mountstats for a list of supported NFS operations,
as it changes occasionally.
nfs_bytes
read()write()mmap())mmap())nfs_events (Per-event metrics)
open()'d.access(). (formerly
called "vfspermission")mmap()?).mmap()?)fsync() on directories
and files.close().nfs_xprt_tcp
nfs_xprt_udp
nfs_ops
operations tag being set to the uppercase name of the NFS
operation in all cases , e.g. "READ", "FSINFO", etc. See
/proc/self/mountstats for a full list:
OP_ops - OP_trans = total_retransmissions.For basic metrics showing server-wise read and write data.
nfsstat,mountpoint=/NFS,operation=READ,serverexport=1.2.3.4:/storage/NFS ops=600i,retrans=1i,bytes=1207i,rtt=606i,exe=607i 1612651512000000000
nfsstat,mountpoint=/NFS,operation=WRITE,serverexport=1.2.3.4:/storage/NFS bytes=1407i,rtt=706i,exe=707i,ops=700i,retrans=1i 1612651512000000000
For fullstat=true metrics, which includes additional measurements for
nfs_bytes, nfs_events, and nfs_xprt_tcp (and nfs_xprt_udp if present).
Additionally, per-OP metrics are collected, with examples for READ, LOOKUP, and
NULL shown. Please refer to /proc/self/mountstats for a list of supported NFS
operations, as it changes as it changes periodically.
nfs_bytes,mountpoint=/home,serverexport=nfs01:/vol/home directreadbytes=0i,directwritebytes=0i,normalreadbytes=42648757667i,normalwritebytes=0i,readpages=10404603i,serverreadbytes=42617098139i,serverwritebytes=0i,writepages=0i 1608787697000000000
nfs_events,mountpoint=/home,serverexport=nfs01:/vol/home attrinvalidates=116i,congestionwait=0i,datainvalidates=65i,delay=0i,dentryrevalidates=5911243i,extendwrite=0i,inoderevalidates=200378i,pnfsreads=0i,pnfswrites=0i,setattrtrunc=0i,shortreads=0i,shortwrites=0i,sillyrenames=0i,vfsaccess=7203852i,vfsflush=117405i,vfsfsync=0i,vfsgetdents=3368i,vfslock=0i,vfslookup=740i,vfsopen=157281i,vfsreadpage=16i,vfsreadpages=86874i,vfsrelease=155526i,vfssetattr=0i,vfsupdatepage=0i,vfswritepage=0i,vfswritepages=215514i 1608787697000000000
nfs_xprt_tcp,mountpoint=/home,serverexport=nfs01:/vol/home backlogutil=0i,badxids=0i,bind_count=1i,connect_count=1i,connect_time=0i,idle_time=0i,inflightsends=15659826i,rpcreceives=2173896i,rpcsends=2173896i 1608787697000000000
nfs_ops,mountpoint=/NFS,operation=NULL,serverexport=1.2.3.4:/storage/NFS trans=0i,timeouts=0i,bytes_sent=0i,bytes_recv=0i,queue_time=0i,response_time=0i,total_time=0i,ops=0i 1612651512000000000
nfs_ops,mountpoint=/NFS,operation=READ,serverexport=1.2.3.4:/storage/NFS bytes=1207i,timeouts=602i,total_time=607i,exe=607i,trans=601i,bytes_sent=603i,bytes_recv=604i,queue_time=605i,ops=600i,retrans=1i,rtt=606i,response_time=606i 1612651512000000000
nfs_ops,mountpoint=/NFS,operation=WRITE,serverexport=1.2.3.4:/storage/NFS ops=700i,bytes=1407i,exe=707i,trans=701i,timeouts=702i,response_time=706i,total_time=707i,retrans=1i,rtt=706i,bytes_sent=703i,bytes_recv=704i,queue_time=705i 1612651512000000000