输出服务器mac、ip、主机名、主机型号及S/N、cpu型号及个数、内存大小、系统版本、openssl版本、
监听端口、snmp的版本、php的版本、apache的版本。
#!bash
echo "MAC">>netstat
for j in `ifconfig|grep HWaddr`
do
echo $j |grep :|grep -v Ethernet>>netstat
done
echo "IP">>netstat
for j in `ifconfig|grep Bcast`
do
echo $j |awk '{printf $1}'|awk -F r: '{printf $2}' >> netstat
done
echo " ">> netstat
echo "hostname">>netstat
hostname>>netstat
echo
dmidecode | grep -A 4 "System Information" |sed -n '3p;$p'>>netstat
echo
echo "number of processor">>netstat
cat /proc/cpuinfo | grep "model name" |uniq >>netstat
cat /proc/cpuinfo |grep ocesso|wc -l>>netstat
echo
echo "size of menory">>netstat
echo `free -m|grep Mem|awk -F ":" '{printf $2}'|awk -F " " '{printf $1}'` "MB">>netstat
echo
echo "size of disk">>netstat
fdisk -l|awk -F ":" '{printf $2}'|awk -F "," '{printf $1}'>>netstat
echo "">>netstat
echo
echo "version of system">>netstat
uname -a|awk '{printf $1 $3}'>>netstat
echo "">>netstat
echo
echo "version of ssl">>netstat
openssl version >>netstat
echo
echo "port listening">>netstat
for i in `netstat -anp |grep LISTEN|grep -v ING`
do
echo $i|awk -F ":" '{printf $2}' >>netstat
echo $i|awk -F ":::" '{printf $2}'>>netstat
sed -i 's/*/\n/' netstat
done
echo
echo "version of snmp">>netstat
snmpwalk -V >>netstat 2>&1
echo
echo "version of PHP">>netstat
php -v|grep PHP>>netstat
echo
echo "version of Apache">>netstat
httpd -v|grep Apache>>netstat
echo
echo "version of JBOSS">>netstat
find /usr/local/ -type d -name "jboss.*.*" >>netstat
echo
#/etc/init.d/mysqld status
find /usr/share/doc/ -type d -name mysql-server*.*.* >>netstat
echo
echo "version of snmp">>netstat
snmpwalk -V >>netstat 2>&1
echo
cat netstat
阅读(488) | 评论(0) | 转发(0) |