Module: check_mk
Branch: master
Commit: 32f6b7cfca78ed4ac6ffdd42d40b5102d656ad28
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=32f6b7cfca78ed…
Author: Kenneth Okoh <ko(a)mathias-kettner.de>
Date: Thu Nov 22 14:51:13 2018 +0100
Removed rendering of nagios legacy sidebar snapin
Change-Id: I716c96da8c84b3f2d06274cf624d4fa8f39e6a9c
---
cmk/gui/plugins/sidebar/nagios.py | 87 +++++++--------------------------------
1 file changed, 16 insertions(+), 71 deletions(-)
diff --git a/cmk/gui/plugins/sidebar/nagios.py b/cmk/gui/plugins/sidebar/nagios.py
index 01148ab..5b74f46 100644
--- a/cmk/gui/plugins/sidebar/nagios.py
+++ b/cmk/gui/plugins/sidebar/nagios.py
@@ -24,82 +24,27 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-import cmk.gui.config as config
from cmk.gui.i18n import _
from cmk.gui.globals import html
from cmk.gui.plugins.sidebar import (
- sidebar_snapins,
- bulletlink,
- nagioscgilink,
- heading,
+ SidebarSnapin,
+ snapin_registry,
)
-def render_nagios():
- html.open_ul()
- bulletlink("Home", "http://www.nagios.org")
- bulletlink("Documentation", "%snagios/docs/toc.html" %
config.url_prefix())
- html.close_ul()
- for entry in [
- "General",
- ("tac.cgi", "Tactical Overview"),
- ("statusmap.cgi?host=all", "Map"),
- "Current Status",
- ("status.cgi?hostgroup=all&style=hostdetail",
"Hosts"),
- ("status.cgi?host=all", "Services"),
- ("status.cgi?hostgroup=all&style=overview", "Host
Groups"),
- ("status.cgi?hostgroup=all&style=summary",
"*Summary"),
- ("status.cgi?hostgroup=all&style=grid", "*Grid"),
- ("status.cgi?servicegroup=all&style=overview", "Service
Groups"),
- ("status.cgi?servicegroup=all&style=summary",
"*Summary"),
- ("status.cgi?servicegroup=all&style=grid", "*Grid"),
- ("status.cgi?host=all&servicestatustypes=28",
"Problems"),
-
("status.cgi?host=all&type=detail&hoststatustypes=3&serviceprops=42&servicestatustypes=28",
- "*Service (Unhandled)"),
-
("status.cgi?hostgroup=all&style=hostdetail&hoststatustypes=12&hostprops=42",
- "*Hosts (Unhandled)"),
- ("outages.cgi", "Network Outages"),
- "Reports",
- ("avail.cgi", "Availability"),
- ("trends.cgi", "Trends"),
- ("history.cgi?host=all", "Alerts"),
- ("history.cgi?host=all", "*History"),
- ("summary.cgi", "*Summary"),
- ("histogram.cgi", "*Histogram"),
- ("notifications.cgi?contact=all", "Notifications"),
- ("showlog.cgi", "Event Log"),
- "System",
- ("extinfo.cgi?type=3", "Comments"),
- ("extinfo.cgi?type=6", "Downtime"),
- ("extinfo.cgi?type=0", "Process Info"),
- ("extinfo.cgi?type=4", "Performance Info"),
- ("extinfo.cgi?type=7", "Scheduling Queue"),
- ("config.cgi", "Configuration"),
- ]:
- if isinstance(entry, str):
- html.close_ul()
- heading(entry)
- html.open_ul()
- else:
- ref, text = entry
- if text[0] == "*":
- html.open_ul(class_="link")
- nagioscgilink(text[1:], ref)
- html.close_ul()
- heading(entry)
- html.open_ul()
- else:
- nagioscgilink(text, ref)
+(a)snapin_registry.register
+class Nagios(SidebarSnapin):
+ @staticmethod
+ def type_name():
+ return "nagios_legacy"
+ @classmethod
+ def title(cls):
+ return _("Old Nagios GUI")
-sidebar_snapins["nagios_legacy"] = {
- "title": _("Old Nagios GUI"),
- "description": _("The classical sidebar of Nagios 3.2.0 with links to
"
- "your local Nagios instance (no multi site support)"),
- "render": render_nagios,
- "allowed": [
- "user",
- "admin",
- "guest",
- ],
-}
+ @classmethod
+ def description(cls):
+ return _("The legacy Nagios GUI has been removed.")
+
+ def show(self):
+ html.write_text(_("The legacy Nagios GUI has been removed."))