Fuel plugin to collect Logging Monitoring and Alerting metrics
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

openstack.pp 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # Copyright 2016 Mirantis, Inc.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License"); you may
  4. # not use this file except in compliance with the License. You may obtain
  5. # a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  11. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  12. # License for the specific language governing permissions and limitations
  13. # under the License.
  14. #
  15. define lma_collector::collectd::openstack (
  16. $user,
  17. $password,
  18. $tenant,
  19. $keystone_url,
  20. $timeout = 20,
  21. $max_retries = 2,
  22. $pacemaker_master_resource = undef,
  23. $polling_interval = undef,
  24. $pagination_limit = undef,
  25. ) {
  26. include lma_collector::params
  27. include lma_collector::collectd::python_openstack_base
  28. $service = $title
  29. $supported_services = ['nova', 'nova_services',
  30. 'cinder', 'cinder_services', 'glance', 'keystone',
  31. 'neutron', 'neutron_agents']
  32. if ! member($supported_services, $service) {
  33. fail("service '${service}' is not supported")
  34. }
  35. validate_integer($timeout)
  36. validate_integer($max_retries)
  37. $config = {
  38. 'Username' => "\"${user}\"",
  39. 'Password' => "\"${password}\"",
  40. 'Tenant' => "\"${tenant}\"",
  41. 'KeystoneUrl' => "\"${keystone_url}\"",
  42. 'Timeout' => "\"${timeout}\"",
  43. 'MaxRetries' => "\"${max_retries}\"",
  44. }
  45. if $polling_interval {
  46. validate_integer($polling_interval)
  47. $polling_config = {
  48. 'PollingInterval' => "\"${polling_interval}\""
  49. }
  50. } else {
  51. $polling_config = {}
  52. }
  53. if $pagination_limit {
  54. validate_integer($pagination_limit)
  55. $limit_config = {
  56. 'PaginationLimit' => "\"${pagination_limit}\""
  57. }
  58. } else {
  59. $limit_config = {}
  60. }
  61. if $pacemaker_master_resource {
  62. $pacemaker_config = {'DependsOnResource' => "\"${pacemaker_master_resource}\""}
  63. } else {
  64. $pacemaker_config = {}
  65. }
  66. $real_config = merge($config, $pacemaker_config, $polling_config, $limit_config)
  67. lma_collector::collectd::python { "openstack_${title}":
  68. config => $real_config,
  69. }
  70. }