node_expoter error occured ! hwmon collector failed
概要
Amazon Linux に node_exporter をインストールし起動した所以下のエラーが発生し、起動停止してしまいました。
1 | ERRO[0007] ERROR: hwmon collector failed after 0.000011s: open /proc/class/hwmon: no such file or directory source="node_exporter.go:92" |
hwmon とは?
Hard Ware MONitoring. Linux カーネルのセンサーチップから Hard Ware の温度やファン回転数や電圧を取得できる。
環境情報は以下の通りです。
- Amazon Linux AMI release 2016.09
- node_exporter version 0.14.0-rc.1 (branch: master, revision:5a07f4173d97fa0dd307db5bd3c2e6da26a4b16e)
上記エラーですが issue として上がっていました。
そして解決されてました!
Allow graceful failure in hwmon collector by mdlayher · Pull Request #427 · prometheus/node_exporter
$ ./node_exporter -web.listen-address 192.168.1.1:9100 -collectors.enabled hwmon -log.level debug
INFO[0000] Starting node_exporter (version…
タイミングが悪かったのかマージされる前の release を取得していた為
このエラーに遭遇していました。
最新のソースは master ブランチしてビルドするのが良さそうです。
以下に Amazon Linux で実施したインストール手順をまとめました。
手順
Golang インストール
以下 Golang オフィシャルサイトにある標準的なインストール方法です。参考にしてください。
標準的な Golang インストール方法 - 長生村本郷Engineers'Blog
以下に移行しました。 kenzo0107.github.io
node_exporter をソースからインストールしビルド
1 | $ mkdir -p $GOPATH/src/github.com/prometheus |
ついでに起動スクリプト
- 事前準備
1 | // pid ファイル置き場 作成 |
- 起動スクリプト作成
1 | $ cd /etc/init.d |
- 起動
1 | $ sudo /etc/init.d/node_exporter start |
無事エラーなく起動するようになりました ♪
node_expoter error occured ! hwmon collector failed
https://kenzo0107.github.io/2017/02/02/2017-02-03-node_exporter-hwmon-collector-failed/