Temat: pomocy z MRTG

Witam, prosiłbym o pomoc w mrtg. Chciałbym żeby mrtg pobierał dane z pliku i je wyświetlał
plik:

 >cat thermal.log
0
3.50
21:47:02
Thermal State

jak widać plik ma cztery linie, oczywiście uprawnienia 777

mrtg.conf

# cat /etc/mrtg.cfg
######################################################################
# Multi Router Traffic Grapher -- Sample Configuration File
######################################################################
# This file is for use with mrtg-2.5.4c

# Global configuration
WorkDir: /var/www/mrtg
WriteExpires: Yes

Title[^]: Traffic Analysis for

# 128K leased line
# ----------------
#Title[leased]: a 128K leased line
#PageTop[leased]: <H1>Our 128K link to the outside world</H1>
#Target[leased]: 1:public@router.localnet
#MaxBytes[leased]: 16000


Target[thermal]: `/bin/cat /usr/local/etc/mrtg/thermal.log`
Pagetop[thermal]: <h1>Thermal State in My Town</h1>
Title[thermal]: Thermal State
PNGTitle[thermal]: Thermal State in Server Room
MaxBytes[thermal]: 50
AbsMax[thermal]: 50
LegendI[thermal]: Outer
LegendO[thermal]: Inner
kMG[thermal]: C
Options[thermal]: nopercent,gauge,noinfo
YLegend[thermal]: Temp, C
ShortLegend[thermal]:
Legend1[thermal]: external
Legend2[thermal]: internal

niestety, mrtg ciągle zero, natomiast log wywala

2013-04-08 21:45:02: ERROR: Target[thermal][_OUT_] ' $target->[0]{$mode} ' did not eval into defined data
2013-04-08 21:50:02: WARNING: Problem with External get '/bin/cat /usr/local/etc/mrtg/thermal.log':
   Expected a Number for 'out' but nothing'

pomysły?

2

Odp: pomocy z MRTG

Jakie końce linii masz w pliku?

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

3

Odp: pomocy z MRTG

w którym pliku? jeśli Ci chodzi o plik z którego rysuje to wygląda tak:

1365452103 -1 -1
1365452103 0 0 0 0
1365451502 0 0 0 0
1365451500 0 0 0 0
1365451200 0 0 0 0
1365450900 0 0 0 0
1365450600 0 0 0 0
1365450300 0 0 0 0
1365450000 0 0 0 0
1365449700 0 0 0 0
1365449400 0 0 0 0
1365449100 0 0 0 0
1365448800 0 0 0 0
1365448500 0 0 0 0
1365448200 0 0 0 0
1365447900 0 0 0 0
1365447600 0 0 0 0
1365447300 0 0 0 0
1365447000 0 0 0 0
1365446700 0 0 0 0
1365446400 0 0 0 0
....

próbowałem zmienić znak ` na ', ale też lipa

4

Odp: pomocy z MRTG

/usr/local/etc/mrtg/thermal.log

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

5 (edytowany przez tipsntrix 2013-04-08 21:39:50)

Odp: pomocy z MRTG

0
3.50
21:47:02
Thermal State

dokładnie tak wygląda
a plik powstaje ze skryptu:

#!/bin/sh
echo 0 > /usr/local/etc/mrtg/thermal.log
digitemp_DS9097U -q -t 0 -c /home/aikon/adm/digitemp.conf | awk '{print $7}' >> /usr/local/etc/mrtg/thermal.log
date | awk '{print $5}' >> /usr/local/etc/mrtg/thermal.log
echo "Thermal State" >> /usr/local/etc/mrtg/thermal.log

6

Odp: pomocy z MRTG

A jakie powinny być końce lini?
Wpisałem w plik na sztywno wartości i działa, ze skryptu niestety nie

pozdrawiam