Skip to content

Commit

Permalink
Added --disable_slave_status flag to mysql_health_check.pl
Browse files Browse the repository at this point in the history
  • Loading branch information
Rod Xavier Bondoc committed Mar 14, 2013
1 parent dc19e6f commit 49e892a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions nagios/mysql_health_check/mysql_health_check.pl
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,10 @@ sub fetch_server_meta_data
$data->{varstatus} = dbi_exec_for_paired_hash($dbh, q|SHOW GLOBAL VARIABLES|);
pdebug("\tSHOW GLOBAL STATUS...\n");
$data->{varstatus} = hash_merge($data->{varstatus}, dbi_exec_for_paired_hash($dbh, q|SHOW GLOBAL STATUS|));
pdebug("\tSHOW SLAVE STATUS...\n");
$data->{slave_status} = dbi_exec_for_loh($dbh, q|SHOW SLAVE STATUS|);
if($np->opts->disable_slave_status eq 0){
pdebug("\tSHOW SLAVE STATUS...\n");
$data->{slave_status} = dbi_exec_for_loh($dbh, q|SHOW SLAVE STATUS|);
}
}
}
elsif($args->{'type'} eq 'lastrun')
Expand Down Expand Up @@ -507,6 +509,7 @@ sub init_plugin
$np->add_arg(spec => 'cache_dir=s', required => 0, default => "/tmp/pdb_nagios_cache", help => "-d, --database\n\tMySQL database");
$np->add_arg(spec => 'no_cache', required => 0, help => "--no_cache\n\tIgnore var/processlist cache");
$np->add_arg(spec => 'is_master', required => 0, default => 0, help => "--is_master\n\tMySQL Database is a master");
$np->add_arg(spec => 'disable_slave_status', required => 0, default => 0, help => "--disable_slave_status\n\tDisable 'SHOW SLAVE STATUS' checking");
$np->add_arg(spec => 'max_cache_age=i', required => 0, default => 300, help => "--max_cache_age\n\tNumber of seconds before the meta data cache is considered stale and refreshed");
$np->add_arg(spec => 'comparison_warning=s', required => 0, help => qq|--comparison_warning\n\tComparison warning threshold (Perl syntax), e.g. ">80"|);
$np->add_arg(spec => 'comparison_critical=s', required => 0, help => qq|--comparison_critical\n\tComparison critical threshold (Perl syntax), e.g. ">100"|);
Expand Down

0 comments on commit 49e892a

Please sign in to comment.