Guest User

Untitled

a guest
Apr 27th, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.63 KB | None | 0 0
  1. # svn diff scripts/mysql_stats.php
  2. Index: scripts/mysql_stats.php
  3. ===================================================================
  4. --- scripts/mysql_stats.php     (revision 2771)
  5. +++ scripts/mysql_stats.php     (working copy)
  6. @@ -57,7 +57,7 @@
  7.  );
  8.  
  9.  $use_ss    = FALSE; # Whether to use the script server or not
  10. -$debug     = TRUE; # Define whether you want debugging behavior.
  11. +$debug     = FALSE; # Define whether you want debugging behavior.
  12.  $debug_log = FALSE; # If $debug_log is a filename, it'll be used.
  13.  
  14.  # ============================================================================
  15. @@ -179,7 +179,7 @@
  16.  # Print out a brief usage summary
  17.  # ============================================================================
  18.  function usage($message) {
  19. -   global $mysql_user, $mysql_pass, $mysql_port, $heartbeat;
  20. +   global $mysql_host, $mysql_user, $mysql_pass, $mysql_port, $heartbeat;
  21.  
  22.     $usage = <<<EOF
  23.  $message
  24. @@ -246,19 +246,19 @@
  25.  function ss_get_mysql_stats( $options ) {
  26.     # Process connection options and connect to MySQL.
  27.     global $debug, $mysql_user, $mysql_pass, $heartbeat, $cache_dir, $poll_time,
  28. -          $chk_options, $mysql_port, $mysql_ssl;
  29. +          $chk_options, $mysql_host, $mysql_port, $mysql_ssl;
  30.  
  31.     # Connect to MySQL.
  32.     $user = isset($options['user']) ? $options['user'] : $mysql_user;
  33.     $pass = isset($options['pass']) ? $options['pass'] : $mysql_pass;
  34.     $port = isset($options['port']) ? $options['port'] : $mysql_port;
  35. -   $port = isset($options['host']) ? $options['host'] : $mysql_host;
  36. +   $host = isset($options['host']) ? $options['host'] : $mysql_host;
  37.  
  38.     $heartbeat = isset($options['heartbeat']) ? $options['heartbeat'] : $heartbeat;
  39.     # If there is a port, or if it's a non-standard port, we add ":$port" to the
  40.     # hostname.
  41. -   $host_str  = $options['host']
  42. -              . (isset($options['port']) || $port != 3306 ? ":$port" : '');
  43. +   $host_str  = $host
  44. +              . $port != 3306 ? ":$port" : '';
  45.     debug(array('connecting to', $host_str, $user, $pass));
  46.     if (!extension_loaded('mysql') ) {
  47.        debug("The MySQL extension is not loaded");
  48. @@ -274,10 +274,9 @@
  49.        die("MySQL: " . mysql_error());
  50.     }
  51.  
  52. -   $sanitized_host
  53. -       = str_replace(array(":", "/"), array("", "_"), $options['host']);
  54. +   $sanitized_host = str_replace(array(":", "/"), array("", "_"), $host);
  55.     $cache_file = "$cache_dir/$sanitized_host-mysql_cacti_stats.txt"
  56. -               . (isset($options['port']) || $port != 3306 ? ":$port" : '');
  57. +               . $port != 3306 ? ":$port" : '';
  58.     debug("Cache file is $cache_file");
  59.  
  60.     # First, check the cache.
Add Comment
Please, Sign In to add comment