[mrtg] Re: monitor of the temperature

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Thu Sep 9 17:44:17 MEST 1999

Let's try that again:

> > > I want to monitor the temperature of the machine by using mrtg_2.5.1.
> > > But I failed to do it.
> > > I have a perl script "temp.pl" which gives us the output of the temperat
> > > ure as 
> > > the format of "(temperature)\n\n\n\n".
> > 
> > I'm not sure if you should have two numbers. First try the stuff mentioned
> > below, if it still fails try "(temp)\n0\n\n\n"
> > When run from the command line your output should show up as the following
> > lines, however without quotes:
> > "/usr1/people/yamada$ ./temp.pl"

This means: From the command prompt on your machine, go into the directory
where your script is placed (i guessed it is /usr1/people/yamada) and execute
the script as follows (without the quotes): "./temp.pl" .

It should return the following lines (again: without the quotes):
> > "42"
> > "0"
> > ""
> > ""

> > > My Mrtg.cfg is as follows.
> > >   
> > > Target[temp]: '/usr1/people/yamada/temp.pl'

This should be back ticks, not "normal" quotes.
At your command prompt, enter the following line (again: leave out the double
quotes):   "echo `./temp.pl`"
If this returns two numbers (probably without a newline) then you have the
right quotes.

> > > MaxBytes[temp]: 
> > 
> > Provide a number for maxbytes or leave the line out.
> > 
You should put a number after "MaxBytes[temp]:" so that it reads, for instance
something like "MaxBytes[temp]: 100" however the number is dependant on what you
actually could get as a maximum.

> > Add a line "Options[temp]: gauge
> > 
> > Try
> > Target[temp]: `/usr1/people/yamada/temp.pl`
> > 
> > Those are backticks (on the same key as the ~)
> > 
This answer was provided by someone else (brian IIRC).

Most keyboards I know do have the backtick and tilde on the same key, this does
not have to be true for your config. Look for a quote that looks like a small
line from upper-left to lower right.

1) Clean up your configuration file and modify as stated above
2) remove any logfiles and/or other files that were made by mrtg
3) run mrtg and make sure that you see its output
3b) Expect to get a failure message about the logfile and the backup log
4) look in the directory, there should be new files, named "temp.log" and
   "temp-day.gif", "temp-week.gif" etcetera.
5) run mrtg again
5b) Expect another failure message about the backup log, not the normal log
6) There should be "temp.log" and "temp.old" + the other files
7) Without much delay, run your script by hand. Remember the numbers.
   View the first line of "temp.log" and compare the second and third number
   with the output of your script. They should be the same or very close.
8) wait 15 minutes
9) repeat step 5,6 and 7 (not step 5b)
10) If all is okay, view the first few lines of "temp.log". They should show
    expected values in the second column.

Try above list and stop when a step fails. If nothing fails, well done. If
something fails try to describe what fails and if you cant figure it out, do
post again.


* To unsubscribe from the mrtg mailing list, send a message with the
  subject: unsubscribe to mrtg-request at list.ee.ethz.ch
* The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg

More information about the mrtg mailing list