Module: check_mk
Branch: master
Commit: 651fa0653dfc526352a33ca3df17a5b592d53875
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=651fa0653dfc52…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Jul 1 15:26:09 2016 +0200
3691 oracle_jobs: status of missing jobs is now configurable
---
.werks/3691 | 9 +++++++
ChangeLog | 1 +
checks/oracle_jobs | 8 ++++--
web/plugins/wato/check_parameters.py | 48 +++++++++++++++++++++-------------
4 files changed, 46 insertions(+), 20 deletions(-)
diff --git a/.werks/3691 b/.werks/3691
new file mode 100644
index 0000000..4a638b3
--- /dev/null
+++ b/.werks/3691
@@ -0,0 +1,9 @@
+Title: oracle_jobs: status of missing jobs is now configurable
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i1
+Date: 1467379514
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index a067ed6..f4f4edf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -109,6 +109,7 @@
* 3688 perle_chassis, perle_chassis.temp, perle_chassis_slots, perle_modules_cm1000,
perle_modules_cm1110, perle_modules_mgt, perle_psmu, perle_psmu.fan: new checks for Perle
Mediaconverter devices which support the PERLE-MCR-MGT MIB
* 3689 brocade_fcport: now monitors BBcredit zero stats and the number of encoding
error or disparity error inside frames received
* 3690 apache_status: upper levels for busy workers are now configurable
+ * 3691 oracle_jobs: status of missing jobs is now configurable
* 3073 FIX: windows agent: relative paths to mrpe scripts are now treated as relative
to the agent installation directory...
* 3061 FIX: mk_jolokia: Fixed debugging of the agent plugin
* 3074 FIX: windows agent: fixed incorrect values for 32-bit performance counters
diff --git a/checks/oracle_jobs b/checks/oracle_jobs
index 7cc39bd..f3d44f3 100644
--- a/checks/oracle_jobs
+++ b/checks/oracle_jobs
@@ -107,13 +107,17 @@ def check_oracle_jobs(item, params, info):
raise MKCounterWrapped("Login not possible for check %s" % item)
if not service_found:
- return (2, 'Job is missing')
+ state = 2
+ infotext = "Job is missing"
+ if "status_missing_jobs" in params:
+ state = params["status_missing_jobs"]
+ infotext += " (configured through WATO)"
+ return state, infotext
state = 0
output = []
perfdata = []
-
txt = "Job-State: %s" % job_state
if job_state == "BROKEN":
txt += "(!!)"
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index ccd62d2..aeb584f 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -6757,31 +6757,42 @@ register_check_parameters(
register_check_parameters(
subgroup_applications,
"oracle_jobs",
- _("ORACLE Scheduler Job"),
+ _("Oracle Scheduler Job"),
Dictionary(
help = _("A scheduler job is an object in an ORACLE database which could be
"
"compared to a cron job on Unix. "),
elements = [
( "run_duration",
- Tuple(
- title = _("Maximum run duration for last execution"),
- help = _("Here you can define an upper limit for the run duration
of "
- "last execution of the job."),
- elements = [
- Age(title = _("warning at")),
- Age(title = _("critical at")),
- ])),
- ( "disabled", DropdownChoice(
- title = _("Job State"),
- totext = "",
- choices = [
- ( True, _("Ignore the state of the Job")),
- ( False, _("Consider the state of the job")),],
- help = _("The state of the job is ignored per default.")
+ Tuple(
+ title = _("Maximum run duration for last execution"),
+ help = _("Here you can define an upper limit for the run
duration of "
+ "last execution of the job."),
+ elements = [
+ Age(title = _("warning at")),
+ Age(title = _("critical at")),
+ ]
)),
- ( "status_disabled_jobs", MonitoringState(
- title = "Status of service in case of disabled job",
default_value = 0
+ ( "disabled",
+ DropdownChoice(
+ title = _("Job State"),
+ help = _("The state of the job is ignored per
default."),
+ totext = "",
+ choices = [
+ ( True, _("Ignore the state of the Job")),
+ ( False, _("Consider the state of the job")),
+ ],
+ )),
+ ( "status_disabled_jobs",
+ MonitoringState(
+ title = "Status of service in case of disabled job",
+ default_value = 0
+ )),
+ ( "status_missing_jobs",
+ MonitoringState(
+ title = _("Status of service in case of missing job."),
+ default_value = 2,
)),
+
]
),
TextAscii(
@@ -12079,3 +12090,4 @@ register_check_parameters(
TextAscii( title = _("Node ID")),
"first"
)
+