diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b953fb..61ad458 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ cookbook-rb-monitor CHANGELOG =============== +## 0.1.0 + + - Miguel Alvarez + - [d89a1db] Fix sensor_name array invalid + - [c47a755] Fix sensor name for monitor + ## 0.0.8 - Miguel Negrón diff --git a/resources/libraries/update_manager_config.rb b/resources/libraries/update_manager_config.rb index 95ef72d..4693f2a 100644 --- a/resources/libraries/update_manager_config.rb +++ b/resources/libraries/update_manager_config.rb @@ -187,14 +187,21 @@ def update_manager_config(resource) node.default['redborder']['monitor']['count'] = node.default['redborder']['monitor']['count'] + 1 end + sensor_name = if node['redborder']['ips'] && !node['redborder']['cloud'] + node['rbname'] + else + resource['hostname'] + end + manager_sensor = { - 'timeout': 5, - 'sensor_name': resource['hostname'], - 'sensor_ip': resource['hostip'], - 'community': resource['community'], - 'snmp_version': '2c', - 'monitors': manager_monitors, + 'timeout' => 5, + 'sensor_name' => sensor_name, + 'sensor_ip' => resource['hostip'], + 'community' => resource['community'], + 'snmp_version' => '2c', + 'monitors' => manager_monitors, } + # Finally, add manager sensor to sensors array in config node.default['redborder']['monitor']['config']['sensors'].push(manager_sensor) end diff --git a/resources/metadata.rb b/resources/metadata.rb index 2b368d1..78a6c55 100644 --- a/resources/metadata.rb +++ b/resources/metadata.rb @@ -3,4 +3,4 @@ maintainer_email 'git@redborder.com' license 'AGPL-3.0' description 'Installs/Configures rb-monitor' -version '0.0.8' +version '0.0.9'