How can I verify that a remote machine is part of a Veritas cluster?

I just created the following ssh command to verify if the remote machine is a VRTS cluster or a Linux availability Red Hat cluster

 ssh LinuxTSR "ls /usr/sbin/clustat /opt/VRTS 2>/dev/null" | wc -l

If I get number that is different from 0, it is a VRTS or Red Hat cluster. But this approach isn't so elegant. Please help me to find more elegant way in order to verify if the remote machine is in a cluster.

  • Can you just use [ -e /usr/sbin/clustat ] || [ -e /opt/VRTS ]? (I don't have a way to check, but I believe this should be equivalent to your check.) Test by appending && echo "in cluster". – Wildcard May 9 '16 at 20:54

An elegant solution is perhaps "ansible"

I have no way to check with "a veritas cluster", but :

ansible yourhost -m setup
  • gather a list of facts from your host.
  • In this list, check if you have something about "veritas",
  • then you can filter to get only the fact about veritas :

    ansible yourhost -m setup -a 'filter=yourmagic'

of course replace "yourmagic" with the keywork found

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.