diff options
| author | Sahina Bose <sabose@redhat.com> | 2014-08-08 19:04:27 +0530 | 
|---|---|---|
| committer | Sahina Bose <sabose@redhat.com> | 2014-09-26 02:07:48 -0700 | 
| commit | 2132a0f6927275e76c5e55069acc3e8314567475 (patch) | |
| tree | e19c241fb5877d20411817a51589821afd1e84d5 | |
| parent | f6934b13b3706c810bdff311b15a2d33ad22a29a (diff) | |
nagios-common: Corrected geo-rep status in case of replicate volumesv1.0.0
The logic to determine faulty should be if
count of passive+faulty > (brickcount/replicacount)
Separated logic for replicate volumes to fix the
comparison
Change-Id: Ia7797cb091dc14e551ddbe2e540d532930e41be3
Bug-Url:https://bugzilla.redhat.com/show_bug.cgi?id=1109727
Signed-off-by: Sahina Bose <sabose@redhat.com>
Reviewed-on: http://review.gluster.org/8443
Reviewed-by: Ramesh N <rnachimu@redhat.com>
Reviewed-by: Kanagaraj M <kmayilsa@redhat.com>
| -rwxr-xr-x | glusternagios/glustercli.py | 13 | 
1 files changed, 8 insertions, 5 deletions
diff --git a/glusternagios/glustercli.py b/glusternagios/glustercli.py index 111c9a9..4ec8194 100755 --- a/glusternagios/glustercli.py +++ b/glusternagios/glustercli.py @@ -557,7 +557,7 @@ def _parseVolumeGeoRepStatus(volumeName, out):      if "REPLICATE" in volumes[volumeName]["volumeType"]:          replicaCount = int(volumes[volumeName]["replicaCount"])      else: -        replicaCount = brickCount +        replicaCount = 1      for slave, count_dict in slaves.iteritems():          if count_dict['nodecount'] > brickCount: @@ -565,15 +565,18 @@ def _parseVolumeGeoRepStatus(volumeName, out):              # may be wrong              slaves[slave]['detail'] += "NOTE:Multiple slave session aggregated"          if count_dict['faulty'] > 0: +            if replicaCount > 1:              # georep cli status does not give the node name in the same way as              # gluster volume info - there's no way to compare and get the              # subvolume. So if fault+passive > than num of primary bricks,              # moving to faulty -            if (count_dict['faulty'] + count_dict['passive'] -                    >= count_dict['nodecount']/replicaCount): -                slaves[slave]['status'] = GeoRepStatus.FAULTY +                if (count_dict['faulty'] + count_dict['passive'] +                        > count_dict['nodecount']/replicaCount): +                    slaves[slave]['status'] = GeoRepStatus.FAULTY +                else: +                    slaves[slave]['status'] = GeoRepStatus.PARTIAL_FAULTY              else: -                slaves[slave]['status'] = GeoRepStatus.PARTIAL_FAULTY +                slaves[slave]['status'] = GeoRepStatus.FAULTY          elif (count_dict['notstarted'] > 0 and                slaves[slave]['status'] == GeoRepStatus.OK):              slaves[slave]['status'] = GeoRepStatus.NOT_STARTED  | 
