Espen S
2011-Mar-17 15:12 UTC
[Puppet Users] Can pPuppet add text to file dependent on class the node is in.
Hi I''ve just started working on puppet and there''s one problem i''m looking for a solution for. We use snmp to monitor our servers and snmpd.conf is dependent of what kind of services and and mountpoints each server has. So here''s what I want. We have a snmpd.conf file which is similar on all servers. It just defines where to send the snmptraps and other general setting. Then I want all mountpoints added dynamically to snmpd.local.conf, to show when we''re low on space. In the same file I want all important processes added as well, dependant on which class they''re inherited. So for example if they''re in a class called webserver, "proc httpd" should be added to that file. So far I''ve gotten to copy the file to each server and added a script to facter which is able to find each mountpoints. But now I''m kind of stuck. Is what I want possible to do i puppet? Or is there a better solution for this? Hope you can give me an answer to this. Regards Espen -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Luke Bigum
2011-Mar-17 17:17 UTC
[Puppet Users] Re: Can pPuppet add text to file dependent on class the node is in.
Hi Espen, Look at R.I.P''s Concat module: https://github.com/ripienaar/puppet-concat It is perfect for what you want to do - I''ve used it before for this exact purpose. You just have snmpd.conf file fragments for every bit of monitoring you want (Apache, MySQL performance, root disk, var disk, home disk, etc) and add fragments based on your server types. You could also use facter to auto detect your partitions and add the right disk checks. -Luke On Mar 17, 3:12 pm, Espen S <espe...@gmail.com> wrote:> Hi > > I''ve just started working on puppet and there''s one problem i''m > looking for a solution for. We use snmp to monitor our servers and > snmpd.conf is dependent of what kind of services and and mountpoints > each server has. > > So here''s what I want. We have a snmpd.conf file which is similar on > all servers. It just defines where to send the snmptraps and other > general setting. Then I want all mountpoints added dynamically to > snmpd.local.conf, to show when we''re low on space. In the same file I > want all important processes added as well, dependant on which class > they''re inherited. So for example if they''re in a class called > webserver, "proc httpd" should be added to that file. > > So far I''ve gotten to copy the file to each server and added a script > to facter which is able to find each mountpoints. But now I''m kind of > stuck. Is what I want possible to do i puppet? Or is there a better > solution for this? > > Hope you can give me an answer to this. > > Regards > Espen-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.