中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

nagios 監控 cisco 交換機

發布時間:2020-07-22 05:26:18 來源:網絡 閱讀:3300 作者:獨彈古調 欄目:移動開發

nagios 監控  cisco 交換機

一、環境:
        1.已搭建好nagios4.0.8
        2.Centos6.5 x86_64    

二、需要有4個監控cisco的腳本
check_snmp_cisco_ifstatus   
check_snmp_cisco_loadavg
check_snmp_cisco_memutil
check_snmp_env
下載鏈接:http://down.51cto.com/data/2118262


三、配置
vim /usr/local/nagios/etc/objects/templates.cfg

define host{
        name                    etnet-switch    
        use                     generic-host    
        check_period            24x7            
        check_interval          1               
        retry_interval          1/2             
        max_check_attempts      2               
        check_command           check-host-alive        
        notification_period     24x7            
        notification_interval   30              
        notification_options    d,r             
        contact_groups          admins          
        register                0               
        }


vim /usr/local/nagios/etc/objects/commands.cfg

##check cisco
#define  check_snmp_env
define command{
command_name check_snmp_env
command_line $USER1$/check_snmp_env -H $HOSTADDRESS$ -C $ARG1$ $ARG2$
}
#define  check_snmp  cisco mem
define command{
command_name check_snmp_cisco_mem
command_line $USER1$/check_snmp_cisco_memutil -H $HOSTADDRESS$ -C $ARG1$ -w $ARG2$ -c $ARG3$
}
#define  check_snmp cisco cpu
define command{
command_name check_snmp_cisco_cpu
command_line $USER1$/check_snmp_cisco_loadavg -H $HOSTADDRESS$ -C $ARG1$ -w $ARG2$ -c $ARG3$
}
#define  check_snmp cisco  if
define command{
command_name check_snmp_cisco_if
command_line $USER1$/check_snmp_cisco_ifstatus -H $HOSTADDRESS$ -C $ARG1$ -i $ARG2$ -w $ARG3$ -c $ARG4$
}

vim /usr/local/nagios/etc/objects/151.3.cfg

define host{
        use             etnet-switch
        host_name       Office-192.168.151.3
        alias           Switch 151.3
        address         192.168.151.3
        }
define service{
        use                     generic-service
        host_name               Office-192.168.151.3
        service_description     PING
        check_command           check_ping!200.0,20%!600.0,60%
        normal_check_interval   5
        retry_check_interval    1
        }
define service{
        use                     generic-service
        host_name               Office-192.168.151.3
        service_description     Uptime
        check_command           check_snmp!-C public -o sysUpTime.0
        }
define service{
        use                     generic-service
        host_name               Office-192.168.151.3
        service_description     Port 1 Link Status
        check_command           check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
        }
define service {
  use                         generic-service
  host_name                   Office-192.168.151.3
  service_description         Memutil
  check_command               check_snmp_cisco_mem!public!90!95
 }
define service {
  use                         generic-service
  host_name                   Office-192.168.151.3
  service_description         LoadAVG
  check_command               check_snmp_cisco_cpu!public!90!95
  }
define service {
  use                         generic-service
  host_name                   Office-192.168.151.3
  service_description         Environment
  check_command               check_snmp_env!public
  }

添加監控交換機
vim /usr/local/nagios/etc/nagios.cfg

cfg_file=/usr/local/nagios/etc/objects/151.3.cfg



重啟nagios
/etc/init.d/nagios restart

四、可能會報錯

No output on stdout) stderr: Can't locate Net/SNMP.pm in @INC (@INC contains: /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 
/usr/local/nagios/libexec/check_snmp_env line 21.

 
問題1:
perl -MCPAN -e shell
Can't locate CPAN.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl

/usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .).

解決:

yum install -y perl-CPAN*



問題2:
No output on stdout) stderr: Can't locate Net/SNMP.pm in @INC (@INC contains: /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

/usr/local/nagios/libexec/check_snmp_env line 21.

解決:

 perl -MCPAN -e shell
cpan[1]> install Net::SNMP
cpan[2]> quit

網上的解決方案
How do I install Net::SNMP               perl module ?            There are 2 ways of doing this
            1) By CPAN (best)
            on command line, as root :
              
              [your_host]# perl -MCPAN -e shell
              cpan shell -- CPAN exploration and modules installation (v1.76)
              ReadLine support enabled
              cpan> install Net::SNMP
            
            If it's the first time you run CPAN, it will               probably ask you some (simple) questions.
            CPAN will also ask you to satisfy some dependencies               (Crypt::DES, Digest::MD5, etc..).
            2) "By hand"
            
            Get the folowings modules (tar.gz format) on               www.cpan.org
            - Crypt::DES
              - Digest::MD5
              - Digest::SHA1
              - Digest::HMAC
              - Net::SNMP
              
              for each one (you must install Net::SNMP at the end) :
              tar zxf <module>.tar.gz
              cd <module>
              perl Makefile.pl
              make test
              make install

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

长武县| 南皮县| 西畴县| 潮州市| 鸡西市| 松原市| 永清县| 长寿区| 敖汉旗| 宁陕县| 广丰县| 策勒县| 广德县| 漾濞| 安溪县| 陆良县| 建昌县| 乡城县| 达尔| 丹阳市| 高唐县| 五莲县| 桂东县| 昭通市| 兴义市| 廉江市| 瑞金市| 莱芜市| 南京市| 法库县| 玉树县| 瑞丽市| 望奎县| 宁河县| 祁东县| 呼伦贝尔市| 阳朔县| 墨玉县| 万安县| 德保县| 克拉玛依市|