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.

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