Hi there, I''m writing a manifests for some Nagios check, like this: nagios_service { ''check_http_test.salesforce.com'':> use => ''generic-service'', > check_command => ''remote-nrpe-tcp-check!test.salesforce.com!443'', > service_description => ''CON: test.salesforce'', > display_name => ''Connection check: test.salesforce.com:443'', > servicegroups => ''cloud'', > hostgroup_name => ''cloud-app'', > } >There are almost 30 of them and the the only difference between the checks are that hostname and port number. Is there anyway to automate this process, instead of specifying these 30 times statically? I was thinking putting those values in an array and loop through it to generate the resultant "nagios_service.cfg". How can I do that? Cheers!! -- 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+unsubscribe@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.
Peter Brown
2013-Feb-15 00:17 UTC
Re: [Puppet Users] Automating nagios_service resource type
I found this a while ago to so I wrote a module to do it easily. It''s on the forge here. https://forge.puppetlabs.com/rendhalver/monitoring I also have an nrpe module which may help here https://forge.puppetlabs.com/rendhalver/nrpe On 15 February 2013 10:15, Sans <r.santanu.das@gmail.com> wrote:> Hi there, > > I''m writing a manifests for some Nagios check, like this: > > > nagios_service { ''check_http_test.salesforce.com'': >> use => ''generic-service'', >> check_command => ''remote-nrpe-tcp-check!test.salesforce.com >> !443'', >> service_description => ''CON: test.salesforce'', >> display_name => ''Connection check: test.salesforce.com:443'', >> servicegroups => ''cloud'', >> hostgroup_name => ''cloud-app'', >> } >> > > > There are almost 30 of them and the the only difference between the checks > are that hostname and port number. Is there anyway to automate this > process, instead of specifying these 30 times statically? I was thinking > putting those values in an array and loop through it to generate the > resultant "nagios_service.cfg". How can I do that? Cheers!! > > > -- > 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+unsubscribe@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+unsubscribe@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.
Thanks Pete, for the heads-up! I''m gonna give it a try now. Cheers!! On Friday, February 15, 2013 12:17:49 AM UTC, Pete wrote:> > I found this a while ago to so I wrote a module to do it easily. > It''s on the forge here. https://forge.puppetlabs.com/rendhalver/monitoring > I also have an nrpe module which may help here > https://forge.puppetlabs.com/rendhalver/nrpe > >-- 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+unsubscribe@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.
Peter Brown
2013-Feb-15 00:56 UTC
Re: [Puppet Users] Automating nagios_service resource type
On 15 February 2013 10:49, Sans <r.santanu.das@gmail.com> wrote:> Thanks Pete, for the heads-up! > I''m gonna give it a try now. Cheers!!Awesome! I do admit the docs are a bit sparse but I have tried to name everything with sensible descriptive names. If you get stuck, find a bug or would like a new feature give me a shout. I use github for my code so you can also submit a bug there if you like so I can keep track of it. I do use it in my infrastructure and it gets updated when I fix things. I do also test the crap out of it before I push it to forge so that is the best version to use. Good luck!. Pete.> > > > > On Friday, February 15, 2013 12:17:49 AM UTC, Pete wrote: >> >> I found this a while ago to so I wrote a module to do it easily. >> It''s on the forge here. https://forge.**puppetlabs.com/rendhalver/** >> monitoring <https://forge.puppetlabs.com/rendhalver/monitoring> >> I also have an nrpe module which may help here https://forge.puppetlabs.* >> *com/rendhalver/nrpe <https://forge.puppetlabs.com/rendhalver/nrpe> >> >> -- > 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+unsubscribe@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+unsubscribe@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.
William Van Hevelingen
2013-Feb-15 01:15 UTC
Re: [Puppet Users] Automating nagios_service resource type
Is there a reason your not using exported nagios resources instead? http://docs.puppetlabs.com/guides/exported_resources.html We''re using it in production and it works quite well with puppetdb as the backend. William On Thu, Feb 14, 2013 at 4:56 PM, Peter Brown <rendhalver@gmail.com> wrote:> On 15 February 2013 10:49, Sans <r.santanu.das@gmail.com> wrote: > >> Thanks Pete, for the heads-up! >> I''m gonna give it a try now. Cheers!! > > > Awesome! > I do admit the docs are a bit sparse but I have tried to name everything > with sensible descriptive names. > If you get stuck, find a bug or would like a new feature give me a shout. > I use github for my code so you can also submit a bug there if you like so > I can keep track of it. > > I do use it in my infrastructure and it gets updated when I fix things. > I do also test the crap out of it before I push it to forge so that is the > best version to use. > > Good luck!. > > Pete. > > >> >> >> >> >> On Friday, February 15, 2013 12:17:49 AM UTC, Pete wrote: >>> >>> I found this a while ago to so I wrote a module to do it easily. >>> It''s on the forge here. https://forge.**puppetlabs.com/rendhalver/** >>> monitoring <https://forge.puppetlabs.com/rendhalver/monitoring> >>> I also have an nrpe module which may help here https://forge.puppetlabs. >>> **com/rendhalver/nrpe <https://forge.puppetlabs.com/rendhalver/nrpe> >>> >>> -- >> 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+unsubscribe@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+unsubscribe@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. > > >-- Thanks, William -- 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+unsubscribe@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.
Peter Brown
2013-Feb-15 01:50 UTC
Re: [Puppet Users] Automating nagios_service resource type
On 15 February 2013 11:15, William Van Hevelingen <wvan13@gmail.com> wrote:> Is there a reason your not using exported nagios resources instead? >Are you asking me or the OP? I use exported resources extensively in my monitoring modules.> > http://docs.puppetlabs.com/guides/exported_resources.html > > We''re using it in production and it works quite well with puppetdb as the > backend. > > William > > > > On Thu, Feb 14, 2013 at 4:56 PM, Peter Brown <rendhalver@gmail.com> wrote: > >> On 15 February 2013 10:49, Sans <r.santanu.das@gmail.com> wrote: >> >>> Thanks Pete, for the heads-up! >>> I''m gonna give it a try now. Cheers!! >> >> >> Awesome! >> I do admit the docs are a bit sparse but I have tried to name everything >> with sensible descriptive names. >> If you get stuck, find a bug or would like a new feature give me a shout. >> I use github for my code so you can also submit a bug there if you like >> so I can keep track of it. >> >> I do use it in my infrastructure and it gets updated when I fix things. >> I do also test the crap out of it before I push it to forge so that is >> the best version to use. >> >> Good luck!. >> >> Pete. >> >> >>> >>> >>> >>> >>> On Friday, February 15, 2013 12:17:49 AM UTC, Pete wrote: >>>> >>>> I found this a while ago to so I wrote a module to do it easily. >>>> It''s on the forge here. https://forge.**puppetlabs.com/rendhalver/** >>>> monitoring <https://forge.puppetlabs.com/rendhalver/monitoring> >>>> I also have an nrpe module which may help here >>>> https://forge.puppetlabs.**com/rendhalver/nrpe<https://forge.puppetlabs.com/rendhalver/nrpe> >>>> >>>> -- >>> 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+unsubscribe@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+unsubscribe@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. >> >> >> > > > > -- > Thanks, > William > > -- > 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+unsubscribe@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+unsubscribe@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.
I''m also using Exported-resource in my module and, if I understood correctly, I still need to loop through the same sort values, e.g. addr1 port1 addr2 port2 ..... on the same host to construct the checks. My understanding of storeconfig, it works pretty well for collecting similar type of values from different hosts. Is it possible to put together a few lines code for reference? Cheers!! On Friday, February 15, 2013 1:15:22 AM UTC, blkperl wrote:> > Is there a reason your not using exported nagios resources instead? > > http://docs.puppetlabs.com/guides/exported_resources.html > > We''re using it in production and it works quite well with puppetdb as the > backend. > > William >-- 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+unsubscribe@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.