mrtg 中mem swap等脚本错误

2009-08-26 11:19:33: ERROR: Target[cpu][_IN_] ' $target->[1]{$mode} ' did not eval into defined data
2009-08-26 11:19:33: ERROR: Target[cpu][_OUT_] ' $target->[1]{$mode} ' did not eval into defined data
2009-08-26 11:19:33: ERROR: Target[disk][_IN_] ' $target->[4]{$mode} ' did not eval into defined data
2009-08-26 11:19:33: ERROR: Target[disk][_OUT_] ' $target->[4]{$mode} ' did not eval into defined data
2009-08-26 11:19:33: ERROR: Target[diskio][_IN_] ' $target->[5]{$mode} ' did not eval into defined data
2009-08-26 11:19:33: ERROR: Target[diskio][_OUT_] ' $target->[5]{$mode} ' did not eval into defined data

半个中文系统,改
cpuusr=`/usr/local/bin/sar -u 1 3 |grep 平均时间 |awk '{print $3}'`

挂上脚本,有图表却没流量
查资料发现,没给予脚本可执行权限

mrtg目录下

# chmod +x *

连续运行三次如下命令
  env LANG=C /usr/bin/mrtg /etc/mrtg.cfg。
用如下命令生成起始页
  /usr/bin/indexmaker --output=/var/www/mrtg/index.html /etc/mrtg.cfg

```````````````````````````````````````````````````````````````````````

自己改了个,不是太成功,主要是sensors给的数据太怪,本本都烫手了,报48度,可能么??

#!/bin/bash

cputem=`/usr/bin/sensors | grep temp4 |awk '{print $2}'|cut -c 2-3`   #挖sensors 的参数 temp4

hdtem=`sudo hddtemp -n /dev/sda` # 挖 hddtemp 的返回值

UPtime=`/usr/bin/uptime |awk '{print $3""$4""$5}'`

echo $cputem

echo $hdtem

echo $UPtime

hostname

mrtg中的设置很好搞,复制CPU的,改改就好用,就不写了

````````````````````````````````````````````````````````````````````
又改了,风扇转速和进程数  方法同上
Target[disk]: `/opt/mrtg/df.sh`

Title[disk]: fans and process ----baran
Unscaled[disk]: dwym

kmg[disk]:k

kilo[disk]:1000

MaxBytes[disk]: 4000

ShortLegend[disk]:rpm

LegendI[disk]: Fans

LegendO[disk]: Process

Legend1[disk]: Fans

Legend2[disk]: Process

YLegend[disk]:   rpm


Options[disk]: growright,gauge,nopercent

PageTop[disk]: <H1>;fans and process ----baran</H1>;

没什么变化,改单位,进制,标签 CV来的东西总是不大好用
mrtg有BUG,如果没输出数据,就会保持在奇怪的位置上,我关了一晚上机,CPU具然还在 80%的使用率 otz

怪事,脚本输出不了数据了,图表却正常了,OTZ
````````````````````````````````````````````````````````````````
改了下桌面的设置,终端的大小终于很养眼了 ^^

gnome-terminal --geometry 120x8+0+0



 另,在桌面上使用root权限来管理文件

在桌面上创建一个启动器,输入命令sudo nautilus

cpu要装sar插件,ubuntu上没了,手动编译下
其它2个只好换脚本
全部成功

本文出自 “闵行” 博客,转载请与作者联系!

你可能感兴趣的:(职场,休闲)