Monitor the datanetwork for non-OpenStack work node

Update the lmon to support datanetwork interface monitoring
and use collectd to control the alarm information. Now lmon
will obtain the list of interfaces from /etc/lmon/lmon.conf
which can be generated by puppet.

Change-Id: I45fd056bd71f2ff9b49b52b8143e43179f18e03c
Story: #2002948
Task: #37326
Depends-on: https://review.opendev.org/#/c/694927
Signed-off-by: marvin <weifei.yu@intel.com>
This commit is contained in:
marvin 2019-11-21 18:27:16 +08:00 committed by marvin Yu
parent 7fb8219b1f
commit ab8a592a99
4 changed files with 65 additions and 0 deletions

View File

@ -100,6 +100,8 @@ include ::openstack::barbican::api
include ::platform::sm
include ::platform::lmon
class { '::platform::config::controller::post':
stage => post,
}

View File

@ -38,6 +38,7 @@ include ::platform::client
include ::platform::ceph::worker
include ::platform::worker::storage
include ::platform::pciirqaffinity
include ::platform::lmon
class { '::platform::config::worker::post':
stage => post,

View File

@ -0,0 +1,42 @@
class platform::lmon::params(
$data_iface_devices = [],
) { }
class platform::lmon
inherits ::platform::lmon::params {
include ::platform::params
include ::platform::network::mgmt::params
include ::platform::network::oam::params
include ::platform::network::cluster_host::params
include ::platform::kubernetes::params
# dependent template variables
$management_interface = $::platform::network::mgmt::params::interface_name
$cluster_host_interface = $::platform::network::cluster_host::params::interface_name
$oam_interface = $::platform::network::oam::params::interface_name
$host_labels = $::platform::kubernetes::params::host_labels
$data_interface = length($data_iface_devices) > 0
and !('openstack-compute-node'
in $host_labels)
$data_interface_str = join($data_iface_devices,',')
$lmon_conf = '/etc/lmon/lmon.conf'
file { '/etc/lmon':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
}
file { $lmon_conf:
ensure => present,
content => template('platform/lmon.conf.erb'),
owner => 'root',
group => 'root',
mode => '0644',
}
}

View File

@ -0,0 +1,20 @@
<%- if @management_interface -%>
management_interface=<%= @management_interface %>
<%- else -%>
management_interface=
<%- end -%>
<%- if @cluster_host_interface -%>
cluster_host_interface=<%= @cluster_host_interface %>
<%- else -%>
cluster_host_interface=
<%- end -%>
<%- if @oam_interface -%>
oam_interface=<%= @oam_interface %>
<%- else -%>
oam_interface=
<%- end -%>
<%- if @data_interface == true -%>
data_network_interface=<%= @data_interface_str %>
<%- else -%>
data_network_interface=
<%- end -%>