问题描述:

  今天想有没有监控主机内存的插件可以供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. ubuntu apt-get 安装指定版本软件

    有时候 Ubuntu安装软件时候会提示你缺少对应版本的软件,这时候你就需要用到 sudo apt-get install softname=version 来安装对应的软件. sudo apt-get ...

  2. Java 原码 反码 补码

    本篇文章讲解了计算机的原码, 反码和补码. 并且进行了深入探求了为何要使用反码和补码, 以及更进一步的论证了为何可以用反码, 补码的加法计算原码的减法. 论证部分如有不对的地方请各位牛人帮忙指正! 希 ...

  3. JMeter (1) —— JMeter与WebDriver安装与测试(101 Tutorial)

    JMeter (1) -- JMeter与WebDriver安装与测试(101 Tutorial) 主要内容 JMeter安装 WebDriver安装 一个简单的JMeter+WebDriver示例 ...

  4. exec和sp_executesql

    sqlserver中的exec和sp_executesql都能执行动态的sql语句和存储过程,但exec用法较为简单,不能带参数,也没有返回参数. sp_executesql则显得功能更加完善,可以用 ...

  5. ambari删除脚本

    #.删除hdp.repo和hdp-util.repo cd /etc/yum.repos.d/ rm -rf hdp* rm -rf HDP* #rm -rf ambari* #.删除安装包 #用yu ...

  6. win7 64位操作系统中 Oracle 11g 安装教程(图解)

    1.下载Oracle 11g R2 for Windows版本,下载地址如下 官方网站: http://download.oracle.com/otn/nt/oracle11g/112010/win3 ...

  7. 8个日志级别(OFF、FATAL、ERROR、WARN、INFO、DEBUG、TRACE、 ALL)

    log4j定义了8个级别的log(除去OFF和ALL,可以说分为6个级别),优先级从高到低依次为:OFF.FATAL.ERROR.WARN.INFO.DEBUG.TRACE. ALL. ALL 最低等 ...

  8. 使用sessionStorage解决vuex在页面刷新后数据被清除的问题

    https://www.jb51.net/article/138218.htm 1.原因 2.解决方法 localStorage没有时间期限,除非将它移除,sessionStorage即会话,当浏览器 ...

  9. Android  <meta-data>

    在AndroidManifest.xml中,<meta-data>元素可以作为子元素,被包含在<activity>.<application>.<servic ...

  10. python的callback函数原理

    __getattribute__作用 """ class C(object): a = 'abc' def __getattribute__(self, *args, * ...