[ Avaa Bypassed ]




Upload:

Command:

www-data@3.134.86.4: ~ $
#!/usr/bin/perl
# Show all drives and their SMART status

require './smart-status-lib.pl';
&ReadParse();

# Make sure SMART commands are installed
if (!&has_command($config{'smartctl'})) {
	&ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1);
	&ui_print_endpage(
		&ui_config_link('index_ecmd',
		        [ "<tt>$config{'smartctl'}</tt>", undef ]));
	}

# Show the version
$ver = &get_smart_version();
if (!$ver) {
	&ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1);
	&ui_print_endpage(
		&ui_config_link('index_ecmd2',
		        [ "<tt>$config{'smartctl'}</tt>", undef ]));
	}
&ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0,
		 &help_search_link("smartctl", "man", "doc", "google"),
		 undef, undef,
		 &text('index_version', $ver));

# Get list of drives
@drives = &list_smart_disks_partitions();
if (!@drives) {
	&ui_print_endpage($text{'index_eidescsi'});
	}

if ($config{'mode'} == 1 || $in{'drive'}) {
	# Just show one drive, selected from menu
	print &ui_form_start("index.cgi");
	print "<b>$text{'index_show'}</b>\n";
	print &ui_select("drive", $in{'drive'},
			 [ map { [ $_->{'device'}.":".$_->{'subdisk'},
				   $_->{'desc'}.($_->{'model'} ? " ($_->{'model'})" : "") ] } @drives ],
			 1, 0, 0, 0, "onChange='form.submit()'");
	print &ui_submit($text{'index_ok'}),"\n";
	print &ui_form_end();

	if ($in{'drive'}) {
		($device, $subdisk) = split(/:/, $in{'drive'});
		($d) = grep { $_->{'device'} eq $device &&
			      $_->{'subdisk'} == $subdisk } @drives;
		&show_drive($d);
		}
	}
else {
	# Show all IDE drives
	foreach $d (@drives) {
		&show_drive($d);
		}
	}

&ui_print_footer("/", $text{'index'});

# show_drive(&drive)
sub show_drive
{
print &ui_form_start("action.cgi");
print &ui_hidden("drive", $_[0]->{'device'});
print &ui_hidden("subdisk", $_[0]->{'subdisk'});
local $h = defined($_[0]->{'subdisk'}) ?
	&text('index_drivesub', "<tt>$_[0]->{'device'}</tt>",
				$_[0]->{'subdisk'}) :
	&text('index_drive', "<tt>$_[0]->{'device'}</tt>");
print &ui_table_start($h, "width=100%", 4,
		      [ "width=30%", undef, "width=30%", undef ]);
local $st = &get_drive_status($_[0]->{'device'}, $_[0]);
print &ui_table_row($text{'index_desc'},
		    $_[0]->{'desc'});
if ($_[0]->{'cylsize'}) {
	print &ui_table_row($text{'index_size'},
		    &nice_size($_[0]->{'cylinders'}*$_[0]->{'cylsize'}));
	}
if ($_[0]->{'model'}) {
	print &ui_table_row($text{'index_model'},
			    $_[0]->{'model'});
	}
print &ui_table_row($text{'index_support'},
		    $st->{'support'} ? $text{'yes'} : $text{'no'});
print &ui_table_row($text{'index_enabled'},
		    $st->{'enabled'} ? $text{'yes'} : $text{'no'});
if ($st->{'support'} && $st->{'enabled'}) {
	if ($st->{'errors'}) {
		print &ui_table_row($text{'index_errors'},
				    "<font color=#ff0000>".
				    &text('index_ecount', $st->{'errors'}).
				    "</font>");
		}
	print &ui_table_row($text{'index_check'},
			    $st->{'check'} ? $text{'yes'} :
				"<font color=#ff0000>$text{'no'}</font>");
	}
if ($st->{'family'}) {
	print &ui_table_row($text{'index_family'}, $st->{'family'});
	}
if ($st->{'model'}) {
	print &ui_table_row($text{'index_model'}, $st->{'model'});
	}
if ($st->{'serial'}) {
	print &ui_table_row($text{'index_serial'}, $st->{'serial'});
	}
if ($st->{'capacity'}) {
	print &ui_table_row($text{'index_capacity'}, $st->{'capacity'});
	}
print &ui_table_end();

# Show extra attributes
if ($config{'attribs'} && @{$st->{'attribs'}}) {
	$attrs_count++;
	print &ui_hidden_table_start($text{'index_attrs'}, "width=100%", 2,
				     "attrs".$attrs_count, 1, [ "width=30%" ]);
	foreach my $a (@{$st->{'attribs'}}) {
		next if ($a->[0] =~ /UDMA CRC Error Count/i); # too long
		print &ui_table_row($a->[0],
			($a->[2] =~ /^\s*(seconds|minutes|hours|days|months|years|weeks)\s*/i || !$a->[2] ? $a->[1]." ".$a->[2] : $a->[2]).
			($a->[3] ? " ($text{'index_norm'} $a->[3])" : ""));
		}
	print &ui_hidden_table_end();
	}

# Show raw data from smartctl
if ($config{'attribs'} && $st->{'raw'}) {
	$raw_count++;
	print &ui_hidden_table_start($text{'index_raw'}, "width=100%", 2,
			     "raw".$raw_count, @{$st->{'attribs'}} ? 0 : 1);
	print &ui_table_row(undef,
		"<pre>".&html_escape($st->{'raw'})."</pre>", 2);
	print &ui_hidden_table_end();
	}

if ($st->{'support'} && $st->{'enabled'}) {
	print &ui_form_end([ [ "short", $text{'index_short'} ],
			     [ "ext", $text{'index_ext'} ],
			     [ "data", $text{'index_data'} ] ]);
	}
else {
	print &ui_form_end();
	}
}


Filemanager

Name Type Size Permission Actions
images Folder 0755
lang Folder 0755
CHANGELOG File 1.34 KB 0644
action.cgi File 810 B 0755
config File 41 B 0644
config-CentOS-Linux-5.0-6.9 File 41 B 0644
config-Redhat-Enterprise-Linux-5.0-6.9 File 41 B 0644
config.info File 221 B 0644
config.info.ca File 264 B 0644
config.info.de File 261 B 0644
config.info.es File 166 B 0644
config.info.fr File 0 B 0644
config.info.ms File 245 B 0644
config.info.nl File 251 B 0644
config.info.no File 230 B 0644
config.info.ru File 360 B 0644
index.cgi File 4.37 KB 0755
install_check.pl File 343 B 0755
module.info File 195 B 0644
module.info.af File 0 B 0644
module.info.af.auto File 127 B 0644
module.info.ar File 0 B 0644
module.info.ar.auto File 152 B 0644
module.info.be File 0 B 0644
module.info.be.auto File 169 B 0644
module.info.bg File 0 B 0644
module.info.bg.auto File 230 B 0644
module.info.ca File 136 B 0644
module.info.cs File 26 B 0644
module.info.cs.auto File 91 B 0644
module.info.da File 0 B 0644
module.info.da.auto File 126 B 0644
module.info.de File 144 B 0644
module.info.el File 0 B 0644
module.info.el.auto File 222 B 0644
module.info.es File 37 B 0644
module.info.es.auto File 102 B 0644
module.info.eu File 0 B 0644
module.info.eu.auto File 127 B 0644
module.info.fa File 0 B 0644
module.info.fa.auto File 190 B 0644
module.info.fi File 0 B 0644
module.info.fi.auto File 116 B 0644
module.info.fr File 0 B 0644
module.info.fr.auto File 143 B 0644
module.info.he File 0 B 0644
module.info.he.auto File 158 B 0644
module.info.hr File 0 B 0644
module.info.hr.auto File 123 B 0644
module.info.hu File 0 B 0644
module.info.hu.auto File 163 B 0644
module.info.it File 0 B 0644
module.info.it.auto File 132 B 0644
module.info.ja File 0 B 0644
module.info.ja.auto File 166 B 0644
module.info.ko File 0 B 0644
module.info.ko.auto File 156 B 0644
module.info.lt File 0 B 0644
module.info.lt.auto File 135 B 0644
module.info.lv File 0 B 0644
module.info.lv.auto File 129 B 0644
module.info.ms File 117 B 0644
module.info.mt File 0 B 0644
module.info.mt.auto File 125 B 0644
module.info.nl File 27 B 0644
module.info.nl.auto File 110 B 0644
module.info.no File 25 B 0644
module.info.no.auto File 100 B 0644
module.info.pl File 0 B 0644
module.info.pl.auto File 120 B 0644
module.info.pt File 0 B 0644
module.info.pt.auto File 130 B 0644
module.info.pt_BR File 0 B 0644
module.info.pt_BR.auto File 136 B 0644
module.info.ro File 0 B 0644
module.info.ro.auto File 136 B 0644
module.info.ru File 46 B 0644
module.info.ru.auto File 157 B 0644
module.info.sk File 26 B 0644
module.info.sk.auto File 95 B 0644
module.info.sl File 0 B 0644
module.info.sl.auto File 120 B 0644
module.info.sv File 0 B 0644
module.info.sv.auto File 134 B 0644
module.info.th File 0 B 0644
module.info.th.auto File 273 B 0644
module.info.tr File 0 B 0644
module.info.tr.auto File 145 B 0644
module.info.uk File 0 B 0644
module.info.uk.auto File 190 B 0644
module.info.ur File 0 B 0644
module.info.ur.auto File 213 B 0644
module.info.vi File 0 B 0644
module.info.vi.auto File 172 B 0644
module.info.zh File 0 B 0644
module.info.zh.auto File 109 B 0644
module.info.zh_TW File 0 B 0644
module.info.zh_TW.auto File 115 B 0644
prefs.info File 20 B 0644
smart-status-lib.pl File 12.98 KB 0755
status_monitor.pl File 4.17 KB 0755