Skip to content

Commit

Permalink
Fixed CG SAN unit bug, added compatibility note into readme
Browse files Browse the repository at this point in the history
  • Loading branch information
evanjfraser committed Mar 23, 2014
1 parent 16819fe commit 30917fd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions recoverpoint/README.mkdn
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Currently gathers:
* Per Consistency Group Write, Data, Time and Journal Lags, as well as WAN and SAN traffic.
* Per Consistency Group Protection Window metrics.

## Compatibility
* Compatible with Recoverpoint 3.5

## DEPENDS
* python YAML
* paramiko modules
Expand All @@ -20,6 +23,7 @@ Currently gathers:

## UPDATE
* 21/03/2014 - Now performs SSH queries asynchronously as a separate thread. (This should stop it slowing and breaking gmond)
* 24/03/2014 - Corrected a bug in reporting SAN traffic when SAN traffic is sometimes reported by recoverpoint in units less than Mbit/s

## AUTHOR

Expand Down
14 changes: 12 additions & 2 deletions recoverpoint/recoverpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Desc: Ganglia Python module for gathering EMC recoverpoint statistics via SSH
# Author: Evan Fraser (evan.fraser@trademe.co.nz)
# Date: 01/08/2012
# Compatibility note: Compatible with Recoverpoint version 3.5


import yaml
Expand Down Expand Up @@ -153,9 +154,18 @@ def get_metrics(name):
for group in rawmetrics['Group']:
#CG SAN and Journal lag are under the policies
for policyname in rawmetrics['Group'][group]['Copy stats']:
#Get CG SAN metrics (remove 'Mbps' from end + convert to float and then bits)
#Get CG SAN metrics (Work out the unit from end + convert to float and then bits)
if 'SAN traffic' in rawmetrics['Group'][group]['Copy stats'][policyname]:
metrics[group + '_SAN_Traffic'] = float(rawmetrics['Group'][group]['Copy stats'][policyname]['SAN traffic']['Current throughput'][:-4]) * 1024 * 1024
cg_san_str = rawmetrics['Group'][group]['Copy stats'][policyname]['SAN traffic']['Current throughput']
cg_san_bw = float(cg_san_str[:-4])
cg_san_unit = cg_san_str[-4:]
if 'Mbps' in cg_san_unit:
cg_san_bw = cg_san_bw * 1024 * 1024
else:
cg_san_bw = cg_san_bw * 1024
metrics[group + '_SAN_Traffic'] = cg_san_bw


elif 'Journal' in rawmetrics['Group'][group]['Copy stats'][policyname]:
datastr = rawmetrics['Group'][group]['Copy stats'][policyname]['Journal']['Journal lag']
amount = float(datastr[:-2])
Expand Down

0 comments on commit 30917fd

Please sign in to comment.