This the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

    Supervisord

    Supervisor daemon is a client/server system that allows its users to monitor and control a number of processes on UNIX-like operating systems., The Supervisor check monitors the uptime, status, and number of processes running under Supervisord.

    No default configuration is provided for the Supervisor check; you must provide the configuration in the dragent.yaml file for the Sysdig agent to collect the data provided by Supervisor.

    This page describes the setup steps required on Supervisor, how to edit the Sysdig agent configuration to collect additional information, the metrics available for integration, and a sample result in the Sysdig Monitor UI.

    Supervisor Setup

    Configuration

    The Sysdig agent can collect data from Supervisor via HTTP server or UNIX socket. The agent collects the same data regardless of the configured collection method.

    Un-comment the following or add them if they are not present in /etc/supervisor/supervisord.conf

    [inet_http_server]
    port=localhost:9001
    username=user  # optional
    password=pass  # optional
    ...
    
    
    [supervisorctl]
    serverurl=unix:///tmp/supervisor.sock
    ...
    
    [unix_http_server]
    file=/tmp/supervisor.sock
    chmod=777 # make sure chmod is set so that non-root users can read the socket.
    ...
    
    [program:foo]
    command=/bin/cat
    

    The programs controlled by Supervisor are given by different [program] sections in the configuration. Each program you want to manage by Supervisor must be specified in the Supervisor configuration file, with its supported options in the [program] section. See Supervisor’s sample.conf file for details.

    Sysdig Agent Configuration

    Review how to Edit dragent.yaml to Integrate or Modify Application Checks.

    Default Configuration

    By default, Sysdig’s dragent.default.yaml does not have any configuration to connect the agent with Supervisor. Edit dragent.yaml following the Examples given to connect with Supervisor and collect supervisor.* metrics.

    Remember! Never edit dragent.default.yaml directly; always edit only dragent.yaml.

    Example 1: Connect by UNIX Socket

      - name: supervisord
        pattern:
          comm: supervisord
        conf:
          socket: "unix:///tmp/supervisor.sock"
    
    

    Example 2: Connect by Host Name and Port, Optional Authentication

    - name: supervisord
      pattern:
        comm: supervisord
      conf:
        host: localhost
        port: 9001
    # user: user # Optional. Required only if a username is configured.
    # pass: pass # Optional. Required only if a password is configured.
    

    Metrics Available

    Metric Name

    Metric Description

    supervisord.process.count

    (gauge)

    The number of supervisord monitored processes

    shown as process

    supervisord.process.uptime

    (gauge)

    The process uptime

    shown as second

    See also Supervisord Metrics.

    Service Check

    supervisored.can.connect:

    Returns CRITICAL if the Sysdig agent cannot connect to the HTTP server or UNIX socket configured, otherwise OK.

    supervisord.process.status:

    SUPERVISORD STATUSSUPERVISORD.PROCESS.STATUS
    STOPPEDCRITICAL
    STARTINGUNKNOWN
    RUNNINGOK
    BACKOFFCRITICAL
    STOPPINGCRITICAL
    EXITEDCRITICAL
    FATALCRITICAL
    UNKNOWNUNKNOWN

    Result in the Monitor UI