On 20 February 2013 21:39, Sans <r.santanu....@gmail.com> wrote:

> Hi Pete, how you doing?
>
>
>
>> You will get duplication if you declare a nagioshost_group with the same
>> name on more than one node...
>> I think you may be missing the point of nagios_hostgroup. It is for
>> declaring a hostgroup in nagios not setting the nagios hostgroup for a node.
>>
>
> Yes, I know that I'll get duplication error for obvious reason and that's
> the whole reason for asking this Q. I know what the "hostgroup" is for
> (using Nagios for a while now) and I'm not trying to setting up hostgroup
> for a node. Perhaps I wasn't clear with my question.
>

Ok sorry for my confusion.


>> I am guessing you are trying to add a node to a hostgroup?
>> You will need to add a hostgroups parameter to your nagios_host
>> declaration and set the hostgroup for the node there.
>>
>
> No - I'm not trying to "add a  node to hostgroup" but I was trying to
> figure out a way to declare a "hostgroup" only after at least one  member
> of that particular comes online.  Suppose, I've three nodes - N1, N2, N3
> and two  hostgroups - HG1 and HG2. N1 (which is Nagios-server) is being in
> HG1 and N2 & N3 in HG2.
>

Yep I get you now.
You could possibly check if it's defined before re defining it.
If it wasn't an exported resource it might be easier but not sure how to
achieve that when realizing exported resources. Tags may help.

I just put my hostgroup definitons in a separate class and then set the
hostgroups on each host.
I do end up with empty ones that way though.


>
>
>> I am also reasonably sure you can have empty hostgroups in nagios...
>>
>
> Yes you can (overlooked that point, really) until a service
> (nagios_service type) is defined. I think, my actual question would be, how
> can I query if a host with certain name (property) is up and only include
> that service if the node count is at least one or more. I think I can
> export some sort of resource from a given host and collect it on the master
> (my Nagios server is co-located with Puppet master)? Any idea what might be
> the best possible way of doing that? cheers!!
>

You may have to resort to querying puppetdb if you use it or your config
store database (puppetdb is easier to query from what I have seen).
I haven't needed to do anything like that but I have seen mention of at
least one tool for doing puppetdb queries posted on the list.

Good luck!

Pete.

>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To post to this group, send email to puppet-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to