Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

nfsstats/python_modules/nfsstats.py: #68

Merged
merged 1 commit into from

2 participants

@waxie
  • added test_proc3: check if string 'proc3' is present in proc file
  • added test_proc3 to tests for nfs_client and nfs_server
  • fixes: #67
Ramon Bastiaans 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
b61d6fe
@jbuchbinder jbuchbinder merged commit 6d693d6 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 26, 2012
  1. nfsstats/python_modules/nfsstats.py:

    Ramon Bastiaans authored
     * added test_proc3: check if string 'proc3' is present in proc file
     * added test_proc3 to tests for nfs_client and nfs_server
This page is out of date. Refresh to see the latest.
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',
Something went wrong with that request. Please try again.