- my $disk = $_[0];
- chomp $disk;
- my @status;
- if (-e "$Header::graphdir/disk-$disk-day.png") {
- &Header::openbox('100%', 'center', "Disk /dev/$disk $Lang::tr{'graph'}");
- my $ftime = localtime((stat("$Header::graphdir/disk-$disk-day.png"))[9]);
- print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
- print "<a href='/cgi-bin/graphs.cgi?graph=disk-$disk'>";
- print "<img alt='' src='/graphs/disk-$disk-day.png' border='0' />";
- print "</a>";
- print "<br />\n";
-
- if (-e "/tmp/hddstatus") {
- open(DATEI, "</tmp/hddstatus") || die "Datei nicht gefunden";
- my @diskstate = <DATEI>;
- close(DATEI);
-
- foreach (@diskstate){
- if ( $_ =~/$disk/ ){@status = split(/-/,$_);}
- }
-
- if ( $status[1]=~/standby/){
- my $ftime = localtime((stat("/tmp/hddshutdown-$disk"))[9]);
- print"<B>Disk /dev/$disk status:<font color=#FF0000>".$status[1]."</font></B> (since $ftime)";
- }
- else{
- print"<B>Disk /dev/$disk status:<font color=#00FF00>".$status[1]."</font></B>";
- }
- }
- my $smart = `/usr/local/bin/smartctrl $disk`;
- $smart = &Header::cleanhtml($smart);
- print <<END
- <br /><input type="button" onClick="swapVisibility('smart_$disk')" value="$Lang::tr{'smart information'}" />
- <div id='smart_$disk' style='display: none'>
- <hr /><table border=0><tr><td align=left><pre>$smart</pre></table>
- </div>
+ my $disk = $_[0];
+ chomp $disk;
+ my @status;
+ if (-e "/var/run/hddstatus"){
+ open(DATEI, "</var/run/hddstatus") || die "Datei nicht gefunden";
+ my @diskstate = <DATEI>;
+ close(DATEI);
+
+ foreach (@diskstate){
+ if ( $_ =~/$disk/ ){@status = split(/-/,$_);}
+ }
+
+ if ( $status[1]=~/standby/){
+ my $ftime = localtime((stat("/var/run/hddshutdown-$disk"))[9]);
+ print"<B>Disk $disk status:<font color=#FF0000>".$status[1]."</font></B> (since $ftime)";
+ }else{
+ print"<B>Disk $disk status:<font color=#00FF00>".$status[1]."</font></B>";
+ }
+ }
+
+ my $smart = `/usr/local/bin/smartctrl $disk`;
+ $smart = &Header::cleanhtml($smart);
+ print <<END
+<br /><input type="button" onClick="swapVisibility('smart_$disk')" value="$Lang::tr{'smart information'}" />
+<div id='smart_$disk' style='display: none'>
+ <hr /><table border=0><tr><td align=left><pre>$smart</pre></table>
+</div>