hddtempによる温度計測 Edit

  • インストール
    apt-get でインストールします。
    landisk:~# apt-get install hddtemp 
    /etc/hddtemp.db に以下を追加します。 SV1203Nは120G、SV1604は160GのSAMSUNGドライブです。
    "SAMSUNG SV1203N"  194  C "Samsung SpinPoint V80 serie"
    "SAMSUNG SV1604N"  194  C "Samsung SpinPoint V80 serie"
  • 実行
    ドライブを引数にコマンドを実行します。
    landisk:~# hddtemp /dev/hda
    /dev/hda: SAMSUNG SV1604N:  41 C
    次のようなスクリプトを用意すれば、温度だけ抜き出すことが可能です。
    #!/bin/sh
    hddtemp /dev/hda | awk '{print $4}'
    
  • その他
    情報交換BBS、スレッドNo.86に関連情報がありますのでそちらもご覧ください。

付録 Edit

  • アクセスログ解析スクリプト
    #!/usr/bin/perl
    
    $logfile="/var/log/apache/access.log";
    open(LOGFILE,"$logfile") or die "Can't open $logfile !?n";
    
    print "Content-Type:text/plain?n?n";
    
    while(<LOGFILE>){
        next if($_ =~ /^192.168.0./);
    
        chop;
        s/?s+/ /go;
    
        ($clientAddress, $rfc1413, $username,
         $localtime, $httpRequest, $statusCode,
         $byteSentToClient, $refer, $clientSoftware) = 
    	 /^(?S+) (?S+) (?S+) ?[(.+)?] ?"(.+)?" (?S+) (?S+) ?"(.*)?" ?"(.*)?"/o;
    
        next if( ($statusCode == 200) || ($statusCode == 304) );
    
        print "$clientAddress [$localtime] $httpRequest $statusCode?n"; 
    
    }
    



Counter: 5085, today: 1, yesterday: 1

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2006-06-13 (火) 20:02:27 (6532d)