Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

nfsstats/python_modules/nfsstats.py:

 * added test_proc3: check if string 'proc3' is present in proc file
 * added test_proc3 to tests for nfs_client and nfs_server
  • Loading branch information...
commit b61d6fe02337b37686982dd3a2d33b85bdd42e9a 1 parent 1eb6ffd
Ramon Bastiaans authored
Showing with 21 additions and 2 deletions.
  1. +21 −2 nfsstats/python_modules/nfsstats.py
View
23 nfsstats/python_modules/nfsstats.py
@@ -7,6 +7,25 @@
import syslog
import sys
+def test_proc3( p_file ):
+
+ """
+ Check if <p_file> contains keyword 'proc3'
+ """
+
+ p_fd = open( p_file )
+
+ p_contents = p_fd.read()
+
+ p_fd.close()
+
+ m = re.search(".*proc3.*", p_contents, flags=re.MULTILINE)
+
+ if not m:
+ return False
+ else:
+ return True
+
verboselevel = 0
descriptors = [ ]
old_values = { }
@@ -14,7 +33,7 @@
configtable = [
{
'group': 'nfs_client',
- 'tests': [ 'stat.S_ISREG(os.stat("/proc/net/rpc/nfs").st_mode)' ],
+ 'tests': [ 'stat.S_ISREG(os.stat("/proc/net/rpc/nfs").st_mode)', 'test_proc3("/proc/net/rpc/nfs")' ],
'prefix': 'nfs_v3_',
# The next 4 lines can be at the 'group' level or the 'name' level
'file': '/proc/net/rpc/nfs',
@@ -47,7 +66,7 @@
},
{
'group': 'nfs_server',
- 'tests': [ 'stat.S_ISREG(os.stat("/proc/net/rpc/nfsd").st_mode)' ],
+ 'tests': [ 'stat.S_ISREG(os.stat("/proc/net/rpc/nfsd").st_mode)', 'test_proc3("/proc/net/rpc/nfsd")' ],
'prefix': 'nfsd_v3_',
# The next 4 lines can be at the 'group' level or the 'name' level
'file': '/proc/net/rpc/nfsd',
Please sign in to comment.
Something went wrong with that request. Please try again.