Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add remaining columns to downtimes_with_info and comments_with_info #134

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/DownCommColumn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,29 @@ void DownCommColumn::output(void *data, Query *query)
query->outputString(dt->_author_name);
query->outputSublistSeparator();
query->outputString(dt->_comment);
query->outputSublistSeparator();
query->outputTime(dt->_entry_time);
if(_is_downtime) {
Downtime *d = (Downtime*) dt;
query->outputSublistSeparator();
query->outputTime(d->_start_time);
query->outputSublistSeparator();
query->outputTime(d->_end_time);
query->outputSublistSeparator();
query->outputInteger(d->_fixed);
query->outputSublistSeparator();
query->outputInteger64(d->_duration);
query->outputSublistSeparator();
query->outputInteger(d->_triggered_by);
} else {
Comment *c = (Comment*) dt;
query->outputSublistSeparator();
query->outputInteger(c->_entry_type);
query->outputSublistSeparator();
query->outputInteger(c->_expires);
query->outputSublistSeparator();
query->outputTime(c->_expire_time);
}
query->outputEndSublist();
}
else
Expand Down
4 changes: 2 additions & 2 deletions src/TableHosts.cc
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,11 @@ void TableHosts::addColumns(Table *table, string prefix, int indirect_offset)
table->addColumn(new DownCommColumn(prefix + "downtimes",
"A list of the ids of all scheduled downtimes of this host", indirect_offset, true, false));
table->addColumn(new DownCommColumn(prefix + "downtimes_with_info",
"A list of the all scheduled downtimes of the host with id, author and comment", indirect_offset, true, true));
"A list of all downtimes of the host with id, author, comment, start_time, end_time, fixed, duration and triggered_by", indirect_offset, true, true));
table->addColumn(new DownCommColumn(prefix + "comments",
"A list of the ids of all comments of this host", indirect_offset, false, false));
table->addColumn(new DownCommColumn(prefix + "comments_with_info",
"A list of all comments of the host with id, author and comment", indirect_offset, false, true));
"A list of all comments of the host with id, author, comment, entry_type, expires and expire_time", indirect_offset, false, true));

table->addColumn(new CustomVarsColumn(prefix + "custom_variable_names",
"A list of the names of all custom variables", (char *)(&hst.custom_variables) - ref, indirect_offset, CVT_VARNAMES));
Expand Down
4 changes: 2 additions & 2 deletions src/TableServices.cc
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,11 @@ void TableServices::addColumns(Table *table, string prefix, int indirect_offset,
table->addColumn(new DownCommColumn(prefix + "downtimes",
"A list of all downtime ids of the service", indirect_offset, true, false));
table->addColumn(new DownCommColumn(prefix + "downtimes_with_info",
"A list of all downtimes of the service with id, author and comment", indirect_offset, true, true));
"A list of all downtimes of the service with id, author, comment, start_time, end_time, fixed, duration and triggered_by", indirect_offset, true, true));
table->addColumn(new DownCommColumn(prefix + "comments",
"A list of all comment ids of the service", indirect_offset, false, false));
table->addColumn(new DownCommColumn(prefix + "comments_with_info",
"A list of all comments of the service with id, author and comment", indirect_offset, false, true));
"A list of all comments of the service with id, author, comment, entry_type, expires and expire_time", indirect_offset, false, true));

if (add_hosts)
g_table_hosts->addColumns(this, "host_", (char *)(&svc.host_ptr) - ref);
Expand Down