【问题】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上执行检查命令


[root@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

[root@s3 ~]# 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、安装完成后,再次执行

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

     本文转自巧克力黒 51CTO博客,原文链接:http://blog.51cto.com/10120275/1793736,如需转载请自行联系原作者





相关文章
|
6月前
|
监控 数据处理 算法框架/工具
Allocation of 179437568 exceeds 10% of free system memory.
本文讨论了在Python编程中遇到的"Allocation of XXXX exceeds 10% of free system memory"错误,并提供了几种解决方法,包括调整代码逻辑以减少内存分配和更改批量大小。
|
9月前
|
Oracle 关系型数据库
Customer RecommendedORA-27090 - Unable to Reserve Kernel Resources for Asynchronous Disk I/O
Customer RecommendedORA-27090 - Unable to Reserve Kernel Resources for Asynchronous Disk I/O
62 4
E: Unable to correct problems, you have held broken packages.
在使用服务器配置环境中遇到的问题,先将解决方案列下: