def metric_init(params):
 global array_dict
 array_dict = {'array1': {'array_name': 'array1', 'ipaddr': '192.168.1.50', 'user': '3paruser', 'pass': '3parpass'}, 'array2': {'array_name': 'array2', 'ipaddr': '192.168.1.51', 'user': '3paruser', 'pass': '3parpass'}}
 Desc_Skel = {'name': 'XXX', 'call_back': get_metric, 'time_max': 600, 'value_type': 'double', 'format': '%0f', 'units': 'XXX', 'slope': 'both', 'description': 'XXX', 'groups': 'storage'}
 descriptors = []
 for array in array_dict:
  ip = array_dict[array]['ipaddr']
  user = array_dict[array]['user']
  passwd = array_dict[array]['pass']
  'Get a list of volumes in the array'
  vols = get_vol_list(ip, user, passwd)
  'Get a list of CPGs in the array'
  cpgs = get_cpg_list(ip, user, passwd)
  'Get a list of CPUs in the array - Only getting totals per node at this point'
  cpus = get_cpu_list(ip, user, passwd)
  'create descriptors for the array'
  array_descriptors = define_metrics(Desc_Skel, array_dict[array]['array_name'], vols, ip, cpgs, cpus)
  descriptors = (descriptors + array_descriptors)
 return descriptors

def metric_init ( params ) : global array_dict array_dict = { 'array1' : { 'array_name' : 'array1' , 'ipaddr' : '192.168.1.50' , 'user' : '3paruser' , 'pass' : '3parpass' } , 'array2' : { 'array_name' : 'array2' , 'ipaddr' : '192.168.1.51' , 'user' : '3paruser' , 'pass' : '3parpass' } } Desc_Skel = { 'name' : 'XXX' , 'call_back' : get_metric , 'time_max' : 600 , 'value_type' : 'double' , 'format' : '%0f' , 'units' : 'XXX' , 'slope' : 'both' , 'description' : 'XXX' , 'groups' : 'storage' } descriptors = [ ] for array in array_dict : ip = array_dict [ array ] [ 'ipaddr' ] user = array_dict [ array ] [ 'user' ] passwd = array_dict [ array ] [ 'pass' ] vols = get_vol_list ( ip , user , passwd ) cpgs = get_cpg_list ( ip , user , passwd ) cpus = get_cpu_list ( ip , user , passwd ) array_descriptors = define_metrics ( Desc_Skel , array_dict [ array ] [ 'array_name' ] , vols , ip , cpgs , cpus ) descriptors = ( descriptors + array_descriptors ) return descriptors
metric_init this is called by gmond to initialise the metrics .