0

我正在阅读一篇关于 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 
4

1 回答 1

2

您验证了: /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

于 2015-08-21T19:10:42.233 回答