{ "info": { "author": "The Health Agency", "author_email": "techniek@thehealthagency.com", "bugtrack_url": null, "classifiers": [ "Framework :: Buildout", "Intended Audience :: Developers", "License :: OSI Approved :: Zope Public License", "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Simple logcheck recipe\n======================\n\nApplications that generate logfiles inside your buildout can profit from\nregular, you know, actually *checking* those logfiles.\n\n`Logcheck `_ is a unix utility that can go through your\nlogfiles and that will mail you those lines that you find interesting,\nprovided you configure it right with ignores.\n\ntha.recipe.logcheck provides a simple way of setting up a set of local\nconfiguration files for logcheck. To actually use it, z3c.recipe.usercrontab\nis recommended. A ``${logcheck:command}`` option is available for easy\nintegration.\n\n\nDetailed documentation\n======================\n\nSupported options\n-----------------\n\nThe recipe supports the following options:\n\nlogfiles\n Logfiles is a list of one or more logfiles that should be handled by the\n logcheck utility. This parameter is required.\n\nrecipient\n One (?TODO: check) email address to serve as recipient of the logcheck\n emails. This parameter is required.\n\nignores\n Several optional lines of regex expressions. If a regex matches, the\n matching line is excluded from the logcheck email.\n\nsubject\n Subject used in the email subject. (Note: only part of the subject,\n logcheck itself appends/prepends the date and so.) Defaults to logfile\n path instead of the unhelpful \"System Events\" default of logcheck itself.\n\n\nExample usage\n-------------\n\nWe'll start by creating a buildout that uses the recipe::\n\n >>> write('buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = logcheck\n ...\n ... [logcheck]\n ... recipe = tha.recipe.logcheck\n ... logfiles = var/example.log\n ... recipient = someone@example.com\n ... subject = my site\n ... \"\"\")\n\nRunning the buildout installs a directory structure in parts and var::\n\n >>> print 'start', system(buildout) \n start...\n Installing logcheck.\n logcheck: Created /sample-buildout/var/logcheck\n logcheck: Created /sample-buildout/var/logcheck/state\n logcheck: Created /sample-buildout/parts/logcheck\n logcheck: Created /sample-buildout/parts/logcheck/cracking.d\n logcheck: Created /sample-buildout/parts/logcheck/cracking.ignore.d\n logcheck: Created /sample-buildout/parts/logcheck/violations.d\n logcheck: Created /sample-buildout/parts/logcheck/violations.ignore.d\n logcheck: Created /sample-buildout/parts/logcheck/ignore.d.paranoid\n logcheck: Created /sample-buildout/parts/logcheck/ignore.d.server\n logcheck: Created /sample-buildout/parts/logcheck/ignore.d.workstation\n \n >>> ls('var/logcheck')\n d state\n >>> ls('parts/logcheck')\n d cracking.d\n d cracking.ignore.d\n d ignore.d.paranoid\n d ignore.d.server\n d ignore.d.workstation\n - logcheck.conf\n - logcheck.logfiles\n d violations.d\n d violations.ignore.d\n >>> ls('bin')\n - buildout\n\nThe logfiles config file lists the logfiles::\n\n >>> cat('parts/logcheck/logcheck.logfiles')\n /sample-buildout/var/example.log\n\nThe generic config file lists the right directories::\n\n >>> cat('parts/logcheck/logcheck.conf')\n REPORTLEVEL=\"workstation\"\n SENDMAILTO=\"someone@example.com\"\n FQDN=0\n RULEDIR=\"/sample-buildout/parts/logcheck\"\n LOCKFILE=\"/sample-buildout/var/logcheck/lock\"\n LOGFILES_LIST=\"/sample-buildout/parts/logcheck/logcheck.logfiles\"\n STATEDIR=\"/sample-buildout/var/logcheck/state\"\n EVENTSSUBJECT=\"my site\"\n\nIf you don't specify a subject, the default fallback is the filename that is\nchecked (added in 0.4):\n\n >>> write('buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = logcheck\n ...\n ... [logcheck]\n ... recipe = tha.recipe.logcheck\n ... logfiles = var/example.log\n ... recipient = someone@example.com\n ... \"\"\")\n >>> print 'start', system(buildout) \n start Uninstalling logcheck.\n Installing logcheck.\n \n >>> cat('parts/logcheck/logcheck.conf')\n REPORTLEVEL=\"workstation\"\n SENDMAILTO=\"someone@example.com\"\n FQDN=0\n RULEDIR=\"/sample-buildout/parts/logcheck\"\n LOCKFILE=\"/sample-buildout/var/logcheck/lock\"\n LOGFILES_LIST=\"/sample-buildout/parts/logcheck/logcheck.logfiles\"\n STATEDIR=\"/sample-buildout/var/logcheck/state\"\n EVENTSSUBJECT=\"/sample-buildout/var/example.log\"\n\n\nSpecifiying two logfiles is possible\n\n >>> write('buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = logcheck\n ...\n ... [logcheck]\n ... recipe = tha.recipe.logcheck\n ... logfiles =\n ... var/example.log\n ... var/emergency.log\n ... recipient = someone@example.com\n ... subject = my site\n ... \"\"\")\n >>> print 'start', system(buildout) \n start Uninstalling logcheck.\n Installing logcheck.\n \n >>> cat('parts/logcheck/logcheck.logfiles')\n /sample-buildout/var/example.log\n /sample-buildout/var/emergency.log \n\n\nStrategy\n--------\n\nThe logcheck setup done by this recipe is very simple. The needed logcheck\ndirectories are created, but mostly left empty. This means that all logfile\nmessages are, in principle, mailed.\n\nThis is obviously not intended. Therefore the ``ignore.d.workstation``\ndirectory has one file with ignore regex's if you specified them.\n\n >>> ls('parts/logcheck/ignore.d.workstation')\n\nWe specify a regex::\n\n >>> write('buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = logcheck\n ...\n ... [logcheck]\n ... recipe = tha.recipe.logcheck\n ... logfiles = var/example.log\n ... recipient = someone@example.com\n ... ignores =\n ... ^.+INFO.*\n ... \"\"\")\n\n >>> print 'start', system(buildout) \n start...\n Uninstalling logcheck.\n Installing logcheck.\n logcheck: Writing file with 1 ignore patterns: /...station/logcheck-ignores\n \n\n >>> ls('parts/logcheck/ignore.d.workstation')\n - logcheck-ignores\n >>> cat ('parts/logcheck/ignore.d.workstation/logcheck-ignores')\n ^.+INFO.*\n\nLogcheck is supposed to be called from a cronjob. The recipe provides an\noption that lists the correct command that can be used from other\nrecipes::\n\n >>> write('crontab', '')\n >>> write('buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = logcheck crontab\n ...\n ... [logcheck]\n ... recipe = tha.recipe.logcheck\n ... logfiles = var/example.log\n ... recipient = someone@example.com\n ... ignores =\n ... ^.+INFO.*\n ... \n ... [crontab]\n ... recipe = z3c.recipe.usercrontab\n ... times = */5 * * * *\n ... command = ${logcheck:command}\n ... readcrontab = cat ${buildout:directory}/crontab\n ... writecrontab = cat > ${buildout:directory}/crontab\n ... \n ... \"\"\")\n >>> print 'start', system(buildout) \n start...\n Updating logcheck.\n Installing crontab.\n >>> cat('crontab')\n \n # Generated by /sample-buildout [crontab]\n */5 * * * * /usr/sbin/logcheck -c /sample-buildout/parts/logcheck/logcheck.conf\n # END /sample-buildout [crontab]\n \n\n\n\nCredits\n=======\n\nCreated by `Reinout van Rees `_ at `The Health\nAgency `_\n\n\n\nChangelog for tha.recipe.logcheck\n=================================\n\n\n1.1 (2009-12-18)\n----------------\n\n- Documentation and license update. [reinout]\n\n- Adjusted tests for change in crontab recipe. [reinout]\n\n\n1.0 (2009-05-27)\n----------------\n\n- Cleaned up code a bit (bootstrap.py in proper location and so). [reinout]\n\n\n0.4 (2009-05-22)\n----------------\n\n- Default subject is now the full pathname of the first logfile. [reinout]\n\n- Little bit more testing. [reinout]\n\n\n0.3 (2009-04-21)\n----------------\n\n- Allow option ('subject') of setting the subject. (Well, part of the subject\n at least). [reinout]\n\n\n0.2 (2009-03-30)\n----------------\n\n- Fixed typo in ignore file generation. [reinout]\n\n\n0.1 (2009-03-17)\n----------------\n\n- Added \"command\" option for use in crontab recipe. [reinout]\n\n- Creating logcheck directories and configfiles in var/ and parts/. [reinout]\n\n- Created recipe with ZopeSkel [reinout]", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/tha.recipe.logcheck", "keywords": "", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "tha.recipe.logcheck", "package_url": "https://pypi.org/project/tha.recipe.logcheck/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/tha.recipe.logcheck/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/tha.recipe.logcheck" }, "release_url": "https://pypi.org/project/tha.recipe.logcheck/1.1/", "requires_dist": null, "requires_python": null, "summary": "Logcheck configuration recipe", "version": "1.1" }, "last_serial": 800540, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "4ecc2b2e4e53353ace7029c3667bc67e", "sha256": "a05e9086ffaac4bd85e1b2e5781385ca0a549992cb009158a9d8427f361dacb3" }, "downloads": -1, "filename": "tha.recipe.logcheck-1.0.tar.gz", "has_sig": false, "md5_digest": "4ecc2b2e4e53353ace7029c3667bc67e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8581, "upload_time": "2009-05-27T10:55:33", "url": "https://files.pythonhosted.org/packages/cd/7e/a3f037ffe307d544841ae1c2465d1468d07bc8bef3b5ab6da93c617ab0a5/tha.recipe.logcheck-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "47c79e8435a263c5d30bbad13814e933", "sha256": "6d3210156808b492f86f2d3f22802b27ec5c397825790b91ad2ba211f97f339c" }, "downloads": -1, "filename": "tha.recipe.logcheck-1.1.tar.gz", "has_sig": false, "md5_digest": "47c79e8435a263c5d30bbad13814e933", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9292, "upload_time": "2009-12-18T22:50:04", "url": "https://files.pythonhosted.org/packages/6b/78/c743b605bbfdf60482eba233ead32d24a6332c120cbc670015aa4a0a9a6d/tha.recipe.logcheck-1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "47c79e8435a263c5d30bbad13814e933", "sha256": "6d3210156808b492f86f2d3f22802b27ec5c397825790b91ad2ba211f97f339c" }, "downloads": -1, "filename": "tha.recipe.logcheck-1.1.tar.gz", "has_sig": false, "md5_digest": "47c79e8435a263c5d30bbad13814e933", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9292, "upload_time": "2009-12-18T22:50:04", "url": "https://files.pythonhosted.org/packages/6b/78/c743b605bbfdf60482eba233ead32d24a6332c120cbc670015aa4a0a9a6d/tha.recipe.logcheck-1.1.tar.gz" } ] }