July 20, 201015 yr This functionality is now in the bubbaUtils at http://lime-technology.com/forum/index.php?topic=7094.0 ======================================= Save this code to /usr/local/webGui/getvar.php <?php header("Content-Type: text/plain"); parse_str(str_replace("+","%2B",$argv[1]), $_GET); if (isset($_GET['varname'])) { $varname = "$" . $_GET['varname']; } else { $varname = '$var[\'fsState\']'; } // Read emhttp status $var = parse_ini_file( "/var/local/emhttp/var.ini"); $sec = parse_ini_file( "/var/local/emhttp/sec.ini", TRUE); $devs = parse_ini_file( "/var/local/emhttp/devs.ini", TRUE); $disks = parse_ini_file( "/var/local/emhttp/disks.ini", TRUE); $users = parse_ini_file( "/var/local/emhttp/users.ini", TRUE); $shares = parse_ini_file( "/var/local/emhttp/shares.ini", TRUE); eval("\$result = $varname;"); echo $result; ?> Then put this url into your browser: http://tower/getvar.php and you get the array status. You can query any of the standard php variables (from http://tower/Utils/Vars) like this: http://tower/getvar.php?varname=var['mdVersion'] <-- returns the version of the md driver http://tower/getvar.php?varname=disks['parity']['status'] <-- returns the status of the parity drive Using this you can easily do remote monitoring of unRAID. I need to add some security to it... someone malicious can exploit it as it is since it uses the eval function. But I wanted to put it out here for comments. I've got several more utilities like this in the works.... so many ideas, so little time. I'll collect them together into a utilities package soon.
July 21, 201015 yr Thanks ! I'll give it a try soon, but from the looks of it this comes pretty close to my request in the other thread !
Archived
This topic is now archived and is closed to further replies.