Giter Club home page Giter Club logo

monitoring-common-shell-library's Introduction

Introduction

The idea of the monitoring-common-shell-library is to have reoccurring code like threshold-evaluation, unit tests, etc. to be shared between plugins.

This reduces the code-lines of a plugin a lot and allows to quick develop a new monitoring-plugin.

Basically, monitoring-common-shell-library relies heavily on Bash 4. Only a few external dependencies are used (see Requirements) which usually are already present on a typical Linux installation.

Some plugins that use the monitoring-common-shell-library:

Requirements

  • Bash 4
  • getopt (from util-linux)
  • mktemp (from GNU core utilities)
  • GNU bc

On Debian and its derivatives, you can quickly fulfilling these requirements by:

sudo apt-get install bash util-unix coreutils bc

Package

monitoring-common-shell-library is also available as Debian package (.deb).

Checkout https://apt.netshadow.net to locate the package and download it.

Integration

Basically, functions.sh is ready for use, the shipped Makefile in the libraries root-directory is used for developers only.

Including it

The easiest way, to include the libraries functionality into your monitoring plugin, is to source functions.sh from your plugin. This can be done by

source functions.sh

or even in a short form

. functions.sh

If you have installed monitoring-common-shell-library as a software package (eg. .deb), functions.sh is usually located in: /usr/share/monitoring-common-shell-library/functions.sh.

To include from there, write:

source /usr/share/monitoring-common-shell-library/functions.sh

Embedding it

Another way to integrate the library into your plugin, is to concatenate the contents of functions.sh to your monitoring plugin.

But note: it might be harder to maintain your plugin if you want to update the functions provided by this library. Your plugin will probably remain more slim, portable and efficient if you choose the way "Including it".

Functions List

See the automatically generated function-reference in ./FUNCREF.md, that is automatically generated from functions.sh.

Development

If you want to extend the monitoring-common-shell-library and contribute your changes to this project, please obey ./CODING.md.

Automated Testing

The monitoring-common-shell-library has been written along with a test-suite, that tries to lead the provided functions up the garden path.

It might not be that perfect, but at least ensures some code quality level to be retained.

See ./README.md in the tests directory for more information.

License

All files are licensed by GNU Affero General Public License v3.

See ./LICENSE file for more information.

Author

(c) 2017-2019 Andreas Unterkircher [email protected]

monitoring-common-shell-library's People

Contributors

unki avatar

Watchers

 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.