Git Product home page Git Product logo

heartbeat's Introduction

This module allows monitoring of hosts, by running a process on each monitored host which updates an entry in a shared database table on a periodic basis (by default once every 45 seconds). If possible, the entry in the database table for the row will include a JSON-encoded block of data which contains:

  • The current load average and number of logged-in users
  • Details of mounted filesystems (parsed from 'df')
  • The structure returned by uname(2)

Check out git://github.com/nexgenta/heartbeat.git into your app/ directory.

You will also need to configure the cluster module, and ensure your configurations match across all of the hosts you want to monitor.

To configure, you will need to define HEARTBEAT_IRI in your config.php, and add the following to your appconfig.php:

$SETUP_MODULES[] = array('name' => 'heartbeat', 'file' => 'module.php', 'class' => 'HeartbeatModule');
$CLI_ROUTES['heartbeat'] = array('class' => 'HeartbeatCLI', 'name' => 'heartbeat', 'file' => 'cli.php', 'description' => 'Launch the heartbeat process');

Note that HEARTBEAT_IRI should be specified with Òautoconnect=noÓ in the parameter list to ensure proper handling of transient errors (for example, loss of network connectivity).

Once done, you can run './eregansu setup' to update the database schema.

You can launch the heartbeat process by running './eregansu heartbeat'.

The heartbeat process will use HOST_NAME if defined, falling back to INSTANCE_NAME otherwise. If neither is explicitly defined, the cluster module defines INSTANCE_NAME to be the first component of the system nodename as reported by uname. If the host you are monitoring runs multiple instances (for example, a staging instance and a live instance), then you should define HOST_NAME explicitly. Similarly, if for some reason you have defined INSTANCE_NAME explicitly but the instance name is not the same as the hostname used in the cluster configuration, then you will need to define HOST_NAME explicitly.

In other words, the hostname used by the heartbeat module (whether itÕs taken from HOST_NAME, INSTANCE_NAME or derived from the system nodename) needs to match the hostname specified in the cluster configuration.

To enable filesystem logging, you must define POSIX_DF_CMDLINE in your config.php to be the complete command-line which produces the equivalent output of POSIX-specified 'df -P -k'. For example, on Mac OS X:

define('POSIX_DF_CMDLINE', '/bin/df -P -k');

On Solaris, it would be:

define('POSIX_DF_CMDLINE', '/usr/xpg4/bin/df -P -k');

Other systems will vary. If POSIX_DF_CMDLINE is not defined, filesystem logging will not occur.

To enable logging of the load average and number of logged-in users, you must define UPTIME_PATH:

define('UPTIME_PATH', '/usr/bin/uptime');

To change the pulse interval, define HEARTBEAT_PULSE_INTERVAL to the number of seconds which should elapse between pulses. The default value for HEARTBEAT_PULSE_INTERVAL is 45.

heartbeat's People

Contributors

nevali avatar

Stargazers

 avatar

Watchers

 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.