Skip to content

Instantly share code, notes, and snippets.

@msterhuj
Created November 13, 2024 22:09
Show Gist options
  • Save msterhuj/ac2e7c518de1a71993d1bb23bf3c74be to your computer and use it in GitHub Desktop.
Save msterhuj/ac2e7c518de1a71993d1bb23bf3c74be to your computer and use it in GitHub Desktop.
easy install openstack exporter
cd /tmp
wget https://github.com/openstack-exporter/openstack-exporter/releases/download/v1.7.0/openstack-exporter_1.7.0_linux_amd64.tar.gz
tar -xvf openstack-exporter_1.7.0_linux_amd64.tar.gz
mv openstack-exporter /usr/bin/
mkdir -p /etc/openstack-exporter
groupadd openstack-exporter
useradd -r -g openstack-exporter -d /etc/openstack-exporter -s /sbin/nologin openstack-exporter
chown -Rv openstack-exporter:openstack-exporter /etc/openstack-exporter
cat <<EOF > /etc/openstack-exporter/clouds.yaml
clouds:
openstack:
auth:
auth_url: https://keystone/v3/
username: ""
password: ""
project_id:
project_name: ""
user_domain_name: ""
region_name: ""
interface: "public"
identity_api_version: 3
EOF
chown -Rv openstack-exporter:openstack-exporter /etc/openstack-exporter
chmod 600 /etc/openstack-exporter/clouds.yaml
cat <<EOF > /etc/systemd/system/openstack-exporter.service
[Unit]
Description=OpenStack Exporter
After=network.target
Wants=network-online.target
[Service]
Restart=yes
User=openstack-exporter
Group=openstack-exporter
Type=simple
WorkingDirectory=/etc/openstack-exporter
ExecStart=/usr/bin/openstack-exporter \
--web.listen-address=127.0.0.1:9180 \
--disable-service.load-balancer \
--disable-service.container-infra \
--disable-service.baremetal \
--disable-service.gnocchi \
--disable-service.database \
--disable-service.orchestration \
--disable-service.object-store \
--disable-service.dns \
--log.level=warn \
--os-client-config=/etc/openstack-exporter/clouds.yaml \
openstack
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl stop openstack-exporter
systemctl enable --now openstack-exporter
systemctl status openstack-exporter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment