一、交換機(jī)配置
在陽東等地區(qū),都構(gòu)建了全面的區(qū)域性戰(zhàn)略布局,加強(qiáng)發(fā)展的系統(tǒng)性、市場前瞻性、產(chǎn)品創(chuàng)新能力,以專注、極致的服務(wù)理念,為客戶提供網(wǎng)站設(shè)計(jì)制作、網(wǎng)站設(shè)計(jì) 網(wǎng)站設(shè)計(jì)制作定制開發(fā),公司網(wǎng)站建設(shè),企業(yè)網(wǎng)站建設(shè),品牌網(wǎng)站制作,成都全網(wǎng)營銷,外貿(mào)營銷網(wǎng)站建設(shè),陽東網(wǎng)站建設(shè)費(fèi)用合理。snmp-server community public ro
snmp-server enable traps
snmp-server host *.*.*.* version 2c public
snmp-server trap-source vlan 1
二、Nagios服務(wù)器配置
下載check_traffic.sh腳本,chech_traffic.sh并不是nagios-plugins自帶插件,需要自行下載。
chmod 777 check_traffic.sh 賦予腳本執(zhí)行權(quán)限
1. 獲取交換機(jī)的index信息
[root@m ~]#/usr/lib64/nagios/plugins/check_traffic.sh -V 2c -C public -H 10.10.3.252 -L
List Interface for host 10.10.3.252.
Interface index 1 orresponding to Vlan1
Interface index 5137 orresponding to StackPort1
Interface index 5138 orresponding to StackSub-St1-1
Interface index 5139 orresponding to StackSub-St1-2
Interface index 10101 orresponding to GigabitEthernet1/0/1
Interface index 10102 orresponding to GigabitEthernet1/0/2
Interface index 10103 orresponding to GigabitEthernet1/0/3
Interface index 10104 orresponding to GigabitEthernet1/0/4
Interface index 10105 orresponding to GigabitEthernet1/0/5
Interface index 10106 orresponding to GigabitEthernet1/0/6
Interface index 10107 orresponding to GigabitEthernet1/0/7
Interface index 10108 orresponding to GigabitEthernet1/0/8
Interface index 10109 orresponding to GigabitEthernet1/0/9
Interface index 10110 orresponding to GigabitEthernet1/0/10
Interface index 10111 orresponding to GigabitEthernet1/0/11
Interface index 10112 orresponding to GigabitEthernet1/0/12
Interface index 10113 orresponding to GigabitEthernet1/0/13
Interface index 10114 orresponding to GigabitEthernet1/0/14
Interface index 10115 orresponding to GigabitEthernet1/0/15
Interface index 10116 orresponding to GigabitEthernet1/0/16
Interface index 10117 orresponding to GigabitEthernet1/0/17
Interface index 10118 orresponding to GigabitEthernet1/0/18
Interface index 10119 orresponding to GigabitEthernet1/0/19
Interface index 10120 orresponding to GigabitEthernet1/0/20
Interface index 10121 orresponding to GigabitEthernet1/0/21
Interface index 10122 orresponding to GigabitEthernet1/0/22
Interface index 10123 orresponding to GigabitEthernet1/0/23
Interface index 10124 orresponding to GigabitEthernet1/0/24
Interface index 10125 orresponding to GigabitEthernet1/0/25
Interface index 10126 orresponding to GigabitEthernet1/0/26
Interface index 10127 orresponding to GigabitEthernet1/0/27
Interface index 10128 orresponding to GigabitEthernet1/0/28
Interface index 12001 orresponding to Null0
Interface index 12002 orresponding to FastEthernet0
命令注解如下:#/usr/lib64/nagios/plugins/check_traffic.sh [ -v ] [ -6 ] [ -i Suffix ] [ -F s|S ] [-p N] [ -r ] -V 1|2c|3 -C snmp-community -H host [ -L ] -I interface -w in,out-warning-value -c in,out-critical-value -K/M -B/b
2.獲取交換機(jī)G1/0/28的端口流量
[root@m ~]# /usr/lib64/nagios/plugins/check_traffic.sh -V 2c -C public -H 10.10.3.252 -I 10128 -w 200,300 -c 400,500 -K -B
OK - It's the first time for this plugins run. We'll get the data from the next time.
[root@m ~]# /usr/lib64/nagios/plugins/check_traffic.sh -V 2c -C public -H 10.10.3.252 -I 10128 -w 200,300 -c 400,500 -K -B
OK - The Traffic In is 82.00KB, Out is 0.0KB, Total is 82.00KB. The Check Interval is 290s |In=82.00KB;200;400;0;0 Out=0.0KB;300;500;0;0 Total=82.00KB;500;900;0;0 Interval=290s;1200;1800;0;0
3.配置nagios配置文件
[root@m ~]#vim /etc/nagios/nagios.cfg
cfg_file=/etc/nagios/objects/switch.cfg #去掉該行前面的#號字符
4.配置commands.cfg
[root@m ~]# vim /etc/nagios/objects/commands.cfg
define command{
command_name check_switch_traffic
command_line $USER1$/check_traffic.sh -V 2c -C public -H $HOSTADDRESS$ -I $ARG1$ -w $ARG2$,$ARG3$ -c $ARG4$,$ARG5$ -M -b
}
5.配置switch.cfg
define host{
use generic-switch ; Inherit default values from a template
host_name H17_2960SW1_3.251 ; The name we're giving to this switch
alias Linksys SRW224P Switch ; A longer name associated with the switch
address 10.10.3.251 ; IP address of the switch
hostgroups switches ; Host groups this switch is associated with
}
define host{
use generic-switch ; Inherit default values from a template
host_name H18_2960SW1_3.247 ; The name we're giving to this switch
alias Linksys SRW224P Switch ; A longer name associated with the switch
address 10.10.3.247 ; IP address of the switch
hostgroups switches ; Host groups this switch is associated with
}
define service{
use generic-service,srv-pnp ; Inherit values from a template
host_name H17_2960SW1_3.251
service_description check_traffice_g1/0/28
check_command check_switch_traffic!10128!200!400!500!800
}
define service{
use generic-service,srv-pnp ; Inherit values from a template
host_name H18_2960SW1_3.247
service_description check_traffice_g1/0/28
check_command check_switch_traffic!10128!200!400!500!800
}
6.配置權(quán)限(有待驗(yàn)證)
[root@m ~]# chmod 777 /var/tmp/check_traffic_10.10.3.249_10128.hist_dat_root__64
7.重啟nagios服務(wù)
[root@m ~]# /etc/init.d/nagios restart
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
文章名稱:nagios監(jiān)控cisco交換機(jī)流量-創(chuàng)新互聯(lián)
當(dāng)前鏈接:http://www.muchs.cn/article42/dhogec.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計(jì)公司、商城網(wǎng)站、響應(yīng)式網(wǎng)站、虛擬主機(jī)、網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容