cd /root
touch inventory_report-$(hostname)-$(date +"%Y%m%d").txt
echo -e "\n\n=====================Inventory_Report===================================" > inventory_report-$(hostname)-$(date +"%Y%m%d").txt
echo HostName:
hostname >>inventory_report-$(hostname)-$(date +"%Y%m%d").txt
echo -e "\n\n======================BOOT==============================================" >> inventory_report-$(hostname)-$(date +"%Y%m%d").txt
cat /etc/fstab >>inventory_report-$(hostname)-$(date +"%Y%m%d").txt
echo -e "\n\n======================VERSION===========================================" >> inventory_report-$(hostname)-$(date +"%Y%m%d").txt
cat /etc/*release >> inventory_report-$(hostname)-$(date +"%Y%m%d").txt
echo -e "\n\n======================Main Point========================================" >> inventory_report-$(hostname)-$(date +"%Y%m%d").txt
df -Th >> inventory_report-$(hostname)-$(date +"%Y%m%d").txt
df -Th /opt >> inventory_report-$(hostname)-$(date +"%Y%m%d").txt
df -Th /var >> inventory_report-$(hostname)-$(date +"%Y%m%d").txt
df -Th /usr >> inventory_report-$(hostname)-$(date +"%Y%m%d").txt
df -Th / >> inventory_report-$(hostname)-$(date +"%Y%m%d").txt
echo -e "\n\n======================VGS===============================================" >> inventory_report-$(hostname)-$(date +"%Y%m%d").txt
vgs >> inventory_report-$(hostname)-$(date +"%Y%m%d").txt
echo -e "\n\n======================DISK==============================================" >> inventory_report-$(hostname)-$(date +"%Y%m%d").txt
lsblk >> inventory_report-$(hostname)-$(date +"%Y%m%d").txt
echo -e "\n\n======================VDO===============================================" >> inventory_report-$(hostname)-$(date +"%Y%m%d").txt
vdostats --hu >> inventory_report-$(hostname)-$(date +"%Y%m%d").txt
echo -e "\n\n======================Yum Makecache=========================================" >> inventory_report-$(hostname)-$(date +"%Y%m%d").txt
yum makecache >> inventory_report-$(hostname)-$(date +"%Y%m%d").txt
echo -e "\n\n======================Users=========================================" >> inventory_report-$(hostname)-$(date +"%Y%m%d").txt
cat /etc/passwd | grep edps >> inventory_report-$(hostname)-$(date +"%Y%m%d").txt
echo -e "\n\n======================END===============================================" >> inventory_report-$(hostname)-$(date +"%Y%m%d").txt
#mailx -v -s " inventory_report_`hostname`_`date '+%Y%m%d %H%M%S'`" kevin.fan@shacombank.com.hk < inventory_report-$(hostname)-$(date +"%Y%m%d").txt
#rm -rf inventory_report-$(hostname)-$(date +"%Y%m%d").txt
浙公网安备 33010602011771号