main.go 693 B

1234567891011121314151617181920212223242526272829
  1. package main
  2. import (
  3. "flag"
  4. "fmt"
  5. "github.com/oz123/gupta"
  6. "time"
  7. )
  8. func main() {
  9. var freq int
  10. var partition, netInterface string
  11. var load, memory, cpu bool
  12. flag.IntVar(&freq, "frequency", 5, "Frequency of polling in secods")
  13. flag.IntVar(&freq, "f", 5, "Frequency of polling in secods")
  14. flag.BoolVar(&memory, "m", false, "Poll memory")
  15. flag.BoolVar(&load, "l", false, "Poll load")
  16. flag.BoolVar(&cpu, "c", false, "poll CPU usage")
  17. flag.StringVar(&partition, "p", "", "Poll disk usage (partition)")
  18. flag.StringVar(&netInterface, "n", "", "Network usage (interface)")
  19. flag.Parse()
  20. for true {
  21. fmt.Println(gupta.Hello())
  22. time.Sleep(time.Duration(freq) * time.Second)
  23. }
  24. }