Add Contrail metrics

Change-Id: I27c8d6430e6bd110047b5762b3e70a16e72e48d1
This commit is contained in:
Olivier Bourdon 2016-11-22 18:26:35 +01:00
parent e84fcc5fdd
commit 4e3c0a107c
3 changed files with 122 additions and 3 deletions

View File

@ -0,0 +1,18 @@
Import "contrail_apis"
<Module "contrail_apis">
{%- for api_check_name, api_check in plugin.api_checks.iteritems() %}
{%- if api_check.url is defined and api_check.xml_element is defined %}
Url "{{ api_check_name }}" "{{ api_check.url }}"
XmlElement: "{{ api_check_name }}" "{{ api_check.xml_element }}"
{%- if api_check.result_type is defined %}
ResultType: "{{ api_check_name }}" "{{ api_check.result_type }}"
{%- endif %}
{%- if api_check.state is defined %}
State: "{{ api_check_name }}" "{{ api_check.state }}"
{%- endif %}
{%- endif %}
{%- endfor %}
</Module>

View File

@ -0,0 +1,6 @@
Import "contrail_ifmap_elements_count"
<Module "contrail_ifmap_elements_count">
</Module>

View File

@ -1,16 +1,48 @@
{%- if pillar.opencontrail is defined %}
{%- if pillar.opencontrail.control is defined %}
{%- from "opencontrail/map.jinja" import collector, config with context %}
{%- from "opencontrail/map.jinja" import control, collector, config with context %}
local_plugin:
{%- if control.get('enabled', False) %}
{%- set bind_addr=control.bind.address|replace('0.0.0.0', '127.0.0.1') %}
contrail_apis:
plugin: python
template: opencontrail/files/collectd_contrail_apis.conf
api_checks:
bgp-session-count:
url: "http://{{ bind_addr }}:8083/Snh_ShowNeighborStatisticsReq?bgp_or_xmpp=bgp"
xml_element: "ShowNeighborStatisticsResp"
result_type: "count"
bgp-session-up-count:
url: "http://{{ bind_addr }}:8083/Snh_ShowNeighborStatisticsReq?bgp_or_xmpp=bgp&up_or_down=up"
xml_element: "ShowNeighborStatisticsResp"
result_type: "count"
bgp-session-down-count:
url: "http://{{ bind_addr }}:8083/Snh_ShowNeighborStatisticsReq?bgp_or_xmpp=bgp&up_or_down=down"
xml_element: "ShowNeighborStatisticsResp"
result_type: "count"
xmpp-session-count:
url: "http://{{ bind_addr }}:8083/Snh_ShowNeighborStatisticsReq?bgp_or_xmpp=xmpp"
xml_element: "ShowNeighborStatisticsResp"
result_type: "count"
xmpp-session-up-count:
url: "http://{{ bind_addr }}:8083/Snh_ShowNeighborStatisticsReq?bgp_or_xmpp=xmpp&up_or_down=up"
xml_element: "ShowNeighborStatisticsResp"
result_type: "count"
xmpp-session-down-count:
url: "http://{{ bind_addr }}:8083/Snh_ShowNeighborStatisticsReq?bgp_or_xmpp=xmpp&up_or_down=down"
xml_element: "ShowNeighborStatisticsResp"
result_type: "count"
{%- endif %}
collectd_check_local_endpoint:
endpoint:
{%- if config.get('enabled', False) %}
{%- set bind_addr=config.bind.address|replace('0.0.0.0', '127.0.0.1') %}
contrail-api:
expected_code: 401
url: "http://{{ config.bind.address|replace('0.0.0.0', '127.0.0.1') }}:{{ config.bind.api_port }}/"
url: "http://{{ bind_addr }}:{{ config.bind.api_port }}/"
contrail-discovery:
expected_code: 200
url: "http://{{ config.bind.address|replace('0.0.0.0', '127.0.0.1') }}:{{ config.bind.discovery_port }}/"
url: "http://{{ bind_addr }}:{{ config.bind.discovery_port }}/"
{%- endif %}
{%- if collector.get('enabled', False) %}
contrail-collector:
@ -70,7 +102,70 @@ local_plugin:
{%- elif pillar.opencontrail.compute is defined %}
{%- from "opencontrail/map.jinja" import compute with context %}
{%- if compute.get('enabled', False) %}
{%- set bind_addr=compute.interface.address|replace('0.0.0.0', '127.0.0.1') %}
local_plugin:
contrail_ifmap_elements_count:
plugin: python
template: opencontrail/files/collectd_contrail_ifmap_elements_count.conf
contrail_apis:
plugin: python
template: opencontrail/files/collectd_contrail_apis.conf
api_checks:
vrouter-flows-active:
url: "http://{{ bind_addr }}:8085/Snh_AgentStatsReq"
xml_element: "FlowStatsResp"
result_type: "flow_active"
vrouter-flows-aged:
url: "http://{{ bind_addr }}:8085/Snh_AgentStatsReq"
xml_element: "FlowStatsResp"
result_type: "flow_aged"
vrouter-flows-created:
url: "http://{{ bind_addr }}:8085/Snh_AgentStatsReq"
xml_element: "FlowStatsResp"
result_type: "flow_created"
vrouter-flows-composite-invalid-interface:
url: "http://{{ bind_addr }}:8085/Snh_KDropStatsReq"
xml_element: "KDropStatsResp"
result_type: "ds_invalid_if"
vrouter-flows-discard:
url: "http://{{ bind_addr }}:8085/Snh_KDropStatsReq"
xml_element: "KDropStatsResp"
result_type: "ds_discard"
vrouter-flows-flow-action-drop:
url: "http://{{ bind_addr }}:8085/Snh_KDropStatsReq"
xml_element: "KDropStatsResp"
result_type: "ds_flow_action_drop"
vrouter-flows-flow-queue-limit-exceeded:
url: "http://{{ bind_addr }}:8085/Snh_KDropStatsReq"
xml_element: "KDropStatsResp"
result_type: "ds_flow_queue_limit_exceeded"
vrouter-flows-flow-table-full:
url: "http://{{ bind_addr }}:8085/Snh_KDropStatsReq"
xml_element: "KDropStatsResp"
result_type: "ds_flow_table_full"
vrouter-flows-frag-err:
url: "http://{{ bind_addr }}:8085/Snh_KDropStatsReq"
xml_element: "KDropStatsResp"
result_type: "ds_frag_err"
vrouter-flows-invalid-label:
url: "http://{{ bind_addr }}:8085/Snh_KDropStatsReq"
xml_element: "KDropStatsResp"
result_type: "ds_invalid_label"
vrouter-flows-invalid-nh:
url: "http://{{ bind_addr }}:8085/Snh_KDropStatsReq"
xml_element: "KDropStatsResp"
result_type: "ds_invalid_nh"
vrouter-dns-xmpp:
url: "http://{{ bind_addr }}:8085/Snh_AgentDnsXmppConnectionStatusReq"
xml_element: "AgentXmppDnsData"
state: "Established"
vrouter-lls:
url: "http://{{ bind_addr }}:8085/Snh_LinkLocalServiceInfo"
xml_element: "LinkLocalServiceData"
vrouter-xmpp:
url: "http://{{ bind_addr }}:8085/Snh_AgentXmppConnectionStatusReq"
xml_element: "AgentXmppData"
state: "Established"
collectd_check_local_endpoint:
endpoint:
contrail-node-manager: