how do i add members to a nagios_hostgroup?

8 views
Skip to first unread message

Krystle

unread,
Jun 23, 2014, 11:40:40 AM6/23/14
to puppe...@googlegroups.com

hi!

I have no idea why i can't get this to work. i'm using puppet to automatically add nodes to my nagios server. So far i can add the nodes as hosts and add the services just fine (with a workaround with permissions). But when i try to add a host to a host group, i'm only seeing it being defined in the host.cfg definition not in the hostgroup.cfg file as a member. The host group got created but there are not members in the cfg file.

Here is the current definition. which i know currently works as it should, where it adds the host group name in the host definition. I've fiddled with these configs a bunch to try and get the member added but just can't figure it out. Any help would be AMAZING!

my puppet configs are:

Server side-

class nagios_server::import{

Nagioshost <<||>>{ require => Class['nagiosserver::install'], notify => File['hosts'] }

Nagiosservice <<||>>{ require => Class['nagiosserver::install'], notify => File['services'] }

Nagioshostgroup {require => Class['nagiosserver::install'], notify => File['hostgroups'],}

nagios_hostgroup { "all-hosts": target => "/etc/nagios3/objects/hostgroups/all-hosts.cfg", notify => File['hostgroups'], }

}


client side-

class nagios_client::targets {

@@nagios_host { $fqdn:

ensure => present,

alias => $hostname, address => $ipaddress,

use => "linux-server",

hostgroups => "all-hosts",

target => "/etc/nagios3/objects/hosts/${::hostname}.cfg",

}

@@nagiosservice { "checkping${hostname}":

checkcommand => "checkping!100.0,20%!500.0,60%",

use => "generic-service", hostname => "$fqdn",

notificationperiod => "24x7",

servicedescription => "PING",

target => "/etc/nagios3/objects/services/ping.cfg", }

}


I've tried doing 

   @@nagios_hostgroup {

        "all-hosts":

        target => "/etc/nagios3/objects/hostgroups/all-hosts.cfg",

        members => $hostname,

}


but that didn't work.  





Reply all
Reply to author
Forward
0 new messages