Coder Social home page Coder Social logo

lausser / coshsh Goto Github PK

View Code? Open in Web Editor NEW
37.0 6.0 5.0 18.03 MB

Der deutschsprachige Open-Source-Monitoring-Workshop incl. Vortrag über Coshsh findet am 16./17.5.2024 in Neckarsulm statt. https://discord.gg/jDfPZ63FcJ

License: GNU Affero General Public License v3.0

Makefile 0.20% Python 89.60% Smarty 10.18% Shell 0.02%
nagios icinga prometheus python

coshsh's Introduction

coshsh Config-Generator for Shinken / Nagios /Icinga

What is coshsh?

Coshsh is a framework which helps you producing configuration files for open source monitoring systems.

Features

  • coshsh is very fast. (~60000 services in 10 seconds)
  • coshsh can be extended easily.
  • coshsh reads only hosts and applications. Services are added later.

Why should you use it?

Because others use it too.

  • The city of Munich. https://bit.ly/2QhNCOJ
  • A car manufacturer in Munich with three letters.
  • A global storage company with three letters. (they were bought and now have four letters)
  • Lidl/Kaufland. https://bit.ly/2L459nH
  • A chinese car manufacturer in Shenyang.
  • An austrian company producing crystal products.
  • A world-wide operating consulting firm.
  • A venerable hanseatic bank.

and many more companies which eliminated manual tasks in monitoring.

Download

http://labs.consol.de/nagios/coshsh

Support

Professional support and consulting is available via www.consol.de

Changelog

The changelog is available on github

How does it work

coshsh reads one or many datasources (which can be files, databases, ldap...) and transforms their contents into host/service/contact-configuration files. Host- and service-definitions are created by filling placeholders in template-files.

In the beginning there are hosts and applications. There are no host and service definitions. Why? Because your server admins don't care about. Your windows admin simply wants to enter his new machine in a cmdb. He has no time to configure check_periods or commands or services. He even doesn't want to know what it is.
The only thing he knows is name, address and model of his new server and the applications he installed.

For example, your datasource is a database table with a column names "type". If you want to handle a value of "windows" or "windows 2008" all you need is a class file for it:

import coshsh

def __mi_ident__(params={}):
    if coshsh.util.compare_attr("type", params, ".*windows.*"):
        return Windows


class Windows(coshsh.application.Application):
    template_rules = [
        coshsh.templaterule.TemplateRule(needsattr=None,
            template="os_windows_default"),
        coshsh.templaterule.TemplateRule(needsattr="filesystems",
            template="os_windows_fs"),
    ]

The class file will be automatically registered to coshsh. Now whenever a record of type "windows" comes out of your datasource, an object of class Windows is created. (Inside coshsh. You actually won't notice it and you don't have to know about it) The only thing you need to know is the relationship between an application's class and some template files. Like this one here:

{{ application|service("os_windows_default_check_nsclient") }}
  host_name                       {{ application.host_name }}
  use                             os_windows_default
  check_command                   check_nrpe_arg!60!checkUpTime!MinWarn=5m MinCrit=1m
}

{{ application|service("os_windows_default_check_cpu") }}
  host_name                       {{ application.host_name }}
  use                             os_windows_default,srv-pnp
  max_check_attempts              10
  check_command                   check_nrpe_arg!60!checkCPU!warn=80 crit=90 time=5m time=1m time=30s
}

{{ application|service("os_windows_default_check_mem") }}
  host_name                       {{ application.host_name }}
  use                             os_windows_default,srv-pnp
  check_command                   check_nrpe_arg!60!checkMem!MaxWarn=80% MaxCrit=90% ShowAll=long type=physical type=virtual type=paged
}

{{ application|service("os_windows_default_check_autosvc") }}
  host_name                       {{ application.host_name }}
  use                             os_windows_default
  check_command                   check_nrpe_arg!60!CheckServiceState!CheckAll
}

{#
{{ application|service("os_windows_default_check_ntp") }}
  host_name                       {{ application.host_name }}
  use                             os_windows_default
  check_command                   windows-check_time!3600!360000
}
#}

define servicedependency {
  name                             dependency_os_windows_default_check_nsclient_uc_{{ application.host_name }}
  host_name                        {{ application.host_name }}
  service_description              os_windows_default_check_nsclient
  execution_failure_criteria       u,c
  notification_failure_criteria    u,c
  dependent_service_description    os_windows_.*,\
                                   !os_windows_default_check_nsclient
}

Only a nagios admin will ever see these template files and will have to edit them.

Coverage Status

coshsh's People

Contributors

datamuc avatar lausser avatar netlution-mmolle avatar palli 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

coshsh's Issues

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.