简体   繁体   English

nrpe:未定义命令mysql_check

[英]nrpe: command mysql_check not defined

I'm trying to check mysql and tomcat on localhost. 我正在尝试检查localhost上的mysql和tomcat。 Basically I need to check the ports to see the applications are listening. 基本上,我需要检查端口以查看应用程序正在侦听。 I have nrpe and nagios plugins installed I'm trying to use nrpe to check mysql on localhost, but nagios shows this error: NRPE: command check_mysql not defined 我安装了nrpe和nagios插件,我试图使用nrpe在本地主机上检查mysql,但是nagios显示此错误:NRPE:未定义命令check_mysql

Any idea please? 有什么想法吗?

# Define a host for the local machine
define host{
        use                     linux-server            ; Name of host template to use
                            ; This host definition will inherit all variables that are defined
                            ; in (or inherited by) the linux-server host template definition.
        host_name               myserver01
        alias                   localhost
        address                 127.0.0.1
        }
# Define an optional hostgroup for Linux machines
define hostgroup{
        hostgroup_name  linux-servers ; The name of the hostgroup
        alias           Linux Servers ; Long name of the group
        members         myserver01     ; Comma separated list of hosts that belong to this group
        }
# Define a service to "ping" the local machine
define service{
        use                             local-service         ; Name of service template to use
        host_name                       myserver01
        service_description             PING
    check_command           check_ping!100.0,20%!500.0,60%
        }
# Define a service to check the disk space of the root partition
# on the local machine.  Warning if < 20% free, critical if
# < 10% free space on partition.
define service{
        use                             local-service         ; Name of service template to use
        host_name                       myserver
        service_description             Root Partition
    check_command           check_local_disk!20%!10%!/
        }
# Define a service to check the number of currently logged in
# users on the local machine.  Warning if > 20 users, critical
# if > 50 users.
define service{
        use                             local-service         ; Name of service template to use
        host_name                       myserver
        service_description             Current Users
    check_command           check_local_users!20!50
        }
# Define a service to check the number of currently running procs
# on the local machine.  Warning if > 250 processes, critical if
# > 400 users.
define service{
        use                             local-service         ; Name of service template to use
        host_name                       myserver
        service_description             Total Processes
    check_command           check_local_procs!250!400!RSZDT
        }
# Define a service to check the load on the local machine. 
define service{
        use                             local-service         ; Name of service template to use
        host_name                       myserver
        service_description             Current Load
    check_command           check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
        }
# Define a service to check the swap usage the local machine. 
# Critical if less than 10% of swap is free, warning if less than 20% is free
define service{
        use                             local-service         ; Name of service template to use
        host_name                       myserver
        service_description             Swap Usage
    check_command           check_local_swap!20!10
        }
# Define a service to check SSH on the local machine.
# Disable notifications for this service by default, as not all users may have SSH enabled.
define service{
        use                             local-service         ; Name of service template to use
        host_name                       myserver
        service_description             SSH
    check_command           check_ssh!-p xx
    notifications_enabled       0
        }
# Define a service to check HTTP on the local machine.
# Disable notifications for this service by default, as not all users may have HTTP enabled.
define service{
        use                             local-service         ; Name of service template to use
        host_name                       myserver
        service_description             HTTP
    check_command           check_http
    notifications_enabled       0
        }
define service{
        use                     generic-service
        host_name               myserver
        service_description     mysql Monitoring
        check_command           check_nrpe!check_mysql
        }

You need to define a check_mysql command definition for NRPE. 您需要为NRPE定义一个check_mysql命令定义。

Edit your nrpe.cfg. 编辑您的nrpe.cfg。

vim /etc/nagios/nrpe.cfg

Add a command entry for check_mysql pointing to the path of the check_mysql plugin: check_mysql添加一个命令条目,指向check_mysql插件的路径:

command[check_mysql]=/usr/lib64/nagios/plugins/check_mysql

Restart nrpe: 重新启动nrpe:

service nrpe restart

Check out page 13 for more information: https://assets.nagios.com/downloads/nagioscore/docs/nrpe/NRPE.pdf 请查看第13页以获取更多信息: https : //assets.nagios.com/downloads/nagioscore/docs/nrpe/NRPE.pdf

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM