Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added monitoring with nagios #309

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion bin/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,10 @@
"wsrep_ssl" => true,
"wsrep_ssl_key" => "/etc/pki/galera/galera.key",
"wsrep_ssl_cert" => "/etc/pki/galera/galera.crt",
"monitoring" => 'nagios',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kind of think this should default to '', otherwise we are assuming the default deployments are using nagios, which means staypuft will need to override in all cases to start until they are ready to support a nagios server. Also, the latest build of opm does not yet have the nagios module in it, so I am testing by pulling that module over from source (ick)

"monitoring_adm_passwd" => SecureRandom.hex,
"monitoring_host" => '172.16.0.1',
"monitoring_interface" => 'eth0',
}

hostgroups = [
Expand Down Expand Up @@ -452,7 +456,9 @@
"quickstack::gluster::server",
]},
{:name=>"Galera Server",
:class=>"quickstack::galera::server"}
:class=>"quickstack::galera::server"},
{:name=>"Nagios Server",
:class=>"quickstack::monitoring::server"}
]

def get_key_type(value)
Expand Down
2 changes: 2 additions & 0 deletions config/hostgroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@
- quickstack::gluster::server
- :name: Galera Server
:class: quickstack::galera::server
- :name: Nagios Server
:class: quickstack::monitoring::server
4 changes: 4 additions & 0 deletions config/quickstack.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,7 @@ wsrep_sst_password: <%= passwd_auto %>
wsrep_ssl: true
wsrep_ssl_key: /etc/pki/galera/galera.key
wsrep_ssl_cert: /etc/pki/galera/galera.crt
monitoring: nagios
monitoring_adm_passwd: <%= passwd_auto %>
monitoring_host: 172.16.0.1
monitoring_interface: eth0
15 changes: 13 additions & 2 deletions puppet/modules/quickstack/manifests/compute_common.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
$ceilometer = 'true',
$ceilometer_metering_secret = $quickstack::params::ceilometer_metering_secret,
$ceilometer_user_password = $quickstack::params::ceilometer_user_password,
$ceph_cluster_network = '',
$ceph_public_network = '',
$ceph_cluster_network = '',
$ceph_public_network = '',
$ceph_fsid = '',
$ceph_images_key = '',
$ceph_volumes_key = '',
Expand All @@ -35,6 +35,9 @@
$libvirt_inject_password = 'false',
$libvirt_inject_key = 'false',
$libvirt_images_type = 'rbd',
$monitoring = $quickstack::params::monitoring,
$monitoring_host = $quickstack::params::monitoring_host,
$monitoring_interface = $quickstack::params::monitoring_interface,
$mysql_ca = $quickstack::params::mysql_ca,
$mysql_host = $quickstack::params::mysql_host,
$nova_host = '127.0.0.1',
Expand Down Expand Up @@ -220,4 +223,12 @@
dport => '5900-5999',
action => 'accept',
}

if ($monitoring) {
class {'quickstack::monitoring::client':
monitoring => $monitoring,
monitoring_host => $monitoring_host,
monitoring_interface => $monitoring_interface,
}
}
}
11 changes: 10 additions & 1 deletion puppet/modules/quickstack/manifests/controller_common.pp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
$keystone_db_password = $quickstack::params::keystone_db_password,
$keystonerc = false,
$neutron_metadata_proxy_secret = $quickstack::params::neutron_metadata_proxy_secret,
$monitoring = $quickstack::params::monitoring,
$monitoring_host = $quickstack::params::monitoring_host,
$monitoring_interface = $quickstack::params::monitoring_interface,
$mysql_host = $quickstack::params::mysql_host,
$mysql_root_password = $quickstack::params::mysql_root_password,
$neutron = $quickstack::params::neutron,
Expand Down Expand Up @@ -92,7 +95,6 @@
$horizon_cert = $quickstack::params::horizon_cert,
$horizon_key = $quickstack::params::horizon_key,
$amqp_nssdb_password = $quickstack::params::amqp_nssdb_password,

) inherits quickstack::params {

class {'quickstack::openstack_common': }
Expand Down Expand Up @@ -491,4 +493,11 @@
}
}

if ($monitoring) {
class {'quickstack::monitoring::client':
monitoring => $monitoring,
monitoring_host => $monitoring_host,
monitoring_interface => $monitoring_interface,
}
}
}
21 changes: 21 additions & 0 deletions puppet/modules/quickstack/manifests/monitoring/client.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Quickstack Monitoring client
class quickstack::monitoring::client (
$monitoring,
$monitoring_host,
$monitoring_interface,
) {
case $monitoring {
'nagios': {
class {'nagios::client':
monitored_ip => getvar("ipaddress_${monitoring_interface}"),
nagios_server_host => $monitoring_host,
}

firewall {'001 Nagios NRPE incoming':
proto => 'tcp',
dport => '5666',
action => 'accept',
}
}
}
}
23 changes: 23 additions & 0 deletions puppet/modules/quickstack/manifests/monitoring/server.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Quickstack Monitoring Server
class quickstack::monitoring::server (
$admin_password,
$monitoring,
$monitoring_adm_passwd,
$controller_admin_host,
) {
case $monitoring {
'nagios': {
class {'nagios::server':
admin_password => $monitoring_adm_passwd,
openstack_adm_passwd => $admin_password,
openstack_controller => $controller_admin_host,
}

firewall {'001 Nagios Server incoming':
proto => 'tcp',
dport => ['80'],
action => 'accept',
}
}
}
}
6 changes: 6 additions & 0 deletions puppet/modules/quickstack/manifests/neutron/compute.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
$glance_host = '127.0.0.1',
$nova_host = '127.0.0.1',
$enable_tunneling = $quickstack::params::enable_tunneling,
$monitoring = $quickstack::params::monitoring,
$monitoring_host = $quickstack::params::monitoring_host,
$monitoring_interface = $quickstack::params::monitoring_interface,
$mysql_host = $quickstack::params::mysql_host,
$neutron_db_password = $quickstack::params::neutron_db_password,
$neutron_user_password = $quickstack::params::neutron_user_password,
Expand Down Expand Up @@ -166,6 +169,9 @@
private_iface => $private_iface,
private_ip => $private_ip,
private_network => $private_network,
monitoring => $monitoring,
monitoring_host => $monitoring_host,
monitoring_interface => $monitoring_interface,
}

class {'quickstack::neutron::firewall::gre':}
Expand Down
6 changes: 6 additions & 0 deletions puppet/modules/quickstack/manifests/neutron/controller.pp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@
$horizon_cert = $quickstack::params::horizon_cert,
$horizon_key = $quickstack::params::horizon_key,
$amqp_nssdb_password = $quickstack::params::amqp_nssdb_password,
$monitoring = $quickstack::params::monitoring,
$monitoring_host = $quickstack::params::monitoring_host,
$monitoring_interface = $quickstack::params::monitoring_interface,
) inherits quickstack::params {

if str2bool_i("$ssl") {
Expand Down Expand Up @@ -215,6 +218,9 @@
horizon_cert => $horizon_cert,
horizon_key => $horizon_key,
amqp_nssdb_password => $amqp_nssdb_password,
monitoring => $monitoring,
monitoring_host => $monitoring_host,
monitoring_interface => $monitoring_interface,
}
->
class { '::neutron':
Expand Down
11 changes: 11 additions & 0 deletions puppet/modules/quickstack/manifests/neutron/networker.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
$verbose = $quickstack::params::verbose,
$ssl = $quickstack::params::ssl,
$mysql_ca = $quickstack::params::mysql_ca,
$monitoring = $quickstack::params::monitoring,
$monitoring_host = $quickstack::params::monitoring_host,
$monitoring_interface = $quickstack::params::monitoring_interface,
) inherits quickstack::params {

class {'quickstack::openstack_common': }
Expand Down Expand Up @@ -106,4 +109,12 @@
class {'quickstack::neutron::firewall::vxlan':
port => $ovs_vxlan_udp_port,
}

if ($monitoring) {
class {'quickstack::monitoring::client':
monitoring => $monitoring,
monitoring_host => $monitoring_host,
monitoring_interface => $monitoring_interface,
}
}
}
7 changes: 6 additions & 1 deletion puppet/modules/quickstack/manifests/nova_network/compute.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
$glance_backend_rbd = 'false',
$glance_host = '127.0.0.1',
$nova_host = '127.0.0.1',
$monitoring = $quickstack::params::monitoring,
$monitoring_host = $quickstack::params::monitoring_host,
$monitoring_interface = $quickstack::params::monitoring_interface,
$mysql_host = $quickstack::params::mysql_host,
$auto_assign_floating_ip = 'True',
$nova_multi_host = 'True',
Expand Down Expand Up @@ -53,7 +56,6 @@
$private_iface = '',
$private_ip = '',
$private_network = '',

) inherits quickstack::params {

# Configure Nova
Expand Down Expand Up @@ -129,5 +131,8 @@
private_iface => $private_iface,
private_ip => $private_ip,
private_network => $private_network,
monitoring => $monitoring,
monitoring_host => $monitoring_host,
monitoring_interface => $monitoring_interface,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@
$horizon_cert = $quickstack::params::horizon_cert,
$horizon_key = $quickstack::params::horizon_key,
$amqp_nssdb_password = $quickstack::params::amqp_nssdb_password,
$monitoring = $quickstack::params::monitoring,
$monitoring_host = $quickstack::params::monitoring_host,
$monitoring_interface = $quickstack::params::monitoring_interface,

$auto_assign_floating_ip
) inherits quickstack::params {
Expand Down Expand Up @@ -187,5 +190,9 @@
horizon_cert => $horizon_cert,
horizon_key => $horizon_key,
amqp_nssdb_password => $amqp_nssdb_password,

monitoring => $monitoring,
monitoring_host => $monitoring_host,
monitoring_interface => $monitoring_interface,
}
}
7 changes: 7 additions & 0 deletions puppet/modules/quickstack/manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@
# Gluster
$gluster_open_port_count = '10',

# Monitoring
# Options are none ('') or 'nagios' for now
$monitoring = '',
$monitoring_host = '172.16.0.1',
$monitoring_interface = 'eth0',
$monitoring_adm_passwd = 'CHANGEME',

# Networking
$neutron = 'false',
$controller_admin_host = '172.16.0.1',
Expand Down