-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.go
33 lines (28 loc) · 798 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package main
import (
"flag"
"fmt"
"os"
"github.com/owitho/prometheus-alicloud-sd/exporter"
)
func main() {
var filePath string
var exporterType string
flag.StringVar(&filePath, "f", "", "Output filename")
flag.StringVar(&exporterType, "t", "", "exporter type(node/mysql/redis)")
flag.Parse()
if filePath == "" {
fmt.Fprintf(os.Stderr, "required arguments -f must pass in.")
os.Exit(1)
}
if exporterType == "node" {
exporter.DiscoveryAlicloudNode(filePath, exporterType)
} else if exporterType == "mysql" {
exporter.DiscoveryAlicloudMysql(filePath, exporterType)
} else if exporterType == "redis" {
exporter.DiscoveryAlicloudRedis(filePath, exporterType)
} else if exporterType == "" {
fmt.Fprintf(os.Stderr, "required arguments -t must pass in.")
os.Exit(1)
}
}