Tools

Aus NAS-4220

Wechseln zu: Navigation, Suche

Source of this page: Forum Post

Inhaltsverzeichnis

Command Tools

Description of tools package
The "Command" Tool contains the following: bash, bashbug, cmp, diff, diff3, find, gpg, gpg-zip, gpgsplit, gpgv, locate, patch, sdiff, updatedb, which, wget, xargs

Download
Command Tools

Installation

  1. unzip and untar it in directory /mnt/ide1/public/
  2. add the path /mnt/ide1/public/local_apps/bin to the $PATH environment

Core Utils

Description
This collection contains the following commands: [,basename,cat,chgrp,chmod,chown,chroot,cksum,comm,cp,csplit,cut,date,dcgen,dd,dir,dirclors,dirname,du,echo,env,expand,expr,factor,false,fmt,fold,ginstall,groups,head, hostid,hostname,id,join,kill,link,ln,logname,ls,md5sum,mkdir,mkfifo,mknod,mv,nice,nl,nohup,od,paste,pathchk,pinky,pr,printev,printf,ptx,pwd,readlink,rm,rmdir,seq,setuidgid, sha1sum,shred,sleep,sort,split,stat,stty,su,sum,sync,tac,tail,tee,test,touch,tr,true,tsort,tty,uname,unexpand,uniq,unlink,uptime,users,vdir,wc,who,whoami,yes

Download
Download from Rapidshare

Archive Tools

Description
Zip is the popular compressionprogram, designed to create/exctract ZIP archives.
Tar is for processing tarballs.
Unrar is a compressionprogram, designed to extract RAR archives

Download
Zip / Unzip
tar
unrar

Hashing-Tools

Download
md5deep
sha1deep
sha256deep
tigerdeep
whirlpooldeep

Network tools

ethtool

Forensic Tools

Description
dcfldd is an alternative version of dd for forensic uses

Download
dcfldd

Comparison Tools

Description
FDupes uses md5sums to compare the content per byte.

Download
fdupes

Spindown Tracking Tool

Description
For everyone who wants to find the reason for unexpected spinups. Needs "find" from the local_apps package. Without this package you have to set FINDREASON=0.

#!/bin/sh
#
# Watch the spindown state of a hard disk
#
# 04.10.2008 - V2.0 gm
#
DEVICE=/dev/hda
MOUNTPOINTS="/mnt/md1 /system"
FINDREASON=1
SLEEPTIME=10
COUNTER=0
echo "Monitoring $DEVICE and mount point(s) $MOUNTPOINTS (Ctrl-C to abort) ..."
#
while (true); do
       STATE=`hdparm -C $DEVICE | grep "drive state" | awk '{print $4}'`
       if [ "$STATE" != "$OLD_STATE" ]; then
               echo -e "\n`date`: $DEVICE: $OLD_STATE -> $STATE"
               if [ "$OLD_STATE" = "standby" -a $FINDREASON ]; then
                       # find reason
                       echo "Searching for files accessed within last minute ..."
                       for i in $MOUNTPOINTS; do
                               find $i -amin 1 -exec ls -alsdu {} \;
                       done
                       echo "done"
               fi
               COUNTER=0
       else
               #show clock
               HOURS=`expr $COUNTER / 3600`
               MINUTES=`expr $COUNTER / 60 - $HOURS \* 60`
               SECONDS=`expr $COUNTER % 60`
               echo -n -e "\r$HOURS hours, $MINUTES minutes, $SECONDS seconds "
       fi
       OLD_STATE=$STATE
       let COUNTER+=$SLEEPTIME
       sleep $SLEEPTIME
done

Save this code to file (eg. drivestate.sh), "chmod 755 drivestate.sh" and run it

ICYBOX2> ./drivestate.sh

Sample output:

Monitoring /dev/hda and mount point(s) /mnt/md1 /system (Ctrl-C to abort) ...
Sat Oct  4 11:40:51 CEST 2008: /dev/hda:  -> active/idle
0 hours, 6 minutes, 0 secondss
Sat Oct  4 11:47:08 CEST 2008: /dev/hda: active/idle -> standby
0 hours, 24 minutes, 50 seconds
Sat Oct  4 12:12:42 CEST 2008: /dev/hda: standby -> active/idle
Seaching for files accessed within last minute ...
  4 drwxrwxrwx    8 root     root         4096 Oct  4 12:12 /mnt/md1/public/applications
276 -rwxr-xr-x    1 root     root       275914 Oct  4 12:12 /mnt/md1/public/local_apps/bin/find
done
0 hours, 5 minutes, 30 seconds
Sat Oct  4 12:18:29 CEST 2008: /dev/hda: active/idle -> standby
0 hours, 0 minutes, 30 seconds
...


Harddisk Temperature Logging Tool

Description
Das Tool ist ein Muss für jeden, der wissen will, welche Temperatur seine Festplatte im Betrieb hat.
Ein netter Nebeneffekt ist, dass man dadurch sieht, wann die Platte im Zustand active/idle oder standby (=Spindown) war.
Leider kann man die Temperatur nicht auslesen, ohne die Platte aufzuwecken. Deshalb wird die Temperatur nur gelesen, wenn die Platte in den Zustand active/idle gewechselt hat,oder die die Zeit (TIM_SD) abgelaufen ist. Zwischendurch wird "on" statt der Temperatur in das Log geschrieben.

  • TIM_RD konfiguriert den Ausleserhytmus
  • TIM_SD muss größer gleich der im Web GUI gesetzten Spindownzeit sein um die Platte nicht dauerhaft wach zu halten
  • HDD_LOG1 muss ein Verzeichnis in der Ramdisk sein um die Platte beim Schreiben der Logeinträge nicht zu wecken #!/bin/sh
#------------------------------------------------
# Harddisk temperature monitor
# Version: 1.0 12-2008 by HWguru
#
# must be on ramdisk to avoid waking up of hdd
# inspired by the spindown tracking tool of gmeyer
#
# TIM_RD sets the readout interval
# TIM_SD must be set to the spindown time
#------------------------------------------------

HDD=/dev/hda                                        #disk to be monitored
HDD_LOGF=hdd_temp.log;                              #name of logfile
HDD_LOG1=/var/log/$HDD_LOGF;                        #path in ramdisk
HDD_LOG2=/mnt/ide1/public/applications/my_dir/$HDD_LOGF;    #path on disk
TIM_RD=5                                            #readout interval [min]
TIM_SD=20                                           #spindown time [min]
CNT=0

while (true); do                                    #loop forever
  DATTIM=`date +%d.%m.%Y,%H:%M,`                    #read date and time
  echo -n $DATTIM >> $HDD_LOG1;
  STATE=`hdparm -C $HDD | grep "drive state" | awk '{print $4}'`

  if [ "$STATE" = "active/idle" ]; then             #only read temperature if disk is active

    if [ "$CNT" = "0" ]; then                       #and only after TIM_SD - otherwise would not sleep
      MINU=`echo $DATTIM | awk 'BEGIN {FS = ","} ; {printf "%2s\n", substr($2,4,2)}'`
      HDT=`smartctl -n standby -A $HDD | grep Temperature | awk '{printf "%2s\n", $10}'`
#old: substr($4,2,2)
      echo $DATTIM$HDT >> $HDD_LOG2;                #log to file on disk
    else
      HDT=on
    fi

    if [ "$CNT" = "$TIM_SD" ]; then                 #spindown time reached
      CNT=0                                         #allow temp readout again
    else
      let CNT+=$TIM_RD
    fi

  else                                              #HDD in standby
    HDT=""
    CNT=0                                           #allow temp readout again
  fi

  echo $HDT >> $HDD_LOG1;                           #write entry to logfile
  sleep `expr $TIM_RD \* 60`                        #sleep for time in seconds
done
# end


Save this code to a file on ramisk (eg. /var/tmp/hddtemp.sh), "chmod 755 hddtemp.sh" and run it
It could be copied from a location on disk to the ramdisk and be started there automatically using some userscript.

ICYBOX2> ./hddtemp.sh &


Sample log output on ramdisk (/var/log/hdd_temp.log):

15.12.2008,22:40,
15.12.2008,22:45,
15.12.2008,22:50,28
15.12.2008,22:55,on
15.12.2008,23:00,on
15.12.2008,23:05,on
15.12.2008,23:10,on
15.12.2008,23:15,


Sample log output on harddisk (/mnt/...../hdd_temp.log):

14.12.2008,23:04,40
14.12.2008,23:12,36
14.12.2008,23:36,43
15.12.2008,00:33,35
15.12.2008,08:19,28
Persönliche Werkzeuge