You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
3.0 KiB

  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
  2. :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
  3. :alt: License: AGPL-3
  4. ===========
  5. NSCA Client
  6. ===========
  7. This is a technical module to send passive alerts to your favorite NSCA daemon
  8. (Nagios, Shinken...).
  9. This module is based on the Odoo cron system and requires a NSCA client
  10. installed on the system to satisfy the ``/usr/sbin/send_nsca`` command.
  11. Installation
  12. ============
  13. To use this module, you need to install a NSCA client.
  14. On Debian/Ubuntu::
  15. $ sudo apt-get install nsca-client
  16. Configuration
  17. =============
  18. To configure this module, you need to:
  19. * Configure your server and a passive service in your monitoring tool
  20. (e.g service ``Odoo Mail Queue`` on host ``MY-SERVER``).
  21. * Declare your NSCA server in the menu Configuration / Technical / NSCA Client / Servers
  22. .. image:: nsca_client/static/description/server.png
  23. :width: 400 px
  24. * Create NSCA checks in the menu Configuration / Technical / NSCA Client / Checks
  25. .. image:: nsca_client/static/description/check.png
  26. :width: 400 px
  27. * Code the methods which will be called by the NSCA checks.
  28. Such methods must return a tuple ``(RC, MESSAGE)`` where ``RC`` is an integer,
  29. and ``MESSAGE`` a unicode string. ``RC`` values and the corresponding status are:
  30. - 0: OK
  31. - 1: WARNING
  32. - 2: CRITICAL
  33. - 3: UNKNOWN
  34. E.g:
  35. .. code-block:: python
  36. class MailMail(models.Model):
  37. _inherit = 'mail.mail'
  38. @api.model
  39. def nsca_check_mails(self):
  40. mails = self.search([('state', '=', 'exception')])
  41. if mails:
  42. return (1, u"%s mails not sent" % len(mails))
  43. return (0, u"OK")
  44. Usage
  45. =====
  46. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  47. :alt: Try me on Runbot
  48. :target: https://runbot.odoo-community.org/runbot/149/8.0
  49. Known issues / Roadmap
  50. ======================
  51. * Send performance data
  52. Bug Tracker
  53. ===========
  54. Bugs are tracked on `GitHub Issues
  55. <https://github.com/OCA/server-tools/issues>`_. In case of trouble, please
  56. check there if your issue has already been reported. If you spotted it first,
  57. help us smashing it by providing a detailed and welcomed `feedback
  58. <https://github.com/OCA/
  59. server-tools/issues/new?body=module:%20
  60. nsca_client%0Aversion:%20
  61. 8.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
  62. Credits
  63. =======
  64. Images
  65. ------
  66. * Daniel Foré: `Icon <http://www.iconarchive.com/show/elementary-icons-by-danrabbit/Apps-system-monitor-icon.html>`_ (Elementary theme, GPL).
  67. Contributors
  68. ------------
  69. * Sébastien Alix <sebastien.alix@osiell.com>
  70. Maintainer
  71. ----------
  72. .. image:: https://odoo-community.org/logo.png
  73. :alt: Odoo Community Association
  74. :target: https://odoo-community.org
  75. This module is maintained by the OCA.
  76. OCA, or the Odoo Community Association, is a nonprofit organization whose
  77. mission is to support the collaborative development of Odoo features and
  78. promote its widespread use.
  79. To contribute to this module, please visit https://odoo-community.org.