Module: check_mk
Branch: master
Commit: 68bb82c2440a25640464547e769f631b15af9c45
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=68bb82c2440a25…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Oct 12 10:31:29 2016 +0200
mail notification plugin: Fixed incorrect output in different situations
---
notifications/mail | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/notifications/mail b/notifications/mail
index abf9026..cee120f 100755
--- a/notifications/mail
+++ b/notifications/mail
@@ -466,12 +466,14 @@ def send_mail_smtp(message, target, from_address, context):
# the exception contains a dict of failed recipients to the respective error. since we
# only have one recipient there has to be exactly one element
errorcode, message = e.recipients.values()[0]
+
# default is to retry, these errorcodes are known to
if errorcode not in [
450, # sender address domain not found
550, # sender address unknown
- ]:
+ ]:
retry_possible = True
+
sys.stderr.write("mail to \"%s\" refused: %d, %s\n" % (target, errorcode, message))
except smtplib.SMTPHeloError, e:
retry_possible = True # server is acting up, this may be fixed quickly
@@ -487,6 +489,7 @@ def send_mail_smtp(message, target, from_address, context):
except smtplib.SMTPException, e:
retry_possible = True # who knows what went wrong, a retry might just work
sys.stderr.write("undocumented error code from \"%s\": %s\n" % (host, str(e)))
+
if success:
return 0
elif retry_possible:
@@ -905,7 +908,7 @@ def main():
subject = context['SUBJECT']
if not mailto: # e.g. empty field in user database
- sys.stdout.write("Cannot send HTML email: empty destination email address")
+ sys.stderr.write("Cannot send HTML email: empty destination email address\n")
sys.exit(2)
# Create the mail and send it
@@ -915,7 +918,7 @@ def main():
try:
sys.exit(send_mail(m, mailto, from_address, context))
except Exception, e:
- sys.stdout.write("unhandled exception %s" % str(e))
+ sys.stderr.write("Unhandled exception: %s\n" % e)
# unhandled exception, don't retry this...
sys.exit(2)
Module: check_mk
Branch: master
Commit: 77fbad61c5ba7df792694db6726195cf1b8f6a71
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=77fbad61c5ba7d…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Oct 12 09:29:21 2016 +0200
made selection menu more user friendly
---
web/htdocs/visuals.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index b7a4ee0..96f38f4 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -661,6 +661,8 @@ def page_edit_visual(what, all_visuals, custom_field_handler = None,
("contact_groups", _("Publish to members of contact groups"), userdb.GroupChoice(
"contact",
title = _("Publish to members of contact groups"),
+ rows = 5,
+ size = 40,
)),
],
title = _('Make this %s available for other users') % visual_type["title"]
Module: check_mk
Branch: master
Commit: 165d95e6fa6938a28b77f683d9a8cf208a2770d3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=165d95e6fa6938…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Tue Oct 11 17:23:33 2016 +0200
3946 uptime: added the uptime to inventory
Added uptime of snmp and other agent based devices into
the "Operating System" subtree. Be aware that the check
interval default for the "HW/SW Inventory" is on
"once per day".
---
.werks/3946 | 13 +++++++++++++
ChangeLog | 1 +
inventory/snmp_uptime | 37 +++++++++++++++++++++++++++++++++++++
inventory/uptime | 39 +++++++++++++++++++++++++++++++++++++++
web/plugins/views/inventory.py | 1 +
5 files changed, 91 insertions(+)
diff --git a/.werks/3946 b/.werks/3946
new file mode 100644
index 0000000..7722025
--- /dev/null
+++ b/.werks/3946
@@ -0,0 +1,13 @@
+Title: uptime: added the uptime to inventory
+Level: 1
+Component: inv
+Compatible: compat
+Version: 1.4.0i2
+Date: 1476199109
+Class: feature
+
+Added uptime of snmp and other agent based devices into
+the "Operating System" subtree. Be aware that the check
+interval default for the "HW/SW Inventory" is on
+"once per day".
+
diff --git a/ChangeLog b/ChangeLog
index 26bf1e5..d5529c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -43,6 +43,7 @@
* 3906 oracle: now version, database creation and startup time, log and open mode, logins, flashback are inventorised
* 3944 Added OS related information for Cisco, Fireeye and Infoblox devices...
* 3908 winperf_if, lnx_if: new inventory plugins for switch port statistics of linux and windows hosts
+ * 3946 uptime: added the uptime to inventory...
1.4.0i1:
diff --git a/inventory/snmp_uptime b/inventory/snmp_uptime
new file mode 100644
index 0000000..1289149
--- /dev/null
+++ b/inventory/snmp_uptime
@@ -0,0 +1,37 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2016 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk 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 in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# tails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+def inv_snmp_uptime(info):
+ uptime = parse_snmp_uptime(info[0][0])
+ since = time.strftime("%c", time.localtime(time.time() - float(uptime)))
+ node = inv_tree("software.os.")
+ node["since"] = since
+
+
+inv_info['snmp_uptime'] = {
+ "inv_function" : inv_snmp_uptime,
+ "includes" : [ 'uptime.include' ],
+}
diff --git a/inventory/uptime b/inventory/uptime
new file mode 100644
index 0000000..112c4c9
--- /dev/null
+++ b/inventory/uptime
@@ -0,0 +1,39 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk 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 in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# tails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+# Example output from agent:
+# <<<uptime>>>
+# 15876.96 187476.72
+
+def inv_uptime(info):
+ uptime = float(info[0][0])
+ since = time.strftime("%c", time.localtime(time.time() - float(info[0][0])) )
+ node = inv_tree("software.os.")
+ node["since"] = since
+
+inv_info['uptime'] = {
+ "inv_function" : inv_uptime,
+}
diff --git a/web/plugins/views/inventory.py b/web/plugins/views/inventory.py
index b720924..1cb65bb 100644
--- a/web/plugins/views/inventory.py
+++ b/web/plugins/views/inventory.py
@@ -680,6 +680,7 @@ inventory_displayhints.update({
".software.os.service_pack" : { "title" : _("Service Pack"), "short" : _("Service Pack") },
".software.os.service_packs:" : { "title" : _("Service Packs"), "render" : render_inv_dicttable,
"keyorder" : [ "name" ] },
+ ".software.os.since" : { "title" : _("Up since") },
".software.configuration." : { "title" : _("Configuration"), },
".software.configuration.snmp_info." : { "title" : _("SNMP Information"), },
".software.configuration.snmp_info.contact" : { "title" : _("Contact"), },