我正在阅读一篇关于 Percona 监控插件的博客文章,以及如何使用 pmp-check-mysql-status 插件以某种方式监控 Galera 集群。以下是博客的链接,证明了这一点:
本教程中的命令在命令行上运行。我希望在 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