FAQ QNAP CLI - polecenia

U

Usunięty użytkownik pigers

Guest
Podzielcie się wiedzą co tam skrywa QNAP w shellu:

Dane o systemie:
Bash:
[~] # getsysinfo
cputmp : get CPU temperature
systmp : get system temperature
sysfan [fan no] : get system fan speed
sysfannum : get total system fan number
hdnum : get total system SATA disk number
hdtmp [disk no] : get SATA disk temperature
hdstatus [disk no] : get SATA disk status
hdmodel [disk no] : get SATA disk model
hdcapacity [disk no] : get SATA disk capacity
hdsmart [disk no] : get SATA disk SMART summary
model : get system model name
sysvolnum : get system volume number
vol_desc [volume no] : get volume description
vol_fs [volume no] : get volume file system
vol_totalsize [volume no] : get volume total size
vol_freesize [volume no] : get volume free size
vol_status [volume no] : get volume status

Numer seryjny QNAPa:
Bash:
get_hwsn
Qxxxxxxxx

Wersja firmware:
Bash:
[~] # getcfg system version
4.3.3

Build firmware:
Bash:
[~] # getcfg system 'Build Number'
20170503

polecenia pod CPU Intela, powinny działać pod ARM.

##########
NAS_info.sh
Bash:
#!/bin/bash
nas_model=$(/sbin/getsysinfo model)
nas_firmware=$(getcfg system version)
nas_ram_slots=$(dmidecode -t 16 | grep -i number | awk -F ":" '{print $2}')
nas_ram_total=$(dmidecode -t 16 | grep -i Capa | awk -F ":" '{print $2}')
nas_ram_used_slot=$(dmidecode -t memory | grep -i size | grep -iv "no module" | wc -l)
echo "NAS model $nas_model running firmware $nas_firmware with RAM size $nas_ram_total in total of $nas_ram_slots slots, where $nas_ram_used_slot slot(s) is used."
echo ""
nas_disk_count=$(/sbin/getsysinfo hdnum)
for (( i=1; i<=nas_disk_count; i++ ));  do
echo "Disk $i:"; /sbin/getsysinfo hdmodel $i
echo ""
done