Reputation: 31
I have the following setup:
All of these are running in a docker stack.
Since I have some more docker containers running game servers etc., I would like to have a dashboard showing which of my servers are up and which of them are down.
I have tried many Google links, Youtube videos etc. but they all show how to create dashboards of aggregated data like CPU consumption per node etc. which I know how to set up.
Really the only thing I need is a panel showing UP or DOWN for different containers and I have not been able to find anything like that.
Solution
Figured it out (in case anyone runs into the same issue):
time() - container_last_seen{name="CONTAINER_NAME"}
There are most likely better solutions but this is what I came up with after some more research.
Upvotes: 0
Views: 6083
Reputation: 11
I used the following query: time() - container_last_seen{name="CONTAINER_NAME"}
With the condition: WHEN last() of A IS ABOVE 30
With range time :
FROM : now-1min TO :now
A short time range, to avoid errors in case of updated containers... it works well
Upvotes: 0
Reputation: 31
Solution
Figured it out (in case anyone runs into the same issue):
time() - container_last_seen{name="CONTAINER_NAME"}
There are most likely better solutions but this is what I came up with after some more research.
Upvotes: 3