Skip to main content

Send passive alerts to monitor your Odoo application.

Project description

Beta License: AGPL-3 OCA/server-tools Translate me on Weblate Try me on Runbot

This is a technical module to send passive alerts to your favorite NSCA daemon (Nagios, Shinken…). This module is based on the Odoo cron system and requires a NSCA client installed on the system to satisfy the /usr/sbin/send_nsca command.

Table of contents

Installation

To use this module, you need to install a NSCA client.

On Debian/Ubuntu:

$ sudo apt-get install nsca-client

Configuration

To configure this module, you need to:

  • Configure your server and a passive service in your monitoring tool (e.g service Odoo Mail Queue on host MY-SERVER).

  • Declare your NSCA server in the menu Configuration / Technical / NSCA Client / Servers

https://raw.githubusercontent.com/OCA/server-tools/13.0/nsca_client/nsca_client/static/description/server.png
  • Create NSCA checks in the menu Configuration / Technical / NSCA Client / Checks

https://raw.githubusercontent.com/OCA/server-tools/13.0/nsca_client/nsca_client/static/description/check.png
  • Code the methods which will be called by the NSCA checks.

Such methods must return a tuple (RC, MESSAGE, PERFORMANCE_DATA) where RC is an integer, MESSAGE a unicode string AND PERFOMANCE_DATA is a dictionary. RC values and the corresponding status are:

  • 0: OK

  • 1: WARNING

  • 2: CRITICAL

  • 3: UNKNOWN

PERFORMANCE_DATA is not mandatory, so it could be possible to send (RC, MESSAGE). Each element of PERFORMANCE_DATA will be a dictionary that could contain:

  • value: value of the data (required)

  • max: Max value on the chart

  • min: Minimum value on the chart

  • warn: Warning value on the chart

  • crit: Critical value on the chart

  • uom: Unit of Measure on the chart (s - Seconds, % - Percentage, B - Bytes, c - Continuous)

The key of the dictionary will be used as the performance_data label.

E.g:

class MailMail(models.Model):
    _inherit = 'mail.mail'

    @api.model
    def nsca_check_mails(self):
        mails = self.search([('state', '=', 'exception')])
        if mails:
            return (1, u"%s mails not sent" % len(mails), {
              'exceptions': {'value': len(mails)}})
        return (0, u"OK", {'exceptions': {'value': len(mails)}})

On the example, the performance data will use the label exceptions and the value will be the number of exception of mails.

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • ABF OSIELL

Contributors

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

This module is part of the OCA/server-tools project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file odoo13_addon_nsca_client-13.0.1.0.1.dev2-py3-none-any.whl.

File metadata

File hashes

Hashes for odoo13_addon_nsca_client-13.0.1.0.1.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 3cf13ce7cd8df01e4adb1d731afabddf04be8765222d8fa163b0a60f0a02fa97
MD5 b90be519a2d5af80df0c1c24c9b153f3
BLAKE2b-256 cc7d37214da72d8ee21e31502e98c22a80e02f83d128af1431f6b099b58bb948

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page