2016-09-06 10:04:13 -06:00
|
|
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
|
|
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
|
|
**Table of Contents**
|
|
|
|
|
|
|
|
- [Modify_Config](#modify_config)
|
|
|
|
- [Examples](#examples)
|
|
|
|
- [Adding a new instance](#adding-a-new-instance)
|
|
|
|
- [Changing the current instance](#changing-the-current-instance)
|
2017-01-31 09:08:37 -07:00
|
|
|
- [Connector](#connector)
|
|
|
|
- [Kubernetes Connector](#kubernetes-connector)
|
2016-09-06 10:04:13 -06:00
|
|
|
- [License](#license)
|
|
|
|
|
|
|
|
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
|
|
|
|
|
|
|
# Modify_Config
|
2017-06-07 12:25:37 +00:00
|
|
|
Modify_config is a function in [monasca_setup/main.py](monasca_setup/main.py).
|
|
|
|
It compares existing and detected configurations for each check plugin and
|
|
|
|
writes out the plugin configurations if there are changes.
|
2016-09-06 10:04:13 -06:00
|
|
|
|
|
|
|
## Examples
|
2017-06-07 12:25:37 +00:00
|
|
|
There are two examples shown here using http_check to:
|
|
|
|
* add a new instance
|
|
|
|
* detect endpoint change on an existing http_check instance
|
2016-09-06 10:04:13 -06:00
|
|
|
|
|
|
|
#### Adding a new instance
|
|
|
|
old_config:
|
|
|
|
|
|
|
|
```
|
|
|
|
{'init_config': None,
|
|
|
|
'instances': [{'built_by': 'HttpCheck',
|
|
|
|
'name': 'logging',
|
|
|
|
'url': 'http://127.0.0.1:9200',
|
|
|
|
'use_keystone': False,
|
|
|
|
'match_pattern': '.*VERSION.*',
|
|
|
|
'collect_response_time': True,
|
|
|
|
'timeout': '10',
|
|
|
|
'dimensions': {'service': 'logging'}}]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
monasca-setup arguments:
|
|
|
|
|
2016-09-28 20:53:26 +09:00
|
|
|
$ monasca-setup -d 'HttpCheck' -a 'url=http://192.168.10.6:8070
|
|
|
|
match_pattern=.*OK.* name=monasca dimensions=service:monitoring'
|
2016-09-06 10:04:13 -06:00
|
|
|
|
|
|
|
input_config generated from monasca-setup:
|
|
|
|
|
|
|
|
```
|
|
|
|
{'http_check':
|
|
|
|
{'instances': [{'built_by': 'HttpCheck',
|
|
|
|
'name': 'monasca',
|
|
|
|
'url': 'http://192.168.10.6:8070',
|
|
|
|
'use_keystone': False,
|
|
|
|
'match_pattern': '.*OK.*',
|
|
|
|
'collect_response_time': True,
|
|
|
|
'timeout': '10',
|
|
|
|
'dimensions': {'service': 'monitoring'}
|
|
|
|
}]
|
|
|
|
'init_config': None
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
output_config from modify_config:
|
|
|
|
|
|
|
|
```
|
|
|
|
{'init_config': None,
|
|
|
|
'instances': [{'built_by': 'HttpCheck',
|
|
|
|
'name': 'logging',
|
|
|
|
'url': 'http://127.0.0.1:9200',
|
|
|
|
'use_keystone': False,
|
|
|
|
'match_pattern': '.*VERSION.*',
|
|
|
|
'collect_response_time': True,
|
|
|
|
'timeout': '10',
|
|
|
|
'dimensions': {'service': 'logging'}},
|
|
|
|
{'built_by': 'HttpCheck',
|
|
|
|
'name': 'monasca',
|
|
|
|
'url': 'http://192.168.10.6:8070',
|
|
|
|
'use_keystone': False,
|
|
|
|
'match_pattern': '.*OK.*',
|
|
|
|
'collect_response_time': True,
|
|
|
|
'timeout': '10',
|
|
|
|
'dimensions': {'service': 'monitoring'}}]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Changing the current instance
|
|
|
|
old_config:
|
|
|
|
|
|
|
|
```
|
|
|
|
{'init_config': None,
|
|
|
|
'instances': [{'built_by': 'HttpCheck',
|
|
|
|
'name': 'logging',
|
|
|
|
'url': 'http://192.168.10.6:8070',
|
|
|
|
'use_keystone': False,
|
|
|
|
'match_pattern': '.*VERSION.*',
|
|
|
|
'collect_response_time': True,
|
|
|
|
'timeout': '10',
|
|
|
|
'dimensions': {'service': 'logging'}}]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
monasca-setup arguments:
|
|
|
|
|
2016-09-28 20:53:26 +09:00
|
|
|
$ monasca-setup -d 'HttpCheck' -a 'url=https://192.168.10.6:8070
|
|
|
|
match_pattern=.*VERSION.* dimensions=service:logging'
|
2016-09-06 10:04:13 -06:00
|
|
|
|
|
|
|
input_config generated from monasca-setup:
|
|
|
|
|
|
|
|
```
|
|
|
|
{'http_check':
|
|
|
|
{'instances': [{'built_by': 'HttpCheck',
|
|
|
|
'name': 'https://192.168.10.6:8070',
|
|
|
|
'url': 'https://192.168.10.6:8070',
|
|
|
|
'use_keystone': False,
|
|
|
|
'match_pattern': '.*VERSION.*',
|
|
|
|
'collect_response_time': True,
|
|
|
|
'dimensions': {'service': 'logging'}
|
|
|
|
}]
|
|
|
|
'init_config': None
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
output_config from modify_config:
|
|
|
|
|
|
|
|
```
|
|
|
|
{'init_config': None,
|
|
|
|
'instances': [{'built_by': 'HttpCheck',
|
|
|
|
'name': 'https://192.168.10.6:8070',
|
|
|
|
'url': 'https://192.168.10.6:8070',
|
|
|
|
'use_keystone': False,
|
|
|
|
'match_pattern': '.*VERSION.*',
|
|
|
|
'collect_response_time': True,
|
|
|
|
'dimensions': {'service': 'logging'}
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2017-01-31 09:08:37 -07:00
|
|
|
# Connector
|
|
|
|
## Kubernetes Connector
|
2017-06-07 12:25:37 +00:00
|
|
|
Kubernetes Connector is a class within [monasca-collector utils](monasca_agent/collector/checks/utils.py)
|
2017-01-31 09:08:37 -07:00
|
|
|
that is used for connecting to the Kubernetes API from within a container that is running in a k8 cluster.
|
|
|
|
|
|
|
|
When a container is brought up in Kubernetes by default there are environmental variables passed in that include needed
|
|
|
|
configurations to connect to the API. Also, the cacert and token that is tied to the serviceaccount the container is
|
|
|
|
under is mounted to the container file system. This class processes both and allows requests to the Kubernetes API.
|
|
|
|
|
2016-09-06 10:04:13 -06:00
|
|
|
# License
|
2017-01-31 09:08:37 -07:00
|
|
|
(C) Copyright 2016,2017 Hewlett Packard Enterprise Development LP
|
2016-09-06 10:04:13 -06:00
|
|
|
|
|
|
|
|