[mrtg] Passing arguments to host template

Daniel J McDonald dan.mcdonald at austinenergy.com
Tue Aug 25 13:35:12 CEST 2009

On Tue, 2009-08-25 at 11:28 +0100, Dunc wrote:
> Hash: SHA1
> Hi everyone,
> I've been getting into host templates quite a lot and it's working well,
> but I've just come across a problem where I really need to pass an
> argument into the host template script which is a path to a config file.
> I was hoping I could just put it after the script name as part of the
> "--host-template=" option but this doesn't work.
> Is there an easy way to pass arguments in?

use an $ENV variable.

CMKR_FOO='stuff'; export CMKR_FOO; cfgmaker ...

then refer to it as $ENV{CMKR_FOO};

Daniel J McDonald, CCIE # 2495, CISSP # 78281, CNX

More information about the mrtg mailing list