Chinaunix首页 | 论坛 | 博客
  • 博客访问: 244357
  • 博文数量: 91
  • 博客积分: 2510
  • 博客等级: 少校
  • 技术积分: 1100
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-15 14:35
文章分类

全部博文(91)

文章存档

2008年(91)

我的朋友

分类: 系统运维

2008-03-22 19:50:56

1、有find命令找到cfgmaker的执行路径。
/usr/local/mrtg/bin/cfgmaker --output=/home/mrtgqy/mrtgqy201200.cfg --global "WorkDir:/home/mrtg/"  --global "Options[_]: growright, bits" --snmp-options=:::::2  
 
这个只是阐述要生成cfg文件,取名为mrtgqy201200.cfg。 workdir是mrtg的工作目录。也是说生成的cfg文件在mrtg的作用下形成的图像在/home/mrtg下面。但是还没有生成,同时用snmp-options=:::::2 community@ip 去抓这个交换机所有端口的信息。然后记录下来。
过程如下:

-base: Get Device Info on Mrtg.Netease@10.163.16.27:::::2

--base: Vendor Id:

--base: Populating confcache

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g1 --> 1

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g2 --> 2

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g3 --> 3

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g4 --> 4

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g5 --> 5

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g6 --> 6

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g7 --> 7

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g8 --> 8

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g9 --> 9

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g10 --> 10

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g11 --> 11

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g12 --> 12

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g13 --> 13

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g14 --> 14

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g15 --> 15

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g16 --> 16

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g17 --> 17

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g18 --> 18

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g19 --> 19

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g20 --> 20

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g21 --> 21

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g22 --> 22

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g23 --> 23

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name g24 --> 24

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name ch1 --> 25

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name ch2 --> 26

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name ch3 --> 27

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name ch4 --> 28

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name ch5 --> 29

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name ch6 --> 30

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name ch7 --> 31

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name ch8 --> 32

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Name 1 --> 100000

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 1

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 2 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 3 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 4 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 5 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 6 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 7 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 8 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 9 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 10 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 11 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 12 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 13 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 14 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 15 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 16 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 17 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 18 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 19 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 20 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 21 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 22 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 23 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 24 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 25 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 26 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 27 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 28 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 29 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 30 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 31 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr Ethernet Interface --> 32 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Descr vlan --> 100000

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 1

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 2 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 3 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 4 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 5 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 6 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 7 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 8 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 9 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 10 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 11 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 12 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 13 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 14 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 15 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 16 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 17 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 18 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 19 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 20 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 21 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 22 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 23 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 24 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 25 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 26 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 27 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 28 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 29 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 30 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 31 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 6 --> 32 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Type 53 --> 100000

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Ip 10.163.16.27 --> 100000

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 1

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 2 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 3 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 4 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 5 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 6 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 7 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 8 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 9 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 10 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 11 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 12 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 13 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 14 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 15 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 16 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 17 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 18 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 19 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 20 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 21 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 22 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 23 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 24 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 25 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 26 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 27 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 28 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 29 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 30 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 31 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 32 (duplicate)

--snpo: confcache Mrtg.Netease@10.163.16.27:::::2 Eth 00-11-43-f7-54-f8 --> 100000 (duplicate)

--base: Get Interface Info

--base: Walking ifIndex

--base: Walking ifType

--base: Walking ifAdminStatus

--base: Walking ifOperStatus

--base: Walking ifSpeed

--base: Walking ifHighSpeed

--base: snmpget Mrtg.Netease@10.163.16.27:::::2 for ifHighSpeed.1 -> 1000 Mb/s

--base: snmpget Mrtg.Netease@10.163.16.27:::::2 for ifHCInOctets.1 ->

--base: check for HighspeedCounters faild ... Droping back to V1

--base: snmpget Mrtg.Netease@10.163.16.27:::::2 for ifHighSpeed.2 -> 1000 Mb/s

--base: snmpget Mrtg.Netease@10.163.16.27:::::2 for ifHCInOctets.2 ->

--base: check for HighspeedCounters faild ... Droping back to V1

--base: snmpget Mrtg.Netease@10.163.16.27:::::2 for ifHighSpeed.3 -> 1000 Mb/s

 

此时:

[root@localhost mrtgyz]# ls

mrtgyz81100.cfg  mrtgyz81106.cfg  mrtgyz81110.cfg  mrtgyz813.cfg   mrtgyz8193.cfg  mrtgyz8197.cfg mrtgyz81103.cfg  mrtgyz81107.cfg  mrtgyz8118.cfg   mrtgyz814.cfg   mrtgyz8194.cfg  mrtgyz8198.cfg  mrtgyz81104.cfg  mrtgyz81108.cfg  mrtgyz8120.cfg   mrtgyz8191.cfg  mrtgyz8195.cfg  mrtgyz8199.cfg

mrtgyz81105.cfg  mrtgyz81109.cfg  mrtgyz81254.cfg  mrtgyz8192.cfg  mrtgyz8196.cfg

 

 

2、
 
  /usr/bin/env LANG=C /usr/local/bin/mrtg  /home/mrtgqy/mrtgqy16125.cfg
这个是在debian情况下的。
 
/usr/local/bin/mrtg /home/mrtgqy/mrtgqy16125.cfg  这个是在freebsd情况下。
 
这里才是把第一步抓到的信息,运行2次后,生成mrtg的png,图像文件同时还有mrtg16001.ok

   

        [root@localhost mrtgyz]# ls

mrtg.sh          mrtgyz81105.ok   mrtgyz81109.ok   mrtgyz81254.ok  mrtgyz8192.ok   mrtgyz8196.ok

mrtgyz81100.cfg  mrtgyz81106.cfg  mrtgyz81110.cfg  mrtgyz813.cfg   mrtgyz8193.cfg  mrtgyz8197.cfg

mrtgyz81100.ok   mrtgyz81106.ok   mrtgyz81110.ok   mrtgyz813.ok    mrtgyz8193.ok   mrtgyz8197.ok

mrtgyz81103.cfg  mrtgyz81107.cfg  mrtgyz8118.cfg   mrtgyz814.cfg   mrtgyz8194.cfg  mrtgyz8198.cfg

mrtgyz81103.ok   mrtgyz81107.ok   mrtgyz8118.ok    mrtgyz814.ok    mrtgyz8194.ok   mrtgyz8198.ok

 

 10.163.18.124_23.html        10.163.18.51_23.old        10.163.20.185_124-day.gif    10.163.23.44_111-month.gif
10.163.18.124_23.log         10.163.18.51_23-week.gif   10.163.20.185_124.html       10.163.23.44_111.old
10.163.18.124_23-month.gif   10.163.18.51_23-year.gif   10.163.20.185_124.log        10.163.23.44_111-week.gif
10.163.18.124_23.old
 
3、
用find命令找到indexmaker的执行路径。
 
/usr/local/bin/indexmaker /home/mrtgqy/mrtgqy16092.cfg
--output=/home/mrtgrsync/indexqy16092.html
 
在home/mrtgrsync目录下面生成首页。

以上三步配置mrtg,称之为mrtg配置三部曲。这里我单独的解释一下。这三步的妙处。

 

注意就是,配置mrtg的三部曲中,第一步是表面snmp抓包,指定是那个交换机的数据,然后指明是把抓到的这些数据放在什么位置。第二步,就是生成cfg配置文件和相关的图像文件,在mrtg的工作目录下面。

 

第三步,生成每个端口的首页,且放在mrtgsrync文件里面。

阅读(723) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~