nfsstat cacti 템플릿 등록 방법
cacti를 사용하다보면, 템플릿을 추가할 경우가 많은데.. 아래는 NFS에 대한 템플릿 추가 방법 입니다.
1) nfsstat client
1. Place nfs_client.sh in /usr/local/bin/, make sure it is excecutable. I use puppet to do this, you can use another tool or do it manually.
2. Add a line like this to your snmpd.conf:
1 2 | exec .1.3.6.1.4.1.2021.66 nfs_client /bin/sh /usr/local/bin/nfs_client.sh | cs |
/usr/local/bin 에 nfs_client.sh 복사
## nfs_client.sh 소스
1 2 3 4 5 6 7 8 9 10 11 12 | NFS=/proc/net/rpc/nfs proc="getattr setattr lookup access readlink read write create mkdir symlink mknod remove rmdir rename link readdir readdirplus fsstat fsinfo pathconf commit" i=4; for a in $proc; do # echo -n "$a.value " grep proc3 $NFS \ | cut -f $i -d ' ' \ | awk '{print $1}' i=$(expr $i + 1) done | cs |
2) nfsstat server
1. Place nfs_server.sh in /usr/local/bin/, make sure it is excecutable. I use puppet to do this, you can use another tool or do it manually.
2. Add a line like this to your snmpd.conf:
1 2 | exec .1.3.6.1.4.1.2021.67 nfs_server /bin/sh /usr/local/bin/nfs_server.sh | cs |
/usr/local/bin 에 nfs_server.sh 복사
## nfs_server.sh 소스
1 2 3 4 5 6 7 8 9 10 11 | NFSD=/proc/net/rpc/nfsd proc="getattr setattr lookup access readlink read write create mkdir symlink mknod remove rmdir rename link readdir readdirplus fsstat fsinfo pathconf commit" i=4; for a in $proc; do grep proc3 $NFSD \ | cut -f $i -d ' ' \ | awk '{print $1}' i=$(expr $i + 1) done | cs |