取得した温度をCactiで表示させる

まぁ別段特別な事はしないんですけどね、あんまり資料も無かったので書いておきます。

Data Input Methods

image(196480byte)

  • Name : 今後使うMethod名。好きなもので。 
  • Input Type : Script/Command
  • Input String : cat /hogehoge/temper.tmp

そしてOutput FieldsへAddし、CelsiusとFahrenheitを作成。

  • Celsius
    • Field [Output] : Celsius
    • Friendly Name : TEMP(C)
    • Update RRD File : true
  • Fahrenheit
    • Field [Output] : Fahrenheit
    • Friendly Name : TEMP(F)
    • Update RRD File : true

Graph Templates

image(414484byte)
Graph TemplatesへAddし、"Item #1"〜"Item #5"を作成。

  • Item #1
    • Data Source : [Data Input Methods]で作成したMethod
    • Color : 00BF47
    • Opacity/Alpha Channel : 100%
    • Graph Item Type : LINE2
    • Consolidation Function : AVERAGE
    • CDEF Function : None
    • Value :
    • GPRINT Type : Normal
    • Text Format : main
    • Insert Hard Return : faulse
  • Item #2
    • Data Source : #1と同じ
    • Color : None
    • Graph Item Type : GPRINT
    • Consolidation Function : MAX
    • CDEF Function : None
    • Value :
    • GPRINT Type : Exact Number
    • Text Format : Max :
    • Insert Hard Return : faulse
  • Item #3
    • Data Source : #1と同じ
    • Color : None
    • Graph Item Type : GPRINT
    • Consolidation Function : LAST
    • CDEF Function : None
    • Value :
    • GPRINT Type : Exact Number
    • Text Format : Current:
    • Insert Hard Return : faulse
  • Item #4
    • Data Source : #1と同じ
    • Color : None
    • Graph Item Type : GPRINT
    • Consolidation Function : MIN
    • CDEF Function : None
    • Value :
    • GPRINT Type : Exact Number
    • Text Format : Min:
    • Insert Hard Return : faulse
  • Item #5
    • Data Source : #1と同じ
    • Color : None
    • Graph Item Type : GPRINT
    • Consolidation Function : AVERAGE
    • CDEF Function : None
    • Value :
    • GPRINT Type : Exact Number
    • Text Format : Average:
    • Insert Hard Return : true

Devices

image(238852byte)
Devicesにある該当ホストを選択、Create Graphs for this Hostをクリック

image(20829byte)
Createから作成したテンプレートを選択し、一番下の[Create]をクリックすればグラフができる…はずです。

cronの設定

当然ですが、cronのスケジュールにtemper.txtを更新させる事をお忘れなく。

*/5 * * * * root /hogehoge/temper

別にStandaloneで動かし続けても良いんですが、イチイチinit.dに書かないといけないのでキャンセルですヽ(´ー`)ノ