Friday, December 3, 2010

Getting started with linux Security Foundation SMIT

Using an example of SMIT script now, let's SMIT is applied to a practical example of AIX.

Suppose that you need 10 or 100 AIX system respectively add a 4 GB file system. You can manually to complete this operation, but in the end might feel very tired, and input repeatedly increases the possibility of error. You can fit together, and using various parameters and flags, and then in each system running them. Alternatively, you can let you writing SMIT. The following example uses the SMIT creates a 4 GB enhanced JFS (JFS2) file system, the file system when the system restarts automatically mount to mount point/fs01 and use inline JFS log. Then, the script will write SMIT are copied to the other system, and run the script to create the file system. Start the SMIT's first step is to use the command: smit-s/tmp/mknewfs.kshcrjfs2std. -S flag to tell the script to output SMIT are written to the file/tmp/mknewfs.ksh, instead of the default file/smit.script. Specific action is logged to the/smit.log. By specifying the shortcut paths crjfs2std, you can go directly to AddanEnhancedJournaledFileSystem dialog screen. To display the screen (as shown in Listing 6), you need to select a volume group to create a new file system. Manifest 6.AddanEnhancedJournaledFileSystemSMIT dialog screen AddanEnhancedJournaledFileSystemTypeorselectvaluesinentryfields.PressEnterAFTERmakingalldesiredchanges. [EntryFields] VolumegroupnamedatavgSIZEoffilesystemUnitSizeGigabytes + * Numberofunits [4] # * MOUNTPOINT [/s01] MountAUTOMATICALLYatsystemrestart? yes + PERMISSIONSread/write + MountOPTIONS [] + BlockSize (bytes) 4096 + InlineLog? yes + InlineLogsize (MBytes) [] # F1 = HelpF2 = RefreshF3 = CancelF4 = ListF5 = ResetF6 = CommandF7 = EditF8 = ImageF9 = ShellF10 = ExitEnter = Do is press the Enter key allows SMIT perform the commands in Listing 6, the script in Listing 7 will be written to the file list/tmp/mknewfs.ks? nbsp; 7./tmp/mknewfs.ks ## [Sep062006, 17: 46: 28] # x () {LIST = FLAG = 0foriin "@" docase "$ I" inMegabytes) FLAG = 1;; Gigabytes)FLAG=2;; 512bytes);; size=*)case"$FLAG"in1)LIST="$LIST\"$i\"M"FLAG=0;; 2)LIST="$LIST\"$i\"G"FLAG=0;;0) LIST="$LIST\"$i\"";; esac;; *)LIST="$LIST\"$i\"";; Esacdoneevalcrfs-vjfs2 $ LIST} x-g'datavg''Gigabytes'-asize = ' 4 '-m '/fs01 '-A ' ' would localeyesstr | awk-F: ' {print $ 1} ' would ', '-p'rw'-aagblksize = ' 4096 ' '-alogname = INLINE ' remaining work is to put the above script is copied to another AIX system, and run it. You can pass a number of ways to accomplish this task. The easiest (though not very safe) is, according to the system cycle, the script performs the rcp operations, and then using rsh to execute it (see Listing 8). 8. the script performs the rcp operations and using rsh to execute it Forhostinhost1host2...hostN; do\rcp/tmp/mknewfs.ksh $ host:/tmp/mknewfs.ks; \rsh $ hostksh/tmp/mknewfs.ks; \done this just an example, but it illustrates the use of SMIT as AIX administrators can gain many advantages and saves a lot of time. The next step for any AIX administrator, SMIT is a powerful tool. As with most tools, familiar with the steps of the best method is to use it. Although SMIT can active system performs the appropriate action, but did not provide an undo function, understanding this point is very important. For some operations (but not all operations), SMIT will issue a warning to permanently delete a message, and you need to confirm to continue. Safer use SMIT applications is to use the-x flag calls it. When specified on the command line when the-x flag, SMIT works properly on the surface, but in fact did not perform any commands. On the contrary, itIn normal operation will be executed command written to smit.script file. SMIT menu and dialog screen of the many options and input fields are available with built-in Help features, you can use the arrow keys to highlight or select the item to be visited, and then press F1 (or Esc + 1). This will display a pop-up window for the selected item for a detailed explanation.

No comments:

Post a Comment