#! /bin/bash

docker node ls &>/dev/null

if [ $? -eq 0 ]; then
   echo "{\"checkValue\": \"\",\"checkStatus\": \"OK\",\"msg\": \"$(hostname) this node is  a swarm manager\"}"
else
   echo "{\"checkValue\": \"\",\"checkStatus\": \"fail\", \"msg\": \"$(hostname) this node is not a swarm manager\"}"
fi
