{ "info": { "author": "Grupa Allegro Sp. z o.o. and Contributors", "author_email": "it-ralph-dev@allegro.pl", "bugtrack_url": null, "classifiers": [], "description": "======\nSelena\n======\n\nIntroduction\n============\n\nSelena is a tool for monitoring website performance by monitoring response\ntimes, response codes and site content (via keyword checks).\n\nIt's distributed by design via agents which can be geographically separate\nallowing for monitoring the user experience from multiple ISP-s.\n\nInstallation\n============\n\nRequirements\n~~~~~~~~~~~~\nSelena requires Python 2.7 which is included in the latest Ubuntu Server 12.04 LTS systems::\n\n $ sudo apt-get install python-dev python-virtualenv\n\nMessage queue\n~~~~~~~~~~~~~\n\nSelena communicates with a central queue with `Redis `_ as the broker. Install redis::\n\n $ sudo apt-get install redis-server\n\nSince lost tasks can always be resent, the durability guarantees that Redis\nprovides by default are not necessary. You can significantly speed up the queue\nby commenting out the ``save`` lines from ``/etc/redis/redis.conf``.\n\nWe can check the status of the Redis server::\n\n $ redis-cli -h localhost -p 6379 -n 0 info\n\nVirtual Environment\n~~~~~~~~~~~~~~~~~~~\n\nLet's create a virtual environment for Python in the user's home::\n\n $ virtualenv . --distribute --no-site-packages\n\nSystem User\n~~~~~~~~~~~\n\nUnprivileged and not owned by a person::\n\n $ sudo adduser --home /home/selena selena\n $ sudo su - selena\n\nIn any shell the user can *activate* the virtual environment. As a result of\nthat, the default Python executable and helper scripts will point to those\nwithin the virtualenv directory structure::\n\n $ which python\n /usr/local/bin/python\n $ . bin/activate\n (selena)$ which python\n /home/selena/bin/python\n\nDatabase\n~~~~~~~~\n\nSelena uses and supports MySQL. To install MySQL invoke::\n\n $ sudo apt-get install mysql-server libmysqlclient-dev libmysqld-dev\n\nYou now have to create a database and a user for Selena system. You can find many tutorials for that on the Internet.\n\n\nCache\n~~~~~\n\nSelena requires some cache system like *memcached*. Install::\n\n $ sudo apt-get install memcached\n\n\nInstalling from pip\n~~~~~~~~~~~~~~~~~~~\n\nSimply invoke::\n\n (selena)$ pip install selena\n\nInstalling from sources\n~~~~~~~~~~~~~~~~~~~~~~~\n\nAlternatively, to live on the bleeding edge, you can clone the selena git\nrepository to ``project`` and install it manually::\n\n (selena)$ git clone git://github.com/allegro/selena.git project\n (selena)$ cd project\n (selena)$ pip install -e .\n\n\nSelena Agent\n~~~~~~~~~~~~\n\nTo function properly, Selena needs `Selena-agent `_ package installed and configured.\n\n\nConfiguration\n~~~~~~~~~~~~~\n\nCreate file /INSTALL_DIR/src/selena/selena/settings-local.py and fill in the appropriate\ndata.\n\nFill MySQL connection data::\n\n DATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.mysql',\n 'NAME': 'your database name',\n 'USER': 'your database username',\n 'PASSWORD': 'your database password',\n 'HOST': 'localhost',\n 'PORT': '3306',\n 'OPTIONS': {\n 'init_command': 'SET storage_engine=INNODB,character_set_connection=utf8,collation_connection=utf8_unicode_ci'\n }\n }\n }\n\nGenerate new secret keys::\n\n SECRET_KEY = 'very_unique_string'\n AES_SECRET_KEY = b'sixteen byte key'\n\nSet the number of minutes that will be displayed by the service errors, example 30::\n\n ERROR_TIME_INTERVAL = 30\n\nDefine RQ queues. The `default` queue is required. You have to also define one queue for main selena agent, for example `agent_1`::\n\n RQ_QUEUES = {\n 'default': {\n 'HOST': '127.0.0.1', # Redis host\n 'PORT': 6379, # Redis port\n 'DB': None,\n 'PASSWORD': None,\n },\n 'agent_1': {\n 'HOST': '127.0.0.1',\n 'PORT': 6379,\n 'DB': None,\n 'PASSWORD': None,\n },\n }\n\nYou can define additional queues: `planner`, `archiving`, `dispacher`, `monitors`, `stats`. They are used as follows:\n\n *planner* - enable or disable planned technical breaks\n\n *archiving* - create partitions, archive data\n\n *dispacher* - run monitoring tasks for services\n\n *monitors* - collect results from agents\n\n *stats* - calculate statistics\n\n\nYou also have to configure cache. Sample cache configuration (for default `memcached` configs)::\n\n CACHES = {\n 'default': {\n 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',\n 'LOCATION': '127.0.0.1:11211',\n }\n }\n\n\nDatabase preparation\n~~~~~~~~~~~~~~~~~~~~\n\nAfter creating the ``settings-local.py`` file, synchronize the database with\nsources by running the standard ``syncdb`` management command::\n\n $(selena): selena syncdb\n\nthen run migrations command::\n\n $(selena): selena migrate\n\n\nCreate partitions in the database by using the command::\n\n $(selena): selena createpartitions\n\n\nRun web interface\n~~~~~~~~~~~~~~~~~\n\nTo run selena web interface use the command::\n\n (selena)$ selena runserver 8080\n\n\nConfiguration agents\n~~~~~~~~~~~~~~~~~~~~\n\nWhen your selena web interface is running you must add a main agents to your selena instance. Open this link in your browser `http://localhost:8080/admin/services/agent/add/ `_ and log in into administration panel.\n\nYou will see a form where you have to fill the name of your main agent, add a queue (remember the name of the queue must be set in your Selena agent `settings-local.py` file), and check the main agent checkbox. After the agent is added you will see `Salt` column in your agent row. Copy this string and add to the Selena-agent `settings-local.py` file in `SALT` variable. It is very important, because without it there will be no communication with the Selena-agent.\n\nAdd monitored services\n~~~~~~~~~~~~~~~~~~~~~~\nIn administration panel add a service which will be monitored by Selena.\nOpen this link in browser `http://localhost:8080/admin/services/service/add/ `_ and add a service URL to be monitored.\n\n\nCommands\n~~~~~~~~\n\nRun a single monitoring service::\n\n (selena)$: selena monitorall\n\nSearch incidents::\n\n (selena)$: selena searchincidents\n\nActivate/Deactivate technical breaks::\n\n (selena)$: selena technicalbreaks\n\nFor optimization, there are commands to archive service monitoring results.\nIf you create partitions in MySQL database run command::\n\n (selena)$: selena createpartitions\n\nYou will need to run the command that merges monitoring data older than 8 days and moves it to the archive::\n\n (selena)$: selena makearchive\n\nCalculate SLA for active services::\n\n (selena)$: selena calculatesla\n\nIf you want to run the commands asynchronically, you can add an ``--async-mode=1`` option to them.\n\n\n\nAutomation\n~~~~~~~~~~\n\nYou can configure Cron to monitor automatically in background. To edit crontab run command::\n\n $(selena): crontab -e\n\nand add this content::\n\n */1 * * * * /YOUR_VIRTUAL_ENV_PATH/bin/selena monitorall\n */1 * * * * /YOUR_VIRTUAL_ENV_PATH/bin/selena searchincidents --async-mode=1\n */5 * * * * /YOUR_VIRTUAL_ENV_PATH/bin/selena technicalbreaks --async-mode=1\n 0 1 * * * /YOUR_VIRTUAL_ENV_PATH/bin/selena createpartitions --async-mode=1\n 30 1 * * * /YOUR_VIRTUAL_ENV_PATH/bin/selena makearchive --async-mode=1\n 0 3 * * * /YOUR_VIRTUAL_ENV_PATH/bin/selena calculatesla\n\nOf course you can set your own time to execute these commands in Cron.\n\n\nTo see the results of the monitoring in a browser, open the following address:\n`http://localhost:8080 `_\n\nLicense\n=======\nSelena is licensed under the `Apache License, v2.0 `_.\n\nCopyright (c) 2013-2014 `Allegro Group `_.", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/allegro/selena", "keywords": null, "license": "Apache Software License v2.0", "maintainer": null, "maintainer_email": null, "name": "selena", "package_url": "https://pypi.org/project/selena/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/selena/", "project_urls": { "Homepage": "http://github.com/allegro/selena" }, "release_url": "https://pypi.org/project/selena/1.0.4/", "requires_dist": null, "requires_python": null, "summary": "Simple CURL based monitoring system.", "version": "1.0.4" }, "last_serial": 1309779, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "2c3bd51bc8f2631ff3f397b29aefa553", "sha256": "12743dd0148c761e47abb313c8df7cf7659ce020f8e4cd399170558e9e282a87" }, "downloads": -1, "filename": "selena-1.0.0.tar.gz", "has_sig": false, "md5_digest": "2c3bd51bc8f2631ff3f397b29aefa553", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 369227, "upload_time": "2013-05-24T07:11:15", "url": "https://files.pythonhosted.org/packages/60/31/da0ff115b5f3d2d8c9de086764aefc1e00a45a366a3efbea3b2fe7336143/selena-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "b0a49c88e483bdcdcaa528a1d8f15f3d", "sha256": "14a7b0c84686c96994e76cd0e849345e3dc801159139a174db57417e8123816d" }, "downloads": -1, "filename": "selena-1.0.1.tar.gz", "has_sig": false, "md5_digest": "b0a49c88e483bdcdcaa528a1d8f15f3d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 366663, "upload_time": "2013-07-19T13:08:04", "url": "https://files.pythonhosted.org/packages/eb/93/f728baf38c4a533b98a68c86f9b0ff341e4dc6000deef7b3c930a983302f/selena-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "a86eb4ddb1d769f567b82fc952a26022", "sha256": "70dd570201768cba854438b4dfe2d87fdb4e9781c9def26fd48d3fc8d6a5ea8d" }, "downloads": -1, "filename": "selena-1.0.2.tar.gz", "has_sig": false, "md5_digest": "a86eb4ddb1d769f567b82fc952a26022", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 367681, "upload_time": "2013-09-10T07:35:58", "url": "https://files.pythonhosted.org/packages/c4/97/0f1a1ca1ce3441079da0f912bfd920b867e92d0ae5712c51533febe92cd6/selena-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "e2ac84d29ea868926e3dd89c724ab2a8", "sha256": "bbe8b87db9ae929eeacab2bfb39b9ca3d96fec4a2cfa7290cd8b7edfa7d6ffdf" }, "downloads": -1, "filename": "selena-1.0.3.tar.gz", "has_sig": true, "md5_digest": "e2ac84d29ea868926e3dd89c724ab2a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 377497, "upload_time": "2014-11-13T11:34:43", "url": "https://files.pythonhosted.org/packages/d3/74/7d603fb471f93c3b65c266a5bcd5d4be1d1125cd6857fd6a228ca3298a3e/selena-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "9f54489d01794598efbb55679f26f558", "sha256": "c1f9cb32b5df861872c8ace2df7f666ea34186f0f8a7afaa8c97b3d258fa71b5" }, "downloads": -1, "filename": "selena-1.0.4.tar.gz", "has_sig": true, "md5_digest": "9f54489d01794598efbb55679f26f558", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 377480, "upload_time": "2014-11-17T11:27:22", "url": "https://files.pythonhosted.org/packages/7b/72/eaf27933b996a628b94f12298b9c8fa4563d5abdf589aeac99b02a7d5dca/selena-1.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9f54489d01794598efbb55679f26f558", "sha256": "c1f9cb32b5df861872c8ace2df7f666ea34186f0f8a7afaa8c97b3d258fa71b5" }, "downloads": -1, "filename": "selena-1.0.4.tar.gz", "has_sig": true, "md5_digest": "9f54489d01794598efbb55679f26f558", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 377480, "upload_time": "2014-11-17T11:27:22", "url": "https://files.pythonhosted.org/packages/7b/72/eaf27933b996a628b94f12298b9c8fa4563d5abdf589aeac99b02a7d5dca/selena-1.0.4.tar.gz" } ] }