Skip to content

Commit

Permalink
Fixups for redfish exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
jovial authored and GregWhiteyBialas committed Apr 15, 2024
1 parent fa18a4a commit 489ccd3
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 11 deletions.
4 changes: 1 addition & 3 deletions etc/kayobe/containers/redfish_exporter/post.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
- name: Restart redfish exporter container if config changed
become: true
docker_container:
name: redfish_exporter
state: restarted
command: docker kill -s SIGHUP redfish_exporter
when:
- redfish_exporter_config is changed
2 changes: 1 addition & 1 deletion etc/kayobe/containers/redfish_exporter/pre.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- name: Template redfish exporter configuration file
template:
src: "{{ kayobe_config_path }}/containers/redfish_exporter/redfish_exporter.yml"
dest: /opt/kayobe/containers/redfish_exporter/redfish-exporter.yml
dest: /opt/kayobe/containers/redfish_exporter/
mode: 0660
become: true
register: redfish_exporter_config
5 changes: 0 additions & 5 deletions etc/kayobe/containers/redfish_exporter/redfish-exporter.yml

This file was deleted.

5 changes: 5 additions & 0 deletions etc/kayobe/containers/redfish_exporter/redfish_exporter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
hosts:
default:
username: "{{ redfish_exporter_default_username }}"
password: "{{ redfish_exporter_default_password }}"
5 changes: 5 additions & 0 deletions etc/kayobe/inventory/groups
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,8 @@ rgws
[mgrs]
[osds]
[rgws]

###############################################################################
# Monitoring groups.
[redfish_exporter_targets:children]
overcloud
25 changes: 25 additions & 0 deletions etc/kayobe/kolla/config/prometheus/prometheus.yml.d/60-redfish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{% if seed_redfish_exporter_container_enabled | bool %}
scrape_configs:
- job_name: redfish-exporter-seed
metrics_path: /redfish
scrape_timeout: 30s
scrape_interval: 5m
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: "{{ lookup('vars', admin_oc_net_name ~ '_ips')[groups.seed.0] }}:9610"
static_configs:
{% for host in groups.get('redfish_exporter_targets', []) %}
{% if hostvars[host]["redfish_exporter_scrape_group"] | default('overcloud') == 'overcloud' %}
- targets:
- '{{ hostvars[host]["redfish_exporter_target_address"] }}'
labels:
server: '{{ host }}'
env: "{{ kayobe_environment | default('openstack') }}"
group: "{{ hostvars[host]['redfish_exporter_scrape_group'] | default('overcloud') }}"
{% endif %}
{% endfor %}
{% endif %}
4 changes: 2 additions & 2 deletions etc/kayobe/seed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ seed_redfish_exporter_container:
post: "{{ kayobe_config_path }}/containers/redfish_exporter/post.yml"
tag: "v1.0.1"
network_mode: host
volumes:
- /opt/kayobe/containers/redfish_exporter/redfish-exporter.yml:/etc/prometheus/redfish-exporter.yml:ro"
command: ./main --config.file /redfish_exporter.yml
volumes: "/opt/kayobe/containers/redfish_exporter/redfish_exporter.yml:/redfish_exporter.yml:ro"
restart_policy: unless-stopped

# Dict of container images to start
Expand Down
10 changes: 10 additions & 0 deletions etc/kayobe/stackhpc-monitoring.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,13 @@ stackhpc_enable_os_capacity: true
# Whether TLS certificate verification is enabled for the OpenStack Capacity
# exporter during Keystone authentication.
stackhpc_os_capacity_openstack_verify: true
# Redfish exporter

# Credentials
redfish_exporter_default_username: "{{ ipmi_admin_user }}"
redfish_exporter_default_password: "{{ ipmi_admin_password }}"

# The address of the BMC that is used to query redfish metrics.
redfish_exporter_target_address: "{{ ipmi_address }}"

###############################################################################

0 comments on commit 489ccd3

Please sign in to comment.