Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some fields are not extracting properly #8

Open
harishcr opened this issue Sep 24, 2018 · 1 comment
Open

some fields are not extracting properly #8

harishcr opened this issue Sep 24, 2018 · 1 comment
Labels

Comments

@harishcr
Copy link

I tried to use your script to get ifconfig and I am seeing problem with few fields are not extracting properly, please see below sample test results. Please let me know if I am missing anything, thanks.

harish@xbs3 (master):tests$ cat mytest_ifcfg_parser.py
import pprint
import commands
from ifparser import Ifcfg

ifdata = Ifcfg(commands.getoutput('/sbin/ifconfig -a'))

eth2 = ifdata.get_interface('eth2')
pprint.pprint(eth2.get_values())

harish@xbs3 (master):tests$ python mytest_ifcfg_parser.py
{u'BROADCAST': True,
u'DYNAMIC': False,
u'LOOPBACK': False,
u'MASTER': False,
u'MULTICAST': True,
u'NOARP': False,
u'POINTOPOINT': False,
u'PROMISC': False,
u'RUNNING': True,
u'SIMPLEX': False,
u'SMART': False,
u'UP': True,
u'bcast': None,
u'hwaddr': 'b4:96:91:02:e3:c4',
u'interface': 'eth2',
u'ip': None,
u'itype': None,
u'mask': None,
u'mtu': '1500',
u'rxbytes': None,
u'rxdroppedpkts': None,

u'rxerrors': None,
u'rxframe': None,
u'rxoverruns': None,
u'rxpkts': None,
u'txbytes': None,

u'txpkts': '41276367'}
harish@xbs3 (master):tests$ /sbin/ifconfig eth2

eth2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether b4:96:91:02:e3:c4 txqueuelen 1000 (Ethernet)
RX packets 120189236 bytes 64423737706 (59.9 GiB)
RX errors 0 dropped 636408 overruns 0 frame 0
TX packets 41276427 bytes 16461100298 (15.3 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

@sanketsudake
Copy link
Owner

@harishcr Can you mention following details?

  1. Linux distro details
  2. Python version
  3. Ifconfig output captured in txt file

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

No branches or pull requests

2 participants