[mrtg] log file becoming logfile.old each time i run mrtg

Alec.Barea at sita.int Alec.Barea at sita.int
Thu Feb 1 23:17:32 MET 2001






Hello there,

I have a problem, each time i run mrtg it  renames the logfile.log logfile.old
and creates a new logfile.log. So i'm having hard times getting something on my
graph...
Here's what i do:

I have a cron script that parses some log file to output some numbers, in this
script, at the end, i have the line that launches mrtg :

---other things---
/usr/local/mrtg-2/bin/mrtg /home/dnssup/stats/ns2/mrtg.cfg
---end of file---

My /home/dnssup/stats/ns2/mrtg.cfg file looks like this :

---Start of /home/dnssup/stats/ns2/mrtg.cfg---

# Created by
# ./cfgmaker --global 'WorkDir: /tmp' --global 'Options[_]: bits,growright'
--output /tmp/mrtg.cfg community at router.abc.xyz

WorkDir: /home/sites/home/web/mrtg/

Target[nqueries.ns2]: `/home/dnssup/stats/ns2/ns2-stats.mrtg`
AbsMax[nqueries.ns2]: 100000
Options[nqueries.ns2]: gauge,integer,growright,noinfo,nopercent
WithPeak[nqueries.ns2]: wym
MaxBytes[nqueries.ns2]: 100000
Title[nqueries.ns2]: Number of DNS queries per day on ns2
PageTop[nqueries.ns2]:
Suppress[nqueries.ns2]: d
#Interval: 1440
kMG[nqueries.ns2]: ,,,,,
YLegend[nqueries.ns2]: DNS queries/day
ShortLegend[nqueries.ns2]: queries/day
Legend1[nqueries.ns2]: Number of DNS queries per day
Legend2[nqueries.ns2]:
Legend3[nqueries.ns2]:
Legend4[nqueries.ns2]:
LegendI[nqueries.ns2]::
LegendO[nqueries.ns2]:
YSize[nqueries.ns2]:400
YTics[nqueries.ns2]: 10


######################################################################
# System:
# Description:
# Contact:
# Location:
######################################################################


---End of /home/dnssup/stats/ns2/mrtg.cfg---


As you can guess i'm monitoring the number of DNS queries per day on my DNS
servers.

The script i use in the "Target" option is this one :

---Start of /home/dnssup/stats/ns2/ns2-stats.mrtg---
#!/bin/sh

tail -1 num-queries.stat | awk '{ print $1}'; echo -e "0 \na very long time...
\nthe DNS service"
---End of /home/dnssup/stats/ns2/ns2-stats.mrtg---



Ok, this is the thing. It works if you consider that mrtg gets the number every
day and puts it in the log file, my only problem is that before doing that he's
renaming the log
file of the previous day to .old and creating a new .log with the new values...I
 end up with log files with only 1 line, different every day, so no
graphs...Please help, i don't
understand why mrtg is behaving like that...


Regards,

Alec Barea



--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list