Skip to content

Added reading OS variabled API_USERNAME and API_PASSWORD - #27

Open
bbruun wants to merge 1 commit into
MauveSoftware:mainfrom
bbruun:main
Open

Added reading OS variabled API_USERNAME and API_PASSWORD#27
bbruun wants to merge 1 commit into
MauveSoftware:mainfrom
bbruun:main

Conversation

@bbruun

@bbruun bbruun commented Aug 14, 2026

Copy link
Copy Markdown

This was added to run ilo_exporter without showing credentials via "ps xa" by any user on a system running it as if it is started with -api.username=user -api.password=pass then ps xa |grep ilo_exporter will show credentials in cleartext so I added the few lines to enable running it as a systemd service or via a container without using the two parameters that divulge credentials.

Example:
In terminal 1:

$ ./ilo_exporter -api.username=ilo-exporter -api.password=password

In terminal 2:

$ ps xa |grep ilo
 416221 ?        Ssl    0:39 ./ilo_exporter -api.username=ilo-exporter -api.password=password

The systemd service file: /etc/systemd/system/ilo_exporter.service
(with a copy of ilo_exporter in /usr/local/bin/ with chown nobody:nobody and chmod +x)

[Service]
[Unit]
Description=HP iLO Prometheus exporter
Documentation=https://github.com/MauveSoftware/ilo_exporter Wants=network-online.target
After=network-online.target

[Install]
WantedBy=multi-user.target

[Service]
Type=simple
User=nobody
Group=nobody
ExecStart=/usr/local/bin/ilo_exporter -api.max-concurrent-requests=50 Restart=always

Systemd override conf file /etc/systemd/system/ilo_exporter.service.d/override.conf with chmod 600 and chown nobody:nobody

[Service]
Environment="API_USERNAME=ilo-exporter"
Environment="API_PASSWORD=password"

This was added to run ilo_exporter without showing credentials via "ps
xa" by any user on a system running it.

systemd service file: ilo_exporter.service

----
[Service]
[Unit]
Description=HP iLO Prometheus exporter
Documentation=https://github.com/MauveSoftware/ilo_exporter
Wants=network-online.target
After=network-online.target

[Install]
WantedBy=multi-user.target

[Service]
Type=simple
User=nobody
Group=nobody
ExecStart=/usr/local/bin/ilo_exporter -api.max-concurrent-requests=50
Restart=always
----
[Service]

Systemd override conf file ilo_exporter.service.d/override.conf with
chmod 600 and chown nobody:nobody
----
[Service]
Environment="API_USERNAME=ilo-exporter"
Environment="API_PASSWORD=password"
----
[Service]
@bbruun
bbruun requested a review from czerwonk as a code owner August 14, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant