Sign inSign up

anroots/sensu-client

By anroots

•Updated almost 10 years ago

Sensu Client

Artifact
Image
3

5.0K

anroots/sensu-client repository overview

⁠Sensu Stack Travis License Docker Pulls

This is the Sensu monitoring framework⁠, running in Docker containers, with Uchiwa⁠ as the web-based frontend.

Sensu is often described as the “monitoring router”. Essentially, Sensu takes the results of “check” scripts run across many systems, and if certain conditions are met, passes their information to one or more “handlers”. Checks are used, for example, to determine if a service like Apache is up or down. - sensuapp.org⁠

⁠Install

This project is opinionated towards Docker Cloud⁠ deployment.

⁠Deploy to Docker Cloud

Press the button below to deploy this stackfile⁠ to your Docker Cloud account.

Deploy to Docker Cloud

⁠Deploy to Other Docker Capable Hosts

Use Docker Compose to deploy the stack to any Docker capable host.

⁠Usage

⁠Web Admin Panel

The default configuration maps the Uchiwa frontend to http://localhost:3000⁠. Default credentials (change those!) are:

  • User: hiro
  • Password: nakamura
⁠Add Your Own Checks

You'll have to create your own Docker image and extend anroots/sensu-client and anroots/sensu-server to add your own configuration and checks. See Dockerfiles in server/example⁠ and client/example⁠ directories. Official documentation on checks can be read here⁠.

FROM anroots/sensu-server:0.3.0

COPY conf.d /etc/sensu/conf.d
⁠Add Your Own Plugins

sensu-plugins.io⁠ lists many Sensu plugins that can be used to perform different checks. To install a new plugin, create a new Docker image (extending anroots/sensu-client) and install the plugins you want to use⁠.

FROM anroots/sensu-client:0.3.0

# Install sensu plugins that perform system resource checks
RUN apt-get update && \
	apt-get install -y bc build-essential && \
	sensu-install --verbose -P memory-checks,cpu-checks,disk-checks && \
	apt-get purge -y build-essential && \
	apt-get autoremove -y && \
	apt-get clean -y && \
	rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

⁠Image Structure

  • debian
    • anroots/sensu - base image for Sensu
      • anroots/sensu-api
      • anroots/sensu-client - barebones setup for Sensu client (no checks)
        • anroots/sensu-client:example - Sensu client which includes basic host-level checks (memory, CPU, disk usage)
      • anroots/sensu-server - barebones setup for Sensu server (no checks)
        • anroots/sensu-client:example - Sensu server with one scheduled check
  • uchiwa/uchiwa
    • anroots/uchiwa
⁠Sending Alerts

This image does not come with built-in event handlers - you'll have to choose and configure one yourself. Documentation on handlers can be found here⁠.

⁠E-mail Handler

The following is an example on how to configure Sensu to send e-mails on failing checks.

First of all, we need to install a handler to the Sensu server. Extend anroots/sensu-server and install the e-mail handler:

# Dockerfile
FROM anroots/sensu-server:example
RUN sensu-install -p mailer
COPY mail.json /etc/sensu/conf.d/

Next, add the settings of the e-mail server to use:

# mail.json
{
  "mailer": {
    "mail_from": "[email protected]",
    "mail_to": "[email protected]",
    "smtp_address": "smtp.mailgun.org",
    "smtp_port": "587",
    "smtp_domain": "sensu.sqroot.eu",
    "smtp_username": "[email protected]",
    "smtp_password": "<password>"
  }
}

Finally, tell Sensu that the handler exists. It can either be a default handler for all checks or specified on per-check basis.

# Override handlers specified in server.tmpl
"handlers":{
  "default":{
    "type":"set",
    "handlers":[
      "mail"
    ]
  },
  "mail":{
    "type": "pipe",
    "command": "handler-mailer.rb"
  }
}

⁠Change Log

Please see CHANGELOG⁠ for more information what has changed recently.

⁠Contributing

Please see CONTRIBUTING⁠ for details.

⁠Security

If you discover any security related issues, please email [email protected]⁠ instead of using the issue tracker.

⁠Credits

⁠Licence

The MIT License (MIT). Please see License File⁠ for more information.

Tag summary

Content type

Image

Digest

sha256:abb74c4b0…

Size

88.7 MB

Last updated

almost 10 years ago

docker pull anroots/sensu-client