NFS Stats

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

zemariacp
Posts: 1
Joined: Fri Sep 28, 2012 1:51 pm

Re: NFS Stats

Post by zemariacp »

hi all,
i think i have the script (nfs_server.sh) running ok, however my snmp agent is not cooperating...
Here is the output when i run the script from the command line:
[user@linux ~]$ nfs_server.sh
717320
8
978699
358637
0
1
3
5
4
0
0
6
0
2
0
10173
363979
4
1
0
3
[user@linux ~]$

and here is the output when I do a snmpwalk:
UCD-SNMP-MIB::ucdavis.67.3.1.2.10.110.102.115.95.115.101.114.118.101.114 = STRING: "grep: /proc/net/rpc/nfsd: Permission denied
grep: /proc/net/rpc/nfsd: Permission denied
grep: /proc/net/rpc/nfsd: Permission denied
grep: /proc/net/rpc/nfsd: Permission denied
grep: /proc/net/rpc/nfsd: Permission denied
grep: /proc/net/rpc/nfsd: Permission denied
grep: /proc/net/rpc/nfsd: Permission denied
grep: /proc/net/rpc/nfsd: Permission denied
grep: /proc/net/rpc/nfsd: Permission denied
grep: /proc/net/rpc/nfsd: Permission denied
grep: /proc/net/rpc/nfsd: Permission denied
grep: /proc/net/rpc/nfsd: Permission denied
grep: /proc/net/rpc/nfsd: Permission denied
grep: /proc/net/rpc/nfsd: Permission denied
grep: /proc/net/rpc/nfsd: Permission denied
grep: /proc/net/rpc/nfsd: Permission denied
grep: /proc/net/rpc/nfsd: Permission denied
grep: /proc/net/rpc/nfsd: Permission denied
grep: /proc/net/rpc/nfsd: Permission denied
grep: /proc/net/rpc/nfsd: Permission denied
grep: /proc/net/rpc/nfsd: Permission denied"

So it seems that my snmp agent is not properly configured.
I've only added this line for the NFS stats collection (snmpd.conf):
extend .1.3.6.1.4.1.2021.67 nfs_server /bin/bash /usr/local/bin/nfs_server.sh

Any clues of what might be wrong?
Norzemen
Posts: 1
Joined: Mon Apr 29, 2013 3:44 pm

Re: NFS Stats

Post by Norzemen »

for your permission denied issue check your permissions. On my CentOS 5.9 cacti server it looks like this.

$ ls -l /proc/net/rpc/nfsd
-r--r--r-- 1 root root 0 Apr 29 14:05 /proc/net/rpc/nfsd

For users who were getting NAN even when everthing else checks out. I discovered that my SPINE Poller was producing value: U.

My settings in data templates (e.g. Data Templates [edit: ucd/net - NFS Server - readlink ]) for each entry was, MINIMUM = 0 and MAXIMUM = 10,000,000. I reset them to U and my NFS data started coming in.
mxljosh
Posts: 17
Joined: Fri Aug 09, 2013 4:58 pm

Re:

Post by mxljosh »

lundman wrote:Carrying on from benr work for Solaris, I changed it for NFS Server, added total nfsops and nfsd number of threads.

Code: Select all

#!/bin/bash
# NFSv3 Solaris Stats Collection
#  - Based on nfs_client.sh by pheezy
#  - benr@cuddletech.com
# NFS server change, and massage:
#  - lundman@lundman.net

proc="getattr setattr lookup access readlink read write create mkdir symlink mknod remove rmdir rename link readdir readdirplus fsstat fsinfo pathconf commit"

for a in $proc; do
     # Change "rfsproccnt_v3" to "rfsreqcnt_v3" for clients. Change "3" for
     # NFS version.
     args="nfs:0:rfsproccnt_v3:${a} ${args}"
done

#echo $args

# Use xargs if $args eventually becomes too large.
# Number of threads
ps -edo nlwp,comm|grep '[n]fsd' | awk '{print $1}'

# Add in the total calls as well.
kstat -p "nfs:0:nfs_server:calls" ${args} | awk '{print $2}'     

Has anybody been able to get this to work on Solaris 11? We can run the script fine on the command line and get results, but our graphs come up blank. They work fine on a normal Centos/RedHat box with the original script. Any help is greatly appreciated.
dantemason
Posts: 1
Joined: Sat Apr 26, 2014 10:53 am

Re:

Post by dantemason »

aboling wrote:This is a modified client template that works with the "extend" directive of net-snmp instead of "exec". exec has been deprecated and will no longer work in the most recent versions, but extend exposes the data in a different format.

Long story short, this is the same client xml file at the top of the thread with the following search and replace performed on it:

.66.101.
to
.66.4.1.2.10.110.102.115.95.99.108.105.101.110.116.


This was a quick hack and it Works On My Machine<tm> - your mileage may vary.
I did some modification of aboling's version so that both "extend" and "exec" directive can exist.
(I have some old systems use "exec" directive and some new systems use "extend" directive)
exported from Version 0.8.8b
Attachments
cacti_graph_template_ucdnet_-_nfs_clientextend.zip
(11.09 KiB) Downloaded 251 times
gru
Posts: 11
Joined: Fri Jun 02, 2006 2:46 am

Re: Error when importing template.

Post by gru »

Threepwood wrote:I'm getting the following error when I try to import the template :

Error: XML: Hash version does not exist.

Do I need to upgrade my CACTI ?. I'm using version : 0.8.6j

Thanks,
Lucas.
Hi,

no need to upgrade, except it is an old version :wink:
I'm using also 0.8.6j and here is the template from the 1st post (i use it with the shell script also from this post).

greetings, Jo
Attachments
cacti_graph_template_ucdnet_nfs_client.zip
(10.82 KiB) Downloaded 192 times
cozoc
Posts: 1
Joined: Fri Nov 14, 2014 12:50 pm

Re: NFS Stats

Post by cozoc »

sirhopcount wrote:Hi

I have a small question about the data being collected and the way its collected. If a take for example my the proc3 line from my /proc/net/rpc/nfsd it looks like this:

Code: Select all

proc3 22 124 293606019 77582633 126915042 380472083 0 98058414 61510311 22269327 6908 0 0 21290377 1243 18438938 1373865 7949872 26250248 3302016 2651 1275 55358199
sirhopcount wrote: The only value i cannot figure out what it represents is the first. Could someone please explain this to me.
roughly speaking, the first value (22) in your proc3 line comes from the size of the array. in other words, there are 22 values that are provided above for nfsd3 statistics.
(i.e. #1=124 ... #22=55358199)

reference: fs/nfsd/nfs3proc.c
eldhovarghese
Posts: 1
Joined: Wed Jan 31, 2018 6:12 am

Re: NFS Stats

Post by eldhovarghese »

Has anybody been able to get this to work on Solaris 11? We can run the script fine on the command line and get results, but our graphs come up blank. They work fine on a normal Centos/RedHat box with the original script. Any help is greatly appreciated.

Yes mine is working on Solaris 11. You need to put following in the /etc/net-snmp/snmp/snmpd.conf file

extend .1.3.6.1.4.1.2021.66 nfs_client /usr/local/bin/nfs_client_solaris.sh

Rest all same.

Thanks
Eldho Varghese
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests