全部博文(1015)
分类: 系统运维
2012-04-06 08:57:37
一般登陆上主机后都会敲一些命令了解主机的主要参数,把常用命令集成在一个vbs脚本里,自动执行,方便高效。 Script - Run 选择vbs脚本 检测SUN主机,solaris_info.vbs如下: ############################################################ #$language = "VBScript" #$interface = "1.0" Sub Main crt.Screen.Send "clear" & chr(13) crt.Screen.WaitForString "$ " crt.Screen.Send "uname -a" & chr(13) crt.Screen.WaitForString "$ " crt.Screen.Send "uptime" & chr(13) crt.Screen.WaitForString "$ " crt.Screen.Send "ifconfig -a" & chr(13) crt.Screen.WaitForString "$ " crt.Screen.Send "psrinfo -v" & chr(13) crt.Screen.WaitForString "$ " crt.Screen.Send "prtconf | grep Mem" & chr(13) crt.Screen.WaitForString "$ " crt.Screen.Send "swap -s" & chr(13) crt.Screen.WaitForString "$ " crt.Screen.Send "echo $NLS_LANG" & chr(13) crt.Screen.WaitForString "$ " crt.Screen.Send "echo $TZ" & chr(13) crt.Screen.WaitForString "$ " crt.Screen.Send "df -k" & chr(13) End Sub ############################################################ 检测IBM主机,aix_info.vbs如下: ############################################################ #$language = "VBScript" #$interface = "1.0" Sub Main crt.Screen.Send "clear" & chr(13) crt.Screen.WaitForString "$ " crt.Screen.Send "uname -a" & chr(13) crt.Screen.WaitForString "$ " crt.Screen.Send "uptime" & chr(13) crt.Screen.WaitForString "$ " crt.Screen.Send "ifconfig -a" & chr(13) crt.Screen.WaitForString "$ " crt.Screen.Send "lsdev -C|grep Process" & chr(13) crt.Screen.WaitForString "$ " crt.Screen.Send "lsattr -E -l sys0 -a realmem" & chr(13) crt.Screen.WaitForString "$ " crt.Screen.Send "lsps -a" & chr(13) crt.Screen.WaitForString "$ " crt.Screen.Send "echo $NLS_LANG" & chr(13) crt.Screen.WaitForString "$ " crt.Screen.Send "echo $TZ" & chr(13) crt.Screen.WaitForString "$ " crt.Screen.Send "df -k" & chr(13) End Sub ############################################################ |