fuel-library/deployment/puppet/zabbix/manifests/monitoring/rabbitmq_mon.pp
Stanislaw Bogatkin 9ea83a7d15 Separate zabbix top-scope role
* Move zabbix role out of legcay/cluster_ha manifests.
* Update tasks.yaml accordingly.
* Update existing classes to work properly with new task.

Change-Id: I50dd06bd7432d7d8ea5fd05ee64c84ee3628a918
Partial-blueprint: fuel-library-modularization
2015-02-02 14:59:47 +00:00

52 lines
1.7 KiB
Puppet

class zabbix::monitoring::rabbitmq_mon {
include zabbix::params
if hiera("deployment_mode") == "multinode" {
$template = "Template App OpenStack RabbitMQ"
} else {
$template = "Template App OpenStack HA RabbitMQ"
}
#RabbitMQ server
if defined(Class['::rabbitmq']) {
zabbix_template_link { "$zabbix::params::host_name Template App OpenStack RabbitMQ":
host => $zabbix::params::host_name,
template => $template,
api => $zabbix::params::api_hash,
}
Package['rabbitmq-server'] ->
Exec['enable rabbitmq management plugin'] ->
Service['rabbitmq-server']
exec { 'enable rabbitmq management plugin':
command => 'rabbitmq-plugins enable rabbitmq_management',
path => ['/usr/sbin', '/usr/bin', '/sbin', '/bin' ],
unless => 'rabbitmq-plugins list -m -E rabbitmq_management | grep -q rabbitmq_management',
environment => "HOME=/root",
notify => Service['rabbitmq-server']
}
firewall {'992 rabbitmq management':
port => 55672,
proto => 'tcp',
action => 'accept',
}
zabbix::agent::userparameter {
'rabbitmq.queue.items':
command => "/etc/zabbix/scripts/check_rabbit.py queues-items";
'rabbitmq.queues.without.consumers':
command => "/etc/zabbix/scripts/check_rabbit.py queues-without-consumers";
'rabbitmq.missing.nodes':
command => "/etc/zabbix/scripts/check_rabbit.py missing-nodes";
'rabbitmq.unmirror.queues':
command => "/etc/zabbix/scripts/check_rabbit.py unmirror-queues";
'rabbitmq.missing.queues':
command => "/etc/zabbix/scripts/check_rabbit.py missing-queues";
}
}
}