|
@@ -1,10 +1,29 @@
|
|
|
package main
|
|
|
|
|
|
import (
|
|
|
+ "flag"
|
|
|
"fmt"
|
|
|
"github.com/oz123/gupta"
|
|
|
+ "time"
|
|
|
)
|
|
|
|
|
|
func main() {
|
|
|
- fmt.Println(gupta.Hello())
|
|
|
+ var freq int
|
|
|
+ var partition, netInterface string
|
|
|
+ var load, memory, cpu bool
|
|
|
+
|
|
|
+ flag.IntVar(&freq, "frequency", 5, "Frequency of polling in secods")
|
|
|
+ flag.IntVar(&freq, "f", 5, "Frequency of polling in secods")
|
|
|
+ flag.BoolVar(&memory, "m", false, "Poll memory")
|
|
|
+ flag.BoolVar(&load, "l", false, "Poll load")
|
|
|
+ flag.BoolVar(&cpu, "c", false, "poll CPU usage")
|
|
|
+ flag.StringVar(&partition, "p", "", "Poll disk usage (partition)")
|
|
|
+ flag.StringVar(&netInterface, "n", "", "Network usage (interface)")
|
|
|
+
|
|
|
+ flag.Parse()
|
|
|
+
|
|
|
+ for true {
|
|
|
+ fmt.Println(gupta.Hello())
|
|
|
+ time.Sleep(time.Duration(freq) * time.Second)
|
|
|
+ }
|
|
|
}
|