目录
- 33.1. 监控多个设备
- 33.2. 批量生成监控配置文件
- 33.3. 图片尺寸
# yum install mrtg
start
# env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
/etc/mrtg/mrtg.cfg
HtmlDir: /var/www/mrtg ImageDir: /var/www/mrtg LogDir: /var/lib/mrtg ThreshDir: /var/lib/mrtg #Target[r1]: 2:public@myrouter.somplace.edu #MaxBytes[r1]: 1250000 #Title[r1]: Traffic Analysis #PageTop[r1]: <H1>Stats for our Ethernet</H1> Target[dell_3548_switch]: ifInOctets.1&ifOutOctets.1:public@172.16.0.252 MaxBytes[dell_3548_switch]: 1250000 Title[dell_3548_switch]: Traffic Analysis PageTop[dell_3548_switch]: <H1>Stats for our Ethernet</H1>
create mrtg.cfg
cp /etc/mrtg/mrtg.cfg /etc/mrtg/mrtg.cfg.old cfgmaker --global "HtmlDir: /var/www/mrtg" \ --global "ImageDir: /var/www/mrtg" \ --global "LogDir: /var/lib/mrtg" \ --global "ThreshDir: /var/lib/mrtg" \ --global "Options[_]: growright,bits" \ --ifref=name --ifdesc=descr --show-op-down \ public@172.16.0.252 > /etc/mrtg/mrtg.cfg
index.html
# indexmaker --output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg
33.1. 监控多个设备
cfgmaker --global "HtmlDir: /var/www/mrtg" \ --global "ImageDir: /var/www/mrtg" \ --global "LogDir: /var/lib/mrtg" \ --global "ThreshDir: /var/lib/mrtg" \ --global "Options[_]: growright,bits" \ --ifref=name --ifdesc=descr \ --subdirs=Dell6224 \ public@172.16.0.251 \ --ifref=name --ifdesc=descr \ --subdirs=Dell3548 \ public@172.16.0.252 \ --ifref=name --ifdesc=descr \ --subdirs=H3CS3600 \ public@172.16.0.253 > /etc/mrtg/mrtg.cfg indexmaker --output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg
Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a>comments powered by Disqus
原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。