neillturner / nagios Goto Github PK
View Code? Open in Web Editor NEWInstall and configure nagios to work with puppetmaster with stored configs
Install and configure nagios to work with puppetmaster with stored configs
Overview ======== The creates nagios server and clients that will interact with a puppetmaster be added automatically to the nagios server. You must have a puppetmaster installed with stored configs setup. It uses the puppet nagios export commands. This works on Centos 64 bit. With need changes for other platforms. To define a server: class { 'nagios': } class { 'nagios::server': require => Class['nagios'] } On a client: 1. Use a nrpe module like pdxcat-nrpe, http://forge.puppetlabs.com/pdxcat/nrpe, to install nrpe on all clients including the nagios server class { 'nrpe': allowed_hosts => ['127.0.0.1', 'monitor.pibenchmark.com'], require => Class['ntp'] } 2. Change the nrpe.cfg to have the required commands installed (probably a cleaner way to do this) a. edit the file nrpe.cfg and change allowed_hosts=127.0.0.1 to #allowed_hosts=127.0.0.1 allowed_hosts=127.0.0.1,99.99.99.99 where 99.99.99.99is the nagios ip address b. replace the nrpe.cfg with this new file exec { 'save old nrpe.cfg': command => "cp -f nrpe.cfg nrpe.cfg.old", cwd => "/etc/nagios", require => Class['nrpe'] } # npre config file file {'new nrpe.cfg': ensure => present, path => '/etc/nagios/nrpe.cfg.new', source => 'puppet:///modules/nagios/nrpe.cfg', require => Exec['save old nrpe.cfg'] } exec { 'move nrpe.cfg': command => "mv -f nrpe.cfg.new nrpe.cfg", cwd => "/etc/nagios", require => File['new nrpe.cfg'] } c. restart the nrpe service exec { 'restart the nrpe service': command => "service nrpe restart", cwd => "/tmp", require => Exec['move nrpe.cfg'] } 3. Export the client host to puppet so it will be added automatically to the nagios server. class { 'nagios::export' : require => Exec['restart the nrpe service'] } Once this is working add additional checks for services etc. Based on http://www.allgoodbits.org/articles/view/31 http://www.allgoodbits.org/articles/view/32 DEBUGGING To debug nagios config file errors run nagios -v /etc/nagios/nagios.cfg To test that the nrpe is running commands run on the nagios server /usr/lib64/nagios/plugins/check_nrpe -H client.example.com -c check_load where client.example.com is the client hostname
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.