[root@centos5 ~]# smartctl -H /dev/sda smartctl version 5.38 [i686-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen Home page is http://smartmontools.sourceforge.net/ === START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED [root@centos5 ~]# smartctl -H /dev/sdb smartctl version 5.38 [i686-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen Home page is http://smartmontools.sourceforge.net/ === START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED |
[root@centos5 ~]# smartctl -a /dev/sda | grep ^194 194 Temperature_Celsius 0x0002 166 166 000 Old_age Always - 36 (Lifetime Min/Max 23/39) [root@centos5 ~]# smartctl -a /dev/sdb | grep ^194 194 Temperature_Celsius 0x0002 171 171 000 Old_age Always - 35 (Lifetime Min/Max 23/39) |
[root@centos5 ~]# mkdir /root/hdsentinel/ ... [root@centos5 ~]# chmod 770 /root/hdsentinel/HDSentinel [root@centos5 ~]# /root/hdsentinel/HDSentinel Hard Disk Sentinel for LINUX console 0.03 (c) 2008-2009 info@hdsentinel.com Start with -r [reportfile] to save data to report, -h for help Examining hard disk configuration ... HDD Device 0: /dev/sda HDD Model ID : Hitachi HDT721032SLA360 HDD Serial No: STH207MT23SR2S HDD Revision : ST2OA3AA HDD Size : 305245 MB Interface : S-ATA II Temperature : 36 °C Health : 100 % Performance : 100 % Power on time: 9 days, 10 hours Est. lifetime: more than 1000 days HDD Device 1: /dev/sdb HDD Model ID : Hitachi HDT721032SLA360 HDD Serial No: STH207MT22JGDS HDD Revision : ST2OA3AA HDD Size : 305245 MB Interface : S-ATA II Temperature : 35 °C Health : 100 % Performance : 100 % Power on time: 9 days, 16 hours Est. lifetime: more than 1000 days |
[root@centos5 ~]# date +'%Y_%m_%d' 2010_04_24 |
-- Physical Disk Information - Disk: #1: Hitachi HDT721032SLA360 -- Hard Disk Summary ----------------- Hard Disk Number. . . . . . . . . . . . . . . . . 1 Hard Disk Device. . . . . . . . . . . . . . . . . /dev/sdb Interface . . . . . . . . . . . . . . . . . . . . S-ATA II Hard Disk Model ID. . . . . . . . . . . . . . . . Hitachi HDT721032SLA360 Hard Disk Revision. . . . . . . . . . . . . . . . ST2OA3AA Hard Disk Serial Number . . . . . . . . . . . . . STH207MT22JGDS Hard Disk Total Size. . . . . . . . . . . . . . . 305245 MB Current Temperature . . . . . . . . . . . . . . . 35 ºC (95 ºF) Power On Time . . . . . . . . . . . . . . . . . . 10 days, 1 hours Estimated Remaining Lifetime. . . . . . . . . . . more than 1000 days Health. . . . . . . . . . . . . . . . . . . . . . #################### 100 % (Excellent) Performance . . . . . . . . . . . . . . . . . . . #################### 100 % (Excellent) The hard disk status is PERFECT. Problematic or weak sectors not found and there are no spin up or data transfer errors. No actions needed. |
#!/bin/bash EV=`date +'%Y'` HO=`date +'%m'` NAP=`date +'%d'` DATE=`date +'%Y_%m_%d'` /root/hdsentinel/HDSentinel -r /root/hdsentinel/rep_tmp.txt > /dev/null cat /root/hdsentinel/rep_tmp.txt | grep -w Excellent > /root/hdsentinel/rep_4e.txt XCE=`wc -l /root/hdsentinel/rep_4e.txt | cut -d" " -f1` if test $XCE -eq 4 then if test ! -d /root/backup/$EV/$HO/$NAP then mkdir -p /root/backup/$EV/$HO/$NAP fi # Konfiguraciós allomanyok és rendszerfájlok napi mentése tar cpzf /root/backup/$EV/$HO/$NAP/"$DATE"_backup.tgz /etc/squid/squidguard.conf \ /etc/squid/squid.conf /etc/squid/nojelszo.txt /etc/squid/csoportok /etc/snmp/snmpd.conf \ /etc/httpd/conf.d/mrtg.conf /etc/httpd/conf.d/sarg.conf \ /etc/httpd/conf.d/ke.conf /etc/dhcpd.conf /root/tuzfal.scp /etc/rc.d/rc.local \ /etc/samba/smb.conf /etc/samba/passdb.tdb /etc/samba/secrets.tdb \ /etc/dnsmasq.conf /etc/passwd /etc/shadow /etc/gshadow /root/felhasznalok.txt # Minden quota információt fájlba /usr/sbin/repquota -a > /root/backup/$EV/$HO/$NAP/"$DATE"_quota.txt # Adatok mentese: rsync -agE --delete --exclude="lost+found" /home/ /homemr # if test ! -d /mentesek/megoszt then mkdir /mentesek/megoszt fi rsync -agE --delete --exclude="lost+found" /megoszt/ /mentesek/megoszt # if test ! -d /mentesek/root then mkdir /mentesek/root fi rsync -agE --delete /root/ /mentesek/root # if test ! -d /mentesek/html then mkdir /mentesek/html fi rsync -agE --delete /var/www/html/ /mentesek/html # if test ! -d /mentesek/squidg then mkdir /mentesek/squidg fi rsync -agE --delete /var/lib/squidguard/ /mentesek/squidg else cp /root/hdsentinel/rep_tmp.txt /root/hdsentinel/rep_$DATE.txt mail -s HIBA_a_merevlemezen root < /root/hdsentinel/rep_$DATE.txt fi |
[root@centos5 ~]# echo "14 01 * * * root /root/backup_napi.scp" > /etc/cron.d/ment_nap |
#!/bin/bash DATE=`date +'%Y_%m_%d'` if test ! -d /root/hetilog then mkdir /root/hetilog fi #Toroljuk a 3 hetes mentest B3=`date +'%Y_%m_%d' --date='21 days ago'` if test -f /mentesek/backup_"$B3".tgz then rm -f /mentesek/backup_"$B3".tgz echo "Törlöm a backup_$B3.tgz fájlt" > /root/hetilog/"$DATE".log fi #Ellenorizzuk, hogy a ket hdd jo: /root/hdsentinel/HDSentinel -r /root/hetilog/"$DATE"_rep.txt > /dev/null cat /root/hetilog/"$DATE"_rep.txt | grep -w Excellent > /root/hetilog/heti_4o.txt XCE=`wc -l /root/hetilog/heti_4o.txt | cut -d" " -f1` if test $XCE -eq 4 then # echo indul a mentes ... tar cpzf /mentesek/backup_"$DATE".tgz --exclude=/proc --exclude=/sys --exclude=/lost+found \ --exclude=/mnt --exclude=/var/spool/squid --exclude=/megoszt --exclude=/mentesek \ --exclude=/homemr --exclude=/tmp --exclude=/var/named --exclude=/var/spool/postfix \ --exclude=/dev --exclude=/media --exclude=/var/run --exclude=/home / >> /root/hetilog/"$DATE".log else cp /root/hetilog/"$DATE"_rep.txt /root/hetilog/hiba_$DATE.txt mail -s NEM_keszult_os_mentes_HDD_HIBA root < /root/hetilog/hiba_$DATE.txt fi |
[root@centos5 ~]# echo "07 2 * * 6 root /root/backup_os.scp" > /etc/cron.d/heti_os |
[root@centos5 ~]# ssh palferi@192.168.55.172 The authenticity of host '192.168.55.172 (192.168.55.172)' can't be established. RSA key fingerprint is e6:93:27:21:d6:dc:44:37:1e:5c:d6:5a:29:07:45:00. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.55.172' (RSA) to the list of known hosts. palferi@192.168.55.172's password: Linux hpm 2.6.31-20-generic #58-Ubuntu SMP Fri Mar 12 05:23:09 UTC 2010 i686 To access official Ubuntu documentation, please visit: http://help.ubuntu.com/ Last login: Tue Dec 8 19:07:04 2009 palferi@hpm:~$ |
palferi@hpm:~$ mkdir /home/palferi/mentc5 palferi@hpm:~$ mkdir /home/palferi/mentc5/homemr palferi@hpm:~$ mkdir /home/palferi/mentc5/mentesek palferi@hpm:~$ exit [root@centos5 ~]# |
[root@centos5 ~]# rsync -ave ssh --delete --exclude="lost+found" /homemr/ palferi@192.168.55.172:/home/palferi/mentc5/homemr [root@centos5 ~]# rsync -ave ssh --delete --exclude="lost+found" --exclude="backup*.tgz" /mentesek/ palferi@192.168.55.172:/home/palferi/mentc5/mentesek |
[root@centos5 ~]# rsync -ave ssh --delete /mentesek/backup_2010_05_28.tgz palferi@192.168.55.172:/home/palferi/mentc5/backup.tgz |
[root@centos5 ~]# cd .ssh [root@centos5 .ssh]# ssh-keygen -t dsa Generating public/private dsa key pair. Enter file in which to save the key (/root/.ssh/id_dsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_dsa. Your public key has been saved in /root/.ssh/id_dsa.pub. The key fingerprint is: bc:b7:15:9c:96:a2:74:2d:4c:11:9d:ce:95:02:a1:37 root@centos5.suli.uz.ua |
[root@centos5 .ssh]# scp id_dsa.pub palferi@192.168.55.172:/home/palferi palferi@192.168.55.172's password: id_dsa.pub 100% 613 0.6KB/s 00:00 |
palferi@hpm:~$ cat /home/palferi/id_dsa.pub >> /home/palferi/.ssh/authorized_keys2 palferi@hpm:~$ chmod 600 /home/palferi/.ssh/authorized_keys2 palferi@hpm:~$ rm /home/palferi/id_dsa.pub |
[root@centos5 ~]# ssh palferi@192.168.55.172 Linux hpm 2.6.31-21-generic #59-Ubuntu SMP Wed Mar 24 07:28:56 UTC 2010 i686 To access official Ubuntu documentation, please visit: http://help.ubuntu.com/ Last login: Thu Apr 29 21:31:52 2010 from suliserver palferi@hpm:~$ |
#!/bin/bash PIP=192.168.55.172 U1=palferi DATE=`date +'%Y_%m_%d'` echo "A $PIP IP cimu gep NEM elerheto" > /root/hetilog/nemelerheto.txt if test ! -d /root/hetilog then mkdir /root/hetilog fi # Ellenorizzuk, hogy a gep elerheto: ping -c 4 $PIP | grep ttl > /root/hetilog/ping.tmp PSOR=`wc -l /root/hetilog/ping.tmp | cut -d" " -f1` if test $PSOR -lt 4 then mail -s NEM_keszult_net_mentes root < /root/hetilog/nemelerheto.txt else /root/hdsentinel/HDSentinel -r /root/hdsentinel/hetin_tmp.txt > /dev/null cat /root/hdsentinel/hetin_tmp.txt | grep -w Excellent > /root/hdsentinel/hetin_4e.txt XCE=`wc -l /root/hdsentinel/hetin_4e.txt | cut -d" " -f1` if test $XCE -eq 4 then rsync -ave ssh --delete --exclude="lost+found" /homemr/ $U1@$PIP:/home/$U1/mentc5/homemr > /root/hetilog/net_"$DATE.log" rsync -ave ssh --delete --exclude="lost+found" --exclude="backup*.tgz" /mentesek/ $U1@$PIP:/home/$U1/mentc5/mentesek >> /root/hetilog/net_"$DATE.log" rsync -ave ssh --delete /mentesek/backup_"$DATE".tgz $U1@$PIP:/home/$U1/mentc5/backup.tgz >> /root/hetilog/net_"$DATE.log" else cp /root/hdsentinel/hetin_tmp.txt /root/hetilog/hetin_$DATE.txt mail -s NEM_keszult_net_mentes_HDD_HIBA root < /root/hetilog/hetin_$DATE.txt fi fi |
[root@centos5 ~]# echo "07 03 * * 6 root /root/backup_net.scp" > /etc/cron.d/hment_net |