[mrtg] Passing arguments to host template

Dunc dunc.lockwood at thebunker.net
Tue Aug 25 15:51:14 CEST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Daniel J McDonald wrote:
> On Tue, 2009-08-25 at 11:28 +0100, Dunc wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> 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};

Hiya Daniel,

Works like a charm, thanks very much for your help again.

Cheers,

Dunc


- --
Duncan Lockwood
Network Team Leader

The Bunker Secure Hosting Limited
Ash Radar Station
Marshborough Road
Sandwich
Kent CT13 0PL
UNITED KINGDOM

t: 01304 814 800
f: 01304 814 899
e: dunc at thebunker.net
w: www.thebunker.net
PGP on Key Servers
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqT7FEACgkQOZKi9YO9TB7kUwCePDDHOpMryMe27ZHJLXfBIIl7
yP8AnRCEGn1XkGJvnPV5J4HxlWO3q/o2
=crCq
-----END PGP SIGNATURE-----



More information about the mrtg mailing list