Merge "Implicitly configure Nagios outputs if available"
This commit is contained in:
commit
851cec5847
|
@ -143,25 +143,21 @@ if ($plugin_data) {
|
|||
}
|
||||
}
|
||||
|
||||
if $plugin_data['alerting_mode'] {
|
||||
# Infrastructure Alerting
|
||||
$lma_infra_alerting = hiera('lma_infrastructure_alerting', {})
|
||||
$infra_alerting_nodes = get_nodes_hash_by_roles($network_metadata, ['infrastructure_alerting', 'primary-infrastructure_alerting'])
|
||||
$infra_alerting_nodes_count = count($infra_alerting_nodes)
|
||||
$infra_vip_name = 'infrastructure_alerting_mgmt_vip'
|
||||
if $network_metadata['vips'][$infra_vip_name] {
|
||||
$nagios_server = $network_metadata['vips'][$infra_vip_name]['ipaddr']
|
||||
} else {
|
||||
$nagios_server = undef
|
||||
}
|
||||
# Infrastructure Alerting
|
||||
$lma_infra_alerting = hiera('lma_infrastructure_alerting', {})
|
||||
$infra_alerting_nodes = get_nodes_hash_by_roles($network_metadata, ['infrastructure_alerting', 'primary-infrastructure_alerting'])
|
||||
$infra_alerting_nodes_count = count($infra_alerting_nodes)
|
||||
$infra_vip_name = 'infrastructure_alerting_mgmt_vip'
|
||||
if $network_metadata['vips'][$infra_vip_name] {
|
||||
$nagios_server = $network_metadata['vips'][$infra_vip_name]['ipaddr']
|
||||
$nagios_password = $lma_infra_alerting['nagios_password']
|
||||
if $infra_alerting_nodes_count > 0 or $nagios_server {
|
||||
$nagios_is_deployed = true
|
||||
} else {
|
||||
$nagios_is_deployed = false
|
||||
}
|
||||
} else {
|
||||
$nagios_is_deployed = false
|
||||
$nagios_server = undef
|
||||
}
|
||||
if $infra_alerting_nodes_count > 0 and $nagios_server {
|
||||
$nagios_is_deployed = true
|
||||
} else {
|
||||
$nagios_is_deployed = false
|
||||
}
|
||||
|
||||
$hiera_file = '/etc/hiera/plugins/lma_collector.yaml'
|
||||
|
|
|
@ -87,9 +87,3 @@ attributes:
|
|||
type: "password"
|
||||
regex: *not_empty_parameter
|
||||
restrictions: *disable_influxdb_parameters
|
||||
|
||||
alerting_mode:
|
||||
type: "checkbox"
|
||||
weight: 90
|
||||
value: true
|
||||
label: "Alerts sent to the StackLight Infrastructure Alerting plugin (Nagios) if deployed."
|
||||
|
|
Loading…
Reference in New Issue