diff options
author | Nishanth Thomas <nthomas@redhat.com> | 2014-03-20 13:08:42 +0530 |
---|---|---|
committer | Bala.FA <barumuga@redhat.com> | 2014-04-29 10:21:36 +0530 |
commit | 3b7cc051a97dfb57454bf71e0aca68acdfc95e4e (patch) | |
tree | 37786eeedf44eb8cf4f6dc52eeeacc74a705dd55 /plugins/livestatus.py | |
parent | 522783ba9afebcd82869c57090feb8258e52915b (diff) |
Added files for volume Utilization - Nagios server side
Change-Id: Idaa995d504e2278fb5a2b67ca4bcbc157307b7d7
Signed-off-by: Nishanth Thomas <nthomas@redhat.com>
Reviewed-on: https://cuckoo.blr.redhat.com:8443/50
Reviewed-by: Sahina Bose <sabose@redhat.com>
Tested-by: Sahina Bose <sabose@redhat.com>
Diffstat (limited to 'plugins/livestatus.py')
-rw-r--r-- | plugins/livestatus.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/livestatus.py b/plugins/livestatus.py index ce546ce..e2f4f03 100644 --- a/plugins/livestatus.py +++ b/plugins/livestatus.py @@ -46,3 +46,20 @@ def readLiveStatus(cmd): table = [line.split('|') for line in answer.split('\n')[:-1]] return table + + +def checkLiveStatus(cmd): + s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) + s.connect(_socketPath) + + # Write command to socket + s.send(cmd) + + # Close socket + s.shutdown(socket.SHUT_WR) + + # Read the answer + answer = s.recv(1000000) + + # return the result + return answer |