apache_cmdline is using wrong hostname

Bug #937017 reported by Mark van Driel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Monitoring Plugins
Fix Released
Medium
Baron Schwartz

Bug Description

When using ssh apache_cmdline is doing wget to hostname instead of to status_server

I think this caused by a bug in the function apache_cmdline: It should use the global variable $use_ssh and not $options['use-ssh']

When I use the following patched function everything is fine

function apache_cmdline ( $options ) {
   global $status_server, $status_url, $http_user, $http_pass, $http_port, $use_ssh;
   $srv = $status_server;
   if ( isset($options['server']) ) {
      $srv = $options['server'];
   }
   elseif ( ! $use_ssh ) {
      $srv = $options['host'];
   }
   $url = isset($options['url']) ? $options['url'] : $status_url;
   $user = isset($options['http-user']) ? $options['http-user'] : $http_user;
   $pass = isset($options['http-password']) ? $options['http-password'] : $http_pass;
   $port = isset($options['port2']) ? ":$options[port2]" : ":$http_port";
   $auth = ($user ? "--http-user=$user" : '') . ' ' . ($pass ? "--http-password=$pass" : '');
   return "wget $auth -U Cacti/1.0 -q -O - -T 5 \"http://$srv$port$url?auto\"";
}

Tags: apache

Related branches

affects: percona-toolkit → percona-monitoring-plugins
tags: added: apache
removed: doc
description: updated
Changed in percona-monitoring-plugins:
milestone: none → 1.0.0
assignee: nobody → Baron Schwartz (baron-xaprb)
importance: Undecided → Medium
status: New → Confirmed
Changed in percona-monitoring-plugins:
status: Confirmed → Fix Committed
Changed in percona-monitoring-plugins:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.