observIQ / disk-usage

Trigger slack alerts when disk usage is too high
BSD 2-Clause "Simplified" License
4 stars 0 forks source link

freebsd + arm returns large negative values #7

Closed jsirianni closed 2 weeks ago

jsirianni commented 6 years ago

ARM v7 (added print statements to: disk-usage_unix.go

} else {
        all  := int(fs.Blocks * uint64(fs.Bsize))
        free := int(fs.Bfree * uint64(fs.Bsize))
        used := int(all - free)
        percentage := int((float64(used) / float64(all)) * 100)

        fmt.Println(strconv.Itoa(all))
        fmt.Println(strconv.Itoa(free))
        fmt.Println(strconv.Itoa(used))
        fmt.Println(strconv.Itoa(percentage))
./disk-usage-arm.bin -t 0
-1221693440
-1963544576
741851136
-60
Disk usage healthy: /
jsirianni commented 3 years ago

Not sure if this is still a problem. I have access to some ARM hardware but it may be outdated (old raspberry pie and Netgate hardware).