Page 1 of 1

Dashboard / Service Status Column Selection

Posted: Tue Nov 26, 2019 4:21 am
by veeravamsi
Hi Team,

When displaying any Status URLs on Dashboards - Can we customize the Out-Of-Box Column list :

Host
Service
Status
Duration
Attempt
Last Check
Status Information

to exclude few of them like Duration & Attempt, and include any custom fields/columns from free variables ?

-- Vamsi

Re: Dashboard / Service Status Column Selection

Posted: Tue Nov 26, 2019 2:56 pm
by cdienger
This would require modifications to at least /usr/local/nagiosxi/html/includes/components/xicore/ajaxhelpers-hoststatus.inc.php and /usr/local/nagiosxi/html/includes/components/xicore/ajaxhelpers-servicestatus.inc.php. ajaxhelpers-servicestatus.inc.php for example has these sections:

Code: Select all

       // Table row output
        $output .= "<tr class='" . $rowclass . "'>
            <td style='white-space: nowrap' class='" . $host_status_class . "'>" . $host_name_cell . "</td>
            <td  style='white-space: nowrap'>" . $service_name_cell . "</td><td class='" . $service_status_class . "'>" . $status_cell . "</td>
            <td nowrap>" . $statedurationstr . "</td>
            <td>" . $current_attempt . "/" . $max_attempts . "</td>
            <td nowrap>" . $last_check . "</td>
            <td>" . $status_info . "</td>";

Code: Select all

   // Sorted table header
    $output .= sorted_table_header($sortby, $sortorder, "", _("Host"), $extra_args, "", $url);
    $output .= sorted_table_header($sortby, $sortorder, "service_description", _("Service"), $extra_args, "", $url);
    $output .= sorted_table_header($sortby, $sortorder, "current_state", _("Status"), $extra_args, "", $url);
    $output .= sorted_table_header($sortby, $sortorder, "last_state_change", _("Duration"), $extra_args, "", $url);
    $output .= sorted_table_header($sortby, $sortorder, "current_check_attempt", _("Attempt"), $extra_args, "", $url);
    $output .= sorted_table_header($sortby, $sortorder, "last_check", _("Last Check"), $extra_args, "", $url);
    $output .= sorted_table_header($sortby, $sortorder, "status_text", _("Status Information"), $extra_args, "", $url);
removing or moving a field would just be a matter of removing desired lines or reodering them. Adding to to the table would be trickier. Since we generally don't advise making direct changes to files like this, I can filed a feature request if you'd like.

Re: Dashboard / Service Status Column Selection

Posted: Wed Nov 27, 2019 7:45 am
by veeravamsi
Awesome . Thank you . One question would this change impact all the pages/Status .. Can i limit this to one Page or Dashboard ?

Re: Dashboard / Service Status Column Selection

Posted: Wed Nov 27, 2019 12:25 pm
by cdienger
This would impact all pages. I've not found a way to limit it but can include that in a feature request.