Skip to content
This repository has been archived by the owner on Mar 7, 2018. It is now read-only.

Faulty data returned from get_environment() #81

Closed
tehhobbit opened this issue Nov 4, 2016 · 1 comment
Closed

Faulty data returned from get_environment() #81

tehhobbit opened this issue Nov 4, 2016 · 1 comment
Assignees
Milestone

Comments

@tehhobbit
Copy link
Contributor

Description of Issue/Question

get_environment() returns wrong data in the following cases

  • On board sensors was never reported due to the following code piece

except: pass

Cpu usage was only reported for userspace due to the following regex

m = re.search('(\d+.\d+)\%', cpu_output.splitlines()[2])

Total memory was reported instead of available memory due to the following regex

`m = re.search('(\d+)k\W+total\W+(\d+)k\W+used\W+(\d+)k\W+free', cpu_output.splitlines()[3])

environment_counters['memory'] = {
'available_ram': int(m.group(1)),
'used_ram': int(m.group(2))
}`

Setup

napalm-eos version

(Paste verbatim output from pip freeze | grep napalm-eos between quotes below)

napalm-eos==0.4.1

eOS version

(Paste verbatim output from show version | json between quotes below)

{
    "modelName": "DCS-7280SR-48C6-M-R",
    "internalVersion": "4.17.1F-3465508.4171F",
    "systemMacAddress": "44:4c:a8:cd:33:7d",
    "serialNumber": "xxxxx",
    "memTotal": 32472080,
    "bootupTimestamp": 1475664380.55,
    "memFree": 29064052,
    "version": "4.17.1F",
    "architecture": "i386",
    "isIntlVersion": false,
    "internalBuildId": "5b73e68d-e45b-4748-8d38-abf09997c867",
    "hardwareRevision": "11.03"
}

Steps to Reproduce the Issue

Pull environment from any fixed form factor arista and you will see several sensors missing
Pull environment from any arista and you will see only userspace cpu usage being reported
Pulll environment from any arista and total memory will be reported as available memory

Error Traceback

(Paste the complete traceback of the exception between quotes below)


@mirceaulinic mirceaulinic added this to the 0.4.3 milestone Nov 4, 2016
@dbarrosop dbarrosop modified the milestones: 0.4.4, 0.4.3 Nov 7, 2016
@dbarrosop
Copy link
Member

Fixed on #79

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants