You are here

function varnish_admin_reports_page in Varnish 6

Same name and namespace in other branches
  1. 5 varnish.module \varnish_admin_reports_page()
  2. 7 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
Implementation of hook_menu()

File

./varnish.admin.inc, line 121
varnish.admin.inc

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;
}