Subject: Re: Using Prog

From: Jeff Weisberg <[email-masked]>
Date: Sat, 17 Jan 2004 18:05:31 -0500 (EST)

| Is there a simple what to pass the host name to a 'prog:' line?
| 
| Looking to have a series of servers that all run certain Unix scripts, and don't wish to c
| ontinually have to type in something like
| 
| prog :
| {
| command : somescript.sh hostname
| }
| 
| Therefore is it possible to do something like
| 
| prog:
| {
|   command : somescript.sh %HOST
| }
| where %HOST passes in the host name variable for the server's entry.
| 
| This what I can easily add in more servers, and only have to change the server's name in o
| ne location, not several.

well, no, but...

many sites with large/complex config files generate the config files
using a script (or several)

also, in the development code[1], argus can automatically run a preprocessor
over the config file, so you could do:

  >  #!/usr/bin/m4
  >  
  >  define(Std_Server, `Host "$1" {
  >  	     Service Ping
  >  	     Service TCP/HTTP
  >  	     Service Prog {
  >  		     command: somescript.pl $1
  >  	     }
  >  }')
  >  
  >  Std_Server( server1.example.com )
  >  Std_Server( server2.example.com )
  >  Std_Server( server3.example.com )

see the file 'examples/config-generate' in the dev tarball
for other examples.

	--jeff

[1] and being development code, the feature may change
    before it is released