percona / percona-monitoring-plugins

Percona Monitoring Plugins

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No option for socket (zabbix script)

atsusta opened this issue · comments

commented

Recently I downloaded version 1.1.8 and made scripts by make.sh.

And in script release/percona-monitoring-plugins-1.1.8/zabbix/script/ss_get_mysql_stats.php, array $opts has no content 'socket'.

I checked 1.1.7 and this issue would be remained for a while.

Please add 'socket' for $opts

# ============================================================================
# Validate that the command-line options are here and correct
# ============================================================================
function validate_options($options) {
   $opts = array('host', 'items', 'user', 'pass', 'nocache', 'port', 'server-id');
   # Show help
   if ( array_key_exists('help', $options) ) {
      usage('');
   }

   # Required command-line options
   foreach ( array('host', 'items') as $option ) {
      if ( !isset($options[$option]) || !$options[$option] ) {
         usage("Required option --$option is missing");
      }
   }
   foreach ( $options as $key => $val ) {
      if ( !in_array($key, $opts) ) {
         usage("Unknown option --$key");
      }
   }
}