Portainer Templates logo

Portainer Templates

Sematext Docker Agent (swarm) Sematext Docker Agent (swarm)

Log ManagementMonitoring

Collect logs, metrics and docker events

Image details

Pulls: 10.9M
Architecture: amd64, arm
Image size: 89 MB
Latest: 1.31.74
User: sematext
Created: Dec 02, 2015
Updated: 7 years ago
Status: active

Source details

Stars: 208
Forks: 32
Language: JavaScript
License: Apache-2.0
Updated: 2 years ago

Configuration

Type
Swarm
Platform
linux
Image
sematext/sematext-agent-docker
Env vars
LOGSENE_TOKEN=$LOGSENE_TOKENSPM_TOKEN=$SPM_TOKEN
Restart
always
Source

Template by portainer·Source

Standalone Install

Select an install method, to see config/commands for deploying Sematext Docker Agent (swarm)

Installation method

Install on Portainer

Import all app templates into your Portainer instance, for easy 1-click deploys

  1. Ensure both Docker and Portainer are installed, and up-to-date
  2. Log into your Portainer web UI
  3. Under Settings → App Templates, paste the below URL
  4. Head to Home → App Templates, and the list of apps will show up
  5. Select Sematext Docker Agent (swarm), fill in any config options, and hit Deploy

Template Import URL

https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json
Show Me demo
Original stackfile

The swarm stack file this template deploys, straight from its repo:

version: '3.2'
services:
  sematext-agent-docker:
    image: sematext/sematext-agent-docker
    deploy:
      mode: global
      restart_policy:
        condition: any
    environment:
      - LOGSENE_TOKEN=$LOGSENE_TOKEN
      - SPM_TOKEN=$SPM_TOKEN
    restart: always
    volumes:
      - type: bind
        source: /var/run/docker.sock
        target: /var/run/docker.sock

Or deploy it directly from the source:

git clone https://github.com/portainer/templates
cd templates
docker stack deploy -c stacks/sematext-agent-docker/docker-stack.yml sematext-docker-agent-swarm

More install options in our documentation, or see sematext/sematext-agent-docker for app-specific guidance.

This image is deprecated

Please use sematext/agent for monitoring and sematext/logagent for log collection.
Both images are available as Docker certified images:
See the following posts for more details:

Sematext Agent for Docker

|||| |---|------------|------------| | Sematext Docker Certified | build status
Sematext Agent for Docker collects Metrics, Events and Logs from the Docker API for Docker Monitoring & Logging & Hosted Elastic Stack. Works with CoreOS, Rancher, Docker Swarm, Kubernetes, Apache Mesos, Hashicorp Nomad, Amazon ECS, ... see the installation.

Quickstart

  1. Get free Sematext account
    Create a Monitoring App of type "Docker" for Docker metrics. Copy its App Token.
Optionally, [create a Logs App](https://apps.sematext.com/ui/integrations)
  1. Run the image using individual App tokens for your Monitoring and Logs Apps
```
docker pull sematext/sematext-agent-docker
docker run -d --name sematext-agent-docker -e SPM_TOKEN=YOUR_SPM_TOKEN -e LOGSENE_TOKEN=YOUR_LOGSENE_TOKEN -v /var/run/docker.sock:/var/run/docker.sock sematext/sematext-agent-docker
```

 You’ll see your Docker metrics in [Sematext Cloud](https://sematext.com/cloud) after about a minute. 
  1. Watch metrics, search container logs, use anomaly detection for logs and metrics, create email reports and much more ...

Certified and Public images

There are several places to obtain Sematext Docker Agent images:
  1. Docker Certified images in Docker Store

docker pull store/sematext/sematext-agent-docker
``` 

2. Red Hat certified images in [Red Hat Container Catalog](https://access.redhat.com/containers/?tab=overview&platform=docker#/registry.connect.redhat.com/sematext/sematext-agent-docker)
docker login registry.connect.redhat.com docker pull registry.connect.redhat.com/sematext/sematext-agent-docker
3. Public images from [Docker Hub](https://hub.docker.com/r/sematext/sematext-agent-docker/) 
docker pull docker.io/sematext/sematext-agent-docker ```

Support

  1. Sematext Docker Agent Homepage
  2. Sematext Docker Agent Documentation
  3. Chat with us via Sematext Cloud UI or drop an e-mail to [email protected]

Check the logs first

Nine times out of ten the logs tell you exactly what went wrong.

  • In Portainer, go to Containers, click the container, then Logs. Or run docker logs <container>
  • Exit codes help too: 137 means killed, usually out of memory. 126 or 127 means the command inside the image is broken.

Image won't pull

Test the pull directly on the host: docker pull sematext/sematext-agent-docker

  • "manifest unknown" means the tag no longer exists. This template uses latest, so try pinning a specific version instead.
  • "toomanyrequests" is the Docker Hub rate limit. Log in with docker login to raise it.
  • "no space left on device" means a full disk. Reclaim space with docker system prune

"exec format error"

This means the image was built for a different CPU architecture than your server.

  • This image supports: amd64, arm
  • Check yours with uname -m: x86_64 is amd64, aarch64 is arm64. Raspberry Pi and other ARM boards are the usual culprits.

Container keeps restarting

The always restart policy relaunches the app after every crash, so the real error can scroll past.

  • Check the logs right after a restart, the last few lines before it died are the useful ones.
  • Get the exit code with docker inspect <container> --format '{{.State.ExitCode}}'
  • Still stuck? Redeploy once with the restart policy set to no so the failure stays visible.

Stack won't deploy

Compose stacks fail fast on small mistakes, and Portainer shows the reason just above the editor.

  • YAML only accepts spaces for indentation, a single tab breaks the whole file.

Raise an issue

Found something which isn't working as it should? Here's how to report it.

A Swarm stack

Sematext Docker Agent (swarm) is a Swarm stack. Swarm is Docker's own way of running apps across more than one machine, so Portainer can spread it over a cluster and move it elsewhere if a server drops out.

The app image

An image is the app packed up ready to go, everything Sematext Docker Agent (swarm) needs bundled into one download. This template pulls sematext/sematext-agent-docker, which Docker fetches once (about 89 MB) and then starts your own copy from.

Where the image comes from

Docker pulls its images from registries, public libraries of ready-built apps. Sematext Docker Agent (swarm)'s comes from Docker Hub, published by sematext.

Version tags

The bit after the colon in the image name is the version tag. Here it's latest, which always points at the newest build, so a redeploy can bump you to a newer release without you asking. Newest right now is 1.31.74. Pin a specific tag if you would rather stay on one version.

Which machines it runs on

Every image is built for particular CPU types. This one ships for amd64, arm, so it runs on both regular x86 servers and ARM boards like a Raspberry Pi.

No stored data

This template doesn't mount any storage, so whatever Sematext Docker Agent (swarm) writes stays inside the container and is wiped if it's recreated or updated. That's fine for something stateless, but add a volume before trusting it with anything you want to keep.

Environment variables

Environment variables are the settings you hand over when you deploy, things like a password or a timezone. Sematext Docker Agent (swarm) takes 2 of them, all with defaults you can leave alone or tweak:

  • LOGSENE_TOKEN, defaults to $LOGSENE_TOKEN. Logs token
  • SPM_TOKEN, defaults to $SPM_TOKEN. SPM monitoring token

Restart policy

The restart policy here is always, so Docker brings Sematext Docker Agent (swarm) back up after a crash and again when the server reboots. Good for anything you want running around the clock. You can change this on the deploy screen. The choices are no (never restart), on-failure (only after a crash), unless-stopped (restart unless you stop it), and always (bring it back no matter what).

Networking

Nothing custom is set, so Sematext Docker Agent (swarm) sits on Docker's default bridge network: its own private space that reaches the outside world only through the ports it publishes.

Container name

Once it's deployed, Portainer names the container sematext-agent-docker. That's what you'll spot in the containers list and use in commands like docker logs sematext-agent-docker.

Platform

The platform is linux, the kind of system the container is built to run on. Docker and Portainer handle this on a normal Linux server.

Open source license

Sematext Docker Agent (swarm) is open source, released under the Apache-2.0 license. In plain terms the code is out in the open, so you're free to run it and change it to fit what you need.

Portainer app templates

Zooming out, this whole page comes from a Portainer app template: a short recipe telling Portainer how to set Sematext Docker Agent (swarm) up. Add the template list to Portainer once, then deploying Sematext Docker Agent (swarm) is a click rather than a wall of config.