Adding Nagios Support
This commit adds an option to install Nagios to monitor the openstack components. Initially we are only monitoring a small subset of what could eventually be monitored http://bugzilla.redhat.com/show_bug.cgi?id=912768 Change-Id: I176876e5ecc35e7c58ef49534341939fd7998701
This commit is contained in:
		
							
								
								
									
										41
									
								
								packstack/puppet/templates/nagios_nrpe.pp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								packstack/puppet/templates/nagios_nrpe.pp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,41 @@
 | 
			
		||||
package{'nrpe':
 | 
			
		||||
    ensure => present,
 | 
			
		||||
    before => Class['nagios_configs']
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class nagios_configs(){
 | 
			
		||||
 | 
			
		||||
    file_line{'allowed_hosts':
 | 
			
		||||
        path => '/etc/nagios/nrpe.cfg',
 | 
			
		||||
        match => 'allowed_hosts=',
 | 
			
		||||
        line => 'allowed_hosts=%(CONFIG_NAGIOS_HOST)s',
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    # 5 minute load average
 | 
			
		||||
    file_line{'load5':
 | 
			
		||||
        path => '/etc/nagios/nrpe.cfg',
 | 
			
		||||
        match => 'command\[load5\]=',
 | 
			
		||||
        line => 'command[load5]=cut /proc/loadavg -f 1 -d " "',
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    # disk used on /var
 | 
			
		||||
    file_line{'df_var':
 | 
			
		||||
        path => '/etc/nagios/nrpe.cfg',
 | 
			
		||||
        match => "command\[df_var\]=",
 | 
			
		||||
        line => "command[df_var]=df /var/ | sed -re 's/.* ([0-9]+)%%.*/\\1/' | grep -E '^[0-9]'",
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
class{'nagios_configs':
 | 
			
		||||
    notify => Service['nrpe'],
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
service{'nrpe': 
 | 
			
		||||
    ensure => running,
 | 
			
		||||
    hasstatus => true,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
firewall { '001 nrpe incoming':
 | 
			
		||||
    proto    => 'tcp',
 | 
			
		||||
    dport    => ['5666'],
 | 
			
		||||
    action   => 'accept',
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user