I am working on automation to monitor all 7mode/cmode storage systems we have by checking for netport port status. Through the automation, we want to check if the ports part of ifgroup are up and working, MTU settings and if there are any CRC errors.
Using NMSDK, i can get ifgroup and MTU details of the interfaces. I found no option to get CRC errors listed for an interface in the system. Is there any option we have to get CRC error details from netapp API?
RECEIVE Frames/second: 25446 | Bytes/second: 16472k | Errors/minute: 0 Discards/minute: 0 | Total frames: 137g | Total bytes: 281t Total errors: 0 | Total discards: 0 | Multi/broadcast: 0 No buffers: 0 | Non-primary u/c: 0 | L2 terminate: 0 Tag drop: 0 | Vlan tag drop: 0 | Vlan untag drop: 0 Vlan forwards: 0 | Vlan broadcasts: 0 | Vlan unicasts: 0 CRC errors: 0 | Runt frames: 0 | Fragment: 0 Long frames: 0 | Jabber: 0 | Bus overruns: 0 Queue drop: 0 | Xon: 0 | Xoff: 0 Jumbo: 2833m
xi = NaElement("counters") cmd.child_add(xi) xi.child_add_string("counter","rx_total_errors") xi2 = NaElement("instances") cmd.child_add(xi2)
for h in jload['results']['attributes-list']['net-port-info']: if h['port-type'] == 'physical': xi2.child_add_string("instance",h['port']) cmd.child_add_string("objectname","nic_common") err = filer.invoke_elem(cmd) a = xmltodict.parse(err.sprintf()) jd = json.dumps(a) jl = json.loads(jd) for x in jl['results']['instances']['instance-data']:
n = int(x['counters']['counter-data']['value'])
if n > 1000: print x['uuid'], print x['counters']['counter-data']['value'] else: pass
I don't *know*, but I believe that the CRC errors is the sum of TCP and UDP frames with bad checksums. Assuming that's true, you can get the values using @gaurav_verma's code, but looking for these counters:
Hope that helps.
If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
i know this is an old post . i am trying to use this code you have for powershell and i keep getting
not sure how this is getting the $instance or do i need to specify a variable for this . every other part is working just this part of the code for me is not working .
if i run this it does show me all of the active lifs on the filer and it shows the UUid's . so i assumed that the code would work from the main script . but somehow it will not finish as it gets the $instance error