Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation Steps and Systemd file for Linux Systems #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,21 @@ By default, this exporter listens on TCP port 9000,Path '/metrics',to expose met
# Building and running

## Requirements
1. Gorelease: `go install github.com/goreleaser/goreleaser`

1. Gorelease: `go install github.com/goreleaser/goreleaser@latest`
2. Taskfile: `go install github.com/go-task/task/v3/cmd/task@latest`

## Installation Steps for Linux Filesystem

1. `cd /root/ ; apt-get install golang`
2. `curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh`
3. `cp /root/go/bin/dep /usr/bin`
4. `useradd libvirt-exporter`
4. `cd /home/libvirt-exporter ; git clone https://github.com/zhangjianweibj/prometheus-libvirt-exporter`
5. `cd prometheus-libvirt-exporter ; go build prometheus-libvirt-exporter.go`
6. `cp libvirt-exporter.service /usr/bin/`
7. `systemctl daemon-reload`
8. `systemctl enable libvirt-exporter ; systemctl start libvirt-exporter ; systemctl status libvirt-exporter`

## use go dep(depressed)
1. install go dep

Expand Down
11 changes: 11 additions & 0 deletions libvirt-exporter.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=<Libvirt Exporter by zhangjianweibj>

[Service]
User=libvirt-exporter
WorkingDirectory=/home/libvirt-exporter/prometheus-libvirt-exporter
ExecStart=/home/libvirt-exporter/prometheus-libvirt-exporter/prometheus-libvirt-exporter
Restart=always

[Install]
WantedBy=multi-user.target