using ss_get_mysql_stats.php with script server doesn't work
Bug #1350602 reported by
Steven Barre
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Monitoring Plugins |
New
|
Undecided
|
Unassigned |
Bug Description
The cacti script server calls
call_user_
thus passing in each argument to the function.
but function ss_get_mysql_stats( $options ) only expects one array of options, not separate options.
To post a comment you must log in.
Doing this to the function seems to fix it, but I'm sure this is an ugly hack.
function ss_get_mysql_stats( $options ) {
$mysql_ port, $mysql_ssl, $mysql_ssl_key, $mysql_ssl_cert, $mysql_ssl_ca,
$heartbeat, $heartbeat_table, $heartbeat_ server_ id, $heartbeat_utc;
# Process connection options.
global $debug, $mysql_user, $mysql_pass, $cache_dir, $poll_time, $chk_options,
# If called from the script server, reparse the args $options) ) { func_get_ args()) ;
if (!is_array(
$options = parse_cmdline(
}
# Chech for the cnf files '/etc/cacti/ ' . basename(__FILE__) . '.cnf' ) ) { '/etc/cacti/ ' . basename(__FILE__) . '.cnf'); __FILE_ _ . '.cnf' ) ) { __FILE_ _ . '.cnf');
if ( file_exists(
require(
debug('Found configuration file /etc/cacti/' . basename(__FILE__) . '.cnf');
}
elseif ( file_exists(
require(
debug('Found configuration file ' . __FILE__ . '.cnf');
}
$user = isset($ options[ 'user'] ) ? $options['user'] : $mysql_user; options[ 'pass'] ) ? $options['pass'] : $mysql_pass; options[ 'port'] ) ? $options['port'] : $mysql_port; server_ id = isset($ options[ 'server- id']) ? $options[ 'server- id'] : $heartbeat_ server_ id;
$pass = isset($
$host = $options['host'];
$port = isset($
$heartbeat_