Giter Site home page Giter Site logo

meanbee-magento-healthcheck's Introduction

Proactive Magento Health Checks

Build Status

There are often metrics in a project that dictate the health of an online store, some examples:

  • Has there been an order placed in the last hour?
  • Are there any orphaned Sage Pay transactions?
  • Is the reindexing process stuck?

This extension provides a framework for the implementation of proactive Magento 'health checks', run every five minutes, with email notifications to designated contacts if a problem occurs.

Installation

modman clone [email protected]:meanbee/meanbee-magento-healthcheck.git
modman deploy meanbee-magento-healthcheck

Architecture

  • A check is an implementation of Meanbee_Healthcheck_Model_CheckInterface
  • Checks are registered with healthcheck through XML configuration
  • Checks are executed every five minutes through a centralised healthcheck cron
  • Checks are responsibile for building an alert (Meanbee_Healthcheck_Model_Alert) and passing it through to the notify method (Meanbee_Healthcheck_Helper_Alert::notify)

Usage

Documentation below describes how a developer might go about implementing a check and plugging it into healthcheck.

Implementing a check

A check is a model that implements an interface: Meanbee_Healthcheck_Model_CheckInterface. An abstract check class is provided with useful utility methods in Meanbee_Healthcheck_Model_Check_Abstract.

A check must implement a check method. Inside of the check method the developer must implement their test logic and notify with an alert if appropriate.

The following example creates an alert and notifies the administrators about the alert.

    class Meanbee_HealthcheckExample_Model_Check_Test extends Meanbee_Healthcheck_Model_Check_Abstract
    {
        public function check()
        {
            $this->log("Starting check..");

            /** @var Meanbee_Healthcheck_Model_Alert $alert */
            $alert = Mage::getModel('meanbee_healthcheck/alert');
            $alert
                ->setName(__CLASS__)
                ->setSeverity(Zend_Log::DEBUG)
                ->setMessage("This is a test check")
                ->setStackTrace(debug_backtrace());

            Mage::helper('meanbee_healthcheck/alert')->notify($alert);

            $this->log("Check complete.");
        }
    }

Registering the check

Next we need to register the check with healthcheck. This is done through configuration XML.

    <config>
        ...
        <meanbee_healthcheck>
            <checks>
                ...
                <my_example_test>
                    <class>Meanbee_HealthcheckExample_Model_Check_Test</class>
                </my_example_test>
                ...
            </checks>
        </meanbee_healthcheck>
        ...
    </config>

By registering of the checks through XML, the healthcheck extension can pick up any checks in third party extensions.

Configuration

There are configuration options in Advanced > Meanbee Healthcheck to set email addresses for notifications.

Roadmap

  • Allow schedules to specified by individual checks
  • Store alerts in a database table for providing an administration dashboard

meanbee-magento-healthcheck's People

Contributors

harrymt avatar punkstar avatar tgerulaitis avatar will-b avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.