dev: hdd just physical stuff
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Kekskurse 2021-09-20 14:06:11 +02:00
parent 7643c96afb
commit a4a6c9c261
Signed by: kekskurse
GPG key ID: 728ACCB59341E7E4
2 changed files with 1 additions and 5 deletions

View file

@ -1,7 +1,6 @@
package main package main
import ( import (
"fmt"
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"gopkg.in/yaml.v2" "gopkg.in/yaml.v2"
"http-server-status/internal/pkg/checks" "http-server-status/internal/pkg/checks"
@ -23,7 +22,6 @@ type Config struct {
} }
func readConfig() { func readConfig() {
fmt.Println(os.Args)
filename := "/etc/http-server-status/config.yml" filename := "/etc/http-server-status/config.yml"
if len(os.Args) > 1 { if len(os.Args) > 1 {
filename = os.Args[1] filename = os.Args[1]

View file

@ -1,7 +1,6 @@
package checks package checks
import ( import (
"github.com/rs/zerolog/log"
"github.com/shirou/gopsutil/disk" "github.com/shirou/gopsutil/disk"
) )
@ -15,8 +14,7 @@ type HDD struct {
func (h HDD) Execute() (ok bool, data interface{}, err error) { func (h HDD) Execute() (ok bool, data interface{}, err error) {
success := true success := true
parts, _ := disk.Partitions(true) parts, _ := disk.Partitions(false)
log.Debug().Int("max_percent", h.Config.MaxPercent).Msg("Execute HDD Check")
usage := make(map[string]float64) usage := make(map[string]float64)
for _, p := range parts { for _, p := range parts {
device := p.Mountpoint device := p.Mountpoint