Improve ethtool parsing speeds
This commit is contained in:
		@@ -69,7 +69,7 @@ class MonitoringPluginScript(MonitoringPlugin):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        # Run any imports first
 | 
					        # Run any imports first
 | 
				
			||||||
        import daemon_lib.common as common
 | 
					        import daemon_lib.common as common
 | 
				
			||||||
        from re import match, search
 | 
					        from re import match, search, findall
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        messages = list()
 | 
					        messages = list()
 | 
				
			||||||
        health_delta = 0
 | 
					        health_delta = 0
 | 
				
			||||||
@@ -150,7 +150,7 @@ class MonitoringPluginScript(MonitoringPlugin):
 | 
				
			|||||||
                            in_modes = False
 | 
					                            in_modes = False
 | 
				
			||||||
                            break
 | 
					                            break
 | 
				
			||||||
                        if in_modes:
 | 
					                        if in_modes:
 | 
				
			||||||
                            speed = int(line.split()[-1].replace('baseT', '').split('/')[0])
 | 
					                            speed = int(findall(r'\d+', line.split()[-1])[0])
 | 
				
			||||||
                            supported_link_speeds.add(speed)
 | 
					                            supported_link_speeds.add(speed)
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                # Get ethtool supported speeds for interface
 | 
					                # Get ethtool supported speeds for interface
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user