Server motherboard hardware monitoring

hardware-events

This software helps with the monitoring of a server motherboard.

The project started when I changed the FANs on a Supermicro motherboard and they started to run at full speed because their nominal speed was measured too low for the motherboard. I could have bought some other FANs, but I didn't want to.

This project:

  • reads temperature from various sensors (CPU, motherboard, disks)
  • sets FAN speed via the command line like ipmitool (multi-zones)
  • sends sensor and FAN data to a monitoring platform (zabbix)
  • suspends hard drive when there's no activity (while still being able to read the temperature before suspending)

I have it running on various Supermicro server boards (X9/X10/X11) and manage the different FAN zones separately.

Configuration

Everything is in the configuration file. This configuration is Linux based. The project probably works on FreeBSD (although not tested) but you might need to change the sensor settings (I'm using linux sysfs):

---
sensors:
  hddtemp:
    command: "/usr/sbin/hddtemp -n ${DEVICE}"
    timeout: 5s
  smartctl:
    command: "/usr/sbin/smartctl -l scttempsts ${DEVICE}"
    regexp: "Current Temperature:\\s+(\\d+) Celsius"
    timeout: 5s
  cpu:
    file: "/sys/devices/platform/coretemp.0/hwmon/hwmon*/temp1_input"
    divider: 1000
  cpu-average:
    files:
    - "/sys/devices/platform/coretemp.0/hwmon/hwmon*/temp?_input"
  pch:
    file: "/sys/class/thermal/thermal_zone1/temp"
    divider: 1000
  drivetemp:
    file: "/sys/block/${DEVICE_NAME}/device/hwmon/hwmon*/temp1_input"
    divider: 1000

fan_control:
  # set fan mode to full
  init_command: "/usr/bin/ipmitool raw 0x30 0x45 0x01 0x01"
  set_command: "/usr/bin/ipmitool raw 0x30 0x70 0x66 0x01 ${FAN_ZONE} ${FAN_SPEED}"
  # set fan mode to normal
  exit_command: "/usr/bin/ipmitool raw 0x30 0x45 0x01 0x00"
  timeout: 5s
  parameters:
    FAN_ZONE:
      format: "%#x"
    FAN_SPEED:
      format: "%#x"
  zones:
    zone1:
      id: 0
      min_speed: 25
      sensors:
        cpu:
          average: 30s
          run_every: 10s
          rules:
          - temperature:
              from: 40
              to: 60
            run_every: 5s
            fan_speed:
              from: 25
              to: 100
        pch:
          average: 1m
          run_every: 20s
          rules:
          - temperature:
              from: 50
              to: 70
            fan_speed:
              from: 25
              to: 100
    zone2:
      id: 1
      min_speed: 25
      run_every: 5m
      sensors:
        rpool1:
          average: 1m
          run_every: 1m
          rules:
          - temperature:
              from: 40
              to: 60
            fan_speed:
              from: 30
              to: 100
        datapool1:
          average: 5m
          rules:
          - temperature:
              from: 40
              to: 60
            fan_speed:
              from: 30
              to: 100
        datapool2:
          average: 5m
          rules:
          - temperature:
              from: 40
              to: 60
            fan_speed:
              from: 30
              to: 100
        datapool3:
          average: 5m
          rules:
          - temperature:
              from: 40
              to: 60
            fan_speed:
              from: 30
              to: 100
        datapool4:
          average: 5m
          rules:
          - temperature:
              from: 40
              to: 60
            fan_speed:
              from: 30
              to: 100

disk_power_status:
  check_command: "/sbin/hdparm -C ${DEVICE}"
  active: "active/idle"
  standby: "standby"
  sleeping: "sleeping"
  standby_command: "/sbin/hdparm -y ${DEVICE}"
  timeout: 5s

disk_pools:
  rpool:
    - rpool1
    - rpool2
  datapool:
    - datapool1
    - datapool2
    - datapool3
    - datapool4

disks:
  rpool1:
    device: "/dev/disk/by-id/ata-SAMSUNG_SSD_first"
    temperature_sensor: drivetemp
    monitor_temperature: always
  rpool2:
    device: "/dev/disk/by-id/ata-SAMSUNG_SSD_second"
    temperature_sensor: drivetemp
    monitor_temperature: always
  datapool1:
    device: "/dev/disk/by-id/ata-ST2000DM001-first"
    temperature_sensor: drivetemp
    monitor_temperature: when_active
    last_active: 50m
    standby_after: 1h
  datapool2:
    device: "/dev/disk/by-id/ata-ST2000DM001-second"
    temperature_sensor: drivetemp
    monitor_temperature: when_active
    last_active: 50m
    standby_after: 1h
  datapool3:
    device: "/dev/disk/by-id/ata-ST2000DM001-third"
    temperature_sensor: drivetemp
    monitor_temperature: when_active
    last_active: 50m
    standby_after: 1h
  datapool4:
    device: "/dev/disk/by-id/ata-ST2000DM001-fourth"
    temperature_sensor: drivetemp
    monitor_temperature: when_active
    last_active: 50m
    standby_after: 1h

templates:
  zabbix:
    source: "zabbix_template.go.txt"

tasks:
  zabbix_sender:
    command: "zabbix_sender -z 127.0.0.1 -s \"Zabbix server\" -i -"
    timeout: 5s
    stdin:
      template: zabbix

schedule:
  zabbix:
    task: zabbix_sender
    when:
    - startup
    - every 5m

External resources

Owner
Fred
French dude living in Scotland.
Fred
Comments
  • Bump github.com/stretchr/testify from 1.7.3 to 1.7.5

    Bump github.com/stretchr/testify from 1.7.3 to 1.7.5

    Bumps github.com/stretchr/testify from 1.7.3 to 1.7.5.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump github.com/stretchr/testify from 1.7.3 to 1.7.4

    Bump github.com/stretchr/testify from 1.7.3 to 1.7.4

    Bumps github.com/stretchr/testify from 1.7.3 to 1.7.4.

    Commits
    • 48391ba Fix panic in AssertExpectations for mocks without expectations (#1207)
    • 840cb80 arrays value types in a zero-initialized state are considered empty (#1126)
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump github.com/stretchr/testify from 1.7.1 to 1.7.2

    Bump github.com/stretchr/testify from 1.7.1 to 1.7.2

    Bumps github.com/stretchr/testify from 1.7.1 to 1.7.2.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump github.com/creativeprojects/clog from 0.10.0 to 0.11.1

    Bump github.com/creativeprojects/clog from 0.10.0 to 0.11.1

    Bumps github.com/creativeprojects/clog from 0.10.0 to 0.11.1.

    Commits
    • 924720a add Pop() method to MemoryHandler
    • 606eaf4 add Logs() method to read the logs from MemoryHandler
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump github.com/creativeprojects/clog from 0.10.0 to 0.11.0

    Bump github.com/creativeprojects/clog from 0.10.0 to 0.11.0

    Bumps github.com/creativeprojects/clog from 0.10.0 to 0.11.0.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump github.com/creativeprojects/clog from 0.9.0 to 0.10.0

    Bump github.com/creativeprojects/clog from 0.9.0 to 0.10.0

    Bumps github.com/creativeprojects/clog from 0.9.0 to 0.10.0.

    Commits
    • 42d3fa3 add unit tests for tee handler
    • bb00b3c add tee_handler
    • 5b5468f upgrade go 1.17
    • 4e64954 remove go 1.15 and add go 1.18 to build targets
    • 16e665f Bump github.com/stretchr/testify from 1.7.0 to 1.7.1 (#1)
    • cd0db7a upgrade dependencies
    • fa25565 reduce number of goroutine for github action agent
    • 90b9625 safe writer renamed to sync writer
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump github.com/stretchr/testify from 1.7.0 to 1.7.1

    Bump github.com/stretchr/testify from 1.7.0 to 1.7.1

    Bumps github.com/stretchr/testify from 1.7.0 to 1.7.1.

    Commits
    • 083ff1c Fixed didPanic to now detect panic(nil).
    • 1e36bfe Use cross Go version compatible build tag syntax
    • e798dc2 Add docs on 1.17 build tags
    • 83198c2 assert: guard CanConvert call in backward compatible wrapper
    • 087b655 assert: allow comparing time.Time
    • 7bcf74e fix msgAndArgs forwarding
    • c29de71 add tests for correct msgAndArgs forwarding
    • f87e2b2 Update builds
    • ab6dc32 fix linting errors in /assert package
    • edff5a0 fix funtion name
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
IP Camera Alarm Server to MQTT

IP Camera Alarm Server Universal Alarm Server for all your IP cameras in one place! Integrates well with Home Assistant, Node-Red, etc. Runs great on

Dec 8, 2022
handle multiple mqtt server/cluster based on paho client

pakhshi Introduction Consider you have an array of brokers but you want to publish and subscribe on all of them at the same time. Why you may need thi

Nov 9, 2022
An embeddable lightweight Go/Golang MQTT broker(server) for IoT.
An embeddable lightweight Go/Golang MQTT broker(server) for IoT.

Snple MQTT 简体中文 Note: The API of this library is still unstable and has not been sufficiently tested, please do not use it in production environments.

Sep 12, 2022
Golang DNSTAP sensor use to collect passive dns data from a recursive name server

dnstap-sensor DNSTAP-SENSOR is a Golang program that is used to collect passive dns data from a recursive name server and submit it to Deteque's DNSTA

Nov 21, 2022
Tool for monitoring network devices (mainly using SNMP) - monitoring check plugin
Tool for monitoring network devices (mainly using SNMP) - monitoring check plugin

Thola Description A tool for monitoring network devices written in Go. It features a check mode which complies with the monitoring plugins development

Dec 29, 2022
Monitoring-go - A simple monitoring tool to sites of MOVA

Monitoring GO A simple monitoring tool to sites of MOVA How to use Clone Repo gi

Feb 14, 2022
Live on-demand transcoding in go using ffmpeg. Also with NVIDIA GPU hardware acceleration.

Go live HTTP on-demand transcoding Transcoding is expensive and resource consuming operation on CPU and GPU. For big companies with thousands of custo

Dec 16, 2022
A directory of hardware related libs, tools, and tutorials for Go

Go + hardware This repo is a directory of tools, packages and tutorials to let you introduce Go in your hardware projects. Why Go? Go can target platf

Dec 30, 2022
ghw - Golang HardWare discovery/inspection library
ghw - Golang HardWare discovery/inspection library

ghw - Golang HardWare discovery/inspection library ghw is a small Golang library providing hardware inspection and discovery for Linux and Windows.

Jan 7, 2023
Golang PoC software for reliable file transfers over a data diode. DIY gigabit data diode hardware instructions
Golang PoC software for reliable file transfers over a data diode. DIY gigabit data diode hardware instructions

DIY Data Diode Simple DIY gigabit data diode (hardware and software). Presented at SEC-T 2021. Hardware By doing a simple hardware mod to a fiber conv

Dec 1, 2022
A golang CTF competition platform with high-performance, security and low hardware requirements.
A golang CTF competition platform with high-performance, security and low hardware requirements.

CTFgo - CTF Platform written in Golang A golang CTF competition platform with high-performance, security and low hardware requirements. Live Demo • Di

Oct 20, 2022
Uniform interface for interacting with network hardware via telnet/ssh

jgivc/console This package provides a uniform interface for interacting with network hardware via telnet/ssh This package uses part of reiver/go-telne

Dec 9, 2021
Hw-keyboard-remapper - This is key code remapper for the hardware keyboard

hw-keyboard-remapper hw-keyboard-remapper is key remapper independent the OS. ht

Jan 11, 2022
Thdl is a tool for easing the work with hardware description languages.
Thdl is a tool for easing the work with hardware description languages.

THDL Thdl is a tool for easing the work with hardware description languages. It is (and will always be) based solely on text processing, with no seman

Nov 17, 2022
Go package for the BeagleBone open source hardware

go-beaglebone Go package for the BeagleBone open source hardware Also check out https://github.com/SpaceLeap/go-embedded This package builds on top of

Jul 6, 2019
Go library for hardware I/O control, in the programming style of Arduino

hwio Introduction hwio is a Go library for interfacing with hardware I/O, particularly on SoC-based boards such as BeagleBone Black, Raspberry Pi and

Dec 9, 2022
Easy to use open source hardware to drive WS2811 LEDs with high-quality color

STOP DOING FADECANDY LEDs were not supposed to be given data pins YEARS of "temporal dithering" but no real-world use found for having more than three

Dec 29, 2022
Generate vector tiles for the entire planet on relatively low spec hardware.
Generate vector tiles for the entire planet on relatively low spec hardware.

Sequentially Generate Planet Mbtiles Sequentially generate and merge an entire planet.mbtiles vector tileset on low memory/power devices for free. com

Dec 21, 2022
Next Generation Monitoring Server With Golang

Next Generation Monitoring Server Build make Arguments $ bin/ng-monitoring-server --help Usage of bin/ng-monitoring-server: --address string

Dec 13, 2022
Fast :zap: reverse proxy in front of any GraphQL server for caching, securing and monitoring.
Fast :zap: reverse proxy in front of any GraphQL server for caching, securing and monitoring.

Fast ⚡ reverse proxy in front of any GraphQL server for caching, securing and monitoring. Features ?? Caching RFC7234 compliant HTTP Cache. Cache quer

Nov 5, 2022