Module: check_mk
Branch: master
Commit: eff2a06a491176e89493de6ab39a17a97074b4b7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=eff2a06a491176…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Nov 9 09:56:32 2017 +0100
Tiny simplification.
Change-Id: I1790c3d879e70153198b41a192e0fe3cb44b6e98
---
livestatus/src/OffsetStringHostMacroColumn.h | 8 ++++----
livestatus/src/OffsetStringMacroColumn.h | 6 +++---
livestatus/src/OffsetStringServiceMacroColumn.h | 8 ++++----
livestatus/src/TableHosts.cc | 12 ++++++------
livestatus/src/TableServices.cc | 13 ++++++-------
5 files changed, 23 insertions(+), 24 deletions(-)
diff --git a/livestatus/src/OffsetStringHostMacroColumn.h
b/livestatus/src/OffsetStringHostMacroColumn.h
index 161419a..d74e0f9 100644
--- a/livestatus/src/OffsetStringHostMacroColumn.h
+++ b/livestatus/src/OffsetStringHostMacroColumn.h
@@ -36,11 +36,11 @@ public:
OffsetStringHostMacroColumn(const std::string &name,
const std::string &description,
int indirect_offset, int extra_offset,
- int extra_extra_offset, int offset,
- int string_offset)
+ int extra_extra_offset, int offset)
: OffsetStringMacroColumn(name, description, indirect_offset,
- extra_offset, extra_extra_offset, offset,
- string_offset) {}
+ extra_offset, extra_extra_offset, offset) {}
+
+private:
const host *getHost(Row row) const override;
const service *getService(Row row) const override;
};
diff --git a/livestatus/src/OffsetStringMacroColumn.h
b/livestatus/src/OffsetStringMacroColumn.h
index a4b73d5..5421b8a 100644
--- a/livestatus/src/OffsetStringMacroColumn.h
+++ b/livestatus/src/OffsetStringMacroColumn.h
@@ -41,10 +41,10 @@ public:
OffsetStringMacroColumn(const std::string &name,
const std::string &description, int indirect_offset,
int extra_offset, int extra_extra_offset,
- int offset, int string_offset)
+ int offset)
: StringColumn(name, description, indirect_offset, extra_offset,
- extra_extra_offset, offset)
- , _string_offset(string_offset) {}
+ extra_extra_offset, 0)
+ , _string_offset(offset) {}
std::string getValue(Row row) const override;
diff --git a/livestatus/src/OffsetStringServiceMacroColumn.h
b/livestatus/src/OffsetStringServiceMacroColumn.h
index 969219b..2330c37 100644
--- a/livestatus/src/OffsetStringServiceMacroColumn.h
+++ b/livestatus/src/OffsetStringServiceMacroColumn.h
@@ -36,11 +36,11 @@ public:
OffsetStringServiceMacroColumn(const std::string &name,
const std::string &description,
int indirect_offset, int extra_offset,
- int extra_extra_offset, int offset,
- int string_offset)
+ int extra_extra_offset, int offset)
: OffsetStringMacroColumn(name, description, indirect_offset,
- extra_offset, extra_extra_offset, offset,
- string_offset) {}
+ extra_offset, extra_extra_offset, offset) {}
+
+private:
const host *getHost(Row row) const override;
const service *getService(Row row) const override;
};
diff --git a/livestatus/src/TableHosts.cc b/livestatus/src/TableHosts.cc
index 66d7d3c..ec8544c 100644
--- a/livestatus/src/TableHosts.cc
+++ b/livestatus/src/TableHosts.cc
@@ -94,7 +94,7 @@ void TableHosts::addColumns(Table *table, const std::string
&prefix,
table->addColumn(std::make_unique<OffsetStringHostMacroColumn>(
prefix + "check_command_expanded",
"Nagios command for active host check of this host with the macros
expanded",
- indirect_offset, extra_offset, -1, 0,
+ indirect_offset, extra_offset, -1,
DANGEROUS_OFFSETOF(host, check_command)));
#else
table->addColumn(std::make_unique<OffsetStringColumn>(
@@ -104,7 +104,7 @@ void TableHosts::addColumns(Table *table, const std::string
&prefix,
table->addColumn(std::make_unique<OffsetStringHostMacroColumn>(
prefix + "check_command_expanded",
"Nagios command for active host check of this host with the macros
expanded",
- indirect_offset, extra_offset, -1, 0,
+ indirect_offset, extra_offset, -1,
DANGEROUS_OFFSETOF(host, host_check_command)));
#endif
table->addColumn(std::make_unique<OffsetStringColumn>(
@@ -131,7 +131,7 @@ void TableHosts::addColumns(Table *table, const std::string
&prefix,
table->addColumn(std::make_unique<OffsetStringHostMacroColumn>(
prefix + "notes_expanded",
"The same as notes, but with the most important macros expanded",
- indirect_offset, extra_offset, -1, 0, DANGEROUS_OFFSETOF(host, notes)));
+ indirect_offset, extra_offset, -1, DANGEROUS_OFFSETOF(host, notes)));
table->addColumn(std::make_unique<OffsetStringColumn>(
prefix + "notes_url",
"An optional URL with further information about the host",
@@ -140,7 +140,7 @@ void TableHosts::addColumns(Table *table, const std::string
&prefix,
table->addColumn(std::make_unique<OffsetStringHostMacroColumn>(
prefix + "notes_url_expanded",
"Same es notes_url, but with the most important macros expanded",
- indirect_offset, extra_offset, -1, 0,
+ indirect_offset, extra_offset, -1,
DANGEROUS_OFFSETOF(host, notes_url)));
table->addColumn(std::make_unique<OffsetStringColumn>(
prefix + "action_url",
@@ -150,7 +150,7 @@ void TableHosts::addColumns(Table *table, const std::string
&prefix,
table->addColumn(std::make_unique<OffsetStringHostMacroColumn>(
prefix + "action_url_expanded",
"The same as action_url, but with the most important macros expanded",
- indirect_offset, extra_offset, -1, 0,
+ indirect_offset, extra_offset, -1,
DANGEROUS_OFFSETOF(host, action_url)));
table->addColumn(std::make_unique<OffsetStringColumn>(
prefix + "plugin_output", "Output of the last host check",
@@ -168,7 +168,7 @@ void TableHosts::addColumns(Table *table, const std::string
&prefix,
table->addColumn(std::make_unique<OffsetStringHostMacroColumn>(
prefix + "icon_image_expanded",
"The same as icon_image, but with the most important macros expanded",
- indirect_offset, extra_offset, -1, 0,
+ indirect_offset, extra_offset, -1,
DANGEROUS_OFFSETOF(host, icon_image)));
table->addColumn(std::make_unique<OffsetStringColumn>(
prefix + "icon_image_alt", "Alternative text for the
icon_image",
diff --git a/livestatus/src/TableServices.cc b/livestatus/src/TableServices.cc
index f0fdc83..ed1c27c 100644
--- a/livestatus/src/TableServices.cc
+++ b/livestatus/src/TableServices.cc
@@ -84,7 +84,7 @@ void TableServices::addColumns(Table *table, const std::string
&prefix,
table->addColumn(std::make_unique<OffsetStringServiceMacroColumn>(
prefix + "check_command_expanded",
"Nagios command used for active checks with the macros expanded",
- indirect_offset, -1, -1, 0,
+ indirect_offset, -1, -1,
DANGEROUS_OFFSETOF(service, service_check_command)));
#else
table->addColumn(std::make_unique<OffsetStringColumn>(
@@ -93,8 +93,7 @@ void TableServices::addColumns(Table *table, const std::string
&prefix,
table->addColumn(std::make_unique<OffsetStringServiceMacroColumn>(
prefix + "check_command_expanded",
"Nagios command used for active checks with the macros expanded",
- indirect_offset, -1, -1, 0,
- DANGEROUS_OFFSETOF(service, check_command)));
+ indirect_offset, -1, -1, DANGEROUS_OFFSETOF(service, check_command)));
#endif
table->addColumn(std::make_unique<OffsetStringColumn>(
prefix + "event_handler", "Nagios command used as event
handler",
@@ -128,7 +127,7 @@ void TableServices::addColumns(Table *table, const std::string
&prefix,
table->addColumn(std::make_unique<OffsetStringServiceMacroColumn>(
prefix + "notes_expanded",
"The notes with (the most important) macros expanded",
indirect_offset,
- -1, -1, 0, DANGEROUS_OFFSETOF(service, notes)));
+ -1, -1, DANGEROUS_OFFSETOF(service, notes)));
table->addColumn(std::make_unique<OffsetStringColumn>(
prefix + "notes_url",
"An optional URL for additional notes about the service",
@@ -136,7 +135,7 @@ void TableServices::addColumns(Table *table, const std::string
&prefix,
table->addColumn(std::make_unique<OffsetStringServiceMacroColumn>(
prefix + "notes_url_expanded",
"The notes_url with (the most important) macros expanded",
- indirect_offset, -1, -1, 0, DANGEROUS_OFFSETOF(service, notes_url)));
+ indirect_offset, -1, -1, DANGEROUS_OFFSETOF(service, notes_url)));
table->addColumn(std::make_unique<OffsetStringColumn>(
prefix + "action_url",
"An optional URL for actions or custom information about the service",
@@ -144,7 +143,7 @@ void TableServices::addColumns(Table *table, const std::string
&prefix,
table->addColumn(std::make_unique<OffsetStringServiceMacroColumn>(
prefix + "action_url_expanded",
"The action_url with (the most important) macros expanded",
- indirect_offset, -1, -1, 0, DANGEROUS_OFFSETOF(service, action_url)));
+ indirect_offset, -1, -1, DANGEROUS_OFFSETOF(service, action_url)));
table->addColumn(std::make_unique<OffsetStringColumn>(
prefix + "icon_image",
"The name of an image to be used as icon in the web interface",
@@ -152,7 +151,7 @@ void TableServices::addColumns(Table *table, const std::string
&prefix,
table->addColumn(std::make_unique<OffsetStringServiceMacroColumn>(
prefix + "icon_image_expanded",
"The icon_image with (the most important) macros expanded",
- indirect_offset, -1, -1, 0, DANGEROUS_OFFSETOF(service, icon_image)));
+ indirect_offset, -1, -1, DANGEROUS_OFFSETOF(service, icon_image)));
table->addColumn(std::make_unique<OffsetStringColumn>(
prefix + "icon_image_alt",
"An alternative text for the icon_image for browsers not displaying
icons",