Giter VIP home page Giter VIP logo

Comments (2)

evanrich avatar evanrich commented on June 12, 2024 1

nevermind i just read the python file and it does work already. Thanks!

from datadog-smartmon.

evanrich avatar evanrich commented on June 12, 2024

going to add how I implemented this because you saved me a TON of work. We use saltstack to deploy changes on machines, here's the salt state in case anyone else uses salt and wants to apply this:

{% if grains['os'] == 'Ubuntu' and grains['manufacturer'] == 'Dell Inc.' -%}

#ensure that the smartmontools pacckage is installed
base-drive_health-smartmontools:
  pkg.installed:
    - name: smartmontools

base-drive_health-change-smartctl-perms:
  cmd.run:
    - name: chmod +s /usr/sbin/smartctl
    - unless: test -u /usr/sbin/smartctl
    - require:
      - pkg: base-drive_health-smartmontools

base-drive_health-install-pysmart:
  pip.installed:
    - name: pysmart
    - bin_env: /opt/datadog-agent/embedded/bin/pip
    - user: dd-agent
    - cwd: /opt/datadog-agent

# install the smartmon.py in the /etc/datadog-agent/checks.d directory
base-drive_health-install-pythoncode:
  file.managed:
    - name: /etc/datadog-agent/checks.d/smartmon.py
    - source: salt://base/files/smartmon.py
    - user: dd-agent
    - group: dd-agent
    - mode: 644
    - require:
      - pip: base-drive_health-install-pysmart

# install the smartmon.yaml in the /etc/datadog-agent/conf.d directory
base-drive_health-install-yaml:
  file.managed:
    - name: /etc/datadog-agent/conf.d/smartmon.yaml
    - source: salt://base/files/smartmon.yaml
    - user: dd-agent
    - group: dd-agent
    - mode: 644
    - require:
      - file: base-drive_health-install-pythoncode

# restart the datadog-agent service if changes are made
base-drive_health-restart-agent:
  service.running:
    - name: datadog-agent
    - watch:
      - file: base-drive_health-install-yaml
      - file: base-drive_health-install-pythoncode
{% endif %}

small little contribution to your amazing contribution. Thanks!

from datadog-smartmon.

Related Issues (6)

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.