forked from unpoller/unpoller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
38 lines (31 loc) · 674 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
34
35
36
37
38
package main
//nolint:gci
import (
"log"
"os"
"time"
"github.com/unpoller/poller"
// Load input plugins!
_ "github.com/unpoller/inputunifi"
// Load output plugins!
_ "github.com/unpoller/influxunifi"
_ "github.com/unpoller/lokiunifi"
_ "github.com/unpoller/promunifi"
)
// Keep it simple.
func main() {
// Set time zone based on TZ env variable.
setTimeZone(os.Getenv("TZ"))
if err := poller.New().Start(); err != nil {
log.Fatalln("[ERROR]", err)
}
}
func setTimeZone(tz string) {
if tz == "" {
return
}
var err error
if time.Local, err = time.LoadLocation(tz); err != nil {
log.Printf("[ERROR] Loading TZ Location '%s': %v\n", tz, err)
}
}