{ "info": { "author": "MickBad", "author_email": "prog@mickbad.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "License :: OSI Approved :: MIT License", "Natural Language :: French", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries", "Topic :: System", "Topic :: System :: Monitoring", "Topic :: System :: Systems Administration", "Topic :: Utilities" ], "description": "# Swappy\n\nFast tools for checking swap memory and remove it in gnu/linux system\n\n**Installation**\n\n```bash\n$ pip install swappy\n```\n\n\n\n**Usage for programming**\n\n```python\n# create automatic procedure\nfrom swappy.swappy import swapcheck_main\nconfig_pathname = \"/path/to/config.yml\"\nswapcheck_main(config_pathname,\n simulation=False,\n display_stdout=True)\n\n# personnal usage\nfrom swappy.swappy import SwapInfo\nswap = SwapInfo()\nprint(swap.swap_memory().percent) # percentage of swap\nprint(swap.swap_total) # total swap taken by system\nprint(swap.count()) # total process found\nprint(swap.swap_info_text(\"pid\")) # display text/plain output ordering by pid\nprint(swap.can_reset()) # can we reset swap with left memories?\n```\n\n**Usage for scripting**\n\n```bash\n$ swappy-check --help\nPython script to check linux swap pressure\nBy Mickael Badet (prog at mickbad dot com)\nhttps://github.com/mickbad/swappy\n\nUsage: swappy-check [options] /path/to/config.yml\n\nOptions:\n -h, --help show this help message and exit\n --info show in stdout swap files if alert [default=False]\n --simulate simulate resetting swap [default=False]\n \n$ sudo swappy-check /path/to/swappy.yml\nSwap Checker v1.0.0\nswap pressure: 0.00%\n```\n\n\n\n**Configuration**\n\n```yaml\n# -------------------------------------------------------\n# - YaML configuration for swappy checker\n# -------------------------------------------------------\n\n# configuration for swap alerting\nswap:\n # percent alerting (float) **default = 50.0**\n alert-limit: 20.0\n\n # ordering for array in template (name, pid or swap)\n order-by: swap\n\n # reset swap if alert\n reset-swap: True\n\n # post process after alert\n pre-process-alert:\n enable: True\n commands:\n # command list to before resetting\n - apt update\n - ls -lF /tmp\n\n # post process after alert\n post-process-alert:\n enable: True\n commands:\n # command list to after resetting\n - apt update\n - ls -la /tmp\n\n # send email to adminsys\n email:\n enable: True\n from: Alert Swap \n subject: Alert swap on this server for {dd}/{mm}/{yyyy} - {H}:{M}:{S}\n to: my@email.com, my_another@email.com\n template: |\n Alert swap detected:
\n \u27a1\ufe0f percent info: {swap_percent} %
\n \u27a1\ufe0f list of pressure:
\n {swap_list}
\n
\n AdminSys
\n\n# SMTP Configuraiton\nsmtp:\n host: localhost\n port: 25\n tls: False\n login:\n password:\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mickbad/swappy", "keywords": "linux tools fasting swap", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "swappy", "package_url": "https://pypi.org/project/swappy/", "platform": "", "project_url": "https://pypi.org/project/swappy/", "project_urls": { "Homepage": "https://github.com/mickbad/swappy" }, "release_url": "https://pypi.org/project/swappy/1.2.0.post1/", "requires_dist": null, "requires_python": "", "summary": "Fast check swap and interact", "version": "1.2.0.post1" }, "last_serial": 4898779, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "f5e0c0d77b4ad3037b6941b800875dd9", "sha256": "bcba7d48d0cbdf3f21646ebaa330ef491773ad12867b2fb53e6199ed15d1c75d" }, "downloads": -1, "filename": "swappy-1.0.0.tar.gz", "has_sig": false, "md5_digest": "f5e0c0d77b4ad3037b6941b800875dd9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7175, "upload_time": "2018-10-22T14:38:41", "url": "https://files.pythonhosted.org/packages/92/b5/c7fbadadd6dbecd1e28923ecdcc66d36f502ab6c5b8871c1c6b69c8b68f8/swappy-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "daac922992fcc7376a527554e242975d", "sha256": "0c8c48bd3e96f0e0cb0b742c83d349a97dfc1f7361f278cc2c2b7960abd99181" }, "downloads": -1, "filename": "swappy-1.0.1.tar.gz", "has_sig": false, "md5_digest": "daac922992fcc7376a527554e242975d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7224, "upload_time": "2018-10-22T15:08:58", "url": "https://files.pythonhosted.org/packages/56/6d/53da6851ce6c1e1c5bf588ae344db6da5ed9698ccd5189e959abe722b86f/swappy-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "6ff570dd43854a5700bd549174c5b7ca", "sha256": "31b73048fdae9b7ce002bced02344dabc029f384129be41ec81d0e0905db2607" }, "downloads": -1, "filename": "swappy-1.0.2.tar.gz", "has_sig": false, "md5_digest": "6ff570dd43854a5700bd549174c5b7ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7106, "upload_time": "2018-10-22T16:05:51", "url": "https://files.pythonhosted.org/packages/29/fa/fda4ce6d42183f540f252a9730022118de53bc09ac8c927d8083b63fdd7a/swappy-1.0.2.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "8475039e5ee1751544568db5b48a8019", "sha256": "e1f94fb617e51126adde5dab120925c5a86cbbe8febfb31d620dd3c60cdc2c08" }, "downloads": -1, "filename": "swappy-1.1.0.tar.gz", "has_sig": false, "md5_digest": "8475039e5ee1751544568db5b48a8019", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7376, "upload_time": "2018-10-27T20:26:14", "url": "https://files.pythonhosted.org/packages/0e/44/9a08a57cca90512c1e4bf33203b39da4a2983c39be46af1a37120e0d4668/swappy-1.1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "ae37d1b8d7407b8f49036494af8ae6b7", "sha256": "25a419216609ad78d1169d46bff8a46dcee923a9e873bb3d0c5fdd08bbc6a298" }, "downloads": -1, "filename": "swappy-1.2.0.tar.gz", "has_sig": false, "md5_digest": "ae37d1b8d7407b8f49036494af8ae6b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7473, "upload_time": "2018-10-27T20:53:08", "url": "https://files.pythonhosted.org/packages/08/b4/edb889563417d23c1eed6b37c7edb2875ea0fc5abc8f036f18438c559a47/swappy-1.2.0.tar.gz" } ], "1.2.0.post1": [ { "comment_text": "", "digests": { "md5": "4095b30d758b45d7395b16485f503355", "sha256": "6a5b8b0087dbf6e71e85703035c6751cbf50efc867ad2724a235379440687e1d" }, "downloads": -1, "filename": "swappy-1.2.0.post1.tar.gz", "has_sig": false, "md5_digest": "4095b30d758b45d7395b16485f503355", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7474, "upload_time": "2019-03-05T11:03:14", "url": "https://files.pythonhosted.org/packages/99/dd/11a870504f8f382e1788312bbf50d2262e87895d71ffe4c8d0a3fd7f5de2/swappy-1.2.0.post1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4095b30d758b45d7395b16485f503355", "sha256": "6a5b8b0087dbf6e71e85703035c6751cbf50efc867ad2724a235379440687e1d" }, "downloads": -1, "filename": "swappy-1.2.0.post1.tar.gz", "has_sig": false, "md5_digest": "4095b30d758b45d7395b16485f503355", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7474, "upload_time": "2019-03-05T11:03:14", "url": "https://files.pythonhosted.org/packages/99/dd/11a870504f8f382e1788312bbf50d2262e87895d71ffe4c8d0a3fd7f5de2/swappy-1.2.0.post1.tar.gz" } ] }