Windows2003下安装mrtg

简介:
[背景]公司需求在windows下装个MRTG来监控几台交换机,这不,就干起来了...
[过程]
(一)必备软件
(1)IIS/apache  [url]http://www.apache.org/[/url]下载Apache,IIS系统自带
(2)ActivePerl  [url]http://www.activestate.com/Products/ActivePerl/[/url] 
(3)Mrtg        [url]http://oss.oetiker.ch/mrtg/[/url]
我将其ActivePerl安装到D盘,Mrtg也放到D盘
(二)配置
因监控多台交换机,故需要有多次重复的配置,仅举一例。
(1)cd d:/mrtg/bin
(2)D:\Perl\bin\perl cfgmaker [email]public@xxx.xxx.xxx.xxx[/email] --global WorkDir:\www1 --output switch_23.cfg
(3)修改switch_23.cfg  mrtg的配置文件
   去掉注释
#  or for NT 
WorkDir: d:\www1   <====去掉这里的"#"                    发布网页的主目录

### Global Defaults           

#  to get bits instead of bytes and graphs growing to the right
Options[_]: growright, bits   <====去掉这里的"#"          图表横坐标时间值是向右发展的,单位为bits 

追加

RunAsDaemon:yes
interval:5                每5分钟自动统计一次
Language:gb               选择语言,中文简体可以选择gb、cn、chinese、gb2312
 

(4)D:\Perl\bin\perl indexmaker --output=D:\www1\index.html --title=Mian-WAN-C3750 D:\mrtg\bin\switch_23.cfg
生成首页
(5)D:\Perl\bin\perl mrtg --logging=switch_23.log D:\mrtg\bin\switch_23.cfg
   注意,这一步骤要执行几次:每一次停止后(显示假死状态),可以按ctrl+c终止,再次执行,直到出现don't close window,or mrtg die
   说明就OK了。但是这是一个在前台执行的,我们想在后台工作,于是就需要wperl
D:\Perl\bin\wperl mrtg --logging=switch_23.log D:\mrtg\bin\switch_23.cfg

(6)对于重启,我们需要用脚本+计划任务
mrtg.bat
@echo off
D:\Perl\bin\wperl D:\mrtg\bin\mrtg --logging=switch_20.log D:\mrtg\bin\switch_20.cfg
D:\Perl\bin\wperl D:\mrtg\bin\mrtg --logging=switch_21.log D:\mrtg\bin\switch_21.cfg
D:\Perl\bin\wperl D:\mrtg\bin\mrtg --logging=switch_22.log D:\mrtg\bin\switch_22.cfg
D:\Perl\bin\wperl D:\mrtg\bin\mrtg --logging=switch_22.log D:\mrtg\bin\switch_22.cfg
计划任务定为“计算机重启时”
(7)在IIS下添加虚拟主机喽,这个就是Next的活。

[结论]任务完成,保留以备不时之需! 



本文转自hahazhu0634 51CTO博客,原文链接:http://blog.51cto.com/5ydycm/123477,如需转载请自行联系原作者

相关文章
|
3天前
|
iOS开发 MacOS Windows
Mac air使用Boot Camp安装win10 ,拷贝 Windows 文件时出错
Mac air使用Boot Camp安装win10 ,拷贝 Windows 文件时出错
|
18天前
|
Windows
Windows操作系统部署安装Kerberos客户端
详细介绍了在Windows操作系统上部署安装Kerberos客户端的完整过程,包括下载安装包、安装步骤、自定义安装路径、修改环境变量、配置hosts文件和Kerberos配置文件,以及安装后的验证步骤。
31 3
Windows操作系统部署安装Kerberos客户端
|
9天前
|
SQL JavaScript 数据库
sqlite在Windows环境下安装、使用、node.js连接
sqlite在Windows环境下安装、使用、node.js连接
|
28天前
|
缓存 NoSQL Linux
【Azure Redis 缓存】Windows和Linux系统本地安装Redis, 加载dump.rdb中数据以及通过AOF日志文件追加数据
【Azure Redis 缓存】Windows和Linux系统本地安装Redis, 加载dump.rdb中数据以及通过AOF日志文件追加数据
【Azure Redis 缓存】Windows和Linux系统本地安装Redis, 加载dump.rdb中数据以及通过AOF日志文件追加数据
|
17天前
|
网络安全 虚拟化 Windows
windows 11安装openSSH server 遇到的"kex_exchange_identification: read: Connection reset"问题
windows 11安装openSSH server 遇到的"kex_exchange_identification: read: Connection reset"问题
|
24天前
|
Ubuntu Linux 虚拟化
安装Windows Linux 子系统的方法:适用于windows 11 版本
本文提供了在Windows 11系统上安装Linux子系统(WSL)的详细步骤,包括启用子系统和虚拟化功能、从Microsoft Store安装Linux发行版、设置WSL默认版本、安装WSL2补丁,以及完成Ubuntu的首次安装设置。
65 2
|
23天前
|
API Docker Windows
2024 Ollama 一站式解决在Windows系统安装、使用、定制服务与实战案例
这篇文章是一份关于Ollama工具的一站式使用指南,涵盖了在Windows系统上安装、使用和定制服务,以及实战案例。
2024 Ollama 一站式解决在Windows系统安装、使用、定制服务与实战案例
|
24天前
|
网络安全 Windows
windows安装ssh服务
windows安装ssh服务
22 0
|
29天前
|
Linux Python Windows
【Azure 环境】Windows中安装Python azure-eventhub-checkpointstoreblob-aio模块时出错 ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory:
【Azure 环境】Windows中安装Python azure-eventhub-checkpointstoreblob-aio模块时出错 ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory:
|
30天前
|
Windows Python
【Azure 批处理 Azure Batch】在Azure Batch中如何通过开始任务自动安装第三方依赖的一些软件(Windows环境)
【Azure 批处理 Azure Batch】在Azure Batch中如何通过开始任务自动安装第三方依赖的一些软件(Windows环境)