nfsiostat output

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
jpeery
Posts: 14
Joined: Wed Oct 24, 2012 9:51 am

nfsiostat output

Post by jpeery »

Has anyone tried wrapping nfsiostat command into a check, more precisely for metrics gathering? In my setup, I'm using Nagios with Graphios to insert performance metrics in an Influx DB for viewing in Grafana. My problem has been trying to parse the output of nfsiostat, I don't need the first results (avg since machine boot), but do want all the values returned for read and write for graphing. Ideally I'd like to do this without doing a lot of sed/awk, or writing a Python program to handle the parsing and formatting for Graphios. Thought I'd see if anyone else has dealt with performance gathering client-side on NFS (v3) mounts?
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: nfsiostat output

Post by dwhitfield »

Graphios is not our product, but of course we can leave this open for community input.

If you don't get any responses here after a bit, you might try posting on their github or their exchange page: https://exchange.nagios.com/directory/A ... os/details (github linked from there).

Also, there's a tutorial at https://exchange.nagios.com/directory/D ... na/details you might find helpful.
jpeery
Posts: 14
Joined: Wed Oct 24, 2012 9:51 am

Re: nfsiostat output

Post by jpeery »

Been a while, but thought I'd follow up here in case anyone is curious, I wrote a little script to do this, am still working on it, but basically here's what I worked out for NFS stats monitoring and perf gathering. It's not pretty, sort of brute force, but might help someone else:

NFS_STATS=`iostat -n |awk 'NR >3' |tr -s ' ' ';' |sed '/^$/d'`

for LINE in `echo ${NFS_STATS}`
do
FILESYSTEM=`echo ${LINE}|cut -d ';' -f 1`
RBLKNORS=`echo ${LINE}|cut -d ';' -f 2`
WBLKNORS=`echo ${LINE}|cut -d ';' -f 3`
RBLKDIRS=`echo ${LINE}|cut -d ';' -f 4`
WBLKDIRS=`echo ${LINE}|cut -d ';' -f 5`
RBLKSVRS=`echo ${LINE}|cut -d ';' -f 6`
WBLKSVRS=`echo ${LINE}|cut -d ';' -f 7`
OPSS=`echo ${LINE}|cut -d ';' -f 8`
ROPSS=`echo ${LINE}|cut -d ';' -f 9`
WOPSS=`echo ${LINE}|cut -d ';' -f 10`
NAGIOS_DATA="Filesystem=${FILESYSTEM} rBlk_nor/s=${RBLKNORS} wBlk_nor/s=${WBLKNORS} rBlk_dir/s=${RBLKDIRS} wBlk_dir/s=${WBLKDIRS} rBlk_svr/s=${RBLKSVRS} wBlk_svr/s=${WBLKSVRS} ops/s=${OPSS} rops/s=${ROPSS} wops/s=${WOPSS}"
PERF_STATS="RBLKNORS=${RBLKNORS}; WBLKNORS=${WBLKNORS}; RBLKDIRS=${RBLKDIRS}; WBLKDIRS=${WBLKDIRS}; RBLKSVRS=${RBLKSVRS}; WBLKSVRS=${WBLKSVRS}; OPSS=${OPSS}; ROPSS=${ROPSS}; WOPSS=${WOPSS}"
echo "OK ${NAGIOS_DATA}|${PERF_STATS}"


Where you might get in trouble is if you have a lot of mounts, then you may hit the size limit Nagios can handle, I think. Anyway, FWIW, hope it helps anyone else if they're needing to gather stats for NFS. If I were to be asked how to handle it now, given all you want is stats, I'd actually say use collectd and pipe it straight into InfluxDB (what I use), if for no other reason because you can gather stats more often than every minute, if you need. You can always grab what you want out of /proc/mountstats, etc, but if you want to wrap it into Nagios and use alerting this might get you on the right path.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: nfsiostat output

Post by dwhitfield »

It's kinda a long thread with some twists and turns, but there seems to be renewed interest and using NDOUtils for graphing. It sounds like you have something working for you, but if you're curious or want something better, you might take a look at https://support.nagios.com/forum/viewto ... =7&t=41917
jpeery
Posts: 14
Joined: Wed Oct 24, 2012 9:51 am

Re: nfsiostat output

Post by jpeery »

That's interesting, I haven't worked with NDOUtils lately, had been using Graphios as an in-between from Nagios to InfluxDB, and displaying in Grafana. I'm all for reducing the interaction points though, will see if I can can grab some time to fire up a test vm and see what it looks like. Thanks for the suggestion.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: nfsiostat output

Post by tmcdonald »

Definitely keep us posted!
Former Nagios employee
Locked