On 6/30/05, Adam Majer <[EMAIL PROTECTED]> wrote:
> 
> Thanks. I'll add it to the next upload but mrtg will not start as a
> daemon by default. 

If you want, it will be easy to add a check to the script along the lines of:

if [ -z "`grep 'RunAsDaemon: Yes' $CFG | grep -v '#'`" ]; then
        echo "Not configured to run as a daemon, exiting."
        exit 0
fi

The above is pretty crude and I can think of at least a couple of ways
to break it.
It would be better to use sed, but I know little about it
unfortunately. Basically I need the following to make it work nicely:

1) Extract all 'RunAsDaemon' lines from config file.
2) Find a line that does not contain a '#' before the 'RunAsDaemon'.
3) If not found, then exit.

I've spent the last few hours poking at it, but I did not get anywhere. :-(

> I have had it running for a long while now as a part
> of cron and it works perfectly. I guess it might be different if you are
> monitoring 1000s of servers.

There is more than one way to skin a cat. ;-)


.George.

Reply via email to