This issue has been migrated from Redmine: https://dev.icinga.com/issues/11501
Created by buhtik on 2016-04-01 10:43:48 +00:00
Assignee: (none)
Status: New
Target Version: Backlog
Last Update: 2016-11-16 10:07:14 +00:00 (in Redmine)
Backport?: Not yet backported
Include in Changelog: 1
After hosts object were updated, service custom variables were not changed.
Example of service definitions:
apply Service "[CONS][OPS] CPU AVG 5 min." {
import "generic-service"
check_command = "check_zabbix"
vars.ARG1 = host.vars.zabbix_host_id
vars.ARG2 = "zabbix_db"
vars.ARG3 = "system.cpu.load[,avg5]"
vars.ARG4 = host.vars.cpu_load
assign where host.vars.cpu_load
}
Steps to reproduce:
- Creating host with attributes: {'templates': ['generic-host'], 'attrs': {'vars.location': 'dub', 'vars.connection_time_wait': '14<OK<45', 'vars.cpu_load': '2<OK<4', 'vars.zabbix_agent_health': 'OK=1', 'vars.notes': 'to_add', 'vars.disk_space_opt': '20<OK<80<90', 'vars.role': 'app', 'vars.application': 'SM', 'vars.disk_spase_root': '44<OK<110', 'vars.description': 'Not in prod', 'address': '127.0.0.1', 'vars.zabbix_host_id': '11725', 'vars.type': 'virtual', 'vars.connection_established': '20<OK<40', 'vars.swap_used': '1.2<2<OK<4<4'}}
cat /var/lib/icinga2/api/packages/_api/first-1458367266-1/conf.d/hosts/app-02-prod.dub.conf
object Host "app-02-prod.dub" {
import "generic-host"
address = "127.0.0.1"
vars["application"] = "SM"
vars["connection_established"] = "20<OK<40"
vars["connection_time_wait"] = "14<OK<45"
vars["cpu_load"] = "2<OK<4"
vars["description"] = "Not in prod"
vars["disk_space_opt"] = "20<OK<80<90"
vars["disk_spase_root"] = "44<OK<110"
vars["location"] = "dub"
vars["notes"] = "to_add"
vars["role"] = "app"
vars["swap_used"] = "1.2<2<OK<4<4"
vars["type"] = "virtual"
vars["zabbix_agent_health"] = "OK=1"
vars["zabbix_host_id"] = "11725"
version = 1459503512.559020
}
- Updating host with attributes: {'templates': ['generic-host'], 'attrs': {'vars.location': 'dub', 'vars.connection_time_wait': '23<OK<44', 'vars.zabbix_agent_health': 'OK=1', 'vars.notes': 'to_update', 'vars.disk_space_opt': '20<OK<80<90', 'vars.role': 'app', 'vars.application': 'SM', 'vars.disk_spase_root': '44<OK<110', 'vars.description': 'Not in prod', 'address': '127.0.0.1', 'vars.zabbix_host_id': '11725', 'vars.type': 'virtual', 'vars.connection_established': '29<OK<99', 'vars.swap_used': '1.2<2<OK<4<4', 'vars.zabbix_name': 'app-02-prod.dub'}}
Please note:
'vars.cpu_load': '2<OK<4' - - WAS REMOVED
'vars.connection_time_wait': '14<OK<45' - WAS CHANGED to 'vars.connection_time_wait': '23<OK<44'
'vars.connection_established': '20<OK<40' - WAS CHANGED to 'vars.connection_established': '29<OK<99'
API Result: {u'results': [{u'status': u'Attributes updated.', u'code': 200.0, u'type': u'Host', u'name': u'app-02-prod.dub'}]}
'vars.connection_time_wait' and 'vars.connection_established' were changed in HOST Custom variables, but were not changed in Service Custom variables.
'vars.cpu_load' was not removed.
File '/var/lib/icinga2/api/packages/_api/first-1458367266-1/conf.d/hosts/app-02-prod.dub.conf' was not changed.
More details in attached screenshots.
Attachments
Relations:
This issue has been migrated from Redmine: https://dev.icinga.com/issues/11501
Created by buhtik on 2016-04-01 10:43:48 +00:00
Assignee: (none)
Status: New
Target Version: Backlog
Last Update: 2016-11-16 10:07:14 +00:00 (in Redmine)
After hosts object were updated, service custom variables were not changed.
Example of service definitions:
apply Service "[CONS][OPS] CPU AVG 5 min." {
import "generic-service"
check_command = "check_zabbix"
vars.ARG1 = host.vars.zabbix_host_id
vars.ARG2 = "zabbix_db"
vars.ARG3 = "system.cpu.load[,avg5]"
vars.ARG4 = host.vars.cpu_load
assign where host.vars.cpu_load
}
Steps to reproduce:
cat /var/lib/icinga2/api/packages/_api/first-1458367266-1/conf.d/hosts/app-02-prod.dub.conf
object Host "app-02-prod.dub" {
import "generic-host"
address = "127.0.0.1"
vars["application"] = "SM"
vars["connection_established"] = "20<OK<40"
vars["connection_time_wait"] = "14<OK<45"
vars["cpu_load"] = "2<OK<4"
vars["description"] = "Not in prod"
vars["disk_space_opt"] = "20<OK<80<90"
vars["disk_spase_root"] = "44<OK<110"
vars["location"] = "dub"
vars["notes"] = "to_add"
vars["role"] = "app"
vars["swap_used"] = "1.2<2<OK<4<4"
vars["type"] = "virtual"
vars["zabbix_agent_health"] = "OK=1"
vars["zabbix_host_id"] = "11725"
version = 1459503512.559020
}
Please note:
'vars.cpu_load': '2<OK<4' - - WAS REMOVED
'vars.connection_time_wait': '14<OK<45' - WAS CHANGED to 'vars.connection_time_wait': '23<OK<44'
'vars.connection_established': '20<OK<40' - WAS CHANGED to 'vars.connection_established': '29<OK<99'
API Result: {u'results': [{u'status': u'Attributes updated.', u'code': 200.0, u'type': u'Host', u'name': u'app-02-prod.dub'}]}
'vars.connection_time_wait' and 'vars.connection_established' were changed in HOST Custom variables, but were not changed in Service Custom variables.
'vars.cpu_load' was not removed.
File '/var/lib/icinga2/api/packages/_api/first-1458367266-1/conf.d/hosts/app-02-prod.dub.conf' was not changed.
More details in attached screenshots.
Attachments
Relations: