Puppet Example42/Nagios Module

96 views
Skip to first unread message

Sergiu Cornea

unread,
Mar 25, 2015, 5:38:19 AM3/25/15
to puppet...@googlegroups.com
Good morning everyone,

I am using Puppet 3.7 and the example42/nagios module. As I am a Puppet newbie I have tried to create hosts using hiera but it doesn't work. I have google it but I am just getting the example42/network module example for hiera.

Could someone guide me into the right direction on how I will go about create a Hiera entry for this module?

Thank you,

Regards,
Sergiu

This message and its attachments are private and confidential. If you have received this message in error, please notify the sender and remove it and its attachments from your system.

The University of Westminster is a charity and a company limited by guarantee. Registration number: 977818 England. Registered Office: 309 Regent Street, London W1B 2UW.

Alessandro Franceschi

unread,
Mar 25, 2015, 7:12:25 AM3/25/15
to puppet...@googlegroups.com
Do you want to add automatically new hosts on Nagios using exported resources or you want to define your hosts "statically" with a bunch of (hiera) data?

Hiera entries for this module are as the ones you may expect from other modules, for each class parameter there's a hiera lookup to the key: $classname::parametername (for example nagios::template to define a custom template for your nagios.cfg)

Finally, if you want to automate your monitoring setup (new hosts are automatically added to the nagios server using Puppet's exported resources) I'd recommend definitively to use Icinga2 instead of Nagios. This allows much easier and more compact management of the exported resources (basically you can just export host resources, and you don't need to export any service check resource)
 
al

Sergiu Cornea

unread,
Mar 25, 2015, 7:25:07 AM3/25/15
to puppet...@googlegroups.com
Hi Al,

Thank you for your answer.

What I am trying to do is as follows:

I have successfully installed Nagios server on CentOS 6.6 using Puppet and example42/nagios module. I have also added a new host with some checks and works like a charm. However I was looking around trying to understand how should I go about when I want to add a host such as localhost.cfg, just by passing the required variables to the Hiera file. I have tried to use nagios::host and nagios::target but doesn't seem to work, all I get it is that the run was successful but nothing has been applied.

Do you think that I should use Icinga2?

Thank you for quick reply and for your answer.

Regards,
Sergiu 

Alessandro Franceschi

unread,
Mar 26, 2015, 11:05:21 AM3/26/15
to puppet...@googlegroups.com
Hi Sergiu,
currently ex42/nagios module has not a dedicated define to add a nagios host objects directly.
It'd quite trivial to do that but currently you can do that, with that module, providing your config file(s) with the host objects you need as plain files (with one or more hosts), or have a small wrapper defines that creates the file for you and is used by the create_resource function feeded by an hash you can have on hiera.

I personally prefer icinga2 nowadays, as it allows me to automate monitoring minimising the number of exported resources (I export only host resources) and managing what services to check on what hosts using Icinga2 apply rules. Your mileage may vary.

Best
al
Reply all
Reply to author
Forward
0 new messages