Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
cb651db
add dumb parser for parse cisco ios xe
Nov 30, 2019
2b3ae7e
add CiscoIOSXE parser to sysdescrparser
Nov 30, 2019
8a11e95
add some ios xe samples to test ios xe parser
Nov 30, 2019
3bcd2bf
add ability to parse centos and ubuntu in linux parser
Dec 3, 2019
c9a0e21
change sample data due to changing linux parse function
Dec 3, 2019
b0169b7
fix bug for not showing ubuntu lts version in string with ubuntu, and…
Dec 4, 2019
269ba31
change samples due to changing linux parse
Dec 4, 2019
39b4dd7
add more sample for catch ubuntu version from hostname
Dec 4, 2019
2913cfc
add setup for 0.1.9 version
Dec 4, 2019
438bfbb
better name for parsing in our vms parser
Dec 7, 2019
9f5cb3e
add linux snmp utils
Dec 7, 2019
2977e1e
update versions os-lookup since change ubuntu to ubuntu_linux
Dec 7, 2019
8fac575
add RouterOS for MikroTik to sysdescrparser
Jan 7, 2020
7089ae6
update version 0.1.14
Jan 7, 2020
e2c8fba
change os name in samples since we change them in parser
Jan 7, 2020
d601f67
add mikrotik routeros to main parser
Jan 8, 2020
af8a898
add r to start of regex string
Jan 8, 2020
c6bde10
0.1.16 release
Jan 8, 2020
a3246b5
:poop: 0.1.17 from now i will run some test :)
Jan 8, 2020
2dcf44e
add some test for MikroTik RouterOS
Jan 8, 2020
1a49dc5
add one more test for MikroTik RouterOS
Jan 8, 2020
5fa6a50
:bug: mikrotik routeros parser ignore dash in version e.g. (long-term)
Jan 27, 2020
90a8487
add RouterOS test for long-term version
Jan 27, 2020
4537b95
update version in setup.py
Jan 27, 2020
b385f98
create pythonpackage.yml
mramirsha Apr 29, 2020
6c3d9ac
add cisco asa parser
mramirsha May 10, 2020
a9913df
add cisco asa parser
mramirsha May 10, 2020
b2278da
some change
mramirsha May 10, 2020
c28d157
add cisco asa parser
mramirsha May 10, 2020
4357d7e
Merge remote-tracking branch 'origin/master'
mramirsha May 10, 2020
a10a1ad
delete github workflow
mramirsha May 10, 2020
19eeb9f
change os name
mramirsha May 10, 2020
f3df1ea
Merge pull request #1 from mramirsha/master
yzdann May 10, 2020
45fa414
added fortinet file and FortiNet class
Ali-Nazarii Jan 30, 2021
a92a67d
added fortinet_fortios file and FortiOs class
Ali-Nazarii Jan 30, 2021
e5eebda
add FortiOs
Ali-Nazarii Jan 30, 2021
623f438
Merge pull request #1 from mramirsha/feature/FortigateFirewall
mramirsha Feb 2, 2021
59eaa2f
Merge pull request #2 from mramirsha/master
yzdann Feb 2, 2021
1ce5aab
Bump version 0.1.19
yzdann Feb 2, 2021
c57d595
Bump version to 0.1.20
yzdann Feb 2, 2021
806ece5
Added new vendor Aruba
carlosmaor Feb 19, 2021
78dc5e7
Added samples
carlosmaor Feb 22, 2021
7c88f3f
Merge pull request #3 from datadope-io/feature/aruba
yzdann Feb 22, 2021
80a385d
Bump version to 0.1.21
yzdann Feb 22, 2021
b447223
Force the use of full module paths and simplify utils
rlaneyjr Mar 18, 2022
30d9f07
Update URLS
rlaneyjr Mar 18, 2022
9f12feb
Fixe TOX envs
rlaneyjr Mar 18, 2022
616d0e9
Fixed URL links
rlaneyjr Mar 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ dist/
htmlcov/
migrations/
test_result.txt
.python-version
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ language: python
sudo: false

env:
- TOXENV=py27
- TOXENV=py36
- TOXENV=py38
- TOXENV=py39
- TOXENV=py310

install:
- pip install virtualenv tox docutils coveralls
Expand Down
14 changes: 7 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ If you have any need to handle the equipment that this module does not support,
then please send the sysDescr value to this package author.
Or, please contact using function of the such as github pull request.

.. image:: https://secure.travis-ci.org/mtoshi/sysdescrparser.svg?branch=master
:target: http://travis-ci.org/mtoshi/sysdescrparser
.. image:: https://coveralls.io/repos/mtoshi/sysdescrparser/badge.svg?branch=master
:target: https://coveralls.io/r/mtoshi/sysdescrparser?branch=master
.. image:: https://secure.travis-ci.org/rlaneyjr/sysdescrparser.svg?branch=master
:target: http://travis-ci.org/rlaneyjr/sysdescrparser
.. image:: https://coveralls.io/repos/rlaneyjr/sysdescrparser/badge.svg?branch=master
:target: https://coveralls.io/r/rlaneyjr/sysdescrparser?branch=master
.. image:: https://img.shields.io/pypi/v/sysdescrparser.svg
:target: https://pypi.python.org/pypi/sysdescrparser/
:alt: Latest Version

Requirements
-------------
* Python2.7, 3.5, 3.6, 3.7, PyPy.
* Python3.8, 3.9, 3.10, PyPy.

Instration
-----------
Expand All @@ -37,7 +37,7 @@ Instration

or

$ git clone https://github.com/mtoshi/sysdescrparser
$ git clone https://github.com/rlaneyjr/sysdescrparser
$ cd sysdescrparser
$ sudo python setup.py install

Expand Down Expand Up @@ -88,7 +88,7 @@ Parsing logic and Support Vendor and OS
----------------------------------------
* About parsing logic and support of vendor and os.
Of course you are able to see this python code and also see how it works easily from sample data.
https://github.com/mtoshi/sysdescrparser/blob/master/samples/sample_data.json
https://github.com/rlaneyjr/sysdescrparser/blob/master/samples/sample_data.json
It will be able to understand almost.
(Sometimes, using hard code. And also using UNKNOWN values.)
This sample data is also used directly by code test.
Expand Down
2 changes: 1 addition & 1 deletion samples/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import os
import json
from sysdescrparser import sysdescrparser
from sysdescrparser.sysdescrparser import sysdescrparser


def main():
Expand Down
144 changes: 132 additions & 12 deletions samples/sample_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,46 @@
"version": "12.2(50)SG3"
},

{
"raw": "Cisco IOS Software [Everest], Catalyst L3 Switch Software (CAT3K_CAA-UNIVERSALK9-M), Experimental Version 16.4.20170410:165034 [v164_throttle-BLD-BLD_V164_THROTTLE_LATEST_20170410_174845 105]",
"vendor": "CISCO",
"os": "IOSXE",
"model": "CAT3K_CAA-UNIVERSALK9-M",
"version": "16.4.20170410:165034"
},

{
"raw": "Cisco IOS XE Software, Version 16.06.05 Cisco IOS Software [Everest], ISR Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 16.6.5, RELEASE SOFTWARE (fc3)",
"vendor": "CISCO",
"os": "IOSXE",
"model": "X86_64_LINUX_IOSD-UNIVERSALK9-M",
"version": "16.06.05"
},

{
"raw": "Cisco IOS Software, IOS-XE Software, Catalyst 4500 L3 Switch Software (cat4500e-UNIVERSALK9-M), Version 03.03.02.SG RELEASE SOFTWARE (fc1)",
"vendor": "CISCO",
"os": "IOSXE",
"model": "cat4500e-UNIVERSALK9-M",
"version": "03.03.02.SG"
},

{
"raw": "Cisco IOS Software [Denali], Catalyst L3 Switch Software (CAT3K_CAA-UNIVERSALK9-M), Version 16.3.1a, RELEASE SOFTWARE (fc4)",
"vendor": "CISCO",
"os": "IOSXE",
"model": "CAT3K_CAA-UNIVERSALK9-M",
"version": "16.3.1a"
},

{
"raw": "Cisco IOS Software [Fuji], ASR1000 Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 16.7.1prd4, RELEASE SOFTWARE (fc1)",
"vendor": "CISCO",
"os": "IOSXE",
"model": "X86_64_LINUX_IOSD-UNIVERSALK9-M",
"version": "16.7.1prd4"
},

{
"raw": "Cisco NX-OS(tm) cgr1000, Software (cgr1000-uk9), Version 5.2(1)CG2(1), Interim version 5.2(1)CG2(0.167), RELEASE SOFTWARE Copyright (c) 2002-2011 by Cisco Systems, Inc. Compiled 1/1/2012 1:00:00",
"vendor": "CISCO",
Expand Down Expand Up @@ -95,6 +135,38 @@
"version": "3.6.0[00]"
},

{
"raw": "RouterOS 6.43.4 (stable) on RB750",
"vendor": "MikroTik",
"os": "RouterOS",
"model": "RB750",
"version": "6.43.4"
},

{
"raw": "RouterOS 6.43.4 (stable) on RB951-2n",
"vendor": "MikroTik",
"os": "RouterOS",
"model": "RB951-2n",
"version": "6.43.4"
},

{
"raw": "RouterOS 6.47 (stable) on CCR1036-12G-4S",
"vendor": "MikroTik",
"os": "RouterOS",
"model": "CCR1036-12G-4S",
"version": "6.47"
},

{
"raw": "RouterOS 6.44.5 (long-term) on CCR1036-12G-4S",
"vendor": "MikroTik",
"os": "RouterOS",
"model": "CCR1036-12G-4S",
"version": "6.44.5"
},

{
"raw": "Juniper Networks, Inc. ex2200-24t-4g internet router, kernel JUNOS 10.2R1.8 #0: 2010-05-27 20:13:49 UTC",
"vendor": "JUNIPER",
Expand Down Expand Up @@ -593,34 +665,58 @@

{
"raw": "Linux HOSTNAME 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u1",
"vendor": "UNKNOWN",
"os": "LINUX",
"vendor": "LINUX",
"os": "LINUX_KERNEL",
"model": "UNKNOWN",
"version": "3.2.0-4-amd64"
},

{
"raw": "Linux HOSTNAME 2.6.32-358.6.2.el6.x86_64 #1 SMP Thu May 16 20:59:36 UTC 2013 x86_64",
"vendor": "UNKNOWN",
"os": "LINUX",
"model": "UNKNOWN",
"version": "2.6.32-358.6.2.el6.x86_64"
"vendor": "CENTOS",
"os": "CENTOS",
"model": "2.6.32-358.6.2.el6.x86_64",
"version": "6.0"
},

{
"raw": "Linux HOSTNAME 2.6.21-1.3194.fc7 #1 SMP Wed May 23 22:35:01 EDT 2007 i686",
"vendor": "UNKNOWN",
"os": "LINUX",
"vendor": "LINUX",
"os": "LINUX_KERNEL",
"model": "UNKNOWN",
"version": "2.6.21-1.3194.fc7"
},

{
"raw": "Linux hostname 3.2.0-56-generic-pae #86-Ubuntu SMP Wed Oct 23 17:51:27 UTC 2013 i686",
"vendor": "UNKNOWN",
"os": "LINUX",
"model": "UNKNOWN",
"version": "3.2.0-56-generic-pae"
"vendor": "CANONICAL",
"os": "UBUNTU_LINUX",
"model": "3.2.0-56-generic-pae",
"version": "UNKNOWN"
},

{
"raw": "Linux ubuntu-bionic 4.15.0-70-generic #79-Ubuntu SMP Tue Nov 12 10:36:11 UTC 2019 x86_64",
"vendor": "CANONICAL",
"os": "UBUNTU_LINUX",
"model": "4.15.0-70-generic",
"version": "18.04"
},

{
"raw": "Linux ubuntu-xenial 4.4.0-169-generic #198-Ubuntu SMP Tue Nov 12 10:38:00 UTC 2019 x86_64",
"vendor": "CANONICAL",
"os": "UBUNTU_LINUX",
"model": "4.4.0-169-generic",
"version": "16.04"
},

{
"raw": "Linux vagrant-ubuntu-trusty-64 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64",
"vendor": "CANONICAL",
"os": "UBUNTU_LINUX",
"model": "3.13.0-170-generic",
"version": "14.04"
},

{
Expand Down Expand Up @@ -791,6 +887,30 @@
"version": "Rev.8.03.92"
},

{
"raw": "ArubaOS (MODEL: 515), Version 8.6.0.4-8.6.0.4",
"vendor": "ARUBA",
"os": "ArubaOS",
"model": "515",
"version": "8.6.0.4-8.6.0.4"
},

{
"raw": "ArubaOS (MODEL: Aruba7010), Version 8.3.0.0 (64659)",
"vendor": "ARUBA",
"os": "ArubaOS",
"model": "7010",
"version": "8.3.0.0 (64659)"
},

{
"raw": "ArubaOS (MODEL: Aruba7210), Version 6.5.1.6 (60228)",
"vendor": "ARUBA",
"os": "ArubaOS",
"model": "7210",
"version": "6.5.1.6 (60228)"
},

{
"raw": "xxxxxxxxxxxxxxx",
"vendor": "UNKNOWN",
Expand Down
23 changes: 10 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,10 @@ def run_tests(self):
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: System :: Networking",
Expand All @@ -65,17 +62,17 @@ def run_tests(self):
EXCLUDE_FROM_PACKAGES = ['tests']

setup(
name="sysdescrparser",
version="0.1.6",
description='SNMP sysDescr parser.',
name="snmpsysdescrparser",
version="0.1.22",
description='SNMP sysDescr parser fork for Windows Support',
long_description=README,
author='Toshikatsu Murakoshi',
author_email='mtoshi.g@gmail.com',
url='https://github.com/mtoshi/sysdescrparser',
author='Yazdan',
author_email='yzdannn@gmail.com',
url='https://github.com/rlaneyjr/sysdescrparser',
license='MIT',
classifiers=classifiers,
packages=find_packages(exclude=EXCLUDE_FROM_PACKAGES),
py_modules=['sysdescrparser'],
py_modules=['snmpsysdescrparser'],
data_files=[],
install_requires=requires,
include_package_data=True,
Expand Down
8 changes: 1 addition & 7 deletions sysdescrparser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,4 @@

"""Sysdescrparser."""

import sys

# pylint: disable=unused-import
if sys.version_info.major == 2:
from sysdescrparser import sysdescrparser
else:
from sysdescrparser.sysdescrparser import sysdescrparser
# Removed lifting to force full path use
2 changes: 1 addition & 1 deletion sysdescrparser/a10.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"""sysdescrparser.a10."""

from sysdescr import SysDescr
from sysdescrparser.sysdescr import SysDescr


# pylint: disable=no-name-in-module
Expand Down
2 changes: 1 addition & 1 deletion sysdescrparser/a10_acos.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


import re
from a10 import A10
from sysdescrparser.a10 import A10


# pylint: disable=no-member
Expand Down
2 changes: 1 addition & 1 deletion sysdescrparser/arista.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"""sysdescrparser.arista."""

from sysdescr import SysDescr
from sysdescrparser.sysdescr import SysDescr


# pylint: disable=no-name-in-module
Expand Down
2 changes: 1 addition & 1 deletion sysdescrparser/arista_eos.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


import re
from arista import Arista
from sysdescrparser.arista import Arista


# pylint: disable=no-member
Expand Down
38 changes: 38 additions & 0 deletions sysdescrparser/aruba.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# -*- coding: utf-8 -*-

"""sysdescrparser.aruba."""

import re
from sysdescrparser.sysdescr import SysDescr


# pylint: disable=no-name-in-module
# pylint: disable=no-member
class Aruba(SysDescr):

"""Class Aruba.

This class is only for vendor definition.

"""

def __init__(self, raw):
"""Constructor."""
super(Aruba, self).__init__(raw)
self.vendor = 'ARUBA'
self.model = self.UNKNOWN
self.os = 'ArubaOS'
self.version = self.UNKNOWN

def parse(self):
"""Parsing for sysDescr value."""
regex = (r'ArubaOS'
r'.* \(MODEL: (?:Aruba)?(.*)\), Version (.*)')
pat = re.compile(regex)
res = pat.search(self.raw)
if res:
self.model = res.group(1)
self.version = res.group(2)
return self

return False
2 changes: 1 addition & 1 deletion sysdescrparser/brocade.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"""sysdescrparser.brocade."""

from sysdescr import SysDescr
from sysdescrparser.sysdescr import SysDescr


# pylint: disable=no-name-in-module
Expand Down
Loading