nagios利用插件(check_mysql_replication.pl)监控mysql主从热备


利用check_mysql_replication.pl监控mysql主从热备

安装插件
# wget http://www.james.rcpt.to/svn/trunk/nagios/check_mysql_replication/check_mysql_replication.pl

# mv check_mysql_replication.pl /usr/local/nagios/libexec/check_mysql_replication

# chmod 755 /usr/local/nagios/libexec/check_mysql_replication

# yum -y install perl-DBD*

check_mysql_replication命令资料

Usage: check_mysql [-d database] [-H host] [-P port] [-s socket] [-u user] [-p password] [-S]

Options:
-h, –help Print detailed help screen
-V, –version Print version information
-H, –hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path)
-P, –port=INTEGER Port number (default: 3306)
-s, –socket=STRING Use the specified socket (has no effect if -H is used)
-d, –database=STRING Check database with indicated name
-u, –username=STRING Connect using the indicated username
-p, –password=STRING Use the indicated password to authenticate the connection
==> IMPORTANT: THIS FORM OF AUTHENTICATION IS NOT SECURE!!! <==

Your clear-text password could be visible as a process table entry

-S, –check-slave Check if the slave thread is running properly.
-w, –warning Exit with WARNING status if slave server is more than INTEGER seconds behind master
-c, –critical Exit with CRITICAL status if slave server is more then INTEGER seconds behind master

There are no required arguments. By default, the local database is checked using the default unix socket. You can force TCP on localhost by using an IP address or FQDN (’localhost’ will use the socket as well).
Send email to nagios-users@lists.sourceforge.net if you have questions regarding use of this software. To submit patches or suggest improvements,send email to nagiosplug-devel@lists.sourceforge.net
check_mysql_replication命令资料
check_replication.pl [ --slave ] [ --slave-pass][ --slave-port ] [ --slave-user ] [ --master ]
[ --master-pass] [ --master-port] [ --master-user ][ --crit] [ --warn] [ --check-random-database ]
[ --table-rows-diff-absolute-crit ][ --table-rows-diff-absolute-warn ]
–slave - MySQL instance running as a slave server
–slave-port - port for the slave
–slave-user - Username with File/Process/Super privs
–slave-pass
- Password for above user
–master - MySQL instance running as server (override)
–master-port - port for the master (override)
–master-user - Username for master (override)
–master-pass
- Password for master
–crit
- Number of complete master binlogs for critical state
–warn
- Number of complete master binlog for warning state
–check-random-database - Select a random DB from the slave’s list of databases and compare to the master’s information for these (need SELECT priv)
–table-rows-diff-absolute-crit - If we do the check-random-database,then ensure that the change in row count between master and slave is below this threshold, and go critical if not
–table-rows-diff-absolute-warn - If we do the check-random-database,then ensure that the change in row count between master and slave is below this threshold, and go warning if not
建立nagios监控用户
nagios监控mysql repl 创建nagios监控用户
master
mysql> mysql> grant replication client,replication slave,super,select on *.* to 'nagios'@'192.168.1.6' identified by 'nagios';
slave
 mysql> grant file,process,super,select on *.* to 'nagios'@'192.168.1.6' identified by 'nagios';
测试
[root@localhost libexec]# ./check_mysql_replication.pl -slave 192.168.1.7 -slave-user nagios -slave-pass nagios -master 192.168.1.2 -master-user nagios -master-pass nagios


[root@localhost nagios]# vi /usr/local/nagios/etc/hosts.cfg
define host{
         host_name                   slave_mysql_192.168.1.7
         address                     192.168.1.7
         check_command               check-host-alive
         contact_groups              mail
         max_check_attempts          3
         notification_interval       10
         notification_period         24x7
         notification_options        d,u,r

        }

[root@localhost nagios]# vi /usr/local/nagios/etc/hostgroups.cfg
define hostgroup{
        hostgroup_name  slave-mysql
        members       slave_mysql_192.168.1.7
        }

[root@localhost nagios]# vi /usr/local/nagios/etc/services.cfg
define service{
        hostgroup_name                  slave-mysql
        service_description             mysql_replication
        check_command                   check_mysql_repl
        contact_groups                  mail
        check_period                    service
        max_check_attempts              4
        normal_check_interval           10
        retry_check_interval            60
        notifications_enabled           1
        notification_options            c,r
        }

[root@localhost nagios]# vi /usr/local/nagios/etc/objects/commands.cfg
define command{
        command_name    check_mysql_repl
        command_line    $USER1$/check_mysql_replication.pl -slave 192.168.1.7 -slave-user nagios -slave-pass nagios -master 192.168.1.2 -master-user nagios -master-pass nagios
        }
(注:请根据现有条件设置,也可以不加如hostgroup,自行设置!)

登录测试即可!

 

 

 


 

内容概要:本文研究了一种基于改进ICEEMDAN的火电-蓄电池-飞轮混合储能联合调频协同控制策略,旨在提升电力系统频率调节的快速响应能力与运行稳定性。通过引入改进的自适应噪声完备集合经验模态分解(ICEEMDAN)方法,对电网频率偏差信号进行多时间尺度分解,精确分离高频与低频动态分量,并据此实现功率的差异化分配:高频成分由响应迅速的飞轮储能承担,低频成分由能量密度高的蓄电池处理,同时结合火电机组的基础调频能力,构建火电-混合储能多源协同控制架构。该策略充分发挥各类储能技术的优势,有效缓解单一储能系统的压力,延长设备寿命,并提升系统整体调频性能。文中提供了完整的Matlab仿真代码实现,验证了该方法在抑制频率波动、优化储能出力、提高系统可靠性和经济性方面的显著效果。; 适合人群:具备电力系统分析、自动控制理论及新能源技术等相关专业知识背景,熟悉Matlab/Simulink仿真平台,从事电力系统调频控制、混合储能系统优化、多时间尺度能量管理等领域研究的研究生、科研人员及工程技术人员。; 使用场景及目标:①深入研究混合储能系统在电网一次调频与二次调频中的功率分配机制与协调控制逻辑;②掌握ICEEMDAN信号分解技术在能源系统动态特征提取与多尺度控制中的应用方法;③实现火电机组与多类型储能协同参与调频的仿真建模、算法开发与性能对比分析;④为综合能源系统、微电网及新型电力系统的多源多时间尺度协调控制提供理论依据与技术参考。; 阅读建议:建议结合提供的Matlab代码逐模块分析算法实现流程,重点理解信号分解、模态分量判别、功率分配规则及控制器设计等关键环节,可通过调整系统参数、模拟不同扰动工况进行仿真测试,进一步开展灵敏度分析与策略优化,以深化对协同控制机理的认识并拓展其实际应用价值。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值