mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-11 19:55:52 +02:00
Merge branch 'master' of git://git.ipfire.org/ipfire-2.x
This commit is contained in:
@@ -76,6 +76,9 @@ elsif ($ARGV[0] eq 'addonbackup') {
|
||||
elsif ($ARGV[0] =~ /ipf$/ ) {
|
||||
system("rm /var/ipfire/backup/$ARGV[0]");
|
||||
}
|
||||
elsif ($ARGV[0] =~ /iso$/ ) {
|
||||
system("rm /var/tmp/backupiso/$ARGV[0]");
|
||||
}
|
||||
elsif ($ARGV[0] eq '') {
|
||||
printf "No argument given, please use <include><exclude><cli>\n"
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ HOME=/
|
||||
|
||||
# Make some nice graphs
|
||||
*/5 * * * * /usr/local/bin/makegraphs >/dev/null
|
||||
01 * * * * /etc/init.d/collectd backup >/dev/null
|
||||
* 05 * * * /etc/init.d/collectd backup >/dev/null
|
||||
|
||||
# Force update the dynamic dns registration once a week
|
||||
# Force update even if IP has not changed once a month if 'minimize update' selected in GUI
|
||||
@@ -37,7 +37,7 @@ HOME=/
|
||||
find /var/log/logwatch/ -ctime +${LOGWATCH_KEEP=56} -exec rm -f '{}' ';'
|
||||
|
||||
# hddshutdown
|
||||
02 * * * * /usr/local/bin/hddshutdown >/dev/null
|
||||
*/30 * * * * /usr/local/bin/hddshutdown >/dev/null
|
||||
|
||||
# connection-scheduler
|
||||
*/5 * * * * /usr/local/bin/connscheduler timer > /dev/null
|
||||
|
||||
@@ -16,7 +16,7 @@ usr/lib/libsensors.so.4.0.2
|
||||
#usr/man/man8/isadump.8
|
||||
#usr/man/man8/isaset.8
|
||||
#usr/man/man8/pwmconfig.8
|
||||
#usr/local/man/man8/sensors-detect.8
|
||||
#usr/man/man8/sensors-detect.8
|
||||
usr/sbin/fancontrol
|
||||
usr/sbin/isadump
|
||||
usr/sbin/isaset
|
||||
|
||||
@@ -617,7 +617,7 @@ usr/bin/vim
|
||||
#usr/share/vim/vim70/syntax/blank.vim
|
||||
#usr/share/vim/vim70/syntax/bst.vim
|
||||
#usr/share/vim/vim70/syntax/btm.vim
|
||||
#usr/share/vim/vim70/syntax/c.vim
|
||||
usr/share/vim/vim70/syntax/c.vim
|
||||
#usr/share/vim/vim70/syntax/calendar.vim
|
||||
#usr/share/vim/vim70/syntax/catalog.vim
|
||||
#usr/share/vim/vim70/syntax/cdl.vim
|
||||
@@ -667,7 +667,7 @@ usr/bin/vim
|
||||
#usr/share/vim/vim70/syntax/desktop.vim
|
||||
#usr/share/vim/vim70/syntax/dictconf.vim
|
||||
#usr/share/vim/vim70/syntax/dictdconf.vim
|
||||
#usr/share/vim/vim70/syntax/diff.vim
|
||||
usr/share/vim/vim70/syntax/diff.vim
|
||||
#usr/share/vim/vim70/syntax/dircolors.vim
|
||||
#usr/share/vim/vim70/syntax/diva.vim
|
||||
#usr/share/vim/vim70/syntax/django.vim
|
||||
@@ -712,7 +712,7 @@ usr/bin/vim
|
||||
#usr/share/vim/vim70/syntax/forth.vim
|
||||
#usr/share/vim/vim70/syntax/fortran.vim
|
||||
#usr/share/vim/vim70/syntax/foxpro.vim
|
||||
#usr/share/vim/vim70/syntax/fstab.vim
|
||||
usr/share/vim/vim70/syntax/fstab.vim
|
||||
#usr/share/vim/vim70/syntax/fvwm.vim
|
||||
#usr/share/vim/vim70/syntax/fvwm2m4.vim
|
||||
#usr/share/vim/vim70/syntax/gdb.vim
|
||||
@@ -856,7 +856,7 @@ usr/bin/vim
|
||||
#usr/share/vim/vim70/syntax/passwd.vim
|
||||
#usr/share/vim/vim70/syntax/pcap.vim
|
||||
#usr/share/vim/vim70/syntax/pccts.vim
|
||||
#usr/share/vim/vim70/syntax/perl.vim
|
||||
usr/share/vim/vim70/syntax/perl.vim
|
||||
#usr/share/vim/vim70/syntax/pf.vim
|
||||
#usr/share/vim/vim70/syntax/pfmain.vim
|
||||
#usr/share/vim/vim70/syntax/php.vim
|
||||
@@ -886,7 +886,7 @@ usr/bin/vim
|
||||
#usr/share/vim/vim70/syntax/ptcap.vim
|
||||
#usr/share/vim/vim70/syntax/purifylog.vim
|
||||
#usr/share/vim/vim70/syntax/pyrex.vim
|
||||
#usr/share/vim/vim70/syntax/python.vim
|
||||
usr/share/vim/vim70/syntax/python.vim
|
||||
#usr/share/vim/vim70/syntax/qf.vim
|
||||
#usr/share/vim/vim70/syntax/quake.vim
|
||||
#usr/share/vim/vim70/syntax/r.vim
|
||||
@@ -927,7 +927,7 @@ usr/bin/vim
|
||||
#usr/share/vim/vim70/syntax/sgml.vim
|
||||
#usr/share/vim/vim70/syntax/sgmldecl.vim
|
||||
#usr/share/vim/vim70/syntax/sgmllnx.vim
|
||||
#usr/share/vim/vim70/syntax/sh.vim
|
||||
usr/share/vim/vim70/syntax/sh.vim
|
||||
#usr/share/vim/vim70/syntax/sicad.vim
|
||||
#usr/share/vim/vim70/syntax/sieve.vim
|
||||
#usr/share/vim/vim70/syntax/simula.vim
|
||||
@@ -973,12 +973,12 @@ usr/bin/vim
|
||||
#usr/share/vim/vim70/syntax/st.vim
|
||||
#usr/share/vim/vim70/syntax/stata.vim
|
||||
#usr/share/vim/vim70/syntax/stp.vim
|
||||
#usr/share/vim/vim70/syntax/strace.vim
|
||||
usr/share/vim/vim70/syntax/strace.vim
|
||||
#usr/share/vim/vim70/syntax/sudoers.vim
|
||||
#usr/share/vim/vim70/syntax/svn.vim
|
||||
#usr/share/vim/vim70/syntax/syncolor.vim
|
||||
#usr/share/vim/vim70/syntax/synload.vim
|
||||
#usr/share/vim/vim70/syntax/syntax.vim
|
||||
usr/share/vim/vim70/syntax/syntax.vim
|
||||
#usr/share/vim/vim70/syntax/sysctl.vim
|
||||
#usr/share/vim/vim70/syntax/tads.vim
|
||||
#usr/share/vim/vim70/syntax/tags.vim
|
||||
|
||||
@@ -170,9 +170,11 @@ echo \\n running on \\s \\r \\m >> /etc/issue
|
||||
#
|
||||
# Update crontab
|
||||
#
|
||||
grep -v "ipacsum" /var/spool/cron/root.orig > /tmp/root.orig.tmp
|
||||
grep -v "ipacsum" /var/spool/cron/root.orig | grep -v "hddshutdown" > /tmp/root.orig.tmp
|
||||
echo "# Backup collectd files" >> /tmp/root.orig.tmp
|
||||
echo "01 * * * * /etc/init.d/collectd backup >/dev/null" >> /tmp/root.orig.tmp
|
||||
echo "* 05 * * * /etc/init.d/collectd backup >/dev/null" >> /tmp/root.orig.tmp
|
||||
echo "# hddshutdown" >> /tmp/root.orig.tmp
|
||||
echo "*/30 * * * * /usr/local/bin/hddshutdown >/dev/null" >> /tmp/root.orig.tmp
|
||||
mv /tmp/root.orig.tmp /var/spool/cron/root.orig
|
||||
chmod 600 /var/spool/cron/root.orig
|
||||
chown root:cron /var/spool/cron/root.orig
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
- To test the memory in your system type: 04memtest <ENTER>07.
|
||||
|
||||
|
||||
- To install in unattended mode, type: 04unattended <ENTER>07.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,9 @@ LABEL novga
|
||||
LABEL dma
|
||||
KERNEL vmlinuz
|
||||
APPEND initrd=instroot root=/dev/ram0 ramdisk_size=16384 vga=791 splash=silent ro
|
||||
LABEL unattended
|
||||
KERNEL vmlinuz
|
||||
APPEND ide=nodma initrd=instroot root=/dev/ram0 ramdisk_size=16384 vga=791 splash=silent unattended ro
|
||||
LABEL memtest
|
||||
KERNEL memtest
|
||||
APPEND -
|
||||
|
||||
@@ -10,4 +10,3 @@ GREEN_NETADDRESS=192.168.180.0
|
||||
GREEN_BROADCAST=192.168.180.255
|
||||
ROOT_PASSWORD=ipfire
|
||||
ADMIN_PASSWORD=ipfire
|
||||
RESTORE_FILE=
|
||||
|
||||
@@ -88,7 +88,7 @@ CONFIG_TAR=y
|
||||
CONFIG_FEATURE_TAR_BZIP2=y
|
||||
# CONFIG_FEATURE_TAR_LZMA is not set
|
||||
# CONFIG_FEATURE_TAR_FROM is not set
|
||||
# CONFIG_FEATURE_TAR_GZIP is not set
|
||||
CONFIG_FEATURE_TAR_GZIP=y
|
||||
# CONFIG_FEATURE_TAR_COMPRESS is not set
|
||||
CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y
|
||||
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
|
||||
|
||||
@@ -56,6 +56,8 @@ system("/usr/local/bin/backupctrl makedirs >/dev/null 2>&1 ") unless ( -e '/var/
|
||||
############################################################################################################################
|
||||
############################################## System calls ohne Http Header ###############################################
|
||||
|
||||
# Replace slashes from filename
|
||||
$cgiparams{'FILE'} =~ s/\///;
|
||||
|
||||
if ( $cgiparams{'ACTION'} eq "download" )
|
||||
{
|
||||
@@ -66,6 +68,15 @@ if ( $cgiparams{'ACTION'} eq "download" )
|
||||
print @fileholder;
|
||||
exit (0);
|
||||
}
|
||||
if ( $cgiparams{'ACTION'} eq "downloadiso" )
|
||||
{
|
||||
open(DLFILE, "</var/tmp/backupiso/$cgiparams{'FILE'}") or die "Unable to open $cgiparams{'FILE'}: $!";
|
||||
my @fileholder = <DLFILE>;
|
||||
print "Content-Type:application/x-download\n";
|
||||
print "Content-Disposition:attachment;filename=$cgiparams{'FILE'}\n\n";
|
||||
print @fileholder;
|
||||
exit (0);
|
||||
}
|
||||
if ( $cgiparams{'ACTION'} eq "downloadaddon" )
|
||||
{
|
||||
open(DLFILE, "</var/ipfire/backup/addons/backup/$cgiparams{'FILE'}") or die "Unable to open $cgiparams{'FILE'}: $!";
|
||||
@@ -140,6 +151,7 @@ if ( $message ne "" ){
|
||||
}
|
||||
|
||||
my @backups = `cd /var/ipfire/backup/ && ls *.ipf 2>/dev/null`;
|
||||
my @backupisos = `cd /var/tmp/backupiso/ && ls *.iso 2>/dev/null`;
|
||||
|
||||
&Header::openbox('100%', 'center', $Lang::tr{'backup'});
|
||||
|
||||
@@ -182,6 +194,15 @@ $Size = sprintf("%02d", $Size);
|
||||
print "<tr><td align='center'>$Lang::tr{'backup from'} $_ $Lang::tr{'size'} $Size KB</td><td width='5'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='download' /><input type='hidden' name='FILE' value='$_' /><input type='image' alt='$Lang::tr{'download'}' title='$Lang::tr{'download'}' src='/images/package-x-generic.png' /></form></td>";
|
||||
print "<td width='5'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='delete' /><input type='hidden' name='FILE' value='$_' /><input type='image' alt='$Lang::tr{'delete'}' title='$Lang::tr{'delete'}' src='/images/user-trash.png' /></form></td></tr>";
|
||||
}
|
||||
foreach (@backupisos){
|
||||
chomp($_);
|
||||
my $Datei = "/var/tmp/backupiso/".$_;
|
||||
my @Info = stat($Datei);
|
||||
my $Size = $Info[7] / 1024;
|
||||
$Size = sprintf("%02d", $Size);
|
||||
print "<tr><td align='center'>$Lang::tr{'backup from'} $_ $Lang::tr{'size'} $Size KB</td><td width='5'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='downloadiso' /><input type='hidden' name='FILE' value='$_' /><input type='image' alt='$Lang::tr{'download'}' title='$Lang::tr{'download'}' src='/images/package-x-generic.png' /></form></td>";
|
||||
print "<td width='5'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='delete' /><input type='hidden' name='FILE' value='$_' /><input type='image' alt='$Lang::tr{'delete'}' title='$Lang::tr{'delete'}' src='/images/user-trash.png' /></form></td></tr>";
|
||||
}
|
||||
print <<END
|
||||
</table>
|
||||
END
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
include Config
|
||||
|
||||
VER = 3.0.2
|
||||
VER = 3.0.3
|
||||
|
||||
THISAPP = lm_sensors-$(VER)
|
||||
DL_FILE = $(THISAPP).tar.bz2
|
||||
@@ -40,7 +40,7 @@ objects = $(DL_FILE)
|
||||
|
||||
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
|
||||
|
||||
$(DL_FILE)_MD5 = 5b210ba9cc01f00161c438fd618484e5
|
||||
$(DL_FILE)_MD5 = e88b236228ac2a50821217015b8fd0fa
|
||||
|
||||
install : $(TARGET)
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ int unattended_setup(struct keyvalue *unattendedkv) {
|
||||
if (strlen(restore_file) > 0) {
|
||||
fprintf(flog, "unattended: Restoring Backup\n");
|
||||
snprintf(commandstring, STRING_SIZE,
|
||||
"cd /harddisk && /bin/tar -xvz --preserve -f /harddisk/var/ipfire/%s", restore_file);
|
||||
"cd /harddisk && /bin/tar -xvz --preserve -f /harddisk/var/ipfire/backup/%s", restore_file);
|
||||
if (mysystem(commandstring)) {
|
||||
errorbox("unattended: ERROR restoring backup");
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# FIXME: edit this lines before release
|
||||
#URL=http://download.ipfire.org/iso/
|
||||
#ISO=ipfire-2.3-beta4.i586-full.iso
|
||||
URL=http://www.rowie.at/ipfire/builds/v2.3test/Beta3/20080930-11uhr/
|
||||
URL=http://www.rowie.at/ipfire/builds/v2.3test/Beta3/20081001-17uhr/
|
||||
ISO=ipfire-2.3-test.i586-full.iso
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
|
||||
@@ -1,26 +1,24 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
############################################################################
|
||||
# #
|
||||
# This file is part of the IPCop Firewall. #
|
||||
# #
|
||||
# IPCop is free software; you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
# the Free Software Foundation; either version 2 of the License, or #
|
||||
# (at your option) any later version. #
|
||||
# #
|
||||
# IPCop is distributed in the hope that it will be useful, #
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||
# GNU General Public License for more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License #
|
||||
# along with IPCop; if not, write to the Free Software #
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
# #
|
||||
# Copyright (C) 2004-01-19 Mark Wormgoor <mark@wormgoor.com>. #
|
||||
# #
|
||||
############################################################################
|
||||
###############################################################################
|
||||
# #
|
||||
# IPFire.org - A linux based firewall #
|
||||
# Copyright (C) 2008 Michael Tremer & Christian Schmidt #
|
||||
# #
|
||||
# This program is free software: you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
# the Free Software Foundation, either version 3 of the License, or #
|
||||
# (at your option) any later version. #
|
||||
# #
|
||||
# This program is distributed in the hope that it will be useful, #
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||
# GNU General Public License for more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License #
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
|
||||
# #
|
||||
###############################################################################
|
||||
|
||||
use strict;
|
||||
#use warnings;
|
||||
@@ -40,97 +38,94 @@ my %mainsettings = ();
|
||||
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
|
||||
&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
|
||||
|
||||
sub updatehdddata
|
||||
{
|
||||
my $disk = $_[0];
|
||||
my $standby;
|
||||
my @array = split(/\//,$disk);
|
||||
sub updatehdddata{
|
||||
my $disk = $_[0];
|
||||
my $standby;
|
||||
my @array = split(/\//,$disk);
|
||||
|
||||
if ( ! -e "$mainsettings{'RRDLOG'}/hddshutdown-".$array[$#array].".rrd"){
|
||||
# database did not exist -> create
|
||||
RRDs::create ("$mainsettings{'RRDLOG'}/hddshutdown-".$array[$#array].".rrd", "--step=300",
|
||||
"DS:standby:GAUGE:600:0:1",
|
||||
"RRA:AVERAGE:0.5:1:576",
|
||||
"RRA:AVERAGE:0.5:6:672",
|
||||
"RRA:AVERAGE:0.5:24:732",
|
||||
"RRA:AVERAGE:0.5:144:1460");
|
||||
$ERROR = RRDs::error;
|
||||
print "Error in RRD::create for hddshutdown-".$array[$#array].": $ERROR\n" if $ERROR;
|
||||
}
|
||||
if ( ! -e "$mainsettings{'RRDLOG'}/hddshutdown-".$array[$#array].".rrd"){
|
||||
# database did not exist -> create
|
||||
RRDs::create ("$mainsettings{'RRDLOG'}/hddshutdown-".$array[$#array].".rrd", "--step=300",
|
||||
"DS:standby:GAUGE:600:0:1",
|
||||
"RRA:AVERAGE:0.5:1:576",
|
||||
"RRA:AVERAGE:0.5:6:672",
|
||||
"RRA:AVERAGE:0.5:24:732",
|
||||
"RRA:AVERAGE:0.5:144:1460");
|
||||
$ERROR = RRDs::error;
|
||||
print "Error in RRD::create for hddshutdown-".$array[$#array].": $ERROR\n" if $ERROR;
|
||||
}
|
||||
|
||||
if (-e "/tmp/hddshutdown-".$array[$#array]) {$standby = 1;}
|
||||
else {$standby = 0;}
|
||||
if (-e "/tmp/hddshutdown-".$array[$#array]) {$standby = 1;}
|
||||
else {$standby = 0;}
|
||||
|
||||
RRDs::update ("$mainsettings{'RRDLOG'}/hddshutdown-".$array[$#array].".rrd", "-t", "standby", "N:$standby");
|
||||
$ERROR = RRDs::error;
|
||||
print "Error in RRD::update for hddshutdown-".$array[$#array].": $ERROR\n" if $ERROR;
|
||||
RRDs::update ("$mainsettings{'RRDLOG'}/hddshutdown-".$array[$#array].".rrd", "-t", "standby", "N:$standby");
|
||||
$ERROR = RRDs::error;
|
||||
print "Error in RRD::update for hddshutdown-".$array[$#array].": $ERROR\n" if $ERROR;
|
||||
|
||||
if ( ! -e "$mainsettings{'RRDLOG'}/hddtemp-".$array[$#array].".rrd"){
|
||||
# database did not exist -> create
|
||||
RRDs::create ("$mainsettings{'RRDLOG'}/hddtemp-".$array[$#array].".rrd", "--step=300",
|
||||
"DS:temperature:GAUGE:600:0:100",
|
||||
"RRA:AVERAGE:0.5:1:576",
|
||||
"RRA:AVERAGE:0.5:6:672",
|
||||
"RRA:AVERAGE:0.5:24:732",
|
||||
"RRA:AVERAGE:0.5:144:1460");
|
||||
$ERROR = RRDs::error;
|
||||
print "Error in RRD::create for hdd-".$array[$#array].": $ERROR\n" if $ERROR;
|
||||
}
|
||||
if ( ! -e "$mainsettings{'RRDLOG'}/hddtemp-".$array[$#array].".rrd"){
|
||||
# database did not exist -> create
|
||||
RRDs::create ("$mainsettings{'RRDLOG'}/hddtemp-".$array[$#array].".rrd", "--step=300",
|
||||
"DS:temperature:GAUGE:600:0:100",
|
||||
"RRA:AVERAGE:0.5:1:576",
|
||||
"RRA:AVERAGE:0.5:6:672",
|
||||
"RRA:AVERAGE:0.5:24:732",
|
||||
"RRA:AVERAGE:0.5:144:1460");
|
||||
$ERROR = RRDs::error;
|
||||
print "Error in RRD::create for hdd-".$array[$#array].": $ERROR\n" if $ERROR;
|
||||
}
|
||||
|
||||
# Temperaturlesen w<>rde die Platte aufwecken!!!
|
||||
if (!$standby){
|
||||
$temp = 0;
|
||||
my $smart_output = '';
|
||||
system("$path_smartctl -iHA -d ata /dev/$disk > /var/log/smartctl_out_hddtemp-$disk");
|
||||
if ( -e "/var/log/smartctl_out_hddtemp-".$array[$#array] ){
|
||||
my $hdd_output = `cat /var/log/smartctl_out_hddtemp-$array[$#array] | grep Temperature_`;
|
||||
my @t = split(/\s+/,$hdd_output);
|
||||
$temp = $t[9];
|
||||
}else{$temp = 0;}
|
||||
print "Temperature for ".$array[$#array]."->".$temp."<-\n";
|
||||
# Nur ins RDD wenn nicht 0 (sonst klappt die min Anzeige nicht)
|
||||
if ($temp){
|
||||
RRDs::update ("$mainsettings{'RRDLOG'}/hddtemp-".$array[$#array].".rrd", "-t", "temperature", "N:$temp");
|
||||
$ERROR = RRDs::error;
|
||||
print "Error in RRD::update for hdd-".$array[$#array].": $ERROR\n" if $ERROR;
|
||||
}
|
||||
}
|
||||
# Temperaturlesen w<>rde die Platte aufwecken!!!
|
||||
if (!$standby){
|
||||
$temp = 0;
|
||||
my $smart_output = '';
|
||||
system("$path_smartctl -iHA -d ata /dev/$disk > /tmp/smartctl_out_hddtemp-$disk");
|
||||
if ( -e "/tmp/smartctl_out_hddtemp-".$array[$#array] ){
|
||||
my $hdd_output = `cat /tmp/smartctl_out_hddtemp-$array[$#array] | grep Temperature_`;
|
||||
my @t = split(/\s+/,$hdd_output);
|
||||
$temp = $t[9];
|
||||
}else{$temp = 0;}
|
||||
print "Temperature for ".$array[$#array]."->".$temp."<-\n";
|
||||
# Nur ins RDD wenn nicht 0 (sonst klappt die min Anzeige nicht)
|
||||
if ($temp){
|
||||
RRDs::update ("$mainsettings{'RRDLOG'}/hddtemp-".$array[$#array].".rrd", "-t", "temperature", "N:$temp");
|
||||
$ERROR = RRDs::error;
|
||||
print "Error in RRD::update for hdd-".$array[$#array].": $ERROR\n" if $ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
## Update ipac logs
|
||||
#system ('/usr/sbin/fetchipac');
|
||||
## Update vnstat
|
||||
system ('/usr/bin/vnstat -u');
|
||||
|
||||
my @disks = `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`;
|
||||
system("unlink /tmp/hddstatus && touch /tmp/hddstatus");
|
||||
foreach (@disks){
|
||||
my $disk = $_;
|
||||
chomp $disk;
|
||||
print "Working on disk ".$disk.".\n";
|
||||
my $disk = $_;
|
||||
chomp $disk;
|
||||
print "Working on disk ".$disk.".\n";
|
||||
|
||||
my $status = "";
|
||||
my $diskstats = "";
|
||||
my $newdiskstats = "";
|
||||
my @array = split(/\//,$disk);
|
||||
my $status = "";
|
||||
my $diskstats = "";
|
||||
my $newdiskstats = "";
|
||||
my @array = split(/\//,$disk);
|
||||
|
||||
$diskstats = `cat /tmp/hddstats-$array[$#array]`;
|
||||
chomp $diskstats;
|
||||
my $newdiskstats = `/usr/bin/iostat -d -t $disk | tail -2 | head -1 | awk '{ print \$5","\$6}'`;
|
||||
chomp $newdiskstats;
|
||||
my $status = `hdparm -C /dev/$disk | tail -1 | cut -d: -f2`;
|
||||
chomp $status;
|
||||
$diskstats = `cat /tmp/hddstats-$array[$#array]`;
|
||||
chomp $diskstats;
|
||||
my $newdiskstats = `/usr/bin/iostat -d -t $disk | tail -2 | head -1 | awk '{ print \$5","\$6}'`;
|
||||
chomp $newdiskstats;
|
||||
my $status = `hdparm -C /dev/$disk | tail -1 | cut -d: -f2`;
|
||||
chomp $status;
|
||||
|
||||
if ($status !~/standby/ || $diskstats ne $newdiskstats){
|
||||
if (-e "/tmp/hddshutdown-".$array[$#array]){system("unlink /tmp/hddshutdown-".$array[$#array]);}
|
||||
}
|
||||
if ($status !~/standby/ || $diskstats ne $newdiskstats){
|
||||
if (-e "/tmp/hddshutdown-".$array[$#array]){system("unlink /tmp/hddshutdown-".$array[$#array]);}
|
||||
}
|
||||
|
||||
if (-e "/tmp/hddshutdown-".$array[$#array]){$status = " standby\n";}
|
||||
else{$status = " active\n";}
|
||||
if (-e "/tmp/hddshutdown-".$array[$#array]){$status = " standby\n";}
|
||||
else{$status = " active\n";}
|
||||
|
||||
open(DATEI, ">>/tmp/hddstatus") || die "Datei nicht gefunden";
|
||||
print DATEI $disk."-".$status;
|
||||
close(DATEI);
|
||||
open(DATEI, ">>/tmp/hddstatus") || die "Datei nicht gefunden";
|
||||
print DATEI $disk."-".$status;
|
||||
close(DATEI);
|
||||
|
||||
updatehdddata($disk);
|
||||
updatehdddata($disk);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user