Created
November 13, 2024 22:09
-
-
Save msterhuj/ac2e7c518de1a71993d1bb23bf3c74be to your computer and use it in GitHub Desktop.
easy install openstack exporter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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