ZabbixでT2000の温度を監視したかった。
結果が返ってくるまで10秒くらいかかるので注意。Zabbixの場合はServerとAgentの設定ファイルのTimeoutを10以上にする必要がある。
#!/bin/sh if [ $# -ne 1 ]; then prtpicl -v -c temperature-sensor | awk '$0~/Label/ || $0~/:Temp/ {print $2}'| awk '{if(NR%2)ORS=" ";else ORS="\n";print}' return 0 fi prtpicl -v -c temperature-sensor | awk '$0~/Label/ || $0~/:Temp/ {print $2}'| awk '{if(NR%2)ORS=" ";else ORS="\n";print}' | grep "$1" | awk '{print $2}'