Example #1
0
#!/usr/bin/env python

from ontapi.NaServer import *
from ontapi.NaElement import *

#### non-prod filer ####
filer = NaServer('filer.filerdomain.com')
filer.setAdminUser('user', 'password')

def get_perf_objects(filer):
    cmd = NaElement('perf-object-list-info')
    res = filer.invokeElem(cmd)
    items = res.getChildByName('objects')
    objects = []
    for item in items.getChildren():
        name = item.getChildContent('name')
        objects.append(name)
        # Debug code
        # print "Name of perf is %s" % (name)
    return objects

outside_list =  get_perf_objects(filer)

def get_perf_instance_info(outside_list, filer):
    cmd = NaElement('perf-object-instance-list-info')
    res = filer.invokeElem(cmd)
    items = res.getChildByName('instances')
    if outside_list == 'fcp':
        for item in items.getChildren():
            name = item.getChildContent('item')
            print "Name of instance is %s" % (name)
Example #2
0
#!/usr/bin/env python

from ontapi.NaServer import *
from ontapi.NaElement import *

filer = NaServer('<fqdn of server>')
filer.setAdminUser('<user>', '<password>')

cmd = NaElement('aggr-list-info')
results = filer.invokeElem(cmd)
aggvars = ['checksum-status', 'checksum-style', 'disk-count', 'files-total',\
			'files-used', 'has-local-root', 'has-partner-root', 'is-checksum-enabled',\
			'is-inconsistent', 'is-snaplock', 'mirror-status', 'name', 'plex-count',\
			'plexes', 'raid-size', 'raid-status', 'size-available', 'size-percentage-used',\
			'size-total', 'size-used', 'snaplock-type', 'state', 'type', 'uuid', 'volume-count',\
			'volume-count-striped-dv', 'volume-count-striped-mdv', 'volumes']

aggrs = results.getChildByName('aggregates')
for aggr in aggrs.getChildren():
		for i in aggvars:
			item = aggr.getChildContent(i)
			print "%-25s \t==> %25s" % (i,item)