summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSteve Dickson <steved@redhat.com>2011-09-21 13:52:49 -0400
committerSteve Dickson <steved@redhat.com>2011-09-21 15:41:43 -0400
commitc9823f479f2d0d379d85a37ad2af41faca6cc911 (patch)
treef0e676f9573f757157225bb321aafe78580affbc /tools
parent076b91078411b6a2c99c8d85bc10ded5c64a7019 (diff)
downloadnfs-utils-c9823f479f2d0d379d85a37ad2af41faca6cc911.tar.gz
nfs-utils-c9823f479f2d0d379d85a37ad2af41faca6cc911.tar.xz
nfs-utils-c9823f479f2d0d379d85a37ad2af41faca6cc911.zip
nfsiostat: Breaks on 3.1 kernels
nfsiostat depend on all devices entries in /proc/self/mountstats to start with the word 'device'. With 3.1 kernels, NFS entries start with the actual device (i.e. server:/export) not the word 'device'. This change confused nfsiostat parsing. Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/nfs-iostat/nfs-iostat.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py
index 4e55dad..d909632 100644
--- a/tools/nfs-iostat/nfs-iostat.py
+++ b/tools/nfs-iostat/nfs-iostat.py
@@ -86,6 +86,12 @@ class DeviceData:
self.__nfs_data['fstype'] = words[7]
if words[7] == 'nfs':
self.__nfs_data['statvers'] = words[8]
+ elif 'nfs' in words or 'nfs4' in words:
+ self.__nfs_data['export'] = words[0]
+ self.__nfs_data['mountpoint'] = words[3]
+ self.__nfs_data['fstype'] = words[6]
+ if words[6] == 'nfs':
+ self.__nfs_data['statvers'] = words[7]
elif words[0] == 'age:':
self.__nfs_data['age'] = long(words[1])
elif words[0] == 'opts:':
@@ -426,6 +432,9 @@ def parse_stats_file(filename):
if words[0] == 'device':
key = words[4]
new = [ line.strip() ]
+ elif 'nfs' in words or 'nfs4' in words:
+ key = words[3]
+ new = [ line.strip() ]
else:
new += [ line.strip() ]
ms_dict[key] = new
@@ -436,7 +445,6 @@ def parse_stats_file(filename):
def print_iostat_summary(old, new, devices, time, options):
stats = {}
diff_stats = {}
-
if old:
# Trim device list to only include intersection of old and new data,
# this addresses umounts due to autofs mountpoints
@@ -553,7 +561,6 @@ client are listed.
parser.add_option_group(displaygroup)
(options, args) = parser.parse_args(sys.argv)
-
for arg in args:
if arg == sys.argv[0]: