package main

import (
	"log"
	"os"
)

func main() {
	addr := os.Getenv("CENTRAL_GRPC")
	serverID := os.Getenv("SERVER_ID")
	key := os.Getenv("AGENT_KEY")
	if addr == "" || serverID == "" || key == "" {
		log.Fatal("mengyamonitor agent requires CENTRAL_GRPC, SERVER_ID, and AGENT_KEY")
	}
	log.Printf("agent reporting via gRPC to %s (server_id=%s)", addr, serverID)
	runGRPCLoop(addr, serverID, key)
}
