Free Tools, Hints, And Tricks - Adams Systems

Transcription

Free Tools, Hints, and TricksRussell Adamsrladams@adamsinfoserv.comThursday 9/24/2009Russell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/20091 / 79

Tools, Hints, and TricksHouston AIX Users GroupSeptember 24th, 2009Russell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/20092 / 79

Shameless Self PromotionPrincipal Consultant @ Adams Information Services LLChttp://www.adamsinfoserv.com/IBM CATEProvides Nationwide consulting services for IBM's AIX, pSeries, SANStorage, and HACMPRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/20093 / 79

ToolsValuable Free Add-on Software!Russell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/20094 / 79

NMONNMON is an open tool written by Nigel Gri thsURLNow included in AIX as a fully supported tool!5.3 TL96.1 TL2VIOS 2.1Comprehensive Performance Data CollectionRecord performance data before you need itRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/20095 / 79

NMONQuick to setupCreate 2GB /var/nmonAdd cron job0 0 * * * /usr/bin/nmon -f -m /var/nmonCollection proceeds for 23:55, named by host and dateRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/20096 / 79

NMON AnalyzerNMON Analyzer is an open tool written by Stephen AtkinsURLExcel spreadsheet/macro to analyze NMON recordingRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/20097 / 79

NMON AnalyzerCPU Utilization, including APV/MicropartitioningMemory UtilizationIO ThroughputDisk Busy %Network Tra cRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/20098 / 79

NMON AnalyzerRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/20099 / 79

NMON AnalyzerRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200910 / 79

NMON AnalyzerRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200911 / 79

NMON AnalyzerRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200912 / 79

NMON AnalyzerRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200913 / 79

NMON AnalyzerRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200914 / 79

NMON ConsolidatorAnother Excel tool written by Stephen AtkinsURLCombine NMON recordings for all LPARs in a CECNarrow focus on CEC UtilizationCPU / Memory / IORussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200915 / 79

NMON ConsolidatorRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200916 / 79

NMON ConsolidatorRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200917 / 79

NMON ConsolidatorRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200918 / 79

AIX Linux ToolkitURLFantastic OSS ToolsPrecompiled for AIXEasy to install RPMsShips with AIX on CDRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200919 / 79

OpenSSHURLMigrated out of Toolkit to Expansion PackRecommended as more secure replacement of:telnetftpr-commands (rcp, rsh, etc. . . )Key-based authentication can minimize password usageOpenSSL provided on AIX Linux Toolkit CDRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200920 / 79

LsofURLMigrated out of Toolkit to Expansion PackLists open lesAdditional functionality over fuserRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200921 / 79

RsyncURLDi erential Remote File Copy ToolStandalone Daemon or over SSHMaintain Mirrors, DR copies, BackupsData Migration ToolRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200922 / 79

SudoURLAllow non-root users to run speci c commandsFree alternative to tools like PowerbrokerRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200923 / 79

ScreenURLMultiplex your terminal windowUse to allow multiple viewers of a sessionLeave long running jobs to connect to laterRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200924 / 79

BashURLSmart tab completionArrow key supportCan be made default shell for regular usersDo not change root's default shellRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200925 / 79

LessURLLess is moreSmart pagingArrow key supportRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200926 / 79

WgetURLFetch les via URL at the command lineSkip downloading to PC then FTPie: Updating invscout catalogRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200927 / 79

Text EditorsEmacs: URLVIM: URLColor syntax highlightingModern editors for sophisticated editingRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200928 / 79

Misc ToolsWireshark: URLPacket sni ng and Network debuggingApache: URLBasic webserverCoreutils: URLColor ls outputDi utils: URLUni ed Di Russell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200929 / 79

Misc ToolsZip/Unzip: URLShare zip les with PC'sExpect: URLTCL extension for scripting text applicationsRCS: URLSimple single le version controlURLRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200930 / 79

Misc ToolsOrg-mode: URLNote taking, organizer, TODO lists, etc.Microsoft Virtual Desktop Manager: URLSplit into desktops to organize windowsRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200931 / 79

HintsRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200932 / 79

BackupBackup and Restoring AIXURLStacking mksysb and savevgURLAutomating HMC Backupbkconsdata -r ftp -h hostname -u username passwdpasswordCan trigger remotely via ssh w/ keys in cronjobURLRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200933 / 79

BackupBackup VIOSURLURLURLCreate NFS mount w/ option root vioserverAfter rstnimresources.tarle, use-mksysbRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and Tricksoption for speedThursday 9/24/200934 / 79

SUMAAutomate download of software updatesIdeal for NIM server LPP sourcesRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200935 / 79

SUMA Examplesuma -x-a Action Download-a RqType SP-a RqName 5300-05-05-a FilterML 5300-05-a DLTarget /usr/sys/inst.images/5300-05-05-a FilterSysFile /dev/null-a FilterDir /usr/sys/inst.images-a Supersedes n-a ResolvePE Never-a Extend y /usr/sys/inst.images/5300-05 5300-05-05.txtRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200936 / 79

SnapPoor man's documentationEssentially a compressed tarballsnap -ac capturesallsystem dataRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200937 / 79

Snap Contentslesysdf -kmountlsfslsvglspvlslvRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200938 / 79

Snap Contentsgenerallsattr -Ellslpp.hacoslevel.infoCopies of common system les from /etckernelbootinfovmo -LlssrcRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200939 / 79

Snap Contentslsvirtlsvirt.out all Virtual Device MappingslvmlspvlsvgRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200940 / 79

Snap ContentssvCollectVIO server mapping datatcpipnetstatCommon tcpip con g lesRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200941 / 79

Common VMM TuningDatabase memory usage con icts with JFS cacheSymptom is high non-computational memory (FS cache)URLAIX 5.2 ML5 or AIX 5.3 ML2Lower minperm% from 20 to 5Lower maxperm% and maxclient% from 80 to 20AIX 5.2 ML5 or 5.3 ML2Toggle lru le repage to 0 (on)AIX 6.1lru le repage now defaults to 0 (on)Russell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200942 / 79

AIX MiscUse INLINE logs for JFS2 FilesystemsUse diag to light identity LEDs for maintenancediag - Task Selection - Identify and Attention IndicatorsChoose the hardware location fromlscfg -vl device Russell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200943 / 79

InvscoutFree rmware reports from IBMURLRequires up to date catalog leURLCopy to/var/adm/invscout/microcode/catalog.micRun invscout, creates /var/adm/invscout/hostname.mupUpload .mup to URLRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200944 / 79

Invscout Sample ReportRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200945 / 79

Invscout Sample ReportRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200946 / 79

Software Location Codeslsdev default contains software/logical codeent0 Available Logical Host Ethernet Port (lp-hea)ent1 Available 01-08 2-Port 10/100/1000 Base-TX PCI-XAdapter (14108902)ent2 Available 01-09 2-Port 10/100/1000 Base-TX PCI-XAdapter (14108902)fcnet0 De ned 02-00-01 Fibre Channel Network Protocol Devicefcnet1 De ned 03-00-01 Fibre Channel Network Protocol Devicefcs0 Available 02-00 4Gb FC PCI Express Adapter (df1000fe)fcs1 Available 03-00 4Gb FC PCI Express Adapter (df1000fe)fscsi0 Available 02-00-02 FC SCSI I/O Controller Protocol Devicefscsi1 Available 03-00-02 FC SCSI I/O Controller Protocol Devicehdisk2 Available 02-00-02 FC 2145hdisk3 Available 02-00-02 FC 2145Russell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200947 / 79

Software Location Codeslsdev -F name status location physloc description hdisk0 Available 10-60-00-4,0 P1/Z1-A4 16 Bit LVD SCSI DiskDrivehdisk1 Available 10-60-00-5,0 P1/Z1-A5 16 Bit SCSI Disk Drivehdisk2 Available 10-60-00-6,0 P1/Z1-A6 16 Bit SCSI Disk DriveRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200948 / 79

Software Location CodesParent/Child RelationshipFind base digits of child deviceie: hdisk0 10-60-00-4,0 - 10-60ie: lsdev grep 10-60cd0 Available 10-60-00-1,0 16 Bit SCSI Multimedia CD-ROMDrivehdisk0 Available 10-60-00-4,0 16 Bit LVD SCSI Disk Drivehdisk1 Available 10-60-00-5,0 16 Bit SCSI Disk Drivehdisk2 Available 10-60-00-6,0 16 Bit SCSI Disk Drivescsi0 Available 10-60 Wide/Ultra-2 SCSI I/O ControllerRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200949 / 79

Hardware Location Codeslscfg -vl device hdisk0 U78A0.001.xxxxxxx-P2-D5 SAS Disk Drive (146800 MB)Manufacturer. . . . . . . . . . . . .IBMMachine Type and Model. . . .HUS153014VLS300FRU Number. . . . . . . . . . . . .10N7232Serial Number. . . . . . . . . . . . JFVTXXXXPart Number. . . . . . . . . . . . .42R4234Device Speci c.(Z0). . . . . . .000005329F003002Hardware Location Code. . . .U78A0.001.DNWGSZB-P2-D5Russell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200950 / 79

Hardware Location Codeslscfg -vp grep fcsfcs1 U78A0.001.xxxxxxx-P1-C3-T1 4Gb FC PCI Express Adapter(df1000fe)fcs0 U78A0.001.xxxxxxx-P1-C2-T1 4Gb FC PCI Express Adapter(df1000fe)Russell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200951 / 79

Hardware Location Codeslscfg -vp grep vhostvhost0 U9117.MMA.10xxxxx-V10-C41Adaptervhost1 U9117.MMA.10xxxxx-V10-C51Adaptervhost2 U9117.MMA.10xxxxx-V10-C61Adaptervhost3 U9117.MMA.10xxxxx-V10-C71AdapterVirtual SCSI ServerVirtual SCSI ServerVirtual SCSI ServerVirtual SCSI ServerRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200952 / 79

VIORussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200953 / 79

Slot NumberingCreate VIO servers at upper limit of LPAR ID's4 CPU box * 10 LPARs / CPU 40 LPARs maxVIO1 LPAR ID 39 (Note odd!)VIO2 LPAR ID 38 (Note even!)Create clients from 2-121 is reserved for Full System PartitionIncrease maximum virtual adapters as neededRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200954 / 79

Slot NumberingVirtual Ethernet in teens (slots 10-19)Virtual SCSI numbered by client LPAR ID and VIO ServerClient LPAR 4 has VSCSI slot 41 directed to VIO1 slot 41VIO1 has VSCSI slot 41 directed to Client slot 41Easier to read and infer clientLPAR Mobility breaks numbering, uses rst available slot on VIOSRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200955 / 79

Slot Numbering DiagramRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200956 / 79

VSCSI Trace WorksheetRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200957 / 79

UDID/IEEE Unique ID SupportAllows transparent migration between direct LUN access and VIOWithout UDID VIO indexes LUNs by PVIDClient writes o setData encapsulated No migration, backup/restore/mirrorlsattr -El hdiskXIBM drivers often listunique idattributePowerpath hides it, query ODM directly insteadodmget -q attribute unique id CuAtRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200958 / 79

VIO Pro leset -o vi or set -o emacsUpdate pathUpdate prompt variable (PS1)Russell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200959 / 79

VIO Pro leAdd to home/padmin.pro leexport ENV /home/padmin/.kshrcRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200960 / 79

VIO Pro leCreate home/padmin.kshrcexport PS1 hostname set -o viRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200961 / 79

TricksRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200962 / 79

HMC Virtual TerminalJava Terminal di cult to copy/pastessh to HMC (ie: ssh hscroot@hmc1.mydomain.com)Old way to access VT via mkvterm di cultvtmenu command presents menu of systems and LPARsOpens terminal in ssh session!Copy and paste work normally, depending on SSH clientTo exit, enter .May still require GUI to close dead terminalsRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200963 / 79

File SharingSetup temporary NFS share, not preserved on rebootexportfs -i /directoryRecommend using CIFS mounts instead of SambaInstead of serving Windows clients, be a Windows clientPush to Windows serversO oad security issuesRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200964 / 79

NIMsmitty eznimSetup NIM in under an hourRequires AIX CD/DVDCreates default SPOT and LPP sourcesGreat way to get started with NIMURLRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200965 / 79

KSH Keybindings: Vi Modeset -o viURLPrior command: Esc kSearch history: Esc /stringFilename completion: Esc \Inline editing movementForward Char / Backward: h / lForward Word / Backward: w / bBOL / EOL: 0 / Edit @ point / after point: i / aEnd editing: EscRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200966 / 79

KSH Keybindings: Emacs Modeset -o emacsURLPrior command: Control-PSearch history: Control-R stringFilename completion: Esc EscInline editing movementForward Char / Backward: C-f / C-bForward Word / Backward: Esc-f / Esc-bBOL / EOL: C-a / C-eRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200967 / 79

SMIT KeybindingsVi mode users frustrated?Smit uses Emacs key bindings!Backspace: C-hDelete to EOL from point: C-kPage down: C-vRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200968 / 79

Handy Shell Tricksgrep -pGrep for paragraphs matching regexpie:grep -p /var /etc/filesystems/var:dev /dev/hd9varvol /var mount automaticcheck falsefree falsevfs jfs2log /dev/hd8type bootfsRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200969 / 79

Handy Shell TricksIterate Commands across a list of items using xargs or while readxargsxargsapplies list to end of supplied command by defaultcommon ags-t echos each command as it runs-n1 means one line of input per commandSpace sensitive!Russell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200970 / 79

Handy Shell TricksIterate Commands across a list of items using xargs or while readwhile readmore exibleMultiple commandsNot limited to applying list item at end of commandCan use quoting to eliminate whitespace sensitivityRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200971 / 79

Handy Shell TricksAlways echo the commands rst!Listing devices example:lsdev -F name grep fscsi xargs -tn1 lsattr -ElBulk set attributes example:lsdev -F name grep fscsi while read X; do chdev -P -l" X" -a dyntrk yes ; doneMount all FS in a VGlsvgfs myvg sort xargs -tn1 mountRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200972 / 79

Screen sharingRemote login monitoringGroup work / demonstrationsportmir commandRoot only, Only one session per OSFind pty via who or ps -efportmir -t pts/7End via portmir -oRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200973 / 79

Finding Large FilesDrill down method:du -sm * sort -ncd to largest suspect andrepeat15 Largest les in current directory tree:find . -type f -size 10000 while read X ; do du -sm" X" ; done sort -n tail -n 15Russell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200974 / 79

Errpt EmailingURLHave errdaemon email you copies of errpt entries in real timeCon gure sendmail so that mail worksSmart host? (DS line in /etc/sendmail/sendmail.cf)Create root /.forward le with comma delimited list of emails tonotifychmod 400 /.forwardRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200975 / 79

Errpt EmailingAdd ODM entry which matches all events and triggers emailerrnotify:en pid 0en name ZZZ mail err en persistence g 1en method errpt -a -l 1 mail -s 'Errpt 1 4 3 9 ' root Russell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200976 / 79

rc.local vs /etc/rc.dOld way to add custom startup script was to add an rc.local to inittabNow create a script in /etc/rc.d/rc2.d/S99Local insteadRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200977 / 79

CLI Text Tricksecho "Line to append" /file/to/append.txtEasy to copy and paste across systems, or sshcat /file/to/overwrite.txtPaste!Control-D endsCompare large lists by checksum (ie: lslpp)lslpp -l cksumRussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200978 / 79

Q&ARussell Adams rladams@adamsinfoserv.com () Free Tools, Hints, and TricksThursday 9/24/200979 / 79

NMON Analyzer NMON Analyzer is an open tool written by Stephen Atkins URL Excel spreadsheet/macro to analyze NMON recording Russell Adams rladams@adamsinfoserv.co