Add -A option
@@ -17,6 +17,7 @@ var opts struct {
Critical *string `short:"c" long:"critical" value-name:"N, N%" description:"Exit with CRITICAL status if less than N units or N% of disk are free"`
Path *string `short:"p" long:"path" value-name:"PATH" description:"Mount point or block device as emitted by the mount(8) command"`
Exclude *string `short:"x" long:"exclude-device" value-name:"EXCLUDE PATH" description:"Ignore device (only works if -p unspecified)"`
+ All bool `short:"A" long:"all" description:"Explicitly select all paths."`
Units *string `short:"u" long:"units" value-name:"STRING" description:"Choose bytes, kB, MB, GB, TB (default: MB)"`
}
@@ -88,6 +89,7 @@ func run(args []string) *checkers.Checker {
return checkers.Unknown(fmt.Sprintf("Faild to fetch partitions: %s", err))
}
+ if !opts.All {
if opts.Path != nil {
if opts.Exclude != nil {
return checkers.Unknown(fmt.Sprintf("Invalid arguments: %s", errors.New("-x does not work with -p")))
@@ -116,6 +118,7 @@ func run(args []string) *checkers.Checker {
}
partitions = tmp
}
+ }
var disks []*gpud.UsageStat
