Skip to content

Instantly share code, notes, and snippets.

@blackknight36
Last active March 23, 2018 14:22
Show Gist options
  • Save blackknight36/9c8b29eb3c0f2bdbb339239d5da5fa6d to your computer and use it in GitHub Desktop.
Save blackknight36/9c8b29eb3c0f2bdbb339239d5da5fa6d to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
procs="getattr setattr lookup access readlink read write create mkdir symlink mknod remove rmdir rename link readdir readdirplus fsstat fsinfo pathconf commit".split()
stats = open('/proc/net/rpc/nfsd') { |f| f.each_line.find { |line| line.include?("proc4ops") } }.split()
i = 11
hostname = `hostname -f`.chomp!
procs.each do |p|
puts "PUTVAL #{hostname}/nfs-v4server/nfs_procedure-#{p} interval=10 N:" + stats[i]
i += 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment