« -: Oct 09, 2006, 20:46 »
Здравейте. На моята линукс машина направих един баш скрипт, който съдържа следните редове:
Цитат |
#!/bin/sh
## -> Created By : Snehal Vyas ## ## -> Server Information Script Version : 1.0 ## -> Date : 15th July 2004 ## ## -> Updated For Lubi Setup : 25th March 05 ## ## -> System wide details ## Kernal details ## RPMs installed ## Services running in each runlevel ## List of modules loaded at the time of backup taken ## Hardware / Memory / Ethernet configuration / Services status at run time ##
echo " Taking System Details Please Wait" sleep 3
echo "=============================================================================" > sysdetails.txt echo " Collecting System Wide Details ON `/bin/date` " >> sysdetails.txt echo "=============================================================================" >> sysdetails.txt echo "" >> sysdetails.txt
echo "" >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt echo " Your Host Name : " >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt cat /proc/sys/kernel/hostname >> sysdetails.txt
echo "" >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt echo " Your Domain Name : " >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt cat /proc/sys/kernel/domainname >> sysdetails.txt
echo "" >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt echo " Your DNS Detail : " >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt cat /etc/resolv.conf >> sysdetails.txt
echo "" >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt echo " Detail About Redhat Installed " >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt
cat /etc/redhat-release >> sysdetails.txt
echo "" >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt echo " Your Kernel Detail " >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt /bin/uname -a >> sysdetails.txt
echo "" >> sysdetails.txt echo "------------------------------" >> sysdetails.txt echo "Getting Disk Partition Details" >> sysdetails.txt echo "------------------------------" >> sysdetails.txt df -ah >> sysdetails.txt
echo "" >> sysdetails.txt echo "------------------------------" >> sysdetails.txt echo "Getting List of RPMs installed" >> sysdetails.txt echo "------------------------------" >> sysdetails.txt rpm -qa --last >> sysdetails.txt
echo "" >> sysdetails.txt echo "------------------------------" >> sysdetails.txt echo "Services Details" >> sysdetails.txt echo "------------------------------" >> sysdetails.txt chkconfig --list >> sysdetails.txt
echo "" >> sysdetails.txt echo "------------------------------" >> sysdetails.txt echo "Getting List of modules Loaded" >> sysdetails.txt echo "------------------------------" >> sysdetails.txt lsmod >> sysdetails.txt
echo "" >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt echo "Getting List of Processes Run Time" >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt ps -ax >> sysdetails.txt
echo "" >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt echo " Detail of fstab " >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt /bin/cat /etc/fstab >> sysdetails.txt
echo "" >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt echo " Disks & Partitions " >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt /sbin/fdisk -l >> sysdetails.txt
echo "" >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt echo " Interfaces & IP details " >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt /sbin/ifconfig >> sysdetails.txt
echo "" >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt echo " Mounted Partitions " >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt /bin/mount >> sysdetails.txt
echo "" >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt echo " Services & Port details " >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt /bin/netstat -an >> sysdetails.txt
echo "" >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt echo " All Directory of / " >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt /bin/ls -al / >> sysdetails.txt
echo "" >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt echo " About Your RAID " >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt /bin/cat /proc/mdstat >> sysdetails.txt
echo "" >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt echo " Memory Info " >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt cat /proc/meminfo >> sysdetails.txt
echo "" >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt echo " CPU Info " >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt cat /proc/cpuinfo >> sysdetails.txt
echo "" >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt echo " Hardware Detail " >> sysdetails.txt echo "------------------------------------------------" >> sysdetails.txt cat /etc/sysconfig/hwconf >> sysdetails.txt |
След като опитам да го отворя през конзолата ми дава Форбидън. Кажете ми как мога да го подкарам.
И един друг върпос. ако изведа ръчно нещата във текстов файл. Като го инклудна в пхп ми ги слага без край на ред, без нищо. Можете ли да ми помогнете?