Changed yaml files for checks to build with concat
Change-Id: I635920bb4ecb2a35caa33a8709517901e84f797e
This commit is contained in:
parent
55052af810
commit
13ea7d6cd4
|
@ -5,27 +5,36 @@
|
||||||
# === Parameters
|
# === Parameters
|
||||||
#
|
#
|
||||||
# [*instances*]
|
# [*instances*]
|
||||||
# An array of instances for the check.
|
# A hash of instances for the check.
|
||||||
# Each instance should be a hash of the check's parameters.
|
# Each instance should be a hash of the check's parameters.
|
||||||
# Parameters for the apache check are:
|
# Parameters for the apache check are:
|
||||||
|
# name (the instance key): The name of the instance.
|
||||||
# apache_status_url (required)
|
# apache_status_url (required)
|
||||||
# dimensions
|
# dimensions
|
||||||
# e.g.
|
# e.g.
|
||||||
# $instances = [{apache_status_url => 'http://your.server.name/server-status'}]
|
# instances:
|
||||||
|
# server:
|
||||||
|
# apache_status_url: 'http://your.server.name/server-status'
|
||||||
#
|
#
|
||||||
class monasca::checks::apache(
|
class monasca::checks::apache(
|
||||||
$instances = [],
|
$instances = undef,
|
||||||
){
|
){
|
||||||
$conf_dir = $::monasca::agent::conf_dir
|
$conf_dir = $::monasca::agent::conf_dir
|
||||||
|
|
||||||
File["${conf_dir}/apache.yaml"] ~> Service['monasca-agent']
|
if($instances){
|
||||||
|
Concat["${conf_dir}/apache.yaml"] ~> Service['monasca-agent']
|
||||||
file { "${conf_dir}/apache.yaml":
|
concat { "${conf_dir}/apache.yaml":
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => $::monasca::group,
|
group => $::monasca::group,
|
||||||
mode => '0640',
|
mode => '0640',
|
||||||
content => template('monasca/checks/generic.yaml.erb'),
|
warn => true,
|
||||||
require => File[$conf_dir],
|
require => File[$conf_dir],
|
||||||
|
}
|
||||||
|
concat::fragment { 'apache_header':
|
||||||
|
target => "${conf_dir}/apache.yaml",
|
||||||
|
order => '0',
|
||||||
|
content => "---\ninit_config: null\ninstances:\n",
|
||||||
|
}
|
||||||
|
create_resources('monasca::checks::instances::apache', $instances)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -10,35 +10,46 @@
|
||||||
# [*ping_timeout*]
|
# [*ping_timeout*]
|
||||||
# ping_timeout is an integer number of seconds
|
# ping_timeout is an integer number of seconds
|
||||||
# [*instances*]
|
# [*instances*]
|
||||||
# An array of instances for the check.
|
# A hash of instances for the check.
|
||||||
# Each instance should be a hash of the check's parameters.
|
# Each instance should be a hash of the check's parameters.
|
||||||
# Parameters for the host_alive check are:
|
# Parameters for the host_alive check are:
|
||||||
|
# name (the instance key): The name of the instance.
|
||||||
# host_name (required)
|
# host_name (required)
|
||||||
# alive_test (required)
|
# alive_test (required)
|
||||||
# e.g.
|
# e.g.
|
||||||
# $instances = [{host_name => 'somehost.somedomain.net',
|
# instances:
|
||||||
# alive_test => 'ssh'},
|
# host:
|
||||||
# {host_name => 'gateway.somedomain.net',
|
# host_name: 'somehost.somedomain.net'
|
||||||
# alive_test => 'ping'},
|
# alive_test: 'ssh'
|
||||||
# {host_name => '192.168.0.221',
|
# gateway:
|
||||||
# alive_test => 'ssh'}]
|
# host_name: 'gateway.somedomain.net'
|
||||||
|
# alive_test: 'ping'
|
||||||
|
# other:
|
||||||
|
# host_name: '192.168.0.221'
|
||||||
|
# alive_test: 'ssh'
|
||||||
#
|
#
|
||||||
class monasca::checks::host_alive(
|
class monasca::checks::host_alive(
|
||||||
$ssh_port = '22',
|
$ssh_port = '22',
|
||||||
$ssh_timeout = '0.5',
|
$ssh_timeout = '0.5',
|
||||||
$ping_timeout = '1',
|
$ping_timeout = '1',
|
||||||
$instances = [],
|
$instances = undef,
|
||||||
){
|
){
|
||||||
$conf_dir = $::monasca::agent::conf_dir
|
$conf_dir = $::monasca::agent::conf_dir
|
||||||
|
|
||||||
File["${conf_dir}/host_alive.yaml"] ~> Service['monasca-agent']
|
if($instances){
|
||||||
|
Concat["${conf_dir}/host_alive.yaml"] ~> Service['monasca-agent']
|
||||||
file { "${conf_dir}/host_alive.yaml":
|
concat { "${conf_dir}/host_alive.yaml":
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => $::monasca::group,
|
group => $::monasca::group,
|
||||||
mode => '0640',
|
mode => '0640',
|
||||||
content => template('monasca/checks/host_alive.yaml.erb'),
|
warn => true,
|
||||||
require => File[$conf_dir],
|
require => File[$conf_dir],
|
||||||
|
}
|
||||||
|
concat::fragment { 'host_alive_header':
|
||||||
|
target => "${conf_dir}/host_alive.yaml",
|
||||||
|
order => '0',
|
||||||
|
content => template('monasca/checks/host_alive.yaml.erb'),
|
||||||
|
}
|
||||||
|
create_resources('monasca::checks::instances::host_alive', $instances)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -5,9 +5,10 @@
|
||||||
# === Parameters
|
# === Parameters
|
||||||
#
|
#
|
||||||
# [*instances*]
|
# [*instances*]
|
||||||
# An array of instances for the check.
|
# A hash of instances for the check.
|
||||||
# Each instance should be a hash of the check's parameters.
|
# Each instance should be a hash of the check's parameters.
|
||||||
# Parameters for the http_check check are:
|
# Parameters for the http_check check are:
|
||||||
|
# name (the instance key): The name of the instance.
|
||||||
# url (required)
|
# url (required)
|
||||||
# timeout (default = 10)
|
# timeout (default = 10)
|
||||||
# username
|
# username
|
||||||
|
@ -19,26 +20,34 @@
|
||||||
# disable_ssl_validation (default = True)
|
# disable_ssl_validation (default = True)
|
||||||
# dimensions
|
# dimensions
|
||||||
# e.g.
|
# e.g.
|
||||||
# $instances = [{url => 'http://192.168.0.254:8774/v2.0',
|
# instances:
|
||||||
# dimensions => '{service: compute_api}',
|
# nova-api:
|
||||||
# match_pattern => '.*version=2.*',
|
# url: 'http://192.168.0.254:8774/v2.0'
|
||||||
# timeout => '10',
|
# dimensions: '{service: compute_api}'
|
||||||
# use_keystone => 'True',
|
# match_pattern: '.*version=2.*'
|
||||||
# collect_response_time => 'True'}]
|
# timeout: '10'
|
||||||
|
# use_keystone: 'True'
|
||||||
|
# collect_response_time: 'True'
|
||||||
#
|
#
|
||||||
class monasca::checks::http_check(
|
class monasca::checks::http_check(
|
||||||
$instances = [],
|
$instances = undef,
|
||||||
){
|
){
|
||||||
$conf_dir = $::monasca::agent::conf_dir
|
$conf_dir = $::monasca::agent::conf_dir
|
||||||
|
|
||||||
File["${conf_dir}/http_check.yaml"] ~> Service['monasca-agent']
|
if($instances){
|
||||||
|
Concat["${conf_dir}/http_check.yaml"] ~> Service['monasca-agent']
|
||||||
file { "${conf_dir}/http_check.yaml":
|
concat { "${conf_dir}/http_check.yaml":
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => $::monasca::group,
|
group => $::monasca::group,
|
||||||
mode => '0640',
|
mode => '0640',
|
||||||
content => template('monasca/checks/generic.yaml.erb'),
|
warn => true,
|
||||||
require => File[$conf_dir],
|
require => File[$conf_dir],
|
||||||
|
}
|
||||||
|
concat::fragment { 'http_check_header':
|
||||||
|
target => "${conf_dir}/http_check.yaml",
|
||||||
|
order => '0',
|
||||||
|
content => "---\ninit_config: null\ninstances:\n",
|
||||||
|
}
|
||||||
|
create_resources('monasca::checks::instances::http_check', $instances)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
define monasca::checks::instances::apache (
|
||||||
|
$apache_status_url,
|
||||||
|
$dimensions = undef,
|
||||||
|
) {
|
||||||
|
$conf_dir = $::monasca::agent::conf_dir
|
||||||
|
concat::fragment { "${title}_apache_instance":
|
||||||
|
target => "${conf_dir}/apache.yaml",
|
||||||
|
content => template('monasca/checks/apache.erb'),
|
||||||
|
order => '1',
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
define monasca::checks::instances::host_alive (
|
||||||
|
$host_name,
|
||||||
|
$alive_test,
|
||||||
|
) {
|
||||||
|
$conf_dir = $::monasca::agent::conf_dir
|
||||||
|
concat::fragment { "${title}_host_alive_instance":
|
||||||
|
target => "${conf_dir}/host_alive.yaml",
|
||||||
|
content => template('monasca/checks/host_alive.erb'),
|
||||||
|
order => '1',
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
define monasca::checks::instances::http_check (
|
||||||
|
$url,
|
||||||
|
$timeout = undef,
|
||||||
|
$username = undef,
|
||||||
|
$password = undef,
|
||||||
|
$match_pattern = undef,
|
||||||
|
$use_keystone = undef,
|
||||||
|
$collect_response_time = undef,
|
||||||
|
$headers = undef,
|
||||||
|
$disable_ssl_validation = undef,
|
||||||
|
$dimensions = undef,
|
||||||
|
) {
|
||||||
|
$conf_dir = $::monasca::agent::conf_dir
|
||||||
|
concat::fragment { "${title}_http_check_instance":
|
||||||
|
target => "${conf_dir}/http_check.yaml",
|
||||||
|
content => template('monasca/checks/http_check.erb'),
|
||||||
|
order => '1',
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
define monasca::checks::instances::mysql (
|
||||||
|
$server = undef,
|
||||||
|
$user = undef,
|
||||||
|
$port = undef,
|
||||||
|
$pass = undef,
|
||||||
|
$sock = undef,
|
||||||
|
$defaults_file = undef,
|
||||||
|
$dimensions = undef,
|
||||||
|
$options = undef,
|
||||||
|
) {
|
||||||
|
$conf_dir = $::monasca::agent::conf_dir
|
||||||
|
concat::fragment { "${title}_mysql_instance":
|
||||||
|
target => "${conf_dir}/mysql.yaml",
|
||||||
|
content => template('monasca/checks/mysql.erb'),
|
||||||
|
order => '1',
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
define monasca::checks::instances::nagios_wrapper (
|
||||||
|
$check_command,
|
||||||
|
$host_name = undef,
|
||||||
|
$check_interval = undef,
|
||||||
|
$dimensions = undef,
|
||||||
|
) {
|
||||||
|
$conf_dir = $::monasca::agent::conf_dir
|
||||||
|
concat::fragment { "${title}_nagios_wrapper_instance":
|
||||||
|
target => "${conf_dir}/nagios_wrapper.yaml",
|
||||||
|
content => template('monasca/checks/nagios_wrapper.erb'),
|
||||||
|
order => '1',
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
define monasca::checks::instances::network (
|
||||||
|
$collect_connection_state = undef,
|
||||||
|
$excluded_interfaces = undef,
|
||||||
|
$excluded_interface_re = undef,
|
||||||
|
$dimensions = undef,
|
||||||
|
) {
|
||||||
|
$conf_dir = $::monasca::agent::conf_dir
|
||||||
|
concat::fragment { "${title}_network_instance":
|
||||||
|
target => "${conf_dir}/network.yaml",
|
||||||
|
content => template('monasca/checks/network.erb'),
|
||||||
|
order => '1',
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
define monasca::checks::instances::process (
|
||||||
|
$search_string,
|
||||||
|
$exact_match = undef,
|
||||||
|
$cpu_check_interval = undef,
|
||||||
|
$dimensions = undef,
|
||||||
|
) {
|
||||||
|
$conf_dir = $::monasca::agent::conf_dir
|
||||||
|
concat::fragment { "${title}_process_instance":
|
||||||
|
target => "${conf_dir}/process.yaml",
|
||||||
|
content => template('monasca/checks/process.erb'),
|
||||||
|
order => '1',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
define monasca::checks::instances::rabbitmq (
|
||||||
|
$rabbitmq_api_url,
|
||||||
|
$rabbitmq_user = undef,
|
||||||
|
$rabbitmq_pass = undef,
|
||||||
|
$queues = undef,
|
||||||
|
$nodes = undef,
|
||||||
|
$exchanges = undef,
|
||||||
|
$max_detailed_queues = undef,
|
||||||
|
$max_detailed_exchanges = undef,
|
||||||
|
$max_detailed_nodes = undef,
|
||||||
|
$dimensions = undef,
|
||||||
|
) {
|
||||||
|
$conf_dir = $::monasca::agent::conf_dir
|
||||||
|
concat::fragment { "${title}_rabbitmq_instance":
|
||||||
|
target => "${conf_dir}/rabbitmq.yaml",
|
||||||
|
content => template('monasca/checks/rabbitmq.erb'),
|
||||||
|
order => '1',
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
define monasca::checks::instances::zk (
|
||||||
|
$host = undef,
|
||||||
|
$port = undef,
|
||||||
|
$timeout = undef,
|
||||||
|
$dimensions = undef,
|
||||||
|
) {
|
||||||
|
$conf_dir = $::monasca::agent::conf_dir
|
||||||
|
concat::fragment { "${title}_zk_instance":
|
||||||
|
target => "${conf_dir}/zk.yaml",
|
||||||
|
content => template('monasca/checks/zk.erb'),
|
||||||
|
order => '1',
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,9 +5,10 @@
|
||||||
# === Parameters
|
# === Parameters
|
||||||
#
|
#
|
||||||
# [*instances*]
|
# [*instances*]
|
||||||
# An array of instances for the check.
|
# A hash of instances for the check.
|
||||||
# Each instance should be a hash of the check's parameters.
|
# Each instance should be a hash of the check's parameters.
|
||||||
# Parameters for the mysql check are:
|
# Parameters for the mysql check are:
|
||||||
|
# name (the instance key): The name of the instance.
|
||||||
# server
|
# server
|
||||||
# user
|
# user
|
||||||
# port
|
# port
|
||||||
|
@ -17,31 +18,39 @@
|
||||||
# dimensions
|
# dimensions
|
||||||
# options
|
# options
|
||||||
# e.g.
|
# e.g.
|
||||||
# $instances = [{defaults_file => '/root/.my.cnf',
|
# instances:
|
||||||
# server => 'localhost',
|
# local:
|
||||||
# user => 'root'}]
|
# defaults_file: '/root/.my.cnf'
|
||||||
|
# server: 'localhost'
|
||||||
|
# user: 'root'
|
||||||
#
|
#
|
||||||
class monasca::checks::mysql(
|
class monasca::checks::mysql(
|
||||||
$instances = [],
|
$instances = undef,
|
||||||
){
|
){
|
||||||
$conf_dir = $::monasca::agent::conf_dir
|
$conf_dir = $::monasca::agent::conf_dir
|
||||||
$virtual_env = $::monasca::agent::virtual_env
|
$virtual_env = $::monasca::agent::virtual_env
|
||||||
|
|
||||||
File["${conf_dir}/mysql.yaml"] ~> Service['monasca-agent']
|
if($instances){
|
||||||
|
Concat["${conf_dir}/mysql.yaml"] ~> Service['monasca-agent']
|
||||||
file { "${conf_dir}/mysql.yaml":
|
concat { "${conf_dir}/mysql.yaml":
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => $::monasca::group,
|
group => $::monasca::group,
|
||||||
mode => '0640',
|
mode => '0640',
|
||||||
content => template('monasca/checks/generic.yaml.erb'),
|
warn => true,
|
||||||
require => File[$conf_dir],
|
require => File[$conf_dir],
|
||||||
|
}
|
||||||
|
concat::fragment { 'mysql_header':
|
||||||
|
target => "${conf_dir}/mysql.yaml",
|
||||||
|
order => '0',
|
||||||
|
content => "---\ninit_config: null\ninstances:\n",
|
||||||
|
}
|
||||||
|
create_resources('monasca::checks::instances::mysql', $instances)
|
||||||
}
|
}
|
||||||
|
|
||||||
python::pip { 'MySQL-python' :
|
python::pip { 'MySQL-python' :
|
||||||
virtualenv => $::monasca::agent::virtual_env,
|
virtualenv => $virtual_env,
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
require => Python::Virtualenv[$virtual_env],
|
require => Python::Virtualenv[$virtual_env],
|
||||||
before => Service['monasca-agent'],
|
before => Service['monasca-agent'],
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -8,36 +8,43 @@
|
||||||
# [*temp_file_path*]
|
# [*temp_file_path*]
|
||||||
# Where to store last-run timestamps for each check
|
# Where to store last-run timestamps for each check
|
||||||
# [*instances*]
|
# [*instances*]
|
||||||
# An array of instances for the check.
|
# A hash of instances for the check.
|
||||||
# Each instance should be a hash of the check's parameters.
|
# Each instance should be a hash of the check's parameters.
|
||||||
# Parameters for the nagios_wrapper check are:
|
# Parameters for the nagios_wrapper check are:
|
||||||
# name (required)
|
# service_name (the instance key): The name of the instance.
|
||||||
# check_command (required)
|
# check_command (required)
|
||||||
# host_name
|
# host_name
|
||||||
# check_interval
|
# check_interval
|
||||||
# dimensions
|
# dimensions
|
||||||
# e.g.
|
# e.g.
|
||||||
# $instances = [{service_name => 'load',
|
# instances:
|
||||||
# check_command => 'check_load -r -w 2,1.5,1 -c 10,5,4'},
|
# load:
|
||||||
# {service_name => 'disk',
|
# check_command: 'check_load -r -w 2,1.5,1 -c 10,5,4'
|
||||||
# check_command => 'check_disk -w 15\% -c 5\% -A -i /srv/node',
|
# disk:
|
||||||
# check_interval => '300'}]
|
# check_command: 'check_disk -w 15\% -c 5\% -A -i /srv/node'
|
||||||
|
# check_interval: '300'
|
||||||
#
|
#
|
||||||
class monasca::checks::nagios_wrapper(
|
class monasca::checks::nagios_wrapper(
|
||||||
$check_path = '/usr/lib/nagios/plugins:/usr/local/bin/nagios',
|
$check_path = '/usr/lib/nagios/plugins:/usr/local/bin/nagios',
|
||||||
$temp_file_path = '/dev/shm/',
|
$temp_file_path = '/dev/shm/',
|
||||||
$instances = [],
|
$instances = undef,
|
||||||
){
|
){
|
||||||
$conf_dir = $::monasca::agent::conf_dir
|
$conf_dir = $::monasca::agent::conf_dir
|
||||||
|
|
||||||
File["${conf_dir}/nagios_wrapper.yaml"] ~> Service['monasca-agent']
|
if($instances){
|
||||||
|
Concat["${conf_dir}/nagios_wrapper.yaml"] ~> Service['monasca-agent']
|
||||||
file { "${conf_dir}/nagios_wrapper.yaml":
|
concat { "${conf_dir}/nagios_wrapper.yaml":
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => $::monasca::group,
|
group => $::monasca::group,
|
||||||
mode => '0640',
|
mode => '0640',
|
||||||
content => template('monasca/checks/nagios_wrapper.yaml.erb'),
|
warn => true,
|
||||||
require => File[$conf_dir],
|
require => File[$conf_dir],
|
||||||
|
}
|
||||||
|
concat::fragment { 'nagios_wrapper_header':
|
||||||
|
target => "${conf_dir}/nagios_wrapper.yaml",
|
||||||
|
order => '0',
|
||||||
|
content => template('monasca/checks/nagios_wrapper.yaml.erb'),
|
||||||
|
}
|
||||||
|
create_resources('monasca::checks::instances::nagios_wrapper', $instances)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -5,30 +5,39 @@
|
||||||
# === Parameters
|
# === Parameters
|
||||||
#
|
#
|
||||||
# [*instances*]
|
# [*instances*]
|
||||||
# An array of instances for the check.
|
# A hash of instances for the check.
|
||||||
# Each instance should be a hash of the check's parameters.
|
# Each instance should be a hash of the check's parameters.
|
||||||
# Parameters for the network check are:
|
# Parameters for the network check are:
|
||||||
|
# name (the instance key): The name of the instance.
|
||||||
# collect_connection_state (default = False)
|
# collect_connection_state (default = False)
|
||||||
# excluded_interfaces
|
# excluded_interfaces
|
||||||
# excluded_interface_re: A regular expression for excluded interfaces
|
# excluded_interface_re: A regular expression for excluded interfaces
|
||||||
# dimensions
|
# dimensions
|
||||||
# e.g.
|
# e.g.
|
||||||
# $instances = [{collect_connection_state => 'False',
|
# instances:
|
||||||
# excluded_interfaces => '[lo, lo0]'}]
|
# net:
|
||||||
|
# collect_connection_state: 'False'
|
||||||
|
# excluded_interfaces: '[lo, lo0]'
|
||||||
#
|
#
|
||||||
class monasca::checks::network(
|
class monasca::checks::network(
|
||||||
$instances = [],
|
$instances = undef,
|
||||||
){
|
){
|
||||||
$conf_dir = $::monasca::agent::conf_dir
|
$conf_dir = $::monasca::agent::conf_dir
|
||||||
|
|
||||||
File["${conf_dir}/network.yaml"] ~> Service['monasca-agent']
|
if($instances){
|
||||||
|
Concat["${conf_dir}/network.yaml"] ~> Service['monasca-agent']
|
||||||
file { "${conf_dir}/network.yaml":
|
concat { "${conf_dir}/network.yaml":
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => $::monasca::group,
|
group => $::monasca::group,
|
||||||
mode => '0640',
|
mode => '0640',
|
||||||
content => template('monasca/checks/generic.yaml.erb'),
|
warn => true,
|
||||||
require => File[$conf_dir],
|
require => File[$conf_dir],
|
||||||
|
}
|
||||||
|
concat::fragment { 'network_header':
|
||||||
|
target => "${conf_dir}/network.yaml",
|
||||||
|
order => '0',
|
||||||
|
content => "---\ninit_config: null\ninstances:\n",
|
||||||
|
}
|
||||||
|
create_resources('monasca::checks::instances::network', $instances)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -5,38 +5,42 @@
|
||||||
# === Parameters
|
# === Parameters
|
||||||
#
|
#
|
||||||
# [*instances*]
|
# [*instances*]
|
||||||
# An array of instances for the check.
|
# A hash of instances for the check.
|
||||||
# Each instance should be a hash of the check's parameters.
|
# Each instance should be a hash of the check's parameters.
|
||||||
# Parameters for the process check are:
|
# Parameters for the process check are:
|
||||||
# name (required): The name of the instance.
|
# name (the instance key): The name of the instance.
|
||||||
# search_string (required): An array of process names to search for.
|
# search_string (required): An array of process names to search for.
|
||||||
# exact_match (default = True): Whether the search_string should exactly
|
# exact_match (default = True): Whether the search_string should exactly
|
||||||
# match the service name. (Boolean)
|
# match the service name. (Boolean)
|
||||||
# cpu_check_interval (default = 0.1):
|
# cpu_check_interval (default = 0.1):
|
||||||
# dimensions: Additional dimensions for the instance.
|
# dimensions: Additional dimensions for the instance.
|
||||||
# e.g.
|
# e.g.
|
||||||
# $instances = [{name => 'nova-api',
|
# instances:
|
||||||
# search_string => '[nova-api]',
|
# nova-api:
|
||||||
# dimensions => '{component: nova-api, service: compute}'},
|
# search_string: '[nova-api]'
|
||||||
# {name => 'ssh',
|
# dimensions: '{component: nova-api, service: compute}'
|
||||||
# search_string => '['ssh', 'sshd']'}
|
# rabbitmq-server:
|
||||||
# {name => 'mysql',
|
# search_string: '[rabbitmq-server]'
|
||||||
# search_string => '[mysql]',
|
|
||||||
# exact_match => 'True'}]
|
|
||||||
#
|
#
|
||||||
class monasca::checks::process(
|
class monasca::checks::process(
|
||||||
$instances = [],
|
$instances = undef,
|
||||||
){
|
){
|
||||||
$conf_dir = $::monasca::agent::conf_dir
|
$conf_dir = $::monasca::agent::conf_dir
|
||||||
|
|
||||||
File["${conf_dir}/process.yaml"] ~> Service['monasca-agent']
|
if($instances){
|
||||||
|
Concat["${conf_dir}/process.yaml"] ~> Service['monasca-agent']
|
||||||
file { "${conf_dir}/process.yaml":
|
concat { "${conf_dir}/process.yaml":
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => $::monasca::group,
|
group => $::monasca::group,
|
||||||
mode => '0640',
|
mode => '0640',
|
||||||
content => template('monasca/checks/generic.yaml.erb'),
|
warn => true,
|
||||||
require => File[$conf_dir],
|
require => File[$conf_dir],
|
||||||
|
}
|
||||||
|
concat::fragment { 'process_header':
|
||||||
|
target => "${conf_dir}/process.yaml",
|
||||||
|
order => '0',
|
||||||
|
content => "---\ninit_config: null\ninstances:\n",
|
||||||
|
}
|
||||||
|
create_resources('monasca::checks::instances::process', $instances)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -5,9 +5,10 @@
|
||||||
# === Parameters
|
# === Parameters
|
||||||
#
|
#
|
||||||
# [*instances*]
|
# [*instances*]
|
||||||
# An array of instances for the check.
|
# A hash of instances for the check.
|
||||||
# Each instance should be a hash of the check's parameters.
|
# Each instance should be a hash of the check's parameters.
|
||||||
# Parameters for the rabbitmq check are:
|
# Parameters for the rabbitmq check are:
|
||||||
|
# name (the instance key): The name of the instance.
|
||||||
# rabbitmq_user (default = guest)
|
# rabbitmq_user (default = guest)
|
||||||
# rabbitmq_pass (default = guest)
|
# rabbitmq_pass (default = guest)
|
||||||
# rabbitmq_api_url (required)
|
# rabbitmq_api_url (required)
|
||||||
|
@ -19,26 +20,34 @@
|
||||||
# max_detailed_nodes
|
# max_detailed_nodes
|
||||||
# dimensions
|
# dimensions
|
||||||
# e.g.
|
# e.g.
|
||||||
# $instances = [{rabbitmq_user => 'guest',
|
# instances:
|
||||||
# rabbitmq_pass => 'guest',
|
# rabbit:
|
||||||
# rabbitmq_api_url => 'http://localhost:15672/api',
|
# rabbitmq_user: 'guest'
|
||||||
# exchanges => '[[nova, cinder, ceilometer, glance, keystone, neutron, heat]',
|
# rabbitmq_pass: 'guest'
|
||||||
# nodes => '[rabbit@devstack]',
|
# rabbitmq_api_url: 'http://localhost:15672/api'
|
||||||
# queues => '[conductor]'}]
|
# exchanges: '[nova, cinder, ceilometer, glance, keystone, neutron, heat]'
|
||||||
|
# nodes: '[rabbit@devstack]'
|
||||||
|
# queues: '[conductor]'
|
||||||
#
|
#
|
||||||
class monasca::checks::rabbitmq(
|
class monasca::checks::rabbitmq(
|
||||||
$instances = [],
|
$instances = undef,
|
||||||
){
|
){
|
||||||
$conf_dir = $::monasca::agent::conf_dir
|
$conf_dir = $::monasca::agent::conf_dir
|
||||||
|
|
||||||
File["${conf_dir}/rabbitmq.yaml"] ~> Service['monasca-agent']
|
if($instances){
|
||||||
|
Concat["${conf_dir}/rabbitmq.yaml"] ~> Service['monasca-agent']
|
||||||
file { "${conf_dir}/rabbitmq.yaml":
|
concat { "${conf_dir}/rabbitmq.yaml":
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => $::monasca::group,
|
group => $::monasca::group,
|
||||||
mode => '0640',
|
mode => '0640',
|
||||||
content => template('monasca/checks/generic.yaml.erb'),
|
warn => true,
|
||||||
require => File[$conf_dir],
|
require => File[$conf_dir],
|
||||||
|
}
|
||||||
|
concat::fragment { 'rabbitmq_header':
|
||||||
|
target => "${conf_dir}/rabbitmq.yaml",
|
||||||
|
order => '0',
|
||||||
|
content => "---\ninit_config: null\ninstances:\n",
|
||||||
|
}
|
||||||
|
create_resources('monasca::checks::instances::rabbitmq', $instances)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -5,31 +5,40 @@
|
||||||
# === Parameters
|
# === Parameters
|
||||||
#
|
#
|
||||||
# [*instances*]
|
# [*instances*]
|
||||||
# An array of instances for the check.
|
# A hash of instances for the check.
|
||||||
# Each instance should be a hash of the check's parameters.
|
# Each instance should be a hash of the check's parameters.
|
||||||
# Parameters for the zk check are:
|
# Parameters for the zk check are:
|
||||||
|
# name (the instance key): The name of the instance.
|
||||||
# host (default = localhost)
|
# host (default = localhost)
|
||||||
# port (default = 2181)
|
# port (default = 2181)
|
||||||
# timeout (default = 3.0)
|
# timeout (default = 3.0)
|
||||||
# dimensions
|
# dimensions
|
||||||
# e.g.
|
# e.g.
|
||||||
# $instances = [{host => 'localhost',
|
# instances:
|
||||||
# port => '2181',
|
# local:
|
||||||
# timeout => '3'}]
|
# host: 'localhost'
|
||||||
|
# port: '2181'
|
||||||
|
# timeout: '3'
|
||||||
#
|
#
|
||||||
class monasca::checks::zk(
|
class monasca::checks::zk(
|
||||||
$instances = [],
|
$instances = undef,
|
||||||
){
|
){
|
||||||
$conf_dir = $::monasca::agent::conf_dir
|
$conf_dir = $::monasca::agent::conf_dir
|
||||||
|
|
||||||
File["${conf_dir}/zk.yaml"] ~> Service['monasca-agent']
|
if($instances){
|
||||||
|
Concat["${conf_dir}/zk.yaml"] ~> Service['monasca-agent']
|
||||||
file { "${conf_dir}/zk.yaml":
|
concat { "${conf_dir}/zk.yaml":
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => $::monasca::group,
|
group => $::monasca::group,
|
||||||
mode => '0640',
|
mode => '0640',
|
||||||
content => template('monasca/checks/generic.yaml.erb'),
|
warn => true,
|
||||||
require => File[$conf_dir],
|
require => File[$conf_dir],
|
||||||
|
}
|
||||||
|
concat::fragment { 'zk_header':
|
||||||
|
target => "${conf_dir}/zk.yaml",
|
||||||
|
order => '0',
|
||||||
|
content => "---\ninit_config: null\ninstances:\n",
|
||||||
|
}
|
||||||
|
create_resources('monasca::checks::instances::zk', $instances)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
- name: <%= @title %>
|
||||||
|
apache_status_url: <%= @apache_status_url %>
|
||||||
|
<%- if @dimensions -%>
|
||||||
|
dimensions: <%= @dimensions %>
|
||||||
|
<%- end -%>
|
|
@ -1,12 +0,0 @@
|
||||||
---
|
|
||||||
init_config: null
|
|
||||||
instances:
|
|
||||||
<% instances.each do |instance| -%>
|
|
||||||
<% for index in 0 ... instance.size -%>
|
|
||||||
<% if index == 0 -%>
|
|
||||||
- <%= instance.keys[index] %>: <%= instance.values[index] %>
|
|
||||||
<% else -%>
|
|
||||||
<%= instance.keys[index] %>: <%= instance.values[index] %>
|
|
||||||
<% end -%>
|
|
||||||
<% end -%>
|
|
||||||
<% end -%>
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
- name: <%= @title %>
|
||||||
|
host_name: <%= @host_name %>
|
||||||
|
alive_test: <%= @alive_test %>
|
|
@ -5,12 +5,3 @@ init_config:
|
||||||
ping_timeout: <%= ping_timeout %>
|
ping_timeout: <%= ping_timeout %>
|
||||||
|
|
||||||
instances:
|
instances:
|
||||||
<% instances.each do |instance| -%>
|
|
||||||
<% for index in 0 ... instance.size -%>
|
|
||||||
<% if index == 0 -%>
|
|
||||||
- <%= instance.keys[index] %>: <%= instance.values[index] %>
|
|
||||||
<% else -%>
|
|
||||||
<%= instance.keys[index] %>: <%= instance.values[index] %>
|
|
||||||
<% end -%>
|
|
||||||
<% end -%>
|
|
||||||
<% end -%>
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
- name: <%= @title %>
|
||||||
|
url: <%= @url %>
|
||||||
|
<%- if @timeout -%>
|
||||||
|
timeout: <%= @timeout %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @username -%>
|
||||||
|
username: <%= @username %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @password -%>
|
||||||
|
password: <%= @password %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @match_pattern -%>
|
||||||
|
match_pattern: <%= @match_pattern %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if not @use_keystone.nil? -%>
|
||||||
|
use_keystone: <%= @use_keystone %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if not @collect_response_time.nil? -%>
|
||||||
|
collect_response_time: <%= @collect_response_time %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @headers -%>
|
||||||
|
headers: <%= @headers %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if not @disable_ssl_validation.nil? -%>
|
||||||
|
disable_ssl_validation: <%= @disable_ssl_validation %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @dimensions -%>
|
||||||
|
dimensions: <%= @dimensions %>
|
||||||
|
<%- end -%>
|
|
@ -0,0 +1,25 @@
|
||||||
|
- name: <%= @title %>
|
||||||
|
<%- if @server -%>
|
||||||
|
server: <%= @server %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @user -%>
|
||||||
|
user: <%= @user %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @port -%>
|
||||||
|
port: <%= @port %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @pass -%>
|
||||||
|
pass: <%= @pass %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @sock -%>
|
||||||
|
sock: <%= @sock %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @defaults_file -%>
|
||||||
|
defaults_file: <%= @defaults_file %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @dimensions -%>
|
||||||
|
dimensions: <%= @dimensions %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @options -%>
|
||||||
|
options: <%= @options %>
|
||||||
|
<%- end -%>
|
|
@ -0,0 +1,11 @@
|
||||||
|
- service_name: <%= @title %>
|
||||||
|
check_command: <%= @check_command %>
|
||||||
|
<%- if @host_name -%>
|
||||||
|
host_name: <%= @host_name %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @check_interval -%>
|
||||||
|
check_interval: <%= @check_interval %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @dimensions -%>
|
||||||
|
dimensions: <%= @dimensions %>
|
||||||
|
<%- end -%>
|
|
@ -4,12 +4,3 @@ init_config:
|
||||||
temp_file_path: <%= temp_file_path %>
|
temp_file_path: <%= temp_file_path %>
|
||||||
|
|
||||||
instances:
|
instances:
|
||||||
<% instances.each do |instance| -%>
|
|
||||||
<% for index in 0 ... instance.size -%>
|
|
||||||
<% if index == 0 -%>
|
|
||||||
- <%= instance.keys[index] %>: <%= instance.values[index] %>
|
|
||||||
<% else -%>
|
|
||||||
<%= instance.keys[index] %>: <%= instance.values[index] %>
|
|
||||||
<% end -%>
|
|
||||||
<% end -%>
|
|
||||||
<% end -%>
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
- name: <%= @title %>
|
||||||
|
<%- if not @collect_connection_state.nil? -%>
|
||||||
|
collect_connection_state: <%= @collect_connection_state %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @excluded_interfaces -%>
|
||||||
|
excluded_interfaces: <%= @excluded_interfaces %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @excluded_interface_re -%>
|
||||||
|
excluded_interface_re: <%= @excluded_interface_re %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @dimensions -%>
|
||||||
|
dimensions: <%= @dimensions %>
|
||||||
|
<%- end -%>
|
|
@ -0,0 +1,11 @@
|
||||||
|
- name: <%= @title %>
|
||||||
|
search_string: <%= @search_string %>
|
||||||
|
<%- if not @exact_match.nil? -%>
|
||||||
|
exact_match: <%= @exact_match %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @cpu_check_interval -%>
|
||||||
|
cpu_check_interval: <%= @cpu_check_interval %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @dimensions -%>
|
||||||
|
dimensions: <%= @dimensions %>
|
||||||
|
<%- end -%>
|
|
@ -0,0 +1,29 @@
|
||||||
|
- name: <%= @title %>
|
||||||
|
rabbitmq_api_url: <%= @rabbitmq_api_url %>
|
||||||
|
<%- if @rabbitmq_user -%>
|
||||||
|
rabbitmq_user: <%= @rabbitmq_user %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @rabbitmq_pass -%>
|
||||||
|
rabbitmq_pass: <%= @rabbitmq_pass %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @queues -%>
|
||||||
|
queues: <%= @queues %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @nodes -%>
|
||||||
|
nodes: <%= @nodes %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @exchanges -%>
|
||||||
|
exchanges: <%= @exchanges %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @max_detailed_queues -%>
|
||||||
|
max_detailed_queues: <%= @max_detailed_queues %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @max_detailed_exchanges -%>
|
||||||
|
max_detailed_exchanges: <%= @max_detailed_exchanges %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @max_detailed_nodes -%>
|
||||||
|
max_detailed_nodes: <%= @max_detailed_nodes %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @dimensions -%>
|
||||||
|
dimensions: <%= @dimensions %>
|
||||||
|
<%- end -%>
|
|
@ -0,0 +1,14 @@
|
||||||
|
- name: <%= @title %>
|
||||||
|
search_string: <%= @search_string %>
|
||||||
|
<%- if @host -%>
|
||||||
|
host: <%= @host %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @port -%>
|
||||||
|
port: <%= @port %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @timeout -%>
|
||||||
|
timeout: <%= @timeout %>
|
||||||
|
<%- end -%>
|
||||||
|
<%- if @dimensions -%>
|
||||||
|
dimensions: <%= @dimensions %>
|
||||||
|
<%- end -%>
|
Loading…
Reference in New Issue