prometheus-node-exporter-service

Example:

# Install the prometheus node exporter.
- prometheus-node-exporter-service:
    web_listen_address: 192.168.1.12:9100

Description

Installs the Prometheus node exporter.

Resources

Variables

Name Type Default Description

disabled_collectors

list --

List of disabled collectors. By default node_exporter disables collectors listed here.

enabled_collectors

list --

List of additionally enabled collectors. It adds collectors to those enabled by default.

textfile_dir

string --

Directory used by the Textfile Collector. To get permissions to write metrics in this directory, users must be in node-exp system group.

Defaults to "/var/lib/node_exporter".

version

string --

The version of the node exporter.

web_listen_address

string --

Address on which the node exporter will listen. Defaults to '0.0.0.0:9100'

Examples

Example 1

Install the prometheus node exporter.

Code
- prometheus-node-exporter-service:
    web_listen_address: 192.168.1.12:9100

Code

doc:
  short_help: Installs the Prometheus node exporter.
  references:
    cloudalchemy.node-exporter Ansible role: https://github.com/cloudalchemy/ansible-node-exporter
  examples:
  - title: Install the prometheus node exporter.
    vars:
      web_listen_address: 192.168.1.12:9100

args:
  version:
    doc:
      short_help: The version of the node exporter.
    type: string
    required: false
  web_listen_address:
    doc:
      short_help: Address on which the node exporter will listen.
      help: |
        Address on which the node exporter will listen. Defaults to '0.0.0.0:9100'
    type: string
    required: false
  enabled_collectors:
    doc:
      short_help: List of additionally enabled collectors.
      help: |
        List of additionally enabled collectors. It adds collectors to those [enabled by default](https://github.com/prometheus/node_exporter#enabled-by-default).
      references:
      - '[list of default collectors](https://github.com/prometheus/node_exporter#enabled-by-default)'
    type: list
    required: false
    empty: true
    schema:
      type: string
    cli:
      metavar: COLLECTOR
      param_decls:
      - --enable-collector
  disabled_collectors:
    doc:
      short_help: List of disabled collectors.
      help: |
        List of disabled collectors. By default node_exporter disables collectors [listed here](https://github.com/prometheus/node_exporter#disabled-by-default).
      references:
      - '[list of disabled collectors](https://github.com/prometheus/node_exporter#disabled-by-default)'
    type: list
    required: false
    empty: true
    schema:
      type: string
    cli:
      metavar: COLLECTOR
      param_decls:
      - --disable-collector
  textfile_dir:
    doc:
      short_help: Directory used by the Textfile Collector.
      help: |
        Directory used by the [Textfile Collector](https://github.com/prometheus/node_exporter#textfile-collector). To get permissions to write metrics in this directory, users must be in node-exp system group.

        Defaults to "/var/lib/node_exporter".
      references:
      - '[Textfile collector documentation](https://github.com/prometheus/node_exporter#textfile-collector)'
    type: string
    required: false

frecklets:
- task:
    become: true
    include-type: import
  frecklet:
    name: cloudalchemy.node-exporter
    type: ansible-role
    resources:
      ansible-role:
      - cloudalchemy.node-exporter
    desc:
      short: installing Prometheus node-exporter
      references:
        "'cloudalchemy.node-exporter'": https://github.com/cloudalchemy/ansible-node-exporter
    properties:
      idempotent: true
      elevated: true
      internet: true
  vars:
    node_exporter_version: '{{:: version ::}}'
    node_exporter_web_listen_address: '{{:: web_listen_address ::}}'
    node_exporter_enabled_collectors: '{{:: enabled_collectors ::}}'
    node_exporter_disabled_collectors: '{{:: disabled_collectors ::}}'
    node_exporter_textfile_dir: '{{:: textfile_dir ::}}'
frecklecute prometheus-node-exporter-service --help

Usage: frecklecute prometheus-node-exporter-service [OPTIONS]

  Installs the Prometheus node exporter.

Options:
  --disable-collector COLLECTOR   List of disabled collectors.
  --enable-collector COLLECTOR    List of additionally enabled collectors.
  --textfile-dir TEXTFILE_DIR     Directory used by the Textfile Collector.
  --version VERSION               The version of the node exporter.
  --web-listen-address WEB_LISTEN_ADDRESS
                                  Address on which the node exporter will
                                  listen.
  --help                          Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.prometheus_node_exporter_service.PrometheusNodeExporterService
#


from dataclasses import dataclass
from pyckles import AutoPycklet
from typing import *    # noqa

@dataclass
class PrometheusNodeExporterService(AutoPycklet):
    """Installs the Prometheus node exporter.

       Args:
         disabled_collectors: List of disabled collectors.
         enabled_collectors: List of additionally enabled collectors.
         textfile_dir: Directory used by the Textfile Collector.
         version: The version of the node exporter.
         web_listen_address: Address on which the node exporter will listen.

    """

    FRECKLET_ID = "prometheus-node-exporter-service"

    disabled_collectors: List = None
    enabled_collectors: List = None
    textfile_dir: str = None
    version: str = None
    web_listen_address: str = None


    def __post_init__(self):
        super(PrometheusNodeExporterService, self).__init__(var_names=["disabled_collectors", "enabled_collectors", "textfile_dir", "version", "web_listen_address"])


frecklet_class = PrometheusNodeExporterService
# -*- coding: utf-8 -*-


#
# module path: pycklets.prometheus_node_exporter_service.PrometheusNodeExporterService
#


from pyckles import AutoPycklet

class PrometheusNodeExporterService(AutoPycklet):
    """Installs the Prometheus node exporter.

       Args:
         disabled_collectors: List of disabled collectors.
         enabled_collectors: List of additionally enabled collectors.
         textfile_dir: Directory used by the Textfile Collector.
         version: The version of the node exporter.
         web_listen_address: Address on which the node exporter will listen.

    """

    FRECKLET_ID = "prometheus-node-exporter-service"

    def __init__(self, disabled_collectors=None, enabled_collectors=None, textfile_dir=None, version=None, web_listen_address=None):

        super(PrometheusNodeExporterService, self).__init__(var_names=["disabled_collectors", "enabled_collectors", "textfile_dir", "version", "web_listen_address"])
        self._disabled_collectors = disabled_collectors
        self._enabled_collectors = enabled_collectors
        self._textfile_dir = textfile_dir
        self._version = version
        self._web_listen_address = web_listen_address

    @property
    def disabled_collectors(self):
        return self._disabled_collectors

    @disabled_collectors.setter
    def disabled_collectors(self, disabled_collectors):
        self._disabled_collectors = disabled_collectors

    @property
    def enabled_collectors(self):
        return self._enabled_collectors

    @enabled_collectors.setter
    def enabled_collectors(self, enabled_collectors):
        self._enabled_collectors = enabled_collectors

    @property
    def textfile_dir(self):
        return self._textfile_dir

    @textfile_dir.setter
    def textfile_dir(self, textfile_dir):
        self._textfile_dir = textfile_dir

    @property
    def version(self):
        return self._version

    @version.setter
    def version(self, version):
        self._version = version

    @property
    def web_listen_address(self):
        return self._web_listen_address

    @web_listen_address.setter
    def web_listen_address(self, web_listen_address):
        self._web_listen_address = web_listen_address



frecklet_class = PrometheusNodeExporterService