Giter Club home page Giter Club logo

nagios_erlang's Introduction

README

This repository contains scripts to facilitate monitoring Erlang. systems using the Nagios monitoring framework.

At this time it supports monitoring nodes, applications and process groups.

Files

  • README - this file
  • Makefile - build script
  • check_erlang_application.sh - shell script interface to check erlang apps are running
  • check_erlang_node.sh - shell script interface to check erlang node is running
  • check_erlang_pg.sh - shell script interface to check process group is running
  • nagios_erlang.erl - Erlang implementation of checking apps/nodes/pgs
  • ebin/ - contains compiled Erlang files

Command Line Usage Examples

Examples of running the verification scripts directly (not via Nagios). These scripts are all being run in a Git checkout of the code, and after running make within that directory.

To run in other directorys, the --beam parameter will need to be updated to point to the directory where nagios_erlang.beam can be found.

Checking Nodes

bash-3.2$ ./check_erlang_node.sh -e `which erl` -n my_node -c `cat /path/to/.erlang.cookie`
OK - Node my_node running.

Checking Applications

bash-3.2$ ./check_erlang_application.sh -e `which erl` -n my_node -c `cat /path/to/.erlang.cookie` -a application1,application2
OK - Applications ["application1","application2"] running on Node my_node.

Checking Process Groups

./check_erlang_pg.sh -e /usr/bin/erl -n my_node -p my_group -w 1
OK - Process group my_group populated on Node my_node with 3 processes.

Full Example

First, we check that the node doesn't exist before we start it:

bash-3.2$ ./check_erlang_node.sh -e erl -n my_node@`hostname` -c cookie
CRITICAL - Node '[email protected]' not running.

Next, actually start the node:

will-larsons-macbook:~ lethain$ erl -setcookie cookie -name my_node@`hostname`
Erlang R13B03 (erts-5.7.4) [source] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.7.4  (abort with ^G)
([email protected])1> node().
'[email protected]'

And we can verify the node is accessible:

bash-3.2$ ./check_erlang_node.sh -e erl -n my_node@`hostname` -c cookie
OK - Node '[email protected]' running.

Next we can check for started applications (note that kernel2 is a made up application which doesn't exist, while kernel is a real application which is indeed running):

bash-3.2$ ./check_erlang_application.sh -e erl -c cookie -n my_node@`hostname` -a kernel2
CRITICAL - Applications ["kernel2"] not running on Node '[email protected]'.
bash-3.2$ ./check_erlang_application.sh -e erl -c cookie -n my_node@`hostname` -a kernel
OK - Applications ["kernel"] running on Node '[email protected]'.

And that is all there is to it.

nagios_erlang's People

Contributors

adw0rd avatar lethain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

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.