[mrtg] Re: Dumb Question about user-written scripts.
Martin Ansdell-Smith
mas at ansdell.demon.co.uk
Wed Jul 7 07:28:55 MEST 1999
You've already had a reply to this, but I'll add:
On Tue, 6 Jul 1999, Ted Bruyere wrote:
> One: I have seen from my journey through the contrib dir, that the
> apparent output that is required from a script is either text to stdout in
> the form
>
> low_number
> high_number
> name
>
> or
>
> low_number
> avg_number
> high_number
> name
>
> I can't find anywhere that tells me this explicitly, but I believe I've
> seen scripts that do each.
The documentation (and what I've used without problem) states
variable 1
variable 2
uptime
name
with the latter two not essential (see doc/config.txt) for scripts that
run as targets (scripts that populate a log file would, of course, be
quite different.
>
> Question 2 is that I have written a script, it returns low/avg/high/name
> to sdout (and I've also tried low/high/name) and also logs to
> /usr/local/log/ dir, so I can see what happens.
>
> Well I can run the script fine by hand, but when I give the target
>
> Target[bombshelter.ca.cpuload]: '/usr/local/bin/perl /usr/local/bin/cpuload'
>
> or
>
> Target[bombshelter.ca.cpuload]: '/usr/local/bin/cpuload'
>
If you're running this on Linux, for example, then the quotes are not what
you want. 'xxxxx' returns the literal xxxxx, `xxxxx` runs the program
named xxxxx and returns the result, which is what you want here. Again,
doc/config.txt explains this use of backticks (around line 232 in the
2.7.5 version).
Hope that helps
Martin
--
Martin Ansdell-Smith
Network Analyst http://www.ansdell.demon.co.uk/
--
* 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