7

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

 LinuxTSR=198.23.12.5
 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.

remmy
  • 4,955
  • 1
  • 23
  • 30
yael
  • 1,511
  • 11
  • 33
  • 57
  • 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 09 '16 at 20:54

1 Answers1

0

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

f35
  • 261
  • 1
  • 5