Exemplo n.º 1
0
func main() {
	cfg := sensu.NewConfigFromFlagSet(sensu.ExtractFlags())

	t := transport.NewRabbitMQTransport(cfg)
	client := sensu.NewClient(t, cfg)

	memCheck := &Check{
		"memory",
		func(n rabbithole.NodeInfo) int { return n.MemUsed / (1024 * 1024) },
		func(t1, t2 int) bool { return t1 > t2 },
		MEMORY_WARNING,
		MEMORY_ERROR,
	}

	check.Store["rabbitmq-memory-check"] = &check.ExtensionCheck{memCheck.Check}
	check.Store["rabbitmq-memory-restart-check"] = &check.ExtensionCheck{memCheck.RestartCheck}
	check.Store["rabbitmq-memory-metric"] = &check.ExtensionCheck{memCheck.Metric}

	diskCheck := &Check{
		"disk",
		func(n rabbithole.NodeInfo) int { return n.DiskFree / (1024 * 1024) },
		func(t1, t2 int) bool { return t1 < t2 },
		DISK_WARNING,
		DISK_ERROR,
	}

	check.Store["rabbitmq-disk-check"] = &check.ExtensionCheck{diskCheck.Check}
	check.Store["rabbitmq-disk-metric"] = &check.ExtensionCheck{diskCheck.Metric}

	check.Store["rabbitmq-cluster-size"] = &check.ExtensionCheck{
		ClusterSizeCheck,
	}

	client.Start()
}
Exemplo n.º 2
0
func main() {
	cfg := sensu.NewConfigFromFlagSet(sensu.ExtractFlags())

	t := transport.NewRabbitMQTransport(cfg)
	client := sensu.NewClient(t, cfg)

	check.Store["host-mem-check"] = &check.ExtensionCheck{memCheck.Check}
	check.Store["host-disk-check"] = &check.ExtensionCheck{diskCheck.Check}
	check.Store["host-docker_vsz-check"] = &check.ExtensionCheck{
		dockerVSZCheck.Check,
	}
	check.Store["host-load_average-check"] = &check.ExtensionCheck{
		loadAverageCheck.Check,
	}
	check.Store["host-mem-metric"] = &check.ExtensionCheck{memCheck.Metric}
	check.Store["host-disk-metric"] = &check.ExtensionCheck{diskCheck.Metric}
	check.Store["host-cpu-metric"] = &check.ExtensionCheck{cpuCheck.Metric}
	check.Store["host-load_average-metric"] = &check.ExtensionCheck{
		loadAverageCheck.Metric,
	}
	check.Store["host-docker_vsz-metric"] = &check.ExtensionCheck{
		dockerVSZCheck.Metric,
	}

	client.Start()
}
Exemplo n.º 3
0
func main() {
	cfg := sensu.NewConfigFromFlagSet(sensu.ExtractFlags())

	t := transport.NewRabbitMQTransport(cfg)
	client := sensu.NewClient(t, cfg)

	client.Start()
}
Exemplo n.º 4
0
func main() {
	cfg := sensu.NewConfigFromFlagSet(sensu.ExtractFlags())
	t := transport.NewRabbitMQTransport(cfg)
	client := sensu.NewClient(t, cfg)

	check.Store["sensu-etcd-client"] = &check.ExtensionCheck{EtcdCheck}

	client.Start()
}
Exemplo n.º 5
0
func main() {
	cfg := sensu.NewConfigFromFlagSet(sensu.ExtractFlags())

	t := transport.NewRabbitMQTransport(cfg)
	client := sensu.NewClient(t, cfg)

	check.Store["aws-nodes-health-check"] = &check.ExtensionCheck{AWSCheck}
	check.Store["aws-nodes-etcd-check"] = &check.ExtensionCheck{EtcdGlobalCheck}

	client.Start()
}
Exemplo n.º 6
0
func main() {
	cfg := sensu.NewConfigFromFlagSet(sensu.ExtractFlags())

	t := transport.NewRabbitMQTransport(cfg)
	client := sensu.NewClient(t, cfg)

	check.Store["postgres-connection-metric"] = &check.ExtensionCheck{
		ConnectonMetric,
	}

	client.Start()
}
Exemplo n.º 7
0
func main() {
	cfg := sensu.NewConfigFromFlagSet(sensu.ExtractFlags())

	t := transport.NewRabbitMQTransport(cfg)
	client := sensu.NewClient(t, cfg)

	check.Store["fleet-units-metrics"] = &check.ExtensionCheck{UnitsMetric}
	check.Store["fleet-machines-metrics"] = &check.ExtensionCheck{MachinesMetric}
	check.Store["fleet-machines-check"] = &check.ExtensionCheck{MachineCheck}
	check.Store["fleet-unit-states-checks"] = &check.ExtensionCheck{
		UnitsStatesCheck,
	}
	check.Store["fleet-units-checks"] = &check.ExtensionCheck{UnitsCheck}

	clusterCheck := utils.StandardCheck{
		ErrorThreshold: utils.EnvironmentValueOrConst(
			"FLEET_CLUSTER_SIZE_ERROR_THRESHOLD",
			DefaultClusterSizeErrorThreshold,
		),
		WarningThreshold: utils.EnvironmentValueOrConst(
			"FLEET_CLUSTER_SIZE_WARNING_THRESHOLD",
			DefaultClusterSizeWarningThreshold,
		),
		MetricName: "fleet.cluster_size",
		Value:      ClusterSize,
		CheckMessage: func(f float64) string {
			return fmt.Sprintf("The cluster size is %.0f", f)
		},
		Comp: func(x, y float64) bool { return x > y },
	}

	check.Store["fleet-cluster-size-check"] = &check.ExtensionCheck{
		clusterCheck.Check,
	}
	check.Store["fleet-cluster-size-metric"] = &check.ExtensionCheck{
		clusterCheck.Check,
	}

	client.Start()
}