better check manpage
Message-ID: <526fdf63.6xBkOYoe2rkpNv7/%gg(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Module: check_mk
Branch: master
Commit: 4d02b6a57688dcc9bdd2341cf8895b396fc993e6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4d02b6a57688dc…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Tue Oct 29 17:14:10 2013 +0100
disabled input parameters for now, better check manpage
---
checkman/check_sql | 9 +++++++--
doc/treasures/active_checks/check_sql | 6 +++---
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/checkman/check_sql b/checkman/check_sql
index e157607..b691f02 100644
--- a/checkman/check_sql
+++ b/checkman/check_sql
@@ -8,8 +8,9 @@ description:
statement to that server, and checks for the following result:
The query must return three columns, a number, a text, and optional
- performance data in the third column.
- If upper and lower levels are given, the number is being checked
+ performance data in the third column. The columns are comma-separated.
+ Performance data must be in the standard format of nagios performance data.
+ If upper and lower levels are given, the number is checked
against these levels and the according state is being computed.
Otherwise the number ist treated as a Nagios state (0,1,2,3).
State, text and the performance data are being returned.
@@ -20,6 +21,10 @@ description:
LD_LIBRARY_PATH needs to be modified to point to the libclntsh.so of
that package.
+ The oracle check supports procedure calls. It must return excactly one output
+ variable. The value of the variable must be in the same format as the return
+ value of the sql statement described above.
+
This check can be configured by WATO.
See the {usage} page of the check for details about the invocation on the command line.
diff --git a/doc/treasures/active_checks/check_sql b/doc/treasures/active_checks/check_sql
index 0079c44..8ea0e23 100755
--- a/doc/treasures/active_checks/check_sql
+++ b/doc/treasures/active_checks/check_sql
@@ -195,8 +195,8 @@ try:
sys.stderr.write("SQL Statement: %s\n" % opt_sql)
if opt_procedure:
outvar = cursor.var(cx_Oracle.STRING)
- opt_input.append("outvar")
- cursor.callproc(opt_sql, opt_input)
+ #opt_input.append("outvar")
+ cursor.callproc(opt_sql, (outvar,))
result = outvar.getvalue()
else:
cursor.execute(opt_sql)
@@ -228,7 +228,7 @@ try:
sys.exit(3)
#row = result[0]
- row = result.split(" ")
+ row = result.split(",")
number = float(row[0])
text = str(row[1])