HW monitor
 
About
 
Install
 
Download
 
FAQ
 
 

FAQ


1. Can I use the daemontools to auto-reload hwmonitor and hwclient when it crashed?

Yes, the "run" shell like:


// -- hwmonitor run shell --
  #!/bin/sh
  killall -9 hwmonitor
  exec fghack /server/hwmonitor/hwmonitor /server/hwmonitor/hwmonitor.conf

// -- hwclient run shell --
  #!/bin/sh
  killall -9 hwclient
  exec fghack /server/hwmonitor/hwclient /server/hwmonitor/hwclient.conf


2. How can I use another program (like PHP) to connect the hwmonitor listen-port and run the predefine command?

For example (I use PHP to whrite this):


<?php
// -- DEMO: connect to hwmonitor daemon and show return msg to webpage --
$server = "127.0.0.1";
$port = 1000;
$def_cmd = "hw_top";

error_reporting(E_ALL);
set_time_limit(0);

$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
if(socket_connect($socket, $server, $port)){
        socket_write($socket, $def_cmd, strlen($def_cmd));
        $receiveStr = "";
        echo "<pre>";
        while($receiveStr = socket_read($socket, 4096)){;
                echo $receiveStr;
                flush();
        }
}
socket_close($socket);
?>

 

 
 
-- Go Top --