diff options
author | Timothy Asir <tim.gluster@gmail.com> | 2014-04-01 17:31:44 +0530 |
---|---|---|
committer | Bala.FA <barumuga@redhat.com> | 2014-04-29 10:14:33 +0530 |
commit | 0682f3b48c06a5bf53f305dd77250cdb796693a5 (patch) | |
tree | 3c1705697a0f9846ae119f328f839d4bc7460906 /tests/test_gluster_proc.py | |
parent | 666983202013dd3c1e236eb458b75b3a95d74782 (diff) |
Add gluster process monitoring plugin
This helps monitoring gluster related process such as glusterd,
glusterfsd, gluster self heal process, nfs and also helps to
monitor other running services
Change-Id: I8c6f252270a847e7ff007c358125a9310525f201
Signed-off-by: Timothy Asir <tjeyasin@redhat.com>
Diffstat (limited to 'tests/test_gluster_proc.py')
-rw-r--r-- | tests/test_gluster_proc.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/test_gluster_proc.py b/tests/test_gluster_proc.py new file mode 100644 index 0000000..36a60fd --- /dev/null +++ b/tests/test_gluster_proc.py @@ -0,0 +1,42 @@ +# +# Copyright 2014 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Refer to the README and COPYING files for full details of the license +# + +from testrunner import PluginsTestCase as TestCaseBase +from plugins import check_proc_status as gProc +from plugins import nscautils +from glusternagios import utils +import check_proc_test_data as gData + + +class TestProc(TestCaseBase): + def _maskGetoutputSuccess(self, val): + return 0, "PROCS OK:", "" + + def _maskGetoutputCritical(self, val): + return 0, "PROCS CRITICAL:", "" + + def _maskSendToNsca(self, hostName, service, status, msg): + return service, status, msg + + def test_Nfs(self): + nscautils.send_to_nsca = self._maskSendToNsca + utils.execCmd = self._maskGetoutputCritical + + assert(gProc.sendNfsStatus("10.70.43.33", gData.nfsEnabled1) == None) |