Unable to determine memory usage

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Unable to determine memory usage相关的知识,希望对你有一定的参考价值。

Nagios报错如下


***** Nagios *****
Notification Type: PROBLEM

Service: MEM_USE
Host: s3
Address: 10.10.16.103
State: UNKNOWN
  
Date/Time: Tue Jun 28 17:41:42 CST 2016

Additional Info:

Unable to determine memory usage.



解决过程:

1、根据Service:MEM_USE在文件/etc/nagios/objects/hosts/s3.cfg中找到相应配置


define service{

        use                             generic-service         ; Name of service template to use

        host_name                       s3

        service_description             MEM_USE

        check_command                   check_nrpe!check_mem_used

        notifications_enabled           1

        contact_groups                  admins,dxgroup

        }


2、在s3上执行检查命令


[[email protected]s3 ~]# /usr/local/nagios/libexec/check_mem.sh 85 90

/usr/local/nagios/libexec/check_mem.sh: line 57: /usr/bin/bc: 没有那个文件或目录

/usr/local/nagios/libexec/check_mem.sh: line 58: /usr/bin/bc: 没有那个文件或目录

/usr/local/nagios/libexec/check_mem.sh: line 69: bc: command not found

/usr/local/nagios/libexec/check_mem.sh: line 69: [: -eq: unary operator expected

/usr/local/nagios/libexec/check_mem.sh: line 72: bc: command not found

/usr/local/nagios/libexec/check_mem.sh: line 72: [: -eq: unary operator expected

/usr/local/nagios/libexec/check_mem.sh: line 75: bc: command not found

/usr/local/nagios/libexec/check_mem.sh: line 75: [: -eq: unary operator expected

Unable to determine memory usage.


3、按照第2步骤提示没有安装bc,安装bc

[[email protected] ~]# yum -y install bc
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.yun-idc.com
 * extras: mirror.bit.edu.cn
 * updates: mirrors.yun-idc.com


4、安装完成后,再次执行

[[email protected] ~]# /usr/local/nagios/libexec/check_mem.sh 85 90
OK - Memory usage is 2.200%


本文出自 “巧克力黑” 博客,请务必保留此出处http://10120275.blog.51cto.com/10110275/1793736

以上是关于Unable to determine memory usage的主要内容,如果未能解决你的问题,请参考以下文章

Unable to determine local host from URL REPOSITORY_URL=http://

MDT2013折腾记-不能抓取映像unable to determine Destination disk,partition driver

安装Neo4j提示:Unable to determine the path to java.exe

ValueError: Unable to determine SOCKS version from socks://127.0.0.1:1080/

Linq------错误: Unable to determine the principal end of an association between the types

Unable to determine application id: com.android.tools.idea.run.ApkProvisionException: ERROR: APK pat