Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

add linux systemd service #54

Open
wants to merge 5 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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

* [Feature] Added metrics: `brick duration`, `totalRead`, `totalWrite`
* [Feature] Extended README doc
* [Feature] Added status badges for cirlce and travis
* [Feature] Added status badges for circle and travis
* [Fix] A lot of formatting, fixing typos and refactoring.
* [Fix] Fixed warning of golint.

Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ gotest: run go tests and reformats

**gotest**: runs *vet* and *fmt* go tools

## Run as systemd service

```
cp gluster_exporter /bin
cp gluster_exporter.service /etc/systemd/system
systemctl enable gluster_exporter.service
systemctl start gluster_exporter.service
```

## Relevant Gluster Metrics
Commands within the exporter are executed with `--xml`.

Expand Down
10 changes: 10 additions & 0 deletions gluster_exporter.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=Gluster Exporter
After=glusterd.service

[Service]
ExecStart=/bin/gluster_exporter
Restart=always

[Install]
WantedBy=multi-user.target
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ type mount struct {
volume string
}

// ParseMountOutput pares output of system execution 'mount'
// ParseMountOutput pairs output of system execution 'mount'
func parseMountOutput(mountBuffer string) ([]mount, error) {
mounts := make([]mount, 0, 2)
mountRows := strings.Split(mountBuffer, "\n")
Expand Down