【问题标题】:Nagios Percona Monitoring PluginNagios Percona 监控插件
【发布时间】:2015-08-21 09:12:40
【问题描述】:

我正在阅读有关 Percona 监控插件的博客文章,以及如何使用 pmp-check-mysql-status 插件以某种方式监控 Galera 集群。以下是该博客的链接:

https://www.percona.com/blog/2013/10/31/percona-xtradb-cluster-galera-with-percona-monitoring-plugins/

本教程中的命令在命令行上运行。我希望在 Nagios .cfg 文件中尝试这些命令,例如 monitor.cfg。我如何为本教程中使用的命令编写服务?

这是我的尝试,我不知道在服务上用于 check_command 的最佳参数是什么。我怀疑问题出在哪里。

所以在我的 /etc/nagios3/conf.d/monitor.cfg 文件中,我有以下内容:

define host{
        use                     generic-host
        host_name               percona-server
        alias                   percona
        address                 127.0.0.1
 }

## Check for a Primary Cluster
define command{
        command_name    check_mysql_status
        command_line    /usr/lib/nagios/plugins/pmp-check-
mysql-status -x wsrep_cluster_status -C == -T str -c non-Primary
}
define service{
        use                             generic-service
        hostgroup_name                  mysql-servers
        service_description             Cluster
        check_command                   pmp-check-mysql-   
status!wsrep_cluster_status!==!str!non-Primary
}

当我运行 Nagios 命令并监控它时,我在 Nagios 仪表板中收到以下消息:

status: UNKNOWN; /usr/lib/nagios/plugins/pmp-check-mysql-status: 31: 
shift: can't shift that many 

【问题讨论】:

    标签: monitoring percona galera


    【解决方案1】:

    您已确认: /usr/lib/nagios/plugins/pmp-check-mysql-status -x wsrep_cluster_status -C == -T str -c non-Primary 在目标主机的命令行上工作正常吗?我怀疑 ==

    存在 shell 转义问题

    这对你有用吗? /usr/lib64/nagios/plugins/pmp-check-mysql-status -x wsrep_flow_control_paused -w 0.1 -c 0.9

    【讨论】:

    • 您提供的命令在 Nagios 中有效。那么我如何用我的命令解决这个问题,因为你提到 == 似乎存在 shell 转义问题。如何重写我的命令:/usr/lib/nagios/plugins/pmp-check-mysql-status -x wsrep_cluster_status -C == -T str -c non-Primary 让它在 Nagios 中工作?
    • 手册显示您需要这样引用 ==:pmp-check-mysql-status -x wsrep_cluster_status -C '==' -T str -c non-Primary
    • 感谢手册和帮助。会试一试,让你知道我是否能正常工作。谢谢@utdrmac。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多