This seems to be the same issue as http://drupal.org/node/1162586, but the code in my nagios.module is as described having been fixed in the ticket - it should return just the data, rather than themeing a page.
That is to say, the end of "nagios_status_page()" function is like this:
$output .= implode(', ', $output_state) . ' | ' . implode(';', $output_perf) . "\n";
// Print the output, so we test the theme
// TODO Please change this theme call as discussed at http://drupal.org/node/224333#theme_page.
// print theme('page', $output);
return $output;
// Exit early so we do not cache the data, nor do we wrap the result in a theme
exit();
So I am not sure what's wrong - /nagios should just show the data, right? Not a full Drupal page with the site template?
Comments
Comment #1
matthewv789 commentedAttaching screenshots showing Nagios themed info page (/nagios) and Nagios module info.
Comment #2
matthewv789 commentedI ended up fixing this by changing line 303 in nagios.module from:
to:
Comment #3
matthewv789 commentedThis seemed to work for me - does the change in comment #2 make sense and should it be tested as a patch?
Comment #4
greg.harveyI'd rather go a little further, run it through a theme function and provide a blank template, I think. That would allow users to theme their own /nagios page and there's a TODO for that anyway.
Thanks for raising - let's keep this alive.
Comment #5
greg.harveyActually, on reflection, I think we should choose an approach here. We already have a patch in #1162332: Customise default /nagios callback which allows you to specify your own callback function. It's waiting to be tested.
We can *either* do that *or* we can "won't fix" that patch and instead do a proper
theme()implementation here. I'm erring on the side of the latter.Thoughts?
Comment #6
c-logemannI think in most cases there is a need for performance which can be improved by avoiding a theme load. First of all Drupal is doing less. But also there is less data to encode by the server if SSL is used (which is recommended). Additionally there is less data to be transferred through the network and less data to be parsed by the monitoring system. I am not sure but I think "echo" is a little bit faster than "print". So I created a patch with "echo" instead of "return".
If there is a need for templating this page there is also a need for more structures in the data as currently provided inside the "$output"-String. So in this case somebody can use the new existing possibility with calling a custom function or create a new menu path with a complete control in a custom module.
An additional thought for templating: Currently only administrators can see this page. Using a code as a custom user-agent is mot user friendly. But this is another issue I will report soon.
Comment #8
greg.harveyI'm sold on this approach. Committed!