Subject: Template a service

From: Rus Foster <[email-masked]>
Date: Sun, 7 May 2006 17:31:19 +0100 (BST)

I've got a number of servers that are running exactly the same service and 
I'm trying to work out a way of templating it so I could do something like

Template "Server" { 
                     Service TCP/SSH
                     Service Ping
                     Service TCP/SMTP
                     Service UDP/DNS
                     Service TCP/HTTP
}

Group "servers2" {
	Group "192.168.0.1" 
		{
		Template Server 
   	 	hostname 192.168.0.1
		}
}

Is this doable or will I have to write a script to do it?

-- 
e: [email-masked] : t: 01635 281120 | google: [email-masked]
Unix Admin work from £40/hour or $75/hour
http://www.a2b2.com - UK and US Dedicated and Virtual servers 
http://www.bofhcast.com - Music and Webhosting news podcast
http://www.vpsforums.com - Discuss your VPS provider and software

---

From: "Frithiof Jensen \(AH/LMD\)" <[email-masked]>
Date: Mon, 8 May 2006 09:59:00 +0200

> -----Original Message-----
> From: [email-masked] 
> [mailto:[email-masked]] On Behalf Of Rus Foster
> Sent: 7. maj 2006 18:31
> To: [email-masked]
> Subject: Template a service
> 
> I've got a number of servers that are running exactly the 
> same service and I'm trying to work out a way of templating 
> it so I could do something like
> 
> Template "Server" { 
>                      Service TCP/SSH
>                      Service Ping
>                      Service TCP/SMTP
>                      Service UDP/DNS
>                      Service TCP/HTTP
> }
> 
> Group "servers2" {
> 	Group "192.168.0.1" 
> 		{
> 		Template Server 
>    	 	hostname 192.168.0.1
> 		}
> }
> 

Doable! 

I did it by using the #include directive to include files, each
containing a template. The template should be located on a separate path
from Argus's default directory or it will be pulled in on the top level.

PS:

I.M.O. it might be well worth scripting it anyway - in my experience it
quickly becomes very tedious and boring work to coordinate Argus and
Cacti configurations with what happens in DNS.

Mvh,
Frithiof Jensen B.Sc. E.E.
System Developer
Ericsson Telebit A/S
+45 4072 6554
[email-masked]

---

From: Jeff Weisberg <[email-masked]>
Date: Mon, 8 May 2006 21:31:39 -0400 (EDT)

| I've got a number of servers that are running exactly the same service and 
| I'm trying to work out a way of templating it so I could do something like

I usually do something like:

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

as long as the config file is executable,
argus will invoke the specified preprocessor.