21 lines
427 B
Go
21 lines
427 B
Go
package apps
|
|
|
|
import (
|
|
"log"
|
|
"os/exec"
|
|
"strings"
|
|
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
)
|
|
|
|
func Cubebackup(m Metrics) {
|
|
out, err := exec.Command("/opt/cubebackup365/bin/cbackup", "version").Output()
|
|
if err != nil {
|
|
log.Printf(">> WARN: Unable to get Cubebackup version: %v", err)
|
|
return
|
|
}
|
|
|
|
version := strings.Split(string(out), " ")[1]
|
|
|
|
m.Cubebackup.With(prometheus.Labels{"version": version}).Set(1)
|
|
}
|