~bisscuitt/percona-monitoring-plugins/lsof_find

« back to all changes in this revision

Viewing changes to cacti/scripts/ss_get_mysql_stats.php

  • Committer: Roman Vynar
  • Date: 2014-03-20 07:59:24 UTC
  • Revision ID: roman.vynar@percona.com-20140320075924-l5h9uwzl6zzpxd5e
Fix for bug #1295006 Introduce more secure location of PHP script configs to harden a Cacti setup

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
$version = '$VERSION$';
62
62
 
63
63
# ============================================================================
64
 
# Include settings from an external config file (issue 39).
 
64
# Include settings from an external config file.
65
65
# ============================================================================
66
 
if ( file_exists(__FILE__ . '.cnf' ) ) {
67
 
   debug("Found configuration file " . __FILE__ . ".cnf");
 
66
if ( file_exists('/etc/cacti/' . basename(__FILE__) . '.cnf' ) ) {
 
67
   require('/etc/cacti/' . basename(__FILE__) . '.cnf');
 
68
   debug('Found configuration file /etc/cacti/' . basename(__FILE__) . '.cnf');
 
69
}
 
70
elseif ( file_exists(__FILE__ . '.cnf' ) ) {
68
71
   require(__FILE__ . '.cnf');
 
72
   debug('Found configuration file ' . __FILE__ . '.cnf');
69
73
}
70
74
 
71
75
# Make this a happy little script even when there are errors.
195
199
 
196
200
   --host      MySQL host
197
201
   --items     Comma-separated list of the items whose data you want
198
 
   --user      MySQL username; defaults to $mysql_user if not given
199
 
   --pass      MySQL password; defaults to $mysql_pass if not given
200
 
   --port      MySQL port; defaults to $mysql_port if not given
 
202
   --user      MySQL username
 
203
   --pass      MySQL password
 
204
   --port      MySQL port
201
205
   --server-id Server id to associate with a heartbeat if heartbeat usage is enabled
202
206
   --nocache   Do not cache results in a file
203
207
   --help      Show usage