[英]Nagios Percona Monitoring Plugin
I was reading a blog post on Percona Monitoring Plugins and how you can somehow monitor a Galera cluster using pmp-check-mysql-status plugin. 我正在阅读有关Percona监视插件的博客文章,以及如何使用pmp-check-mysql-status插件监视Galera集群。 Below is the link to the blog demonstrating that: 以下是表明该博客的链接:
https://www.percona.com/blog/2013/10/31/percona-xtradb-cluster-galera-with-percona-monitoring-plugins/ https://www.percona.com/blog/2013/10/31/percona-xtradb-cluster-galera-with-percona-monitoring-plugins/
The commands in this tutorial are run on the command line. 本教程中的命令在命令行上运行。 I wish to try these commands in a Nagios .cfg file eg, monitor.cfg. 我希望在Nagios .cfg文件(例如monitor.cfg)中尝试这些命令。 How do i write the services for the commands used in this tutorial? 如何为本教程中使用的命令编写服务?
This was my attempt and i cannot figure out what the best parameters to use for check_command on the service. 这是我的尝试,我无法确定在服务上使用check_command的最佳参数是什么。 I am suspecting that where the problem is. 我怀疑问题出在哪里。
So inside my /etc/nagios3/conf.d/monitor.cfg file, i have the following: 因此,在我的/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
}
When i run the command Nagios and go to monitor it, i get this message in the Nagios dashboard: 当我运行命令Nagios并对其进行监视时,我在Nagios仪表板中收到以下消息:
status: UNKNOWN; /usr/lib/nagios/plugins/pmp-check-mysql-status: 31:
shift: can't shift that many
You verified that: /usr/lib/nagios/plugins/pmp-check-mysql-status -x wsrep_cluster_status -C == -T str -c non-Primary
works fine on command line on the target host? 您已验证: /usr/lib/nagios/plugins/pmp-check-mysql-status -x wsrep_cluster_status -C == -T str -c non-Primary
在目标主机上的命令行上工作正常吗? I suspect there's a shell escape issue with the == 我怀疑==存在shell逃逸问题
Does this work well for you? 这对您有用吗? /usr/lib64/nagios/plugins/pmp-check-mysql-status -x wsrep_flow_control_paused -w 0.1 -c 0.9
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.