Bugfixes
This commit is contained in:
1 parent
597c6cd373
commit
898d4e85c5
1 file changed
+3
-5
+3
-5
@@ -12,13 +12,10 @@
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
import re
|
||||
|
||||
from pyFG.fortios import FortiOS, FortiConfig, logger
|
||||
from pyFG.exceptions import FailedCommit, CommandExecutionException
|
||||
|
||||
from base import NetworkDriver
|
||||
from exceptions import ReplaceConfigException, MergeConfigException
|
||||
|
||||
from napalm.utils.string_parsers import colon_separated_string_to_dict, convert_uptime_string_seconds
|
||||
|
||||
|
||||
@@ -307,7 +304,9 @@ class FortiOSDriver(NetworkDriver):
|
||||
m = re.search('(.+?) states: (.+?)% user (.+?)% system (.+?)% nice (.+?)% idle', l)
|
||||
cpuname = m.group(1)
|
||||
idle = m.group(5)
|
||||
output[cpuname] = 100 - int(idle)
|
||||
output[cpuname] = {
|
||||
'%usage': 100.0 - int(idle)
|
||||
}
|
||||
return output
|
||||
|
||||
def get_memory(memory_line):
|
||||
@@ -346,7 +345,6 @@ class FortiOSDriver(NetworkDriver):
|
||||
temp_lines = [x for x in sensors_block if any([True for y in ['dts', 'temp', 'adt7490'] if y in x])]
|
||||
out['temperature'] = get_temperature(temp_lines, sensors_block)
|
||||
|
||||
|
||||
# fans
|
||||
out['fans'] = get_fans([x for x in sensors_block if 'fan' in x and 'temp' not in x])
|
||||
|
||||
|
||||
Reference in new issue
Block a user