You are here

function varnish_admin_reports_page in Varnish 7

Same name and namespace in other branches
  1. 5 varnish.module \varnish_admin_reports_page()
  2. 6 varnish.admin.inc \varnish_admin_reports_page()

Menu callback for varnish admin settings.

1 string reference to 'varnish_admin_reports_page'
varnish_menu in ./varnish.module
Implements hook_menu().

File

./varnish.admin.inc, line 167
Administrative functions for Varnish integration.

Code

function varnish_admin_reports_page() {
  if (floatval(variable_get('varnish_version', 2.1)) >= 3) {
    return t('Varnish 3 has removed the option to display statistics directly from the terminal. Use varnishstat instead.');
  }

  // Connect to varnish and do a full status report.
  $status = _varnish_terminal_run(array(
    'stats',
  ));
  $output = '';
  foreach ($status as $terminal => $stat) {
    $output .= '<pre>' . $stat['stats']['msg'] . '</pre>';
  }
  return $output;
}