Loading ...
Sorry, an error occurred while loading the content.

Adding Hard Drive Temperature to the Linkstation Maintenance page

Expand Messages
  • cynicaltaf
    Not sure if this has been listed already, but if you have hddtemp on your Linkstation then it is relatively easy to display the internal Hard Drive
    Message 1 of 1 , Jan 31, 2006
    • 0 Attachment
      Not sure if this has been listed already, but if you have "hddtemp"
      on your Linkstation then it is relatively easy to display the
      internal Hard Drive Temperature on the Linkstation browser interface
      Maintenance->System Status page.

      Here are the details for modifying the necessary browser Perl
      scripts (N.B. WARNING: Only tested with my PPC Firmware V146_10 and,
      do I really need to say it(?) - Do not attempt this unless you know
      what you are doing! Get it wrong and you could break the Linkstation
      browser interface.):


      /www/cgi-bin/mellib_msg_jp.pl
      -----------------------------
      Here we add the descriptive text that appears on the System Status
      page. It is best to place this after the long list of
      $defMsgMainte?? definitions (line 834 in my file). N.B. I used J6 as
      this was the next available alphanumeric pair:

      $defMsgMainteJ6 = 'Drive Temperature';


      /www/cgi-bin/sysinfo.pl
      -----------------------
      Need to include the actual line that displays the Hard Disk
      Temperature to the System Status page. I included this after the
      code that displays the percentage disk space used (line 164 - search
      for '/help/m-hddpar.htm' to be sure you have the right place):

      &HtmlMainInfoTable($defMsgMainteJ6, "/help/m-hddtemp.htm",
      &MelGetHddTemp);


      /www/cgi-bin/mellib_common.pl
      -----------------------------
      Here we add the actual new code that calls hddtemp and parses the
      output (N.B. hddtemp must be available on the path). I added this
      code at line 832, just before the MelGetTime subroutine, for
      consistency. If you use something other than hddtemp then this is
      the code you would alter to call that instead, with changes to parse
      the output as well:

      # Sub MelGetHddTemp () return $TEMP
      sub MelGetHddTemp
      {
      my $tmpHddTemp;
      my @tmpHddInfo;

      $tmpHddTemp = readpipe("hddtemp /dev/hda");
      @tmpHddInfo = split(/:/, $tmpHddTemp);

      return $tmpHddInfo[2];
      }


      /www/help/m-hddtemp.htm (this is a new file)
      -----------------------
      Defines the Hard Drive Temperature help popup box contents:

      <HTML>
      <HEAD>
      <title>Link Station</title>
      </HEAD>
      <body bgcolor="#FFFFFF" text="#000000" link="#000000"
      vlink="#000000" alink="#FF0000">
      <p><font color="#008080"><strong>Hard Drive
      Temperature</strong></font></p>
      <p>This displays the LinkStation's current internal Hard Drive
      temperature. The hddtemp utility needs to be available on the path
      for this to function correctly. </p>
      <p align="right"><script language="JavaScript"><!--
      document.write("<a href='javascript:window.close
      ();'><b>Close</b><\/a>");
      // --></script></p>
      </body>
      </HTML>


      I realise that this is not the quickest method of adding the
      necessary code, but it was important to me that it was implemented
      consistently with the existing interface code. The next step is to
      see what other useful additions can be made to expand the
      Linkstation interface!
    Your message has been successfully submitted and would be delivered to recipients shortly.