Module: check_mk
Branch: master
Commit: d63c167af1d2fb9561ce34c1a9fa246a6d037962
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d63c167af1d2fb…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Jan 15 09:44:27 2014 +0100
Draft for rule based notifications updated
---
doc/drafts/README.rule_based_notifications | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/drafts/README.rule_based_notifications b/doc/drafts/README.rule_based_notifications
index 1c16b99..dbbcc57 100644
--- a/doc/drafts/README.rule_based_notifications
+++ b/doc/drafts/README.rule_based_notifications
@@ -43,9 +43,9 @@ The condition can be formed of:
* the event type (up, down, ok, crit, etc.)
* a host specification like in WATO rules (using host tags, etc.)
* a service specification using regular expressions (like in WATO rules)
+* The original state or the complete state transition (e.g. CRIT -> WARN vs. OK -> WARN)
Further conditions that we can think of are:
-* The original state or the complete state transition (e.g. CRIT -> WARN vs. OK -> WARN)
* the type of the check plugin, e.g. only checks of type "if" or "if64"
* whether the host or service is contained in a certain host/service group
* whether it's contained in a certain contact group
Module: check_mk
Branch: master
Commit: 45615ffd6b7c1d609f78bfdd045664c3f632ffe9
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=45615ffd6b7c1d…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Jan 14 16:25:55 2014 +0100
wato snapshot: add missing i8n
---
web/htdocs/wato.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 3a38420..992568a 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -5828,8 +5828,8 @@ def mode_snapshot(phase):
html.write("<br>")
html.write("<h3>" + _("Restore from uploaded file") + "</h3>")
- html.write("Only supports snapshots up to 100MB. If your snapshot is larger than 100MB please copy it into the sites<br>"
- "backup directory %s/wato/snapshots. It will then show up in the snapshots table.<br><br>" % defaults.var_dir)
+ html.write(_("Only supports snapshots up to 100MB. If your snapshot is larger than 100MB please copy it into the sites<br>"
+ "backup directory %s/wato/snapshots. It will then show up in the snapshots table.<br><br>") % defaults.var_dir)
html.begin_form("upload_form", method = "POST")
html.upload_file("_upload_file")
html.button("upload_button", _("Restore from file"), "submit")
Module: check_mk
Branch: master
Commit: a7e26a0c55454be4d53d51b6ea8e10f77bcea83d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a7e26a0c55454b…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Jan 14 16:10:20 2014 +0100
snapshot upload: add comment to 'Restore from file' feature
---
web/htdocs/wato.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index d1ca549..3a38420 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -5828,6 +5828,8 @@ def mode_snapshot(phase):
html.write("<br>")
html.write("<h3>" + _("Restore from uploaded file") + "</h3>")
+ html.write("Only supports snapshots up to 100MB. If your snapshot is larger than 100MB please copy it into the sites<br>"
+ "backup directory %s/wato/snapshots. It will then show up in the snapshots table.<br><br>" % defaults.var_dir)
html.begin_form("upload_form", method = "POST")
html.upload_file("_upload_file")
html.button("upload_button", _("Restore from file"), "submit")
Module: check_mk
Branch: master
Commit: 5d780dfee6a85a5c473db924d34af0eeba64029c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5d780dfee6a85a…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Tue Jan 14 15:21:56 2014 +0100
FIX Column was too short
when activating changes by another user, the column showing the username was too
short for it's content
---
.werks/456 | 9 +++++++++
ChangeLog | 3 ++-
web/htdocs/wato.css | 2 +-
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/.werks/456 b/.werks/456
new file mode 100644
index 0000000..05af86e
--- /dev/null
+++ b/.werks/456
@@ -0,0 +1,9 @@
+Title: Column was too short
+Level: 1
+Component: wato
+Version: 1.2.5i1
+Date: 1389709232
+Class: fix
+
+when activating changes by another user, the column showing the username was too
+short for it's content
diff --git a/ChangeLog b/ChangeLog
index e94c309..35e92bd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -41,8 +41,8 @@
* 0324 hitachi_hnas_cifs: new check for the number of users using a CIFS share
* 0455 hitachi_hnas_span: new check for Spans (Storage Pools) in Hitachi HNAS storage systems
* 0445 mem.win: Allow time-averaging of values before applying levels...
- * 0566 services.summary: new check to monitor stopped services of mode autostart in windows
* 0446 mem.used, solaris_mem: Introduce optional averaging of used memory...
+ * 0566 services.summary: new check to monitor stopped services of mode autostart in windows
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
@@ -173,6 +173,7 @@
* 0250 FIX: Fixed error on creating very large WATO snapshots...
* 0422 FIX: Fixed numbers shown in log entries of bulk inventory...
* 0252 FIX: ESX vSphere configuration: Fixed non-working configuration parameters...
+ * 0456 FIX: Column was too short...
Notifications:
* 0362 sms: now searching PATH for sendsms and smssend commands...
diff --git a/web/htdocs/wato.css b/web/htdocs/wato.css
index 7cd2eb1..03dd57e 100644
--- a/web/htdocs/wato.css
+++ b/web/htdocs/wato.css
@@ -147,7 +147,7 @@ Boston, MA 02110-1301 USA.
margin: 0 5px 0 0;
padding: 0;
border-style: none;
- float: left;
+ float: none;
}
.wato table.foreignchanges {
Module: check_mk
Branch: master
Commit: f7741b0fc6eb4c5998ca4cd85b76263a83121f8c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f7741b0fc6eb4c…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Tue Jan 14 15:12:13 2014 +0100
services.summary: new check to monitor stopped services of mode autostart in windows
---
.werks/566 | 8 +++++
ChangeLog | 1 +
checkman/services.summary | 30 ++++++++++++++++
checks/services | 62 ++++++++++++++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 33 ++++++++++++++++++
5 files changed, 134 insertions(+)
diff --git a/.werks/566 b/.werks/566
new file mode 100644
index 0000000..d375693
--- /dev/null
+++ b/.werks/566
@@ -0,0 +1,8 @@
+Title: services.summary: new check to monitor stopped services of mode autostart in windows
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1389708658
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 2f8e444..cc4e873 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -41,6 +41,7 @@
* 0324 hitachi_hnas_cifs: new check for the number of users using a CIFS share
* 0455 hitachi_hnas_span: new check for Spans (Storage Pools) in Hitachi HNAS storage systems
* 0445 mem.win: Allow time-averaging of values before applying levels...
+ * 0566 services.summary: new check to monitor stopped services of mode autostart in windows
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/checkman/services.summary b/checkman/services.summary
new file mode 100644
index 0000000..2071226
--- /dev/null
+++ b/checkman/services.summary
@@ -0,0 +1,30 @@
+title: Windows Services
+agents: windows
+catalog: applications
+license: GPL
+distribution: check_mk
+description:
+ This check gives a summary of the windows services and monitors
+ the number of services of mode "autostart" which are stopped.
+ The state of the check as soon as such a stopped service is found
+ can be configured to be any valid state. The default is {OK}. Also,
+ if no such stopped service is found, the state is {OK}.
+
+ A list of ignored services can be configured. These services will not be
+ considered when determining the stopped services.
+
+[configuration]
+{services_summary_default_levels(dict):} A dictionary with the following preset keys
+
+{"ignored": (),}
+{"state_of_stopped": 0}
+
+
+[parameters]
+parameters(dict): A dictionary with the following keys:
+
+ {"ignored"}: tuple: A tuple of service names or regular expressions for
+ services. These services will be disregarded when determining the state of the check
+
+ {"state_if_stopped"}: int: The monitoring state that should be applied if
+ stopped services are found
diff --git a/checks/services b/checks/services
index decd941..5fa1f4e 100644
--- a/checks/services
+++ b/checks/services
@@ -235,3 +235,65 @@ check_info['services'] = {
"group" : "services",
"default_levels_variable" : "services_default_levels",
}
+
+factory_settings["services_summary_default_levels"] = {
+ "ignored": (),
+ "state_if_stopped": 0
+}
+
+def inventory_services_summary(info):
+ if info[0]:
+ return [ (None, "services_summary_default_levels") ]
+
+def check_services_summary(item, params, info):
+ blacklist = params.get("ignored", () )
+ stoplist = []
+ num_blacklist = 0
+ num_auto = 0
+ for line in info:
+ startstop, auto = line[2].split("/")
+ srv_name = line[1]
+ if auto == "auto":
+ num_auto += 1
+ if startstop == "stopped":
+ match = False
+ for srv in blacklist:
+ if re.match(srv,srv_name):
+ match = True
+ if match == False:
+ stoplist.append(srv_name)
+ else:
+ num_blacklist += 1
+
+ num_stoplist = len(stoplist)
+ num_srv = len(info)
+ length_runlist = len(info) - len(stoplist) - num_blacklist
+
+ if len(stoplist) > 0:
+ stopped_srvs = " ("+", ".join(stoplist)+")"
+ state = params.get("state_if_stopped")
+ if state == 1:
+ sym = "(!)"
+ elif state == 2:
+ sym="(!!)"
+ else:
+ sym = ""
+ else:
+ stopped_srvs = ""
+ state = 0
+ sym = ""
+
+
+ infotext = "%d services, %d services in autostart - of which %d services are stopped%s%s, %d services stopped but ignored" % \
+ ( num_srv, num_auto, num_stoplist, sym, stopped_srvs, num_blacklist )
+
+ return state, infotext
+
+check_info['services.summary'] = {
+ "check_function" : check_services_summary,
+ "inventory_function" : inventory_services_summary,
+ "default_levels_variable" : "services_summary_default_levels",
+ "service_description" : "Services Summary",
+ "node_info" : True,
+ "group" : "services_summary",
+}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 9af97d5..f51346e 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -2083,6 +2083,38 @@ register_check_parameters(
None,
"dict",
)
+
+register_check_parameters(
+ subgroup_applications,
+ "services_summary",
+ _("Windows Service Summary"),
+ Dictionary(
+ title = _('Autostart Services'),
+ elements = [
+ ('ignored',
+ ListOfStrings(
+ title = _("Ignored autostart services"),
+ help = _('Regular expressions matching the begining of the internal name '
+ 'or the description of the service. '
+ 'If no name is given then this rule will match all services. The '
+ 'match is done on the <i>beginning</i> of the service name. It '
+ 'is done <i>case sensitive</i>. You can do a case insensitive match '
+ 'by prefixing the regular expression with <tt>(?i)</tt>. Example: '
+ '<tt>(?i).*mssql</tt> matches all services which contain <tt>MSSQL</tt> '
+ 'or <tt>MsSQL</tt> or <tt>mssql</tt> or...'),
+ orientation = "horizontal",
+ )),
+ ('state_if_stopped',
+ MonitoringState(
+ title = _("Default state if stopped autostart services are found"),
+ default_value = 0,
+ )),
+ ],
+ ),
+ None,
+ "dict"
+)
+
register_check_parameters(
subgroup_applications,
"esx_vsphere_objects",
@@ -4536,3 +4568,4 @@ register_check_parameters(
),
"first", False
)
+