LoginSignup
3
3

More than 5 years have passed since last update.

TEMPer + Arch Linux + Muninで温度監視

Last updated at Posted at 2016-11-14

Yet Another TEMPer.

やりたいこと

  • Arch Linuxでやりたい
    • たまたまDebianじゃないんです、すいません
    • apt-getは使えないんです、すいません
  • Muninでグラフにしたい
    • たまたまZabbixじゃないんです、すいません
  • 簡単に入れたい
    • 手抜きします、すいません

対象センサーデバイス

どこにでも売っている、1000円くらいのGold TEMPer
RPiでキャリブレーションの記事が、とても参考になる。精度はいまいちっぽい。

TEMPerドライバ

とにかくいろいろある。

  1. Arch LinuxのAURのpython2-temper
    依存関係が複雑でPKGBUILDによるbuildに失敗、断念

  2. キャリブレーションの記事でも紹介されていたhttps://github.com/bitplane/temper
    libusbがあればmake一発だが、Muninで使うには別途スクリプト必要?

  3. SNMPもあって高機能そうなhttps://github.com/padelt/temper-python
    PKGBUILD見つからず…python-usbも面倒そう…いやいやPyPIなら簡単?

  4. ここで推されていたhttps://github.com/petechap/usb-thermometer
    Muninプラグインがある

その他forkも含めて、カオス。

デバイスのバグ

こちらによると、このデバイスには連続使用に問題がありそうだ。4.のMuninプラグインには、

This script compensates this by a retry after a second after a failed invocation of pcsensor.

とあり、workaroundが入っていそうなので、4.の組み合わせにしてみよう。

設置

usb-thermometer

もう忘れてしまったが、

$ pacman -S libusb
$ git clone https://github.com/petechap/usb-thermometer.git
$ cd usb-thermometer
$ make
$ sudo ./pcsensor
$ sudo install -s pcsensor /usr/local/bin/pcsensor

だったと思う。

munin-pcsensor

こちらも記憶が無いが、本当はudevと組み合わせてuser=muninで走らせたりするところを手抜きして、

/etc/munin/plugin-conf.d/pcsensor
[pcsensor*]
user root
$ git clone https://github.com/cmur2/munin-pcsensor.git
$ sudo cp munin-pcsensor/pcsensor /usr/lib/munin/plugins/
$ sudo ln -s /usr/lib/munin/plugins/pcsensor /etc/munin/plugins/pcsensor
$ sudo systemctl restart munin-node

なんかをした気がする。

結果

温度

pcsensor-week.png

パラメーター調整を何もしていないが、カーブはきれいな感じ。
合っているかは不明だが…。

おまけ::NTPのPLL

ntp_kernel_pll_freq-week.png

相似!

自由研究

VMware vSphere ESXiでUSBのHIDって使えない? Passthrough?

追記

ある日4.が動かなくなり、2.にお引越し。失敗時のリトライなども入っているように見える。
muninのpluginはこちらでばっちり。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3