pymdstat


Namepymdstat JSON
Version 0.4.3 PyPI version JSON
download
home_pagehttps://github.com/nicolargo/pymdstat
SummaryPython library to parse Linux /proc/mdstat
upload_time2023-01-29 07:53:20
maintainer
docs_urlNone
authorNicolas Hennion
requires_python
licenseMIT
keywords raid linux
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            ========
PyMDstat
========

.. image:: https://scrutinizer-ci.com/g/nicolargo/pymdstat/badges/build.png?b=master
        :target: https://scrutinizer-ci.com/g/nicolargo/pymdstat/?branch=master
.. image:: https://scrutinizer-ci.com/g/nicolargo/pymdstat/badges/quality-score.png?b=master
        :target: https://scrutinizer-ci.com/g/nicolargo/pymdstat/?branch=master
.. image:: https://img.shields.io/pypi/v/pymdstat.svg
    :target: https://pypi.python.org/pypi/pymdstat/
    :alt: Latest Version


A pythonic library to parse Linux /proc/mdstat file.

.. code-block:: python

    >>> from pymdstat import MdStat

    >>> mds = MdStat() # Read the /proc/mdstat file

    >>> mds
    Personalities : [raid1] [raid6] [raid5] [raid4]
    md1 : active raid1 sdb2[1] sda2[0]
          136448 blocks [2/2] [UU]

    md2 : active raid1 sdb3[1] sda3[0]
          129596288 blocks [2/2] [UU]

    md3 : active raid5 sdl1[9] sdk1[8] sdj1[7] sdi1[6] sdh1[5] sdg1[4] sdf1[3] sde1[2] sdd1[1] sdc1[0]
          1318680576 blocks level 5, 1024k chunk, algorithm 2 [10/10] [UUUUUUUUUU]

    md0 : active raid1 sdb1[1] sda1[0]
          16787776 blocks [2/2] [UU]

    unused devices: <none>

    >>> mds.get_stats()
    {'arrays': {'md0': {'available': '2',
       'components': {'sda1': '0', 'sdb1': '1'},
       'config': 'UU',
       'status': 'active',
       'type': 'raid1',
       'used': '2'},
      'md1': {'available': '2',
       'components': {'sda2': '0', 'sdb2': '1'},
       'config': 'UU',
       'status': 'active',
       'type': 'raid1',
       'used': '2'},
      'md2': {'available': '2',
       'components': {'sda3': '0', 'sdb3': '1'},
       'config': 'UU',
       'status': 'active',
       'type': 'raid1',
       'used': '2'},
      'md3': {'available': '10',
       'components': {'sdc1': '0',
        'sdd1': '1',
        'sde1': '2',
        'sdf1': '3',
        'sdg1': '4',
        'sdh1': '5',
        'sdi1': '6',
        'sdj1': '7',
        'sdk1': '8',
        'sdl1': '9'},
       'config': 'UUUUUUUUUU',
       'status': 'active',
       'type': 'raid5',
       'used': '10'}},
     'personalities': ['raid1', 'raid6', 'raid5', 'raid4']}

    >>> mds.personalities()
    ['raid1', 'raid6', 'raid5', 'raid4']

    >>> mds.arrays()
    ['md2', 'md3', 'md0', 'md1']

    >>> mds.type('md3')
    'raid6'

    >>> mds.status('md3')
    'active'

    >>> mds.components('md3')
    ['sdk1', 'sdj1', 'sde1', 'sdl1', 'sdg1', 'sdf1', 'sdh1', 'sdc1', 'sdd1', 'sdi1']

    >>> mds.available('md3')
    10

    >>> mds.used('md3')
    10

    >>> mds.config('md3')
    'UUUUUUUUUU'

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/nicolargo/pymdstat",
    "name": "pymdstat",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "raid linux",
    "author": "Nicolas Hennion",
    "author_email": "nicolas@nicolargo.com",
    "download_url": "https://files.pythonhosted.org/packages/86/ee/bb7efa8ef03a35be5072494b4813d5e2d31fd29d8f106b7f73947744d702/pymdstat-0.4.3.tar.gz",
    "platform": null,
    "description": "========\nPyMDstat\n========\n\n.. image:: https://scrutinizer-ci.com/g/nicolargo/pymdstat/badges/build.png?b=master\n        :target: https://scrutinizer-ci.com/g/nicolargo/pymdstat/?branch=master\n.. image:: https://scrutinizer-ci.com/g/nicolargo/pymdstat/badges/quality-score.png?b=master\n        :target: https://scrutinizer-ci.com/g/nicolargo/pymdstat/?branch=master\n.. image:: https://img.shields.io/pypi/v/pymdstat.svg\n    :target: https://pypi.python.org/pypi/pymdstat/\n    :alt: Latest Version\n\n\nA pythonic library to parse Linux /proc/mdstat file.\n\n.. code-block:: python\n\n    >>> from pymdstat import MdStat\n\n    >>> mds = MdStat() # Read the /proc/mdstat file\n\n    >>> mds\n    Personalities : [raid1] [raid6] [raid5] [raid4]\n    md1 : active raid1 sdb2[1] sda2[0]\n          136448 blocks [2/2] [UU]\n\n    md2 : active raid1 sdb3[1] sda3[0]\n          129596288 blocks [2/2] [UU]\n\n    md3 : active raid5 sdl1[9] sdk1[8] sdj1[7] sdi1[6] sdh1[5] sdg1[4] sdf1[3] sde1[2] sdd1[1] sdc1[0]\n          1318680576 blocks level 5, 1024k chunk, algorithm 2 [10/10] [UUUUUUUUUU]\n\n    md0 : active raid1 sdb1[1] sda1[0]\n          16787776 blocks [2/2] [UU]\n\n    unused devices: <none>\n\n    >>> mds.get_stats()\n    {'arrays': {'md0': {'available': '2',\n       'components': {'sda1': '0', 'sdb1': '1'},\n       'config': 'UU',\n       'status': 'active',\n       'type': 'raid1',\n       'used': '2'},\n      'md1': {'available': '2',\n       'components': {'sda2': '0', 'sdb2': '1'},\n       'config': 'UU',\n       'status': 'active',\n       'type': 'raid1',\n       'used': '2'},\n      'md2': {'available': '2',\n       'components': {'sda3': '0', 'sdb3': '1'},\n       'config': 'UU',\n       'status': 'active',\n       'type': 'raid1',\n       'used': '2'},\n      'md3': {'available': '10',\n       'components': {'sdc1': '0',\n        'sdd1': '1',\n        'sde1': '2',\n        'sdf1': '3',\n        'sdg1': '4',\n        'sdh1': '5',\n        'sdi1': '6',\n        'sdj1': '7',\n        'sdk1': '8',\n        'sdl1': '9'},\n       'config': 'UUUUUUUUUU',\n       'status': 'active',\n       'type': 'raid5',\n       'used': '10'}},\n     'personalities': ['raid1', 'raid6', 'raid5', 'raid4']}\n\n    >>> mds.personalities()\n    ['raid1', 'raid6', 'raid5', 'raid4']\n\n    >>> mds.arrays()\n    ['md2', 'md3', 'md0', 'md1']\n\n    >>> mds.type('md3')\n    'raid6'\n\n    >>> mds.status('md3')\n    'active'\n\n    >>> mds.components('md3')\n    ['sdk1', 'sdj1', 'sde1', 'sdl1', 'sdg1', 'sdf1', 'sdh1', 'sdc1', 'sdd1', 'sdi1']\n\n    >>> mds.available('md3')\n    10\n\n    >>> mds.used('md3')\n    10\n\n    >>> mds.config('md3')\n    'UUUUUUUUUU'\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python library to parse Linux /proc/mdstat",
    "version": "0.4.3",
    "split_keywords": [
        "raid",
        "linux"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "facb8156f881e09d9b17513df723bde4d44de197c6dfd433917c8c4168348bdc",
                "md5": "a3ca502368f84e8cd2f1502662ce2a98",
                "sha256": "7fc593da1a2017a7a44c9d61f571ea4c73fcc99b881f62d34fbdcfbd61cc77f2"
            },
            "downloads": -1,
            "filename": "pymdstat-0.4.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a3ca502368f84e8cd2f1502662ce2a98",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 8699,
            "upload_time": "2023-01-29T07:53:19",
            "upload_time_iso_8601": "2023-01-29T07:53:19.587483Z",
            "url": "https://files.pythonhosted.org/packages/fa/cb/8156f881e09d9b17513df723bde4d44de197c6dfd433917c8c4168348bdc/pymdstat-0.4.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "86eebb7efa8ef03a35be5072494b4813d5e2d31fd29d8f106b7f73947744d702",
                "md5": "b12257e84b1b37dde30429aeb20e4221",
                "sha256": "606f5032aad67c5f096fdc1c56cbe9beba80f5c1aa544c6b82a3e12c8f9105f1"
            },
            "downloads": -1,
            "filename": "pymdstat-0.4.3.tar.gz",
            "has_sig": false,
            "md5_digest": "b12257e84b1b37dde30429aeb20e4221",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5736,
            "upload_time": "2023-01-29T07:53:20",
            "upload_time_iso_8601": "2023-01-29T07:53:20.729984Z",
            "url": "https://files.pythonhosted.org/packages/86/ee/bb7efa8ef03a35be5072494b4813d5e2d31fd29d8f106b7f73947744d702/pymdstat-0.4.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-29 07:53:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "nicolargo",
    "github_project": "pymdstat",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "pymdstat"
}
        
Elapsed time: 0.06049s