timdaman / check_docker

Nagios plugin to check docker containers
GNU General Public License v3.0
152 stars 60 forks source link

"check swarm status" only works on manager node #80

Open guillomovitch opened 3 years ago

guillomovitch commented 3 years ago

check_swarm status checking is implemented by requesting http:/swarm URL, whereas this seems to works only on manager nodes: $> curl --unix-socket /var/run/docker.sock http:/swarm {"message":"This node is not a swarm manager. Worker nodes can't be used to view or modify cluster state. Please run this command on a manager node or promote the current node to a manager."}

Parsing http:/info result seems a more portable option.

I checked it with docker versions 19.03.14 and 20.10.7.