User defined macros in host, services , templates

Request new features for NConf

User defined macros in host, services , templates

Postby dguenault » Sun Jun 03, 2012 15:29

Hello,
we use a lot of configuration based on host templates linked with service templates. Every commands args are user macros defined in host templates. This way we just have to create a host that inherit one ore more host templates and services are also created. When we need to change a parameter (such as threshold) we just have to create a host macros that overide the one from the host template.

My problem is that nconf does not seem to support user defined macros neither in host, host templates or anywhere else.

I understant that it is easy to alter the host and host template classes and create new attributes corresponding to macros but i do not want to have to define every single macros in just one template.

Do you think there is a way to workaround ?

Thx
David

here is a sample of how we configure

Code: Select all
define command {
       command_name     check_aix_load
       command_line     $PLUGINSDIR$/check_snmp_load.pl -H $HOSTADDRESS$ -C $_HOSTSNMPCOMMUNITY$ -f -w $_HOSTLOAD_WARN$ -c $_HOSTLOAD_CRIT$ -T netsl
}

define command {
        command_name     check_aix_disks
        command_line  $PLUGINSDIR$/check_snmp_storage.pl -H $HOSTADDRESS$ -C $_HOSTSNMPCOMMUNITY$ -m / -f -w $_HOSTSTORAGE_WARN$ -c $_HOSTSTORAGE_CRIT$ -S0,1
}

define command {
        command_name     check_aix_cpu
        command_line     $PLUGINSDIR$/check_snmp_load.pl -H $HOSTADDRESS$ -C $_HOSTSNMPCOMMUNITY$ -f -w $_HOSTCPU_WARN$ -c $_HOSTCPU_CRIT$
}

define command {
        command_name     check_aix_memory
        command_line     $PLUGINSDIR$/check_snmp_mem.pl -H $HOSTADDRESS$ -C $_HOSTSNMPCOMMUNITY$ -f -w $_HOSTMEMORY_WARN$ -c $_HOSTMEMORY_CRIT$
 }

define service{
   service_description    Cpu
   use                 generic-service
   register            0
   host_name          aix
   check_command       check_aix_cpu
}
define service{
   service_description    Disks
   use            generic-service
   register       0
   host_name     aix
   check_command  check_aix_disks
}
define service{
   service_description    Load
   use            generic-service
   register       0
   host_name     aix
   check_command  check_aix_load
}
define service{
   service_description    Memory
   use                 generic-service
   register            0
   host_name          aix
   check_command       check_aix_memory
}

# The AIX template.
define host{
   name            aix
   use            generic-host
   check_command              check_ping
   register         0

   _SNMPCOMMUNITY      $SNMPCOMMUNITYREAD$

   _LOAD_WARN                   2,2,2
   _LOAD_CRIT                   3,3,3
   _STORAGE_WARN                90
   _STORAGE_CRIT                95
   _CPU_WARN                    80
   _CPU_CRIT                    90
   _MEMORY_WARN                 90,20
   _MEMORY_CRIT                 95,50
}

define host {
  use aix
  name my-aix-server-1
  address 10.10.10.1
  _STORAGE_WARN  95
  _STORAGE_CRIT 98
}

dguenault
starter
starter
 
Posts: 1
Joined: Sun Jun 03, 2012 15:06

Return to Feature requests

Who is online

Users browsing this forum: No registered users and 1 guest

cron