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:
Derek Higgins
2013-02-20 06:25:31 -05:00
parent 76e6de9a61
commit 40fecc1a15
10 changed files with 356 additions and 0 deletions

View 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',
}