问题描述:

  今天想有没有监控主机内存的插件可以供nagios来使用,然后找到一个插件check_linux_stats.pl

  但是在将脚本上传之后,执行的时候报错

[root@testvm02 libexec]# ./check_linux_stats.pl -T -w  -c  -p /var/run/jonas.pid
Can't locate Sys/Statistics/Linux.pm in @INC (@INC contains: /usr/local/nagios/libexec /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./check_linux_stats.pl line 35.
BEGIN failed--compilation aborted at ./check_linux_stats.pl line .

处理过程:

1.通过以上分析应该是少了perl的模块,下载perl-Sys-Statistics-Linux-0.59-3.el6.noarch.rpm软件包,并且安装

[root@testvm03 software]# rpm -ivh perl-Sys-Statistics-Linux-0.59-.el6.noarch.rpm
warning: perl-Sys-Statistics-Linux-0.59-.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
error: Failed dependencies:
perl(Time::HiRes) is needed by perl-Sys-Statistics-Linux-0.59-.el6.noarch

备注:通过以上信息,发现又少了依赖包perl-Time-HiRes-1.9721-144.el6.x86_64.rpm

perl-Sys-Statistics-Linux RPM包下载地址:

http://rpmfind.net/linux/epel/6/x86_64/Packages/p/perl-Sys-Statistics-Linux-0.59-3.el6.noarch.rpm

2.下载并且安装perl-Time-HiRes-1.9721-144.el6.x86_64.rpm(这个RPM包在系统镜像ISO里面有)

[root@testvm03 software]# rpm -ivh perl-Time-HiRes-1.9721-.el6.x86_64.rpm
warning: perl-Time-HiRes-1.9721-.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [%]
:perl-Time-HiRes ########################################### [%]

再安装perl-Sys-Statistics包:
[root@testvm03 software]# rpm -ivh perl-Sys-Statistics-Linux-0.59-.el6.noarch.rpm
warning: perl-Sys-Statistics-Linux-0.59-.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing... ########################################### [%]
:perl-Sys-Statistics-Lin########################################### [%]

备注:脚本执行需要依赖的软件包安装完成.

3.执行脚本(插件命令)

[root@testvm03 libexec]# ./check_linux_stats -M -w , -c ,   #备注:原脚本后缀为.pl,为了使用方便已经通过mv将后缀去掉了.
MEMORY OK : Mem used: 6.96%, Swap used: 0.00% |MemUsed=6.96%;; SwapUsed=0.00%;; MemCached=5.58% SwapCached=0.00% Active=4.11%

备注:命令执行成功,那么就可以把这个脚本加入nagios的命令中了.

插件check_linux_stats/details地址(下载和基本使用):

https://exchange.nagios.org/directory/Plugins/Operating-Systems/Linux/check_linux_stats/details

文档创建时间:2018年8月14日11:03:38

nagios安装check_linux_stats.pl插件报错Can't locate Sys/Statistics/Linux.pm in @INC的处理?的更多相关文章

  1. ubuntu16.04安装库、插件报错:

    安装一些插件.库,遇到报错 Could not fetch URL https://pypi.org/simple/pytest-pycodestyle/: There was a problem c ...

  2. Eclipse4.4安装旧版本插件报错 Failed to prepare partial IU

    Failed to prepare partial IU: [R]com.googlecode.veloeclipse.ui 2.0.8. work around: go to Help -> ...

  3. adcfgclone.pl appsTier报错Unable to locate 'linkxlC' utility in path

    $ cd /u01/dev/apps/apps_st/comn/clone/bin$ perl adcfgclone.pl  appsTier                     Copyrigh ...

  4. linux安装软件报错: Can't locate ExtUtils/Embed.pm in @INC...

    安装snmp服务, 中间报错: Can't locate ExtUtils/Embed.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/l ...

  5. sublime 安装插件报错

    sublime  安装插件报错,大部分原因是本地防火墙开启了,关闭本地防火墙

  6. vscode安装dlv插件报错:There is no tracking information for the current branch.

    vscode安装dlv插件报错:There is no tracking information for the current branch. https://blog.csdn.net/a7859 ...

  7. 安装J2EE的SDK报错:could not find the required version of the Java(TM)2 Runtime Environment in '(null)'的解决办法。

    国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...

  8. 安装Oracle 11gR2,报错:[INS-06101] IP address of localhost could not be determined

    安装Oracle 11gR2,报错:[INS-06101] IP address of localhost could not be determined 出现这种错误是因为主机名和/etc/host ...

  9. npm不能安装任何包,报错:npm WARN onload-script failed to require onload script npm-autoinit/autoinit及解决方法

    想要利用Hexo搭建一个博客,但是安装时npm一直报错,不仅仅是Hexo包,连别的其他包也不行,会提示下面的一堆错误 npm WARN onload-script failed to require ...

随机推荐

  1. <七年成为百万富翁:欧洲最知名致富教练的实用教程>读书笔记

    如果说乐观主义让你看到事物积极的一面,那么自信则同时给你与阴暗面打交道的信心 只有弱者才会推卸责任 把问题当做机会,反问自己:我如何才能创造一种环境,使这个问题永不再现 提出正确的问题 你自己,而不是 ...

  2. Linux 使用tty0 显示10分钟自动关闭功能

    如果用屏幕显示控制台,10分钟左右会自动关闭,有如下方法可以解决 在应用层调用如下代码: #include <fcntl.h> #include <stdio.h> #incl ...

  3. Postgresql添加/删除触发器示例

    -- 定义触发器 CREATE TRIGGER "vss_after_insert_flow_201702" AFTER INSERT ON "public". ...

  4. sed实现文件自我复制

    sed -n '1,$'p test  >> test

  5. 攻城狮送女友的CSS3生日蛋糕

    在线预览:http://keleyi.com/keleyi/phtml/html5/29.htm 代码如下: <!DOCTYPE html> <html> <head&g ...

  6. ConsoleHelper 类

    //Writes colored text to the console and allows to clear previously written lines //as long a not li ...

  7. 关于Unity中场景的导入与导出(专题九)

    Unity场景 场景虽然是由场景美术做好的,但是我们经常需要自己去导导出以及从别的项目导入,所以我们需要对场景的导入和导出有一个详细的了解 1: 场景是由美术人员搭建完成后提交给程序;2: 场景一般包 ...

  8. (转)PCM数据格式

        1. 音频简介 经常见到这样的描述: 44100HZ 16bit stereo 或者 22050HZ 8bit mono 等等. 44100HZ 16bit stereo: 每秒钟有 4410 ...

  9. MongoDB多文档查询

    db.getCollection('transactionCompensation').find( { "$and":[ { "status":{ " ...

  10. (弃) Keystone CLI_可选命令详解

    本文详细介绍keystone客户端命令行界面(CLI)keystone的可选子命令.关于keystone客户端命令行工具keystone命令的子命令和选项列表,请参考前文<解读keystone命 ...