我有一些基本的 mrtg / rrdtool 知识,目前正在使用 mrtg-rrd.cgi/rrdtool 来绘制各种值的图表。
我有一个温度脚本,可以输出四种不同的室温
20
23
25
30
我想将它们绘制在一张图中。有人能告诉我如何在一张图中显示四个值吗?
目前我有以下 cfg,但它只显示 2 行
### MONITORING KARACHI Temperature vs our DATA Center ###
Target[KARACHI_CITY_vs_NOC_tempr]: `/temp/weather.sh`
Title[KARACHI_CITY_vs_NOC_tempr]: Temperature Monitoring of Data Center vs Karachi City
PageTop[KARACHI_CITY_vs_NOC_tempr]: <h1>Temperature Monitoring of Data Center vs Karachi City by zaib</h1>
Options[KARACHI_CITY_vs_NOC_tempr]: gauge, growright, nopercent
MaxBytes[KARACHI_CITY_vs_NOC_tempr]: 10000
Colours[KARACHI_CITY_vs_NOC_tempr]: RED#ff4f27,BLUE#2952f4,RED#ff4f27,BLUE#2952f4
#Unscaled[KARACHI_CITY_vs_NOC_tempr]: dwmy
YLegend[KARACHI_CITY_vs_NOC_tempr]: Temprature
ShortLegend[KARACHI_CITY_vs_NOC_tempr]: c
LegendI[KARACHI_CITY_vs_NOC_tempr]: A
LegendO[KARACHI_CITY_vs_NOC_tempr]: B
Legend1[KARACHI_CITY_vs_NOC_tempr]: C
Legend2[KARACHI_CITY_vs_NOC_tempr]: D
(没有 Routers2 前端有什么办法可以做到这一点吗?)
答案1
来自mrtg文档:
External Monitoring Scripts
If you want to monitor something which does not provide data via snmp you can use some external program to do the data gathering.
The external command must return 4 lines of output:
Line 1
current state of the first variable, normally 'incoming bytes count'
Line 2
current state of the second variable, normally 'outgoing bytes count'
Line 3
string (in any human readable format), telling the uptime of the target.
Line 4
string, telling the name of the target.
您需要在脚本输出末尾添加两行内容为时间和名称。