From 627f96d85d10fa88b7e330fce6e55a3f7768c53a Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Thu, 12 Jun 2014 11:59:21 +0200 Subject: [PATCH] Livestatus: Add 'host_name' and 'service_description' columns for NagVis These columns are used for filtering and seem to be not documented nor supported. Only added for compatibility reasons. fixes #6474 --- components/livestatus/hoststable.cpp | 1 + components/livestatus/servicestable.cpp | 1 + test/livestatus/queries/host/host_nagvis | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/components/livestatus/hoststable.cpp b/components/livestatus/hoststable.cpp index 797e8d8d3..f459229c3 100644 --- a/components/livestatus/hoststable.cpp +++ b/components/livestatus/hoststable.cpp @@ -47,6 +47,7 @@ void HostsTable::AddColumns(Table *table, const String& prefix, const Column::ObjectAccessor& objectAccessor) { table->AddColumn(prefix + "name", Column(&HostsTable::NameAccessor, objectAccessor)); + table->AddColumn(prefix + "host_name", Column(&HostsTable::NameAccessor, objectAccessor)); //ugly compatibility hack table->AddColumn(prefix + "display_name", Column(&HostsTable::DisplayNameAccessor, objectAccessor)); table->AddColumn(prefix + "alias", Column(&HostsTable::DisplayNameAccessor, objectAccessor)); table->AddColumn(prefix + "address", Column(&HostsTable::AddressAccessor, objectAccessor)); diff --git a/components/livestatus/servicestable.cpp b/components/livestatus/servicestable.cpp index 6ccfcde07..3a7022be3 100644 --- a/components/livestatus/servicestable.cpp +++ b/components/livestatus/servicestable.cpp @@ -46,6 +46,7 @@ void ServicesTable::AddColumns(Table *table, const String& prefix, const Column::ObjectAccessor& objectAccessor) { table->AddColumn(prefix + "description", Column(&ServicesTable::ShortNameAccessor, objectAccessor)); + table->AddColumn(prefix + "service_description", Column(&ServicesTable::ShortNameAccessor, objectAccessor)); //ugly compatibility hack table->AddColumn(prefix + "display_name", Column(&ServicesTable::DisplayNameAccessor, objectAccessor)); table->AddColumn(prefix + "check_command", Column(&ServicesTable::CheckCommandAccessor, objectAccessor)); table->AddColumn(prefix + "check_command_expanded", Column(&ServicesTable::CheckCommandExpandedAccessor, objectAccessor)); diff --git a/test/livestatus/queries/host/host_nagvis b/test/livestatus/queries/host/host_nagvis index 34cdc75fc..a09d01359 100644 --- a/test/livestatus/queries/host/host_nagvis +++ b/test/livestatus/queries/host/host_nagvis @@ -1,5 +1,5 @@ GET hosts -Columns: name alias +Columns: name alias host_name OutputFormat:json KeepAlive: on ResponseHeader: fixed16