<html><body><div style="font-family: lucida console,sans-serif; font-size: 12pt; color: #000000"><div><br></div><div>Hi all,<br></div><div><br></div><div>I found that the gluster CLI's lack of a health check command to be pretty annoying, and I'm sure many of you have found the same thing!<br></div><div><br></div><div>I'm equally sure that a great many of you have put scripts together to bridge this functionality gap - but, why have one tool when you can have more :)<br></div><div><br></div><div>I've written a python tool call gstatus that's available on the forge (<a href="https://forge.gluster.org/gstatus," data-mce-href="https://forge.gluster.org/gstatus,"><a target="_blank" data-mce-href="https://forge.gluster.org/gstatus" href="https://forge.gluster.org/gstatus">https://forge.gluster.org/gstatus</a>)</a> It performs a number of health checks on a cluster, providing a point-in-time view of what's going on.<br></div><div><br></div><div>At the moment it's dependant upon glusterfs 3.4 (since I'm using the xml output from various gluster commands), but it shows things like<br></div><div><br></div><div><span style="font-family: courier new,courier,monaco,monospace,sans-serif;">[root@glfs35-1 gstatus]# gstatus -a<br>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Status: HEALTHY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Capacity: 80.00 GiB(raw bricks)<br>&nbsp;&nbsp; Glusterfs: 3.5.0beta3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 60.00 GiB(usable)<br><br>&nbsp;&nbsp; Nodes&nbsp;&nbsp;&nbsp; :&nbsp; 4/ 4&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Volumes:&nbsp; 2 Up<br>&nbsp;&nbsp; Self Heal:&nbsp; 4/ 4&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 Up(Degraded)<br>&nbsp;&nbsp; Bricks&nbsp;&nbsp; :&nbsp; 8/ 8&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 Up(Partial)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 Down<br>Volume Information<br>&nbsp;&nbsp; &nbsp;myvol&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UP - 4/4 bricks up - Distributed-Replicate<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Capacity: (0% used) 77.00 MiB/20.00 GiB (used/total)<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Self Heal:&nbsp; 4/ 4&nbsp;&nbsp; All files in sync<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Protocols: glusterfs:on&nbsp; NFS:off&nbsp; SMB:off<br><br>&nbsp;&nbsp; &nbsp;dist&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UP - 4/4 bricks up - Distribute<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Capacity: (0% used) 129.00 MiB/40.00 GiB (used/total)<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Self Heal: N/A<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Protocols: glusterfs:on&nbsp; NFS:on&nbsp; SMB:on<br><br>Status Messages<br>&nbsp; - Cluster is HEALTHY, all checks successful<br></span><br></div><div>You install it with "<span style="font-family: courier new,courier,monaco,monospace,sans-serif;">python setup.py install</span>" (you'll need python-setuptools rpm). However, if you're just curious, you can take a look at the examples directory in the download archive to see how the tool reports on various error scenarios (nodes down, bricks down etc). It's <br></div><div><br></div><div>It's at version 0.45, so it's still early days and subject to the limited scenarios I can throw at it - so there will be bugs!</div><div><br></div><div>Anyway, if you have the time give it a go and see if it helps you. And if it misses the mark in your environment, let me know what else it should do and why.<br></div><div><br></div><div>Cheers,<br></div><div><br></div><div>Paul C<br><br></div><div><br></div><div><br></div><div><br></div></div></body></html>