<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Times New Roman; font-size: 12pt; color: #000000'><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div class="h5">I wrote a script to do something similar. Here's a modified version that will verify working glusterfs mounts in general... All you need is a path that is the same on all nodes being checked and on the node performing the check, and passwordless ssh into the gluster client nodes. For testing I just made a tmp directory right inside the glusterfs mount and used that:</div><div class="h5"><br></div><div class="h5">#!/bin/bash</div><div class="h5"><br></div><div class="h5">check_node() {</div><div class="h5">  # ssh into the node and have it write its hostname into a temp file</div><div class="h5">  # in a gluster mounted directory. If we can read it from here and it's</div><div class="h5">  # correct, the node is online with 100% certainty</div><div class="h5">  SSH="ssh -q -l root -o StrictHostKeyChecking=no -o PasswordAuthentication=no -o ConnectTimeout=5"</div><div class="h5"><br></div><div class="h5">  # All nodes must have the same path to this directory</div><div class="h5">  TEMP_DIR=/cluster/tmp</div><div class="h5">  FILE=`mktemp -p $TEMP_DIR`</div><div class="h5">  $SSH $ip "hostname > $FILE"</div><div class="h5"><br></div><div class="h5">  # For any ip addresses listed in /a_node_ip_list (list them one per line)</div><div class="h5">  # on line 27, we need to get the hostname</div><div class="h5">  # from /etc/hosts. Make sure it's in there</div><div class="h5">  if test "`grep $ip /etc/hosts | awk '{print $2}'`" == "`cat $FILE`"</div><div class="h5">   then</div><div class="h5">    echo "confirmed online"</div><div class="h5">   else</div><div class="h5">    echo "not online. Call someone!"</div><div class="h5">   fi</div><div class="h5"> }</div><div class="h5"><br></div><div class="h5">echo</div><div class="h5">echo "GlusterFS status:"</div><div class="h5">echo</div><div class="h5"><br></div><div class="h5">for ip in `cat /a_node_ip_list`</div><div class="h5"> do</div><div class="h5">     echo -n "checking $ip...  "</div><div class="h5">     check_node</div><div class="h5"> done</div><div class="h5"><br></div><div class="h5"># Clean up</div><div class="h5">rm -rf $TEMP_DIR/tmp.*</div><div class="h5"><br></div><div class="h5">exit 0</div><div class="h5"> </div><div class="h5"><br></div><div class="h5"><br></div><div class="h5">><br>
> This is an interesting topic indeed.<br>
><br>
> I'm planning to have each server ping it's AFR pair, and if one of them<br>
> goes down, the moment it comes up, to run ls -lR on the mount.<br>
><br>
> Perhaps others can share additional ideas?<br>
><br>
> Regards.<br>
><br>
> 2009/4/2 Cory Meyer &lt;<a href="mailto:cory.meyer@gmail.com" target="_blank">cory.meyer@gmail.com</a>><br>
><br>
> > Has anyone found a decent way out there to monitor GlusterFS volumes?<br>
> > I'm currently using Nagios and Cacti to take care of basic CPU, Load,<br>
> > Memory, and raw Disk I/O.   I need to monitor GlusterFS status and making<br>
> > sure all volumes are available..<br>
> ><br>
> > My test environment is 6 servers with 6 AFR volumes which are each shared<br>
> > between those 2 servers.  All volumes are mounted on each server.<br>
> ><br>
> > The checks I'm testing out so far include a simple Bash script that<br>
> > writes the current Unix timestamp and hostname to a file once a minute.<br>
> > This is done by each server on only the volumes that they store.<br>
> >    echo "$(uname -n):$(date +%s)" > /mnt/gluster01/CHECK_FILE<br>
> ><br>
> > The Nagios NRPE daemon would then execute a Perl script on each of the<br>
> > clients.   This script goes thorugh each of the Gluster mount points<br>
> > comparing the timestamps in the CHECK_FILE to the current system time<br>
> > alarming if the timestamp is off by more than a minute.  Another test<br>
> > which hasn't been implimented was checking the contents of the CHECK_FILE<br>
> >  with the data that is on the raw disk.<br>
> ><br>
> > Bash code to write timestamps and executed via cron once a minute.<br>
> > (write_timestamps.sh)<br>
> > <a href="http://glusterfs.pastebin.com/m5a220a6" target="_blank">http://glusterfs.pastebin.com/m5a220a6</a><br>
> ><br>
> > Perl code to compare the timestamps which is executed on the client.<br>
> > (check_glusterfs_mounts.pl)<br>
> > <a href="http://glusterfs.pastebin.com/m2f057a77" target="_blank">http://glusterfs.pastebin.com/m2f057a77</a><br>
> ><br>
> > Any ideas/questions/comments?<br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > Gluster-users mailing list<br>
> > <a href="mailto:Gluster-users@gluster.org" target="_blank">Gluster-users@gluster.org</a><br>
> > <a href="http://zresearch.com/cgi-bin/mailman/listinfo/gluster-users" target="_blank">http://zresearch.com/cgi-bin/mailman/listinfo/gluster-users</a><br>
<br>
<br>
</div></div></blockquote></div></div>
<br>_______________________________________________
Gluster-users mailing list
Gluster-users@gluster.org
http://zresearch.com/cgi-bin/mailman/listinfo/gluster-users
</div></body></html>