Nagios Percona 监控插件
Nagios Percona Monitoring Plugin
我正在阅读一篇关于 Percona 监控插件的博客 post,以及如何使用 pmp-check-mysql-status 插件以某种方式监控 Galera 集群。下面是博客的 link 证明:
本教程中的命令在命令行中 运行。我想在 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
您确认:
/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
我正在阅读一篇关于 Percona 监控插件的博客 post,以及如何使用 pmp-check-mysql-status 插件以某种方式监控 Galera 集群。下面是博客的 link 证明:
本教程中的命令在命令行中 运行。我想在 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
您确认:
/usr/lib/nagios/plugins/pmp-check-mysql-status -x wsrep_cluster_status -C == -T str -c non-Primary
在目标主机上的命令行上工作正常吗?我怀疑 ==
这适合你吗? /usr/lib64/nagios/plugins/pmp-check-mysql-status -x wsrep_flow_control_paused -w 0.1 -c 0.9