home / infca / aix (navigation links) The only way of discovering the limits of the possible
is to venture a little way past them into the impossible

vi | cron | pv, lv | X11 | Perl intro (ext) | TCPIP | CVS | mksysb TRUSS | scripts {repos} | Files | Crib Sheet | BestP | Books | Links | End

AIX - system p

AIX Information Center ; resources ;

Amunt! Top Amunt!
HW level
bcnhcc03[root]:/etc> lscfg INSTALLED RESOURCE LIST Model Architecture: chrp Model Implementation: Multiple Processor, PCI bus + hdisk0 16 Bit LVD SCSI Disk Drive (300000 MB) + hdisk1 16 Bit LVD SCSI Disk Drive (300000 MB) + mem0 Memory + proc0 Processor + proc2 Processor + proc4 Processor + proc6 Processor bcnhcc03[root]:/etc> lsattr -El proc0 frequency 1.648.350.000 Processor Speed False smt_enabled true Processor SMT enabled False smt_threads 2 Processor SMT threads False state enable Processor state False type PowerPC_POWER5 Processor type False bcnhcc03[root]:/etc> lsattr -El mem0 goodsize 16000 Amount of usable physical memory in Mbytes False size 16000 Total amount of physical memory in Mbytes False bcnhcc03[root]:/etc> lsattr -El hdisk0 PCM PCM/friend/scsiscsd Path Control Module False algorithm fail_over Algorithm True dist_err_pcnt 0 Distributed Error Percentage True dist_tw_width 50 Distributed Error Sample Time True hcheck_interval 0 Health Check Interval True hcheck_mode nonactive Health Check Mode True max_transfer 0x40000 Maximum TRANSFER Size True pvid 0002f6da5b12174b0 Physical volume identifier False queue_depth 3 Queue DEPTH False reserve_policy single_path Reserve Policy True size_in_mb 300000 Size in Megabytes False unique_id 27080005D7A40B H0scsi Unique device identifier False

Amunt! Top Amunt!
SW level
lab013[root]:/> oslevel 4.3.3.0 lab013[root]:/> lslpp -h bos.rte Fileset Level Action Status Date Time ---------------------------------------------------------------------------- Path: /usr/lib/objrepos bos.rte 4.3.3.0 COMMIT COMPLETE 11/26/01 16:55:59 4.3.3.50 APPLY COMPLETE 05/29/02 12:32:09 Path: /etc/objrepos bos.rte 4.3.3.0 COMMIT COMPLETE 11/26/01 16:55:59 lab013[root]:/>

Amunt! Top Amunt!
software install
$ smitty > Instalacio i manteniment de programari > Instalar i actualitzar programari > Instalar programari > Directori / dispositiu d'entrada : {F4} /dev/cd0 > Programari que voleu instalar : F4 {display} + F7 {select}

Amunt! Top Amunt!
AIX troubleshooting

Use these commands:

File System full

Few commands :

$ df -k : display all file systems $ who : see who is on the LPAR $ last : who was here $ du -k | sort -nr | more : show disk usage sorting by the largest files $ du -sk : show directory size $ du -sk * | sort -n : id, largest on bottom $ du -xk . | sort -nr | head -20 : display largest 20 $ find / -size +500000000c : display files larger that 500MB $ find / -type d -size +500M : display directories larger than 500MB
Large file

Display actual value :

$ ulimit -a cat /etc/security/limits | grep fsize

For changes to the /etc/security/limits file to take effect, the user must log out of the current login session and log back in.


Security

Initial Shell
  • /etc/security/login.cfg : contiene los shells aceptados
  • smitty + user + initial program := /usr/bin/bash ;

Compte : BASH no es "standard" de AIX, així que un re-inici "mínim" igual no el pot carregar ...
Conclusió : NO fer-lo servir per a root

System Trace
  • /etc/syslog.conf - configuración
  • refresh -s syslogd - reiniciar el daemon
  • logger -p user.info hello - test it works / set a milestone.
url
Retrive old commands
  • /usr/bin/ksh
  • set -o vi {use "set -o emacs" better !}
  • "Esc" + "k"
Initial & final commands
Es troben a /imi/tools : all_start.sh & all_stop.sh
Com compilar un programa en c
  1. determinar el tipus de shell : echo $SHELL
    The Bourne-shell path is /bin/bsh or /bin/sh.
    The Korn shell path is /bin/ksh.
    The C-shell path is /bin/csh.

    Diferences, Korn Shell,

  2. The following statements show how you can set environment variables in the Bourne or Korn shells:
    LANG=en_US NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/L/%N export LANG NLSPATH

    To set the variables so that all users have access to them, add the commands to the file /etc/profile. To set them for a specific user only, add the commands to the file .profile in the user's home directory.

url

root user initial profile can be found at /.profile {? and/or /etc/security/.profile ?}.

smitty (GUI), smit (cmd line)
És l'eina d'administració del AIX.

Shortcuts : "smitty system", "smitty tcpip", "smitty mktcpip", "smitty configtcp", "smitty route", "smitty chinet", "smit mkvg", "smit mksysb", "smit chkbd", ...

Llibre
Network Information Services (NIS and NIS+) Guide :
Amunt! Top Amunt!
AIX Security Mechanisms

In essence, AIX security is provided by gates that users must pass through in order to enter the AIX environment, and permission matrixes that determine what they are able to do once inside.

The overall system is composed of four gates and two permission matrixes.

  • Dialup gate - to access a given AIX environment from the outside through a modem and phone line, you must provide a valid login ID and dialup password.
  • Login gate - to enter a given AIX environment you must provide a valid login ID and user password.
  • File and Directory Matrix - once you have gained access to a AIX environment, your ability to read, execute, modify, create, and destroy files and directories is governed by the applicable permissions matrix.
  • Root gate - to gain access to root privileges, you must provide a valid super user (root) password.
How to trace keyboard after "su -"
In .profile, include
export HISTFILE=/home/root/.sh_history.$SUFF
How to modify PATH
In .profile, include
export PATH=$PATH:/home/user/cmds
FileSystem permissions

url

There are three specific permissions on Unix-like systems that apply to each class:

  • The read permission, which grants the ability to read a file. When set for a directory, this permission grants the ability to read the names of files in the directory (but not to find out any further information about them such as contents, file type, size, ownership, permissions, etc.)
  • The write permission, which grants the ability to modify a file. When set for a directory, this permission grants the ability to modify entries in the directory. This includes creating files, deleting files, and renaming files.
  • The execute permission, which grants the ability to execute a file. This permission must be set for executable binaries (for example, a compiled c++ program) or shell scripts (for example, a Perl program) in order to allow the operating system to run them. When set for a directory, this permission grants the ability to traverse its tree in order to access files or subdirectories, but not see files inside the directory (unless read is set).

The effect of setting the permissions on a directory (rather than a file) is "one of the most frequently misunderstood file permission issues"

"T" bit : sticky bit.

wikipedia or linuxnix

When set, it instructed the operating system to retain the text segment of the program in swap space after the process exited.

If Sticky bit is enabled on a folder, the folder contents are deleted by only owner who created them and the root user.

"S" bit:

url

setuid and setgid (short for set user ID upon execution and set group ID upon execution, respectively) are Unix access rights flags that allow users to run an executable with the permissions of the executable's owner or group. They are often used to allow users on a computer system to run programs with temporarily elevated privileges in order to perform a specific task. While the assumed user id or group id privileges provided are not always elevated, at a minimum they are specific.

Pregunta : How to Set ? How to Clear ?

To set the sticky bit on the new directory, run: 'chmod a+t' or 'chmod 1777' on it.

{repos}
Amunt! Top Amunt!
Shell scripts
Shell we have
[wbrkadm@dmqb261]:/MQHA/cfg/> echo $SHELL /bin/ksh mqm@lope:/home/mqm/eines/bin> whereis ksh ksh: /usr/bin/ksh
Display the Queue Manager(s) that are running ...
[wbrkadm@dmqb261]:/home/wbrkadm/mq> cat vermq dspmq | grep -i "QMNAME" | cut -d '(' -f2,3 | cut -d ')' -f1 | while read QMGR ; do echo "Have qmgr ${QMGR}...." sleep 3 done
Run a command under another user (from root)
su - ${MQM_USER} -c "${MQM_HOME}/bin/hamqm_start_su ${QM}" 2>&1 1>/dev/null
Determine if Listener is running
ps -ef | grep lsr
Count the number of files under a path
find . * -print | wc -l
Parametres i IFs
[mqm@MQS1P1 config]$ cat bl.sh #!/bin/bash echo "$# parameters" echo "$@"; MYFLAG="x" MYFN="log_mq.txt" echo "Filename temporal = {" $MYFN "}." rm -f $MYFN cat '/var/mqm/qmgrs/qm!dec!P1!A/errors/AMQERR01.LOG' > $MYFN ls -al $MYFN if [ "$1" = $MYFLAG ] then cat $MYFN | grep AMQ echo "Dentro del IF" fi echo "Fin del Shell."

Bash Guide for Beginners.

Bash by example :

Visit GNU's bash home page

Beep at bash
#!/bin/bash fn0='-en "\007"' echo $fn0 echo $'\a' # Alert (beep). echo +++ Fet.
Remove terminal beep
setterm -blength 0 in /etc/profile or $HOME/.bash_profile
Verify current user
if [ `id -u` -ne 0 ] then echo "Must be running as root" exit 1 fi
Verify file (parameter) exists
if [ -e $f_src ]; then . . . else echo "File does not exist. Bye." exit 1 fi
Verify directory (parameter) exists
if [ -d $f_src ]; then . . . else echo "Directory does not exist. Bye." exit 1 fi
Verify user/calculated value
# read user input read choice # bash nested if/else if [ $choice -eq 1 ] ; then echo "You have chosen word: Bash" else if [ $choice -eq 2 ] ; then echo "You have chosen word: Scripting" else if [ $choice -eq 3 ] ; then echo "You have chosen word: Tutorial" else echo "Please make a choice between 1-3 !" echo "1. Bash" echo "2. Scripting" echo "3. Tutorial" echo -n "Please choose a word [1,2 or 3]? " choice=4 fi fi fi done
Bash File Testing
-b filename Block special file -c filename Special character file -d directoryname Check for directory existence -e filename Check for file existence -f filename Check for regular file existence not a directory -G filename Check if file exists and is owned by effective group ID. -g filename True if file exists and is set-group-id. -k filename Sticky bit -L filename Symbolic link -O filename True if file exists and is owned by the effective user id. -r filename Check if file is a readable -S filename Check if file is socket -s filename Check if file is nonzero size -u filename Check if file set-ser-id bit is set -w filename Check if file is writable -x filename Check if file is executable

Sample :

#!/bin/bash file="./file" if [ -e $file ]; then echo "File exists" else echo "File does not exists" fi
Reading (parameter) file(s)
MYFN="file.txt" while read line ;do echo $line done < $MYFN

El algorisme que ens interessa (per obtenir dades sobre tots el EG) ha de ser així com :

Shell file handling
myhost:/home/wbrkadm/Shells # cat verEG MYFN="lista.txt" while read line ;do echo Linea = $line MYCL="mqsilist $line" echo CommandLine = $MYCL $MYCL done < $MYFN siempre que dx0609:/home/wbrkadm/Shells # cat lista.txt BKDESA01 BKDESA02 BKDESA03 BKDESA04 BKDESA05 BKDESA06
Korn Shell scripting intro

E-mail from a script :

$REPORT="/tmp/users" cat $REPORT | mailx s "User admin report from server XYZ" email_user@email_server

url


Amunt! Top Amunt!
TTY

Select "erase" key :

stty erase ^?

Amunt! Top Amunt!
VI

How to remove Ctrl-M chars introduced by WinSCP :

Open the file with vi and type: :1,$s/^M//g Enter the carriage return character (^M) with Ctl-V Ctl-M.

How to replace "global" :

:1,$s/13_objects_system/23_user_objects/g

Amunt! Top Amunt!
Timestamp

How to create timestamps to be used as part of filename :

#!/bin/sh # Backup Diario del repositorio prfx=$1 # Definir numero de dias que se quiere conservar los ficheros. dias=10 # Primero se borra el fichero de backup que se creo hace 10 dias find /backup -name "backup*" -mtime +$dias -exec rm '{}' ';' # Nombre para el fichero de nuestro backup date_name=`date +"%y%m%d"` time_name=`date +"%H%M"` # Backup path myfn="backup" bak_file="/backups/backup_"prfx"_"$myfn"_"$date_name".tar" echo "BAK FILE = ("$bak_file")."

Amunt! Top Amunt!
FTP from a shell

How to transfer files automagically :

lab013[root]:/>cat doftp.sh #!/bin/ksh HOST='9.137.165.42' USER='pere' PASSWD='mipwd' FILE=$1 echo sending file $FILE source_dir='/backup' remote_dir='BKP' ftp -n -i -v $HOST << END_SCRIPT > doftp.log user $USER $PASSWD status binary lcd $source_dir cd $remote_dir mput $FILE quit END_SCRIPT exit 0

Amunt! Top Amunt!
sendmail

Amunt! Top Amunt!
Cron

Como se configura el Cron ? O sea, donde se especifica qué comandos se ejecutaran a qué hora ?

Wiki.

The schedule for cron is written in the /etc/crontab file

[sag@BCN01 cron]$ crontab usage: crontab [-u user] file crontab [-u user] [ -e | -l | -r ] (default operation is replace, per 1003.2) -e (edit user's crontab) -l (list user's crontab) -r (delete user's crontab) -i (prompt before deleting user's crontab) -s (selinux context)

url, url.

Definim la feina a fer ...
[root@BCNILOG01 sag]# cat sag_cron.pl #!/usr/bin/perl # # volem enviar una linia a /var/log/messages # ($seg, $min, $hora, $dia, $mes, $anho, @zape) = localtime(time) ; # Use four digit year ($year is a value based on # of years since 1900) $anho += 1900; # Set to 2 digit month from 01 to 12 $mes = $mes + 1 ; if(length($mes) == 1) { $mes = "0" . $mes; } # Set to 2 digit day if(length($dia) == 1) { $dia = "0" . $dia; } if(length($hora) == 1) { $hora = "0" . $hora; } if(length($min) == 1) { $min = "0" . $min; } if(length($seg) == 1) { $seg = "0" . $seg; } $madata = "SAGcron15min - son les $hora:$min del $dia/$mes/$anho." ; $linia = "logger -p user.info $madata" ; print "$linia" ; system($linia) ; $file = "/home/sebas/scripts/cron/newLog.txt"; if (unlink($file) == 0) { # print "+++ File deleted successfully.\n"; } else { # print "--- File was not deleted.\n"; } system("ps -ef | grep vmx >> $file") ; $linia = "logger -p user.info -f $file" ; system($linia) ;
Escollim que es faci cada 15 minuts ...
[root@BCNILOG01 sag]# cat cron_sag ########################################################## # minute (0-59), # # | hora (0-23), # # | | dia del mes (1-31), # # | | | mes (1-12), # # | | | | dia de la semana (0-6 donde 0=Domingo) # # | | | | | comandos # ########################################################## */15 * * * * /home/sag/sag_cron.pl >> /home/sag/sag_cron.out

Si la volem cada dia 3 de tots els mesos a les 4 del matí :

lab013[root]:/home/sag/cmds/cron> cat cron_programacio_semanal ########################################################## # minute (0-59), # # | hora (0-23), # # | | dia del mes (1-31), # # | | | mes (1-12), # # | | | | dia de la semana (0-6 donde 0=Domingo) # # | | | | | comandos # ########################################################## 0 4 3 * * /backup/backup_ALL_repos.sh >> /home/sag/cmds/cron/cron.out

Si volem la feina feta cada dissabte a les 4 del matí :

[root@labss1 ~]# crontab -l ########################################################## # minute (0-59), # # | hora (0-23), # # | | dia del mes (1-31), # # | | | mes (1-12), # # | | | | dia de la semana (0-6 donde 0=Domingo) # # | | | | | comandos # ########################################################## 0 4 * * 6 /home/sag/cmds/backup.sh >> /home/sag/cmds/cron/feina_semanal/cron.out

Si volem fer diverses feines pel mateix usuari, nomes podem tenir 1 fitxer de programacio :

[root@labss1 ~]# crontab -l ########################################################## # minute (0-59), # # | hora (0-23), # # | | dia del mes (1-31), # # | | | mes (1-12), # # | | | | dia de la semana (0-6 donde 0=Domingo) # # | | | | | comandos # ########################################################## */15 * * * * /home/sebas/cmds/cron/feina_15min.pl >> /home/sebas/cmds/cron/cron.log 2>&1 0 23 * * * /home/sebas/cmds/cron/feina_Aturar.sh >> /home/sebas/cmds/cron/cron.log 2>&1 0 8 * * * /home/sebas/cmds/cron/feina_Engegar.sh >> /home/sebas/cmds/cron/cron.log 2>&1
Activem la feina ...
[root@BCNILOG01 log]# crontab -u sag cron_sag
Reiniciem el servei ...
[root@BCNILOG01 log]# service crond restart Stopping crond: [ OK ] Starting crond: [ OK ]

Bibli CronTab :

Scheduling explained. As you can see there are 5 stars. The stars represent different date parts in the following order:

  1. minute (from 0 to 59) - use "*/15" to mean "every 15 min" ; use "0,10,20" to mean "or".
  2. hour (from 0 to 23)
  3. day of month (from 1 to 31)
  4. month (from 1 to 12)
  5. day of week (from 0 to 6) (0=Sunday)

So if we want to schedule the script to run at 1AM every Friday, we would need the following cronjob:

0 1 * * 5 /bin/execute/this/script.sh
Display "croned" jobs (for actual user only)
[sag@labss ~]$ crontab -l no crontab for sag
Remove all jobs
crontab -r

Another way :

/etc/cron.hourly

Si hi posem un fitxer com aquest, s'executarà cada hora ...

#!/usr/bin/perl # clear FDC files from /var/mqm/errors # trace every entry in this job : $linia = "date >> /home/sebas/tmp/scripttest" ; system($linia) ; # remove FDC files : $linia = "rm -f /var/mqm/errors/AMQ???.?.FDC" ; system($linia) ; $linia = "rm -f /var/mqm/errors/AMQ????.?.FDC" ; system($linia) ; $linia = "rm -f /var/mqm/errors/AMQ?????.?.FDC" ; system($linia) ;

To test it, restart cron daemon

p9111-520:/etc/init.d # /etc/init.d/cron restart Shutting down CRON daemon done Starting CRON daemon done

and modify the system date/time from root user :

date 02041659

and display /var/mqm/errors !

Cron troubleshooting

Troubleshooting cron and custom scripts can be a frustrating experience. A few, easy to use, lines of code can help troubleshoot possible problems.

  1. Use the date command in the beginning of the script as a check to verify if the script was called. A simple
    date >> /tmp/scripttest
    placed at the top of the script enables a quick check to see if the script was called and processed. The scripttest file will reveal when the script was called and when the date command was executed.
  2. If the date command reveals the script is running but the desired result of the script is not realized, there is a problem with the script. With cron jobs, any output that would normally go to the screen is lost. Redirecting the output and errors to a file may help discover the problem, for example
    mycmd > /tmp/script.out 2>&1

Amunt! Top Amunt!
Paginación

Usar el comando topas o vmstat. Mirar si hay po/pi. Si no es cero, hay algo de paginación. El número de Paging In/Out pi/out del topas y vmstat indica el uso en tiempo real.

Otro indicador de cuánto pagina es el uso del espacio de paginación (que viene a ser nada). Se ve con lsps -a, y da un porcentaje. Si el porcentaje es mayor del 3%, malo.

La máquina NO debe paginar. Si lo hace, la cosa no va bien. Una máquina con paginación no debe ser una situación aceptable de manera permanente. Puede ser que alguna aplicación consuma más memoria de la adecuada para sus funciones o que los productos que tienen per se consumen más de la memoria que tienen. En el primer caso puede haber un problema puntual y en el otro, hay que poner más memoria.

topas
Topas Monitor for host: dmqb261 EVENTS/QUEUES FILE/TTY Wed May 9 16:15:03 2007 Interval: 2 Cswitch 117 Readch 1113 Syscall 220 Writech 1681 Kernel 1.8 |# | Reads 3 Rawin 0 User 0.4 |# | Writes 2 Ttyout 575 Wait 0.0 | | Forks 0 Igets 0 Idle 97.9 |############################| Execs 0 Namei 0 Physc = 0.02 %Entc= 3.3 Runqueue 0.0 Dirblk 0 Waitqueue 0.0 Network KBPS I-Pack O-Pack KB-In KB-Out en0 2.5 12.5 3.5 1.2 1.3 PAGING MEMORY lo0 0.0 0.0 0.0 0.0 0.0 Faults 0 Real,MB 1536 Steals 0 % Comp 80.1 Disk Busy% KBPS TPS KB-Read KB-Writ PgspIn 0 % Noncomp 4.8 hdisk1 0.0 0.0 0.0 0.0 0.0 PgspOut 0 % Client 7.0 hdisk0 0.0 0.0 0.0 0.0 0.0 PageIn 0 hdisk3 0.0 0.0 0.0 0.0 0.0 PageOut 0 PAGING SPACE hdisk2 0.0 0.0 0.0 0.0 0.0 Sios 0 Size,MB 2048 % Used 21.5 Name PID CPU% PgSp Owner NFS (calls/sec) % Free 78.4 topas 635044 0.3 1.6 wbrkadm ServerV2 0 muxatmd 274580 0.0 0.6 root ClientV2 0 Press: amqzlaa0 618676 0.0 3.0 wbrkadm ServerV3 0 "h" for help gil 65568 0.0 0.1 root ClientV3 0 "q" to quit amqrmppa 831512 0.0 3.4 mqm DataFlow 389296 0.0 90.5 wbrkadm xmgc 45078 0.0 0.0 root amqzlaa0 245844 0.0 1.6 wbrkadm

Amunt! Top Amunt!
Misc commands
nmon

Nigel's Monitor is a performance measure tool

URLS :

Threads info

Pues es un poco tricky. Poca información sé sacar de las threads. Imagina que el proceso (PID) del broker es 1234. Mira en /proc/1234/lwp y verás la lista de threads del proceso 1234. En /proc/{PIDvalue} hay información variada sobre cada proceso incluyendo las threads (light-weighted process, lwp).

ML, Kernel, other

oslevel - reports the latest installed maintenance level of the system.

Use oslevel -r command to find out the current level of ML. oslevel -q will tell you the known maintenance levels. For more help type oslevel -help.

[wbrkadm@rcmqb272]:/home/wbrkadm> oslevel -r 5300-05

uname : displays the name of the current operating system

[root@dmqb261]:> uname -a AIX dmqb261 3 5 00C4C32E4C00

bootinfo : display system info, as 32/64 bit ("-K")

usage: bootinfo { -a | -b | -B device | -c | -d | -e | -f device | -g device | i | -k | -K | -L | -m | -M | -o disk | -p | -q device | -Q number | -r | -s diskname [ -P 0 ] | -t | -T | -v | -w | -y | -z } root@lope:/home/soft/server> bootinfo -K 64

[root@dmqb261]:> instfix -i | grep ML All filesets for 5.3.0.0_AIX_ML were found. All filesets for 5300-01_AIX_ML were found. All filesets for 5300-02_AIX_ML were found. All filesets for 5300-03_AIX_ML were found. All filesets for 5300-04_AIX_ML were found.

url

RPM
* rpm -q -a > tot.txt - display all installed packages * per cada lnia del fitxer anterior, rpm -q -l - list files in package
VMO
[root@dmqb261]:> vmo -h Usage: vmo -h [tunable] | {-L [tunable]} | {-x [tunable]} vmo [-p|-r] (-a | {-o tunable}) vmo [-p|-r] (-D | ({-d tunable} {-o tunable=value})) -h Display help about the command and its arguments -h tunable Display help about a tunable -L [tunable] List information about one or all tunables in a table format -x [tunable] List information about one or all tunables in a comma-separated format -a Display value for all tunables, one per line -o tunable Display current value of a tunable -D Reset all tunables to their default values -d tunable Reset tunable to its default value -o tunable=value Set tunable to value -r Make change(s) (-D/-d/-o) or display (-a/-o) apply to nextboot value -p Make change(s) (-D/-d/-o) or display (-a/-o) apply to permanent (current and nextboot) value [root@dmqb261]:>

Hector : vmo/ioo/schedo han sustituido en AIX 5.3 a vmtune que era el programa para cambiar parametros de kernel en AIX 5.2

ipcs - reports interprocess communication facility status.

[wbrkadm@dmqb261]:/home/wbrkadm/> ipcs /h usage: ipcs [ - [ [ at ] | T ] bcmopqrsX [ [S1] | P ] [ -C corefile ] [ -N namelist ] ]

lppchk command - verifies files of an installable software product.

[u@k]
ODM

Database of system and device configuration information integrated into the OS.

Types of objects stored in the ODM:

Useful commands:

In order to make any system change permanent, you have to change it in the ODM instead of just at run-time. When in doubt, use SMIT!

url


Amunt! Top Amunt!
AIX disks & Filesystem

Excelent concepts, commands and grouping : url.

AIX filestructure - complete but not ordered : url.

Document ben arreglat i ordenat : pdf.

publib:
Per visualitzar informació sobre el dispositiu SCSI virtual de la partició lògica de client d'AIX:

lscfg -l nom_dispositiu Aquesta ordre torna resultats semblants als segents: U9117.570.1012A9F-V3-C2-T1-L810000000000 Virtual SCSI Disk Drive

En el nostre cas:

lab013[root]:/> lscfg -vl hdisk0 DEVICE LOCATION DESCRIPTION hdisk0 10-80-00-2,0 16 Bit LVD SCSI Disk Drive (36400 MB) Manufacturer................IBM Machine Type and Model......DDYS-T36950M FRU Number..................00P1519 ROS Level and ID............53394841 Serial Number...............4FFXB495 EC Level....................F79924 Part Number.................07N3832 Device Specific.(Z0)........000003029F00013A Device Specific.(Z1)........07N4923 Device Specific.(Z2)........0933 Device Specific.(Z3)........01149 Device Specific.(Z4)........0001 Device Specific.(Z5)........22 Device Specific.(Z6)........F79924
PV, LV, etc

There are three main objects in the Logical Volume Manager:

lsdev -Cc disk = display what disks are recognized by the system. lspv = display the Physical Volumes on a system. lspv hdisk0 = display details about disc. lsvg = list information about all volume groups. lsvg -p <vg> = list PV's in the VG lsvg -l <vg> = list LV's in the VG lslv = list information about logical volumes. Use "df -k" to display filesystem and its logical volumes.
How many disk space do we have ?

First, display existing physical volumes

hcc03[root]:/> lspv hdisk0 00025b12174b sapr3vg active hdisk1 000248d29cf1 rootvg active

Now, for every one, display physical volume details (see total size under "total PPs" and free space under "free PPs")

hcc03[root]:/> lspv hdisk1 PHYSICAL VOLUME: hdisk1 VOLUME GROUP: rootvg PV IDENTIFIER: 0002f6da48d29cf1 VG IDENTIFIER 0002f6da0000d3000000011248d2a88e PV STATE: active STALE PARTITIONS: 0 ALLOCATABLE: yes PP SIZE: 512 megabyte(s) LOGICAL VOLUMES: 16 TOTAL PPs: 558 (285696 megabytes) VG DESCRIPTORS: 2 FREE PPs: 19 (9728 megabytes) HOT SPARE: no USED PPs: 539 (275968 megabytes) MAX REQUEST: 256 kilobytes FREE DISTRIBUTION: 00..00..00..00..19 USED DISTRIBUTION: 112..112..111..111..93
Comandes per incorporar un nou disc al AIX

First, display existing volume groups

hcc03[root]:/> lsvg rootvg BackupVG

Now, for every one, display PV and LV distribution

lab013[sebas]:/home/sebas> lsvg -p rootvg rootvg: PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION hdisk0 active 542 181 01..13..00..58..109 lab013[sebas]:/home/sebas> lsvg -l rootvg rootvg: LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT hd4 jfs 7 7 1 open/syncd / hd2 jfs 39 39 1 open/syncd /usr hd9var jfs 3 3 1 open/syncd /var hd3 jfs 34 34 1 open/syncd /tmp hd1 jfs 10 10 1 open/syncd /home lv00 jfs 2 2 1 open/syncd /usr/local/CredMutPoC lv01 jfs 15 15 1 open/syncd /usr/local/bic-repos lv02 jfs 2 2 1 open/syncd /usr/local/repos_bpc lv03 jfs 77 77 1 open/syncd /usr/local/newrepos lv05 jfs 77 77 1 open/syncd /usr/local/repository lv07 jfs 7 7 1 open/syncd /usr/local/bred lv08 jfs 7 7 1 open/syncd /usr/local/repos_bic20 lv09 jfs 2 2 1 open/syncd /usr/local/repos_xades lv04 jfs 15 15 1 open/syncd /usr/local/r_bic2010 lv10 jfs 15 15 1 open/syncd /usr/local/repos_BTT_projects lv11 jfs 15 15 1 open/syncd /usr/local/repos_BTTv8
Comandes per incorporar un nou disc al AIX

First, display available devices :

# lsdev -Cc disk

If you wanted to make physical volume hdisk1 its own volume group called datavg, you would use SMIT (smit mkvg) or the mkvg command:

# mkvg -f -y datavg hdisk1

You must use the varyonvg command to activate the volume group before you access it:

# varyonvg datavg

If you were to put hdisk1 into the datavg this way, then the lsvg (list volume groups) command, given our example so far, would produce:

# lsvg rootvg datavg

If you were to type the lspv (list physical volumes) command, you would get something like:

# lspv hdisk0 0004038485e2483a rootvg hdisk1 000013403f203af5 datavg

The first column would be the physical volume label, the second column would be the hexadecimal PVID, and the third would be the volume group to which each physical volume belongs.

url

Now, you can create a filesystem and a mount point simultaneously:

# crfs -v jfs -g'datavg' 'Megabytes' -m'/backups-repositoris' -a size='2048'

where "-v" specifies the filesystem type, "-g" the volume group, "-m" the mount point and "-a" the size in Megabytes.

Verify is has been registered into /etc/filesystems :

# cat /etc/filesystems /backups-repositoris: dev = /dev/lv00 vfs = jfs log = /dev/loglv00 mount = true options = rw account = false

And verify it is mounted by forcing it:

# mount -a

Now all should display ok:

$ df Sistema de fitxers Blocs 512 Lliure %Usat Iusat %Iusat Muntat a /dev/lv00 4194304 4062552 4% 17 1% /backups-repositoris
Creació d'un nou repositori
Problems & solutions
Major AIX Directories
Path Purpose
/ Root directory
/usr/bin Shared executables (/bin is a link to /usr/bin)
/usr/sbin Shared administrative commands
/usr/lib Shared libraries
/etc Local configuration files
/sbin Files needed to boot and mount /usr from another machine
/dev Device files directory
/tmp World-writeable storage for temporary files
/home Default location for user home directories
/export Files needed for diskless machines
/var Host-specific files, accounting and spool files

url"> url


Amunt! Top Amunt!
Misc info

Display how many processors does my system have :

hcc03[root]:/> lscfg | grep proc + proc0 Processor + proc2 Processor + proc4 Processor + proc6 Processor

Display how many memory does my system have :

hcc03[root]:/> lsattr -El sys0 -a realmem realmem 16384000 Amount of usable physical memory in Kbytes False

Display paging space allocated and in use :

hcc03[root]:/> lsps -a Page Space Physical Volume Volume Group Size %Used Active Auto Type hd6 hdisk1 rootvg 31232MB 1 yes yes lv

Amunt! Top Amunt!
X11

El Sistema X Window de GNU/Linux (X11) es un sistema de ventanas para GNU/Linux y otros Unix que tiene la característica de poder usarse en red. Esta propiedad hace referencia al "DISPLAY", que no es más que una variable de entorno para averiguar a qué pantalla deben enviarse los gráficos; esta variable es consultada por las aplicaciones gráficas de Xwindows al ejecutarlas. El poder arrancar aplicaciones o escritorios de forma remota, permite utilizar la potencia de otra CPU externa mientras desde nuestro ordenador manejamos la aplicación gráficamente. Todas las aplicaciones X Window, como pueden ser Gimp, Amsn, Aterm, konqueror, Firefox, Kde, Gnome o cualquier otro programa gráfico, son clientes de que se conectan a un servidor gráfico : el servidor X.

Windows does not come with support for X, but many third-party implementations exist, both free software such as Cygwin/X, Xming and WeirdX; and proprietary products such as Xmanager, MKS X/Server, Exceed and X-Win32. They normally serve to control remote X clients.

Wiki

Al XP, instalar Xming i editar "c:\Program Files\Xming\X0.hosts" per contenir la IP del AIX per acceptar les peticions.

Aplicacions al AIX : "xclock &", "xeyes &", "xterm &", etc.


Amunt! Top Amunt!
TCP/IP

Herramienta de configuración : smitty - use "smitty chinet" or "smitty tcpip" or "smitty mktcpip" or "smitty configtcp" (hostname, DNS)
"smit" uses GUI (slow), "smitty" is command-line (faster).

Network commands.

Terminologia :

IP address is assigned to a network interface

Parameter Display Modify
MAC lscfg -vl ent0  
IP lsattr -E -l en0 smitty mktcpip
net mask lsattr -E -l en0 smitty mktcpip
def GW netstat -rn smitty mktcpip
hostname hostname or cat /etc/hosts smitty mktcpip
domain cat /etc/resolv.conf smitty mktcpip
DNS cat /etc/resolv.conf smitty mktcpip
status lsattr -E -l en0 ifconfig en0 up or smitty mktcpip
AIX net cfg files
root@aix403v53:/etc> cat /etc/hosts - contiene nuestra IP y el hostname corto y completo 127.0.0.1 loopback localhost # loopback (lo0) name/address 9.137.164.26 aix403v53 aix403v53.bar.es.hal.com # en0 interface root@aix403v53:/etc> cat resolv.conf - contiene el dominio y los DNSs domain bar.es.hal.com nameserver 9.64.163.21 nameserver 9.64.162.21
net management commands

Configuration :

root@aix53:/> mktcpip -h <myhostname> -a <myip> -m <net_mask> -i en0 \ -n <ip_nameserver> -d <domainname> -g <ip_gateway> -s -C 0 -A no

Status :

root@aix403v53:/> ifconfig -a - display (all) interface status root@aix403v53:/> ifconfig en0 - display ethernet interface status root@aix403v53:/> ifconfig en0 down - set interface down root@aix403v53:/> ifconfig en0 up - set interface up
TCP/IP troubleshooting
netstat -v entstat -d en0 lsattr -E -l en0 tcpdump -i en2 -I -n

Some samples :

# lsattr -E -l en0 alias4 IPv4 Alias including Subnet Mask True alias6 IPv6 Alias including Prefix Length True arp on Address Resolution Protocol (ARP) True authority Authorized Users True broadcast Broadcast Address True mtu 1500 Maximum IP Packet Size for This Device True netaddr 9.137.164.26 Internet Address True netaddr6 IPv6 Internet Address True netmask 255.255.255.0 Subnet Mask True prefixlen Prefix Length for IPv6 Internet Address True remmtu 576 Maximum IP Packet Size for REMOTE Networks True rfc1323 Enable/Disable TCP RFC 1323 Window Scaling True security none Security Level True state up Current Interface Status True tcp_mssdflt Set TCP Maximum Segment Size True tcp_nodelay Enable/Disable TCP_NODELAY Option True tcp_recvspace Set Socket Buffer Space for Receiving True tcp_sendspace Set Socket Buffer Space for Sending True

To see what a specific interface supports use:

# lsattr -R -l ent0 -a media_speed 10_Half_Duplex 10_Full_Duplex 100_Half_Duplex 100_Full_Duplex Auto_Negotiation

To change the speed or duplex settings use:

# ifconfig en0 down detach # chdev -l ent0 -a media_speed=100_Full_Duplex ent0 changed # chdev -l en0 -a state=up en0 changed # entstat -d en0
Problema Login()
AIX Version 4 (C) Copyrights by IBM and by others 1982, 1996. login: username username's Password: All available login sessions are in use.

"smitty system"
Change / Show number of Lincensed users =3D (999 for unlimited)

Check out the file /etc/security/login.cfg and change the "maxlogins" parameter to some high number, as 64.

URLs

Amunt! Top Amunt!
CVS

The Concurrent Versions System (CVS) is a tool for version control.
For CVS updates and additional information, see the CVS home page at http://www.cvshome.org/ or Pascal Molli's CVS site at http://www.loria.fr/~molli/cvs-index.html

Documentacio.

CVS install
  1. obtenir soft from here
    $ ls -al -rw-r--r-- 1 sebas system 749720 Aug 29 12:12 cvs-1.11.22-AIX.bin.gz
  2. descomprimir
    $ gunzip cvs-1.11.22-AIX.bin.gz $ ls -al -rw-r--r-- 1 sebas system 2274802 Aug 29 12:12 cvs-1.11.22-AIX.bin
  3. install
    $ chmod 555 cvs-1.11.22-AIX.bin $ cp ./cvs-1.11.22-AIX.bin /usr/bin/cvs
  4. verify
    $ cvs -v Concurrent Versions System (CVS) 1.11.22 (client/server) Copyright (C) 2006 Free Software Foundation, Inc. Senior active maintainers include Larry Jones, Derek R. Price, and Mark D. Baushke. Please see the AUTHORS and README files from the CVS distribution kit for a complete list of contributors and copyrights. CVS may be copied only under the terms of the GNU General Public License, a copy of which can be found with the CVS distribution kit.

Again :

CVS syntax
lab013[root]:/> cvs Usage: cvs [cvs-options] command [command-options-and-arguments] where cvs-options are -q, -n, etc. (specify --help-options for a list of options) where command is add, admin, etc. (specify --help-commands for a list of commands or --help-synonyms for a list of command synonyms) where command-options-and-arguments depend on the specific command (specify -H followed by a command name for command-specific help) Specify --help to receive this message CVS commands are: add Add a new file/directory to the repository admin Administration front end for rcs annotate Show last revision where each line was modified checkout Checkout sources for editing commit Check files into the repository diff Show differences between revisions edit Get ready to edit a watched file editors See who is editing a watched file export Export sources from CVS, similar to checkout history Show repository access history import Import sources into CVS, using vendor branches init Create a CVS repository if it doesn't exist log Print out history information for files login Prompt for password for authenticating server logout Removes entry in .cvspass for remote repository pserver Password server mode rannotate Show last revision where each line of module was modified rdiff Create 'patch' format diffs between releases release Indicate that a Module is no longer in use remove Remove an entry from the repository rlog Print out history information for a module rtag Add a symbolic tag to a module server Server mode status Display status information on checked out files tag Add a symbolic tag to checked out version of files unedit Undo an edit command update Bring work tree in sync with repository version Show current CVS version(s) watch Set watches watchers See who is watching a file (Specify the --help option for a list of other help options) lab013[root]:/home/david> cvs --help-options CVS global options (specified before the command name) are: -H Displays usage information for command. -Q Cause CVS to be really quiet. -q Cause CVS to be somewhat quiet. -r Make checked-out files read-only. -w Make checked-out files read-write (default). -n Do not execute anything that will change the disk. -t Show trace of program execution -- try with -n. -v CVS version and copyright. -T tmpdir Use 'tmpdir' for temporary files. -e editor Use 'editor' for editing log information. -d CVS_root Overrides $CVSROOT as the root of the CVS tree. -f Do not use the ~/.cvsrc file. -z # Use compression level '#' for net traffic. -a Authenticate all net traffic. -s VAR=VAL Set CVS user variable. (Specify the --help option for a list of other help options)
Our CVS

lab013[root]:/> cvs -v Concurrent Versions System (CVS) 1.11.5 (client/server) Copyright (c) 1989-2002 Brian Berliner, david d "zoo" zuhn, Jeff Polk, and other authors CVS may be copied only under the terms of the GNU General Public License, a copy of which can be found with the CVS distribution kit. Specify the --help option for further information about CVS
How to move a CVS repository

To move a cvs repository the basic process is to tar it up, transfer it to its new location, then untar preserving permissions.
To tar up the repository, from the cvsreps parent directory:

tar -zcf mycvsrep.tar.gz cvsrep/
What the options mean: z means compress (with gzip), c means create a new archive, and f means use the filename specified on the command line.
Then transfer the file, then extract with permissions preserved:
tar -zxpf myarchive.tar.gz
What the options mean: z means uncompress (with gzip), x means extract from the archive, p means preserve permissions and again f means use the file specified on the command line.

url

How to move CVS without losing history

Create a new repository
  1. create a new "Standard Journaled File System"
    System Storage Management + File Systems + Add / Change / Show / Delete File Systems + Journaled File Systems + Add a Journaled File System + Add a Standard Journaled File System + rootvg. Size := 917504 (512-byte blocks), mount /usr/local/repospro
    Verify new Logical Volume has been created and note the name, as "lv06"
  2. mount first time
    lab013[root]:/home/user> mount /dev/lv06 /usr/local/repospro
  3. verify
    lab013[root]:/home/user> df -k Filesystem 1024-blocks Free %Used Iused %Iused Mounted on /dev/lv06 458752 444308 4% 17 1% /usr/local/repospro
  4. change specs
    lab013[root]:/> smitty -> create group gbpr lab013[root]:/> chmod g+srwx /usr/local/repospro lab013[root]:/> chgrp -R gbpr /usr/local/repospro lab013[root]: > chown -R cadanl /usr/local/repospro lab013[root]:/> cvs -d /usr/local/repospro init
  5. modify /etc/inetd.conf to contain:
    cvspserver2 stream tcp nowait root /usr/local/bin/cvs cvs --allow-root=/usr/local/repospro pserver
  6. also /etc/services to contain:
    cvspserver2 2402/tcp # repospro port cvspserver2 2402/ucp # repospro port
  7. restart daemon
    bcnlab013[root]:/etc>refresh -s inetd 0513-095 The request for subsystem refresh was completed successfully.
  8. verify
    bcnlab013[root]:/etc>cvs -d /usr/local/repospro version Concurrent Versions System (CVS) 1.11.5 (client/server)
  9. try to access from Eclipse
    1. start Eclipse
    2. open perspective "CVS Repository Exploring"
    3. "New" repository location
    4. Host := "99.137.166.136" ;
    5. Path to repository = "/usr/local/repospro" ;
    6. usr/pwd
    7. connection type := pserver ;
    8. port := 2402 ;
CVS pointers

Homepage. Savannah, Help Mailing Lists.

Bon llibre : Open Source Development with CVS. PDF.

Cheat Sheet (Luis) HTML de PS. On Line (varis formats).

Resum.

One sheet pdf

Manual 1.12.13, 1.11.23 FAQs.

How To, Simple howtos.

CVS Problem
Assertion failed: ptr >= rcsbuf_buffer && ptr < rcsbuf_buffer + rcsbuf_buffer_size, file rcs.c, line 1095 cvs [server aborted]: received abort signal

Solution :

# Replace corrupt file with latest working backup cvs update -r 1.65 -p pnp.tex > pnp.tex # Delete garbage file from repository cvs admin -o 1.65:1.67 pnp.tex # Method 1: Collapse everything between cvs admin -o 1.66 pnp.tex # Method 2: Delete a specific version # Delete garbage file from repository cvs update -r 1.53 -p prp_mri.tex > prp_mri.tex cvs admin -o 1.54 prp_mri.tex

Need to update CVS :

This has been reported a number of times and is already fixed in the current development version of CVS. The assertion itself is wrong: change the < to <= and recompile. -Larry Jones

url.

CVS troubleshooting

Errors along the lines of "connection refused" typically indicate that inetd isnt even listening for connections on port 2401 whereas errors like "connection reset by peer", "received broken pipe signal", "recv() from server: EOF", or "end of file from server" typically indicate that inetd is listening for connections but is unable to start CVS (this is frequently caused by having an incorrect path in 'inetd.conf' or by firewall software rejecting the connection). "unrecognized auth response" errors are caused by a bad command line in 'inetd.conf', typically an invalid option or forgetting to put the 'pserver' command at the end of the line. Another less common problem is invisible control characters that your editor "helpfully" added without you noticing. One good debugging tool is to "telnet servername 2401". After connecting, send any text (for example "foo" followed by return). If CVS is working correctly, it will respond with

cvs [pserver aborted]: bad auth protocol start: foo

If instead you get:

Usage: cvs [cvs-options] command [command-options-and-arguments]

then youre missing the pserver command at the end of the line in inetd.conf; check to make sure that the entire command is on one line and that its complete. Likewise, if you get something like:

Unknown command: `pserved' CVS commands are: add Add a new file/directory to the repository

then youve misspelled pserver in some way. If it isnt obvious, check for invisible control characters (particularly carriage returns) in 'inetd.conf'.
If it fails to work at all, then make sure inetd is working right. Change the invocation in 'inetd.conf' to run the echo program instead of cvs. For example:

2401 stream tcp nowait root /bin/echo echo hello

After making that change and instructing inetd to re-read its configuration file, "telnet servername 2401" should show you the text hello and then the server should close the connection. If this doesnt work, you need to fix it before you can worry about CVS problems.
On AIX systems, the system will often have its own program trying to use port 2401. This is AIXs problem in the sense that port 2401 is registered for use with CVS. I hear that there is an AIX patch available to address this problem.
Another good debugging tool is the '-d' (debugging) option to inetd. Consult your system documentation for more information.
If you seem to be connecting but get errors like:

cvs server: cannot open /root/.cvsignore: Permission denied cvs [server aborted]: can't chdir(/root): Permission denied

then you probably havent specified '-f' in inetd.conf.

url

CVS successors

Amunt! Top Amunt!
mksysb

This is the most important utility you should know. Only mksysb lets you recreate your root volume group. Actually, this command will only back up rootvg. Its purpose isnt to back up user data, but to create an installable image of the root volume group (rootvg). To reiterate, user data should be kept out of the rootvg. Its important to note that any user-defined paging spaces, unmounted filesystems and raw devices arent backed up in a mksysb, so they need to be recreated.

url

Why Create a mksysb?
The IBM AIX UNIX differs from other UNIXs because of two main features: the ODM (object database manager) and the LVM (logical volume manager). Due to the ODM and the LVM, as well as the ability to have multiple volume groups, a complete system archive made with cpio or tar will not restore properly. Attempting to restore such an archive on a running system can potentially crash the machine.

Un altre mètode : NIM.

Creating to a File

Creating a mksysb to a file will create a non-bootable, single-image backup and restore archive containing ONLY rootvg jfs mounted file systems.

url

Excluding files from mksysb

If you want to exclude certain files from the backup, create the /etc/exclude.rootvg file on the client and enter the patterns of file names that you do not want included in your system backup image.

url


Scoring
  1. Have you 2 years or more hands-on AIX Systems Administration experience (topics like: installation, users, networking, filesystems, LVM, devices, monitoring and backup)?
  2. Have you 2 years or more Linux Systems Administration experience (same topics)?
  3. Do you regularly use smitty for systems admin work?
  4. Do you use the WebSM tool for systems administration of AIX machines?
  5. Do you understand the hostname, IP address, gateway, domain and DNS server terms?
  6. Have you updated the firmware on pSeries or System p machines?
  7. Do you know the IBM website to download firmware updates?
  8. Do you know the AIX command to find out the AIX version, release and maintainance or technlogy level?
  9. Do you know the process to check if there are AIX fixes for your current maintenance level of AIX?
  10. Are you using the latest or latest but one AIX Maintance Level?
  11. Can you find a pSeries or System p Diagnostics CDROM?
  12. Do you update your firmware and AIX Level once every a year?
  13. Do you use the mksysb command to backup AIX operating systems?
  14. Can you describe the value of a service processor?
  15. How are virtual memory and paging space related?
  16. Do you take perfPMR and snap data before upgrading AIX or applications?
  17. Do you follow change control before making updates to production systems?
  18. Do you use NIM to install AIX?
  19. Do you use NIM to install other software?
  20. Do you use NIM to recover from failures?
  21. Do you perform performance monitoring and tuning?
Scoring Level Comments
1 to 5 none You are not ready for AIX Admin ; you need to drasically improve your skills and processes or buy in skills in on a permanant basis
6 to 8 Bronze Note the no answers and develop plans now to correct these gaps, fix the easy ones immediately and the others ASAP .
You are not ready for AIX Admin but could be a 2 to 3 months
9 to 11 Silver You are on the way; make a note of where the holes are and make plans to improve these
12 to 15 Gold Well done - you are ready to make good use of Virtualisation

url


Amunt! Top Amunt!
Dubtes

{repos}
Amunt! Top Amunt!
MQ/MB on AIX
MQ Server configuration on AIX
export MQSERVER='SYSTEM.ADMIN.SVRCONN/TCP/172.16.16.169(1414)' echo $MQSERVER
MQ/MB scripts on AIX
execute a command 1208 times
#!/bin/ksh typeset -i var=0 while (( var < 1208 )) do # echo $var amqsput AIX.DEV.FIX.ERROR.QL QMBIBMDEV < txt1 var=$var+1 done
list one Broker components

[\\mb\Eines_Shell_Java_Ant_Perl\listMB]

#!/bin/ksh clear echo "Please enter the broker name -- Valid Broker Names are :" mqsilist | grep Broker read brokerName return_stat=`mqsilist | grep "$brokerName" | grep -c -v "grep"` if [ $return_stat = 1 ] ; then for LCV2 in `mqsilist $brokerName | cut -d \- -f 1 | cut -d : -f 3` do echo " \tExecution groups : $LCV2" for LCV3 in `mqsilist $brokerName -e $LCV2 | cut -d : -f 3 ` do echo "\t\tMessage Flow : $LCV3" done done else echo "BrokerName incorrect OR Broker does not exist :" $brokerName fi

MQ trace AIX Files

RPM install on AIX 4.3 (without RPM)
http://rpm.org/releases/historical/rpm-3.0.x/ or ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/INSTALLP/ppc/ installp -qaXgd rpm.rte rpm.rte ftp t42 rpm.rte.3.0.5.20 mv rpm.rte.3.0.5.20 rpm.rte installp -qaXgd rpm.rte rpm.rte

url


Amunt! Top Amunt!
SSH on AIX
  1. Insert the AIX toolbox for Linux applications for POWER Systems CD-ROM media into the CD-ROM drive.
  2. Enter the following command as the root user:
    # mount -v cdrfs -o ro /dev/cd0 /mnt # cd /mnt/RPMS/ppc # ls -l openssl* openssl-0.9.6b-2.aix4.3.ppc.rpm openssl-devel-0.9.6b-2.aix4.3.ppc.rpm openssl-doc-0.9.6b-2.aix4.3.ppc.rpm # rpm -Uvh openssl-0.9.6b-1.aix4.3.ppc.rpm # rpm -Uvh openssl-0.9.7g-1.aix5.1.ppc.rpm openssl ##################################################

    The two packages openssl-devel and openssl-doc, are not mandatory packages for using OpenSSH on AIX. These are development tools and documentation for OpenSSH.

  3. If the package is correctly installed, you can verify the installation status using either of the following commands:
    # lslpp -L | grep openssl openssl 0.9.6b C R Secure Sockets Layer and # rpm -q openssl openssl-0.9.6b-2
    Note: The OpenSSH packages are also available at the following site: opensource
  4. Unmount the /mnt filesystem and eject the CD-ROM media:
    # cd / # umount /mnt

Managing AIX Server farms redbook

OpenSSH is now bundled with AIX - installation, images publib

Instalacio
# cd /mnt/RPMS/ppc/ # rpm -Uvh wget-1.9.1-1ssl.aix5.1.ppc.rpm wget ################################################## # # wget http://mirror.cdmon.com/pub/OpenBSD/OpenSSH/portable/openssh-6.1p1.tar.gz # rpm -Uvh zlib-1.2.2-4.aix5.1.ppc.rpm zlib ################################################## # rpm -Uvh zlib-devel-1.2.2-4.aix5.1.ppc.rpm zlib-devel ################################################## # gunzip openssh-6.1p1.tar.gz # tar -xvf openssh-6.1p1.tar # cd /tmp/openssh/openssh-6.1p1 # ./configure checking for gcc... gcc checking for zlib.h... no configure: error: *** zlib.h missing - please install first or check config.log *** # ./configure --without-zlib-version-check checking OpenSSL header version... not found configure: error: OpenSSL version header not found. {requires libopenssl-devel and zlib-devel package} # ./configure --without-zlib-version-check --disable-crypto configure: WARNING: unrecognized options: --disable-crypto OpenSSH has been configured with the following options: User binaries: /usr/local/bin System binaries: /usr/local/sbin Configuration files: /usr/local/etc Askpass program: /usr/local/libexec/ssh-askpass # ./configure --with-ssl-headers=/usr/local/ssl/include/ --with-ssl-lib=/usr/local/ssl/lib/ # make # make install mkdir /usr/local/etc exec(): 0509-036 El programa ./ssh-keygen no es pot carregar a causa d'aquests errors: 0509-150 El mdul dependent libcrypto.a(libcrypto.so.0.9.7) no s'ha pogut carregar. 0509-022 El mdul libcrypto.a(libcrypto.so.0.9.7) no es pot carregar. 0509-026 Error del sistema: Un dels fitxers o dels directoris de la via d'accs no existeix. make: 1254-004 El codi d'error de la darrera ordre s 255.

After you download the OpenSSL package, you can install OpenSSL and OpenSSH.

Install the OpenSSL RPM package using the geninstall command: # geninstall -d/dev/cd0 R:openssl-0.9.7g Install the OpenSSH installp packages using the geninstall command: # geninstall -I"Y" -d/dev/cd0 I:openssh.base

The following OpenSSH binary files are installed as a result of the preceding procedure: scp, sftp, ssh (in /usr/local/bin/), sshd (in /usr/local/sbin/)

See sshd daemon in /etc/ssh/ directory. The sshd daemon is under AIX SRC control. You can start, stop, and view the status of the daemon by issuing the following commands:

url


Amunt! Top Amunt!
Tips and tricks

Unix tips.


Amunt! Top Amunt!
AIX healthcheck

Nice place


Amunt! Top Amunt!
{bestp}
Best practices

Amunt! Top Amunt!
Llibres

Amunt! Top Amunt!
AIX Command Crib Sheet
OS LEVEL : AIX DATE : 29/01/2001 VERSION : 1.8 >> Latest version can be found at http://www.mort.level5.net/johnr/howto/aix.txt << ---------------------------------------------------------------------------- MISCELLANEOUS ---------------------------------------------------------------------------- http://www.rs6000.ibm.com/cgi-bin/ds_form Web based man pages oslevel Returns operating system level whence (program) Returns full path of program whereis (program) Returms full path of program what (program) Displays identifying info from the executable like version number, when compiled. lslpp -L all list all installed software lslpp -L (program set name) Check if software installed lslpp -f Lists filesets vs packages lslpp -ha Lists installation history of filesets instfix -ik (fix number eg IX66617) Checks id fix is installed instfix -ik 4330-02_AIX_ML compress -c file.txt > file.Z Create a compressed file. uuencode (infile) (extract-file-name) > (output file) Converts a binary file to an ASCII file for transfer by modem or email uudecode (encoded file) Extracts a binary file from encoded file and calls it the extract-file-name examples :- uuencode maymap maymap > maymap.enc uuencode maymap.enc od -c /tmp Displays contents of the /tmp directory file ls -i Lists files with their inode numbers echo * Lists files, can be used if ls is corrupt/missing alog -o -t boot View the boot log chtz (timezone eg GMT0BST) Changes the timezone in /etc/environment file chlang (language eg En_GB) Changes the language in /etc/environment file ar -v -t (archive file) List contents of an archive ar -v -x (archive file) Extracts the archive ar -v -t /usr/lib/libC-r.a Lists contents of the libC_r.a library find /source -print | cpio -pdm /target Copying directories using cpio, creates /target/source directory. dump -nTv (binary executable) Displays the contents of an executable file dump -c Displays string information dump -o Displays object file headers dump -l Displays line numbers dump -s Displays the text section snap -ao /dev/rmt0 Create a snapshot onto tape snap -ad (directory) Create a snapshot into a named directory other than the default (/tmp/ibmsupt) /usr/dt/bin/dtconfig -d Disables desktop logins /usr/dt/bin/dtconfig -e Enables desktop logins /var/dt/Xpid PID of the dtlogin process -------------------------------------------------------------------------------- TERMINALS -------------------------------------------------------------------------------- tty displays what the tty/pty number of the terminal is. termdef reports the termtype setup in smit for the tty port that termdef is run on. chdev -l (device eg tty1) -a term=vt100 Sets tty to a vt100 terminal type penable tty0 adds getty line into /etc/inittab for tty0 and starts getty pdisable tty0 disables the getty line and disables getty penable / pdisable -a option is for all stty erase ^? Set backspace key for vt100 terminals stty erase ^H Set backspace key for wyse50 terminals lscons Displays the console device chcons -a login=enable (device eg /dev/tty1) Changes the console device Create ttys on ports 0 to 7 on adapter sa2 :- for i in 0 1 2 3 4 5 6 7 do mkdev -c tty1 -t tty -s rs232 -p sa2 -w$i -a login=enable -a term=vt100 done portmir -t /dev/tty0 Mirror current terminal onto /dev/tty0 portmir -o Turns off port mirroring -------------------------------------------------------------------------------- NETWORK -------------------------------------------------------------------------------- host (ip or hostname) Resolves a hostname / ip address hostname Displays hostname hostname (hostname) Sets the hostname until next reboot chdev -l (device name) -a hostname=(hostname) Changes hostname permanently chdev -l inet0 -a hostname=thomas ifconfig (device name) Displays network card settings ifconfig (device name) up Turns on network card ifconfig (device name) down Turns off network card ifconfig (device name) detach Removes the network card from the network interface list eg - "ifconfig en0 inet 194.35.52.1 netmask 255.255.255.0 up" ifconfig lo0 alias 195.60.60.1 Create alias ip address for loopback route (add/delete) (-net/-host) (destination) (gateway) Add/delete route, but does not update ODM database, so will be lost at reboot. eg - "route add -net 194.60.89.0 194.60.90.4" lsattr -EHl inet0 Displays routes set in ODM and hostname odmget -q "name=inet0" CuAt Displays routes set in ODM and hostname refresh -s inetd Refresh inetd after changes to inetd.conf kill -1 (inetd PID) Refresh inetd after changes to inted.conf netstat -i Displays interface statistics entstat -d (ethernet adapter eg en0) Displays ethernet statistics The ifconfig status shows only the TCPIP subsystem status and not the physical link. The entstat output shows you the RJ45 link status between the server and the switch port. arp -a Displays ip to mac address table from arp cache no -a Displays network options use -o to set individual options or -d to set individual options to default. no -o option=value (this value is reset at reboot) no -o "ipforwarding=1" traceroute (name or ipaddress) Displays all the hops from source to destination supplied. ping -R (name or ipaddress) Same as traceroute except repeats. -------------------------------------------------------------------------------- N.F.S. -------------------------------------------------------------------------------- exportfs Lists all exported filesystems exportfs -a Exports all fs's in /etc/exports file exportfs -u (filesystem) Un-exports a filesystem mknfs Configures and starts NFS services rmnfs Stops and un-configures NFS services mknfsexp -d /directory Creates an NFS export directory mknfsmnt Creates an NFS mount directory mount hostname:/filesystem /mount-point Mount an NFS filesystem nfso -a Display NFS Options nfso -o option=value Set an NFS Option nfso -o nfs_use_reserved_port=1 -------------------------------------------------------------------------------- BACKUPS -------------------------------------------------------------------------------- MKSYSB ------ mkszfile -f Creates /image.data file (4.x onwards) mkszfile -X Creates /fs.size file (3.x) mksysb (device eg /dev/rmt0) CPIO ARCHIVE ------------ find (filesystem) -print | cpio -ocv > (filename or device) eg find ./usr/ -print | cpio -ocv > /dev/rmt0 CPIO RESTORE ------------ cpio -ict < (filename or device) | more Lists archive cpio -icdv < (filename or device) cpio -icdv < (filename or device) ("files or directories to restore") eg cpio -icdv < /dev/rmt0 "tcpip/*" Restore directory and contents cpio -icdv < /dev/rmt0 "*resolve.conf" Restore a named file TAR ARCHIVE ----------- tar -cvf (filename or device) ("files or directories to archive") eg tar -cvf /dev/rmt0 "/usr/*" TAR RESTORE ----------- tar -tvf (filename or device) Lists archive tar -xvf (filename or device) Restore all tar -xvf (filename or device) ("files or directories to restore") use -p option for restoring with original permissions eg tar -xvf /dev/rmt0 "tcpip" Restore directory and contents tar -xvf /dev/rmt0 "tcpip/resolve.conf" Restore a named file AIX ARCHIVE ----------- find (filesystem) -print | backup -iqvf (filename or device) Backup by filename. eg find /usr/ -print | backup -iqvf /dev/rmt0 backup -(backup level 0 to 9) -f (filename or device) ("filesystem") Backup by inode. eg backup -0 -f /dev/rmt0 "/usr" -u option updates /etc/dumpdates file AIX RESTORE ----------- restore -qTvf (filename or device) Lists archive restore -qvxf (filename or device) Restores all restore -qvxf (filename or device) ("files or directories to restore") (use -d for restore directories) restore -qvxf /dev/rmt0.1 "./etc/passwd" Restore /etc/passwd file restore -s4 -qTvf /dev/rmt0.1 Lists contents of a mksysb tape BACKUPS ACROSS A NETWORK ------------------------ To run the backup on a local machine (cpio) and backup on the remote machine's (remhost) tape drive (/dev/rmt0) find /data -print | cpio -ocv | dd obs=32k | rsh remhost \ "dd ibs=32k obs=64k of=/dev/rmt0" To restore/read the backup (cpio) on the remote machine dd ibs=64k if=/dev/rmt0 | cpio -icvt To restore/read the backup (cpio) on the local machine from the remote machine's (remhost) tape drive (/dev/rmt0) rsh remhost "dd ibs=64k obs=32k if=/dev/rmt0" | dd ibs=32k \ | cpio -icvt To run the backup (cpio) on a remote machine (remhost) and backup to the local machines tape drive (/dev/rmt0) rsh remhost "find /data -print | cpio -icv | dd ibs=32k" \ | dd ibs=32k obs=64k of=/dev/rmt0 -------------------------------------------------------------------------------- Copying diskettes and tape -------------------------------------------------------------------------------- COPYING DISKETTES ----------------- dd if=/dev/fd0 of=(filename) bs=36b dd if=(filename) of=/dev/fd0 bs=36b conv=sync or flcopy COPYING TAPES ------------- dd if=/dev/rmt0 of=(filename) dd if=(filename) of=/dev/rmt0 or tcopy -------------------------------------------------------------------------------- VI Commands -------------------------------------------------------------------------------- :g/xxx/s//yyy/ global change where xxx is to be changed by yyy sed 's(ctrl v ctrl m)g//g' old.filename > new.filename Strips out ^M characters from ascii files that have been transferred as binary. To enter crontrol characters type ctrl v then ctrl ? where ? is whatever ctrl character you need. -------------------------------------------------------------------------------- DEVICES -------------------------------------------------------------------------------- lscfg lists all installed devices lscfg -v lists all installed devices in detail lscfg -vl (device name) lists device details bootinfo -b reports last device the system booted from bootinfo -k reports keyswitch position - 1=secure, 2=service, 3=normal bootinfo -r reports amount of memory (/ by 1024) bootinfo -s (disk device) reports size of disk drive bootinfo -T reports type of machine ie rspc lsattr -El sys0 -a realmem reports amount of useable memory mknod (device) c (major no) (minor no) creates a /dev/ device file. mknod /dev/null1 c 2 3 lsdev -C lists all customised devices ie installed lsdev -P lists all pre-defined devices ie supported lsdev -(C or P) -c (class) -t (type) -s (subtype) chdev -l (device) -a (attribute)=(new value) change a device attribute chdev -l sys0 -a maxuproc=80 lsattr -EH -l (device) -D Lists the defaults in the pre-defined db lsattr -EH -l sys0 -a modelname rmdev -l (device) Change device state from available to defined rmdev -l (device) -d Delete the device rmdev -l (device) -SR S stops device, R unconfigures child devices lsresource -l (device) Displays bus resource attributes of a device. Power Management (PCI machines) ------------------------------- pmctrl -a Displays the Power Management state rmdev -l pmc0 Unconfigure Power Management mkdev -l pmc0 Configure Power Management -------------------------------------------------------------------------------- TAPE DRIVES -------------------------------------------------------------------------------- rmt0.x where x = A + B + C A = density 0 = high 4 = low B = retension 0 = no 2 = yes C = rewind 0 = no 1 = yes tctl -f (tape device) fsf (No) Skips forward (No) tape markers tctl -f (tape device) bsf (No) Skips back (No) tape markers tctl -f (tape device) rewind Rewind the tape tctl -f (tape device) offline Eject the tape tctl -f (tape device) status Show status of tape drive chdev -l rmt0 -a block_size=512 changes block size to 512 bytes (4mm = 1024, 8mm = variable but 1024 recommended) bootinfo -e answer of 1 = machine can boot from a tape drive answer of 0 = machine CANNOT boot from tape drive diag -c -d (tape device) Hardware reset a tape drive. tapechk (No of files) Checks Number of files on tape. < /dev/rmt0 Rewinds the tape !!! -------------------------------------------------------------------------------- PRINTERS / PRINT QUEUES -------------------------------------------------------------------------------- splp (device) Displays/changes printer driver settings splp /dev/lp0 export $LPDEST="pqname" Set default printer queue for login session lsvirprt Lists/changes virtual printer attributes. rmvirprt -q queuename -d queuedevice Removes a virtual printer qpri -#(job No) -a(new priority) Change a queue job priority. qhld -#(job No) Put a hold on hold qhld -r #(job No) Release a held job qchk -A Status of jobs in queues lpstat lpstat -p(queue) Status of jobs in a named queue qcan -x (job No) Cancel a job from a queue cancel (job No) enq -U -P(queue) Enable a queue enable (queue) enq -D -P(queue) Disable a queue disable (queue) qmov -m(new queue) -#(job No) Move a job to another queue startsrc -s qdaemon Start qdaemon sub-system lssrc -s qdaemon List status of qdaemon sub-system stop -s qdaemon Stop qdaemon sub-system -------------------------------------------------------------------------------- FILE SYSTEMS -------------------------------------------------------------------------------- Physical Volumes (PV's) ----------------------- lspv Lists all physical volumes (hard disks) lspv (pv) Lists the physical volume details lspv -l (pv) Lists the logical volumes on the physical volume lspv -p (pv) Lists the physical partition usage for that PV chdev -l (pv) -a pv=yes Makes a new hdisk a physical volume. chpv -v r (pv) Removes a disk from the system. chpv -v a (pv) Adds the removed disk back into the system. chpv -a y (pv) Changes pv allocatable state to YES chpv -a n (pv) Changes pv allocatable state to NO migratepv (old pv) (new pv) Moves all LV's from one PV to another PV, both PV's must be in the same volume group. Volume Groups (VG's) -------------------- lsvg Lists all volume groups lsvg (vg) Lists the volume group details lsvg -l (vg) Lists all logical volumes in the volume group lsvg -p (vg) Lists all physical volumes in the volume group lsvg -o Lists all varied on volume groups varyonvg (vg) Vary On a volume group varyonvg -f (vg) Forces the varyon process varyonvg -s (vg) Vary on a VG in maintenance mode. LV commands can be used on VG, but LV,s cannot be opened for I/O. varyoffvg (vg) Vary Off a volume group synclvodm (vg) Tries to resync VGDA, LV control blocks and ODM. mkvg -y(vg) -s(PP size) (pv) Create a volume group mkvg -y datavg -s 4 hdisk1 reducevg -d (vg) (pv) Removes a volume group reducevg (vg) (PVID) Removes the PVID disk reference from the VGDA when a disk has vanished without the reducevg (vg) (pv) command first. extendvg (vg) (new pv) Adds another PV into a VG. exportvg (vg) Exports the volume group eg deletes it! Note : Cannot export a VG if it has active paging space, turn off paging, reboot before exporting VG. Exporting removes entries from filesystems file but does not remove the mount points. chvg -a y (vg) Auto Vary On a volume group at system start. lqueryvg -Atp (pv) Details volume group info for the hard disk. importvg -y (vg name) (pv) Import a volume group from a disk. importvg (pv) Same as above but VG will be called vg00 etc. chvg -Q (y/n) (vg name) Turns on/off Quorum checking on a vg. Logical Volumes (LV's) ---------------------- lslv (lv) Lists the logical volume details lslv -l (lv) Lists the physical volume which the LV is on mklv (vg) (No of PP's) (pv Name optional) Create a logical volume mklv -y (lv) (PP's) (pv name optional) Creates a named logical volume chlv -n (new lv) (old lv) Rename a logical volume extendlv (lv) (extra No of PP's) Increase the size of an LV rmlv (lv) Remove a logical volume mklv/extendlv -a = PP alocation policy -am = middle -ac = center -ae = edge -aie = inner edge -aim = inner middle migratepv -l (lv) (old pv) (new pv) Move a logical volume between physical volumes. Both physical volumes must be in the same volume group ! mklv -y (lv) -t jfslog (vg) (No of PP's) (pv Name optional) Creates a JFSlog logical volume. logform (/dev/lv) Initialises an LV for use as an JFSlog getlvcb -AT (lv) Displays Logical Volume Control Block information File Systems (FS's) ------------------- lsfs Lists all filesystems lsfs -q (fs) Lists the file system details mount Lists all the mounted filesystems mount (fs or lv) Mounts a named filesystem mount -a Mounts all filesystems mount all mount -r -v cdrfs /dev/cd0 /cdrom mounts cd0 drive over /cdrom crfs -v jfs -d(lv) -m(mount point) -A yes create a file system on the whole of the logical volume, adds entry into /etc/filesystems and create mount point directory if it does not exist. crfs -v jfs -g(vg) -m(mount point) -a size=(size of fs) -A yes create a logical volume on the volume group and create the file system on the logical volume. Add entry into /etc/filesystems and create the mount point directory if it does not exist. chfs -A yes (fs) Change file system to Auto Mount in /etc/filesystems chfs -a size=(new fs size)(fs) Change file system size rmfs (fs) Removes the file system and will also remove the LV if there are no onther file systems on it. defrag -q (fs) Reports the fragment status of the file system. defragfs -r (fs) Runs in report only defrag mode (no action). defragfs (fs) Defragments a file system. fsck (fs) Verify a file system, the file system must be unmounted! fsck (-y or -n) (fs) Pre-answer questions either yes or no ! fsck -p (fs) Will restore primary superblock from backup copy if the superblock is corrupt. Mirroring --------- mklv -y (lv) -c(copies 2 or 3) (vg) (No of PP's) (PV Name optional) Creates a mirrored named logical volume. mklvcopy -s n (lv) (copies 2 or 3) (pv) Creates a copy of a logical volume onto another physical volume. The physical volume MUST be in the same volume group as the orginal logical volume ! rmlvcopy (lv) (copies 1 or 2) Removes logical volume copies. rmlvcopy (lv) (copies 1 or 2) (pv) From this pv only! syncvg -p (pv) Synchronize logical partion copies syncvg -l (lv) syncvg -v (vg) mirrorvg (vg) (pv) Mirrors the all the logical volumes in a volume group onto a new physical volume. New physical volume must already be part of the volume group. -------------------------------------------------------------------------------- BOOT LOGICAL VOLUME (BLV) -------------------------------------------------------------------------------- bootlist -m (normal or service) -o displays bootlist bootlist -m (normal or service) (list of devices) change bootlist bootinfo -b Identifies the bootable disk bootinfo -t Specifies type of boot bosboot -a -d (/dev/pv) Creates a complete boot image on a physical volume. mkboot -c -d (/dev/pv) Zero's out the boot records on the physical volume. savebase -d (/dev/pv) Saves customised ODM info onto the boot device. -------------------------------------------------------------------------------- SYSTEM DUMP -------------------------------------------------------------------------------- sysdumpdev -l Lists current dump destination. sysdumpdev -e Estimates dumpsize of the current system in bytes. sysdumpdev -L Displays information about the previous dump. sysdumpstart -p Starts a dump and writes to the primary dump device. sysdumpstart -s Starts a dump and writes to the secondary dump device. (MCA machine can also dump if key is in service position and the reset button is pressed) sysdumpdev -p (dump device) -P Sets the default dump device, permanently Analyse dump file :- echo "stat\n status\n t -m" | crash /var/adm/ras/vmcore.0 -------------------------------------------------------------------------------- PAGING SPACE (PS's) -------------------------------------------------------------------------------- lsps -a Lists out all paging space lsps -s Displays total paging and total useage lsps (ps) mkps -s(No of 4M blocks) -n -a (vg) mkps -s(No of 4M blocks) -n -a (vg) (pv) -n = don't activate/swapon now -a = activate/swapon at reboot chps -a n (ps) Turns off paging space. chps -s(No of 4M blocks) (ps) Increases paging space. chlv -n (new name) (old name) Change paging space name rmps (ps) Remove paging space. PS must have been turned off and then the system rebooted before it can be removed. Note : Need to change the swapon entry in /sbin/rc.boot script if you are changing the default paging space from /dev/hd6. You also need to do a "bosboot -a -d /dev/hdiskx" before the reboot. /etc/swapspaces File that lists all paging space devices that are activated/swapon during reboot. -------------------------------------------------------------------------------- SCHEDULING -------------------------------------------------------------------------------- crontab -l List out crontab entrys crontab -e Edit crontab entrys crontab -l > (filename) Output crontab entrys to a file crontab (filename) Enter a crontab from a file crontab -r Removes all crontab entrys crontab -v Displays crontab submission time. /var/adm/cron/cron.allow File containing users allowed crontab use. /var/adm/cron/cron.deny File containing users denied crontab use. /var/adm/cron/crontab Directory containing users crontab entries. at (now + 2 minutes, 13:05, etc) {return} Schedule a job using at Command or schell script {return} {CTRL D} at -l atq Lists out jobs scheduled to run via at command at -r (at job No) atrm (at job No) Removes an at job scheduled to run. /var/adm/cron/at.allow File containing users allowed at use. /var/adm/cron/at.deny File containing users denied at use. /var/adm/cron/atjobs Directory containing users at entries. -------------------------------------------------------------------------------- SECURITY -------------------------------------------------------------------------------- groups Lists out the groups that the user is a member of setgroups Shows user and process groups chmod abcd (filename) Changes files/directory permissions Where a is (4 SUID) + (2 SGID) + (1 SVTX) b is (4 read) + (2 write) + (1 execute) permissions for owner c is (4 read) + (2 write) + (1 execute) permissions for group d is (4 read) + (2 write) + (1 execute) permissions for others -rwxrwxrwx -rwxrwxrwx -rwxrwxrwx ||| ||| ||| - - - | | | Owner Group Others -rwSrwxrwx = SUID -rwxrwSrwx = SGID drwxrwxrwt = SVTX chown (new owner) (filename) Changes file/directory owners chgrp (new group) (filename) Changes file/directory groups chown (new owner).(new group) (filename) Do both !!! umask Displays umask settings umask abc Changes users umask settings where ( 7 - a = new file read permissions) ( 7 - b = new file write permissions) ( 7 - c = new file execute permissions) eg umask 022 = new file permissions of 755 = read write and execute for owner read ----- and execute for group read ----- and execute for other mrgpwd > file.txt Creates a standard password file in file.txt passwd Change current user password pwdadm (username) Change a users password pwdck -t ALL Verifies the correctness of local authentication lsgroup ALL Lists all groups on the system mkgroup (new group) Creates a group chgroup (attribute) (group) Change a group attribute rmgroup (group) Removes a group -------------------------------------------------------------------------------- USERS -------------------------------------------------------------------------------- passwd -f Change current users gecos (user description) passwd -s Change current users shell chfn (username) Changes users gecos chsh (username) (shell) Changes users shell env Displays values of environment variables printenv id Displays current user's uid and gid details id (user) Displays user uid and gid details whoami Displays current user details who am i (or who -m) who Displays details of all users currently logged in. w who -b Displays system reboot time uptime Displays number of users logged in, time since last reboot, and the machine load averages. lslicense Displays number of current user licensese chlicense -u (number) Changes the number of user licenses lsuser ALL Lists all users details lsuser (username) Lists details for user {*** Santi @ BPA ***} lsuser -a(attribute) (username or ALL) Lists user attributes lsuser -a home ALL mkuser -a(attributes) (newuser) Add a new user chuser (attributes) (user) Change a user chuser login=false (user) Lock a user account rmuser -p (user) Removes a user and all entries in security files usrck -t ALL Checks all the user entires are okay. fuser -u (logical volume) Displays processes using the files in that LV lsattr -D -l sys0 -a maxuproc Displays max number of processes per user chdev -l sys0 -a maxuproc=(number) Changes max number of processes per user -------------------------------------------------------------------------------- REMOTE USERS -------------------------------------------------------------------------------- ruser -a -f (user) Adds entry into /etc/ftpusers file ruser -a -p (host) Adds entry into /etc/host.lpd file ruser -a -r (host) Adds entry into /etc/hosts.equiv file ruser -d -f (user) Deletes entry in /etc/ftpusers file ruser -d -p (host) Deletes entry in /etc/host.lpd file ruser -d -r (host) Deletes entry in /etc/hosts.equiv file ruser -s -F Shows all entries in /etc/ftpusers file ruser -s -P Shows all entries in /etc/host.lpd file ruser -s -R Shows all entries in /etc/hosts.equiv file ruser -X -F Deletes all entries in /etc/ftpusers file ruser -X -P Deletes all entries in /etc/host.lpd file ruser -X -R Deletes all entries in /etc/hosts.equiv file -------------------------------------------------------------------------------- INITTAB -------------------------------------------------------------------------------- telinit S Switches to single user mode. telinit 2 Switches to multi user mode. telinit q Re-examines /etc/inittab lsitab -a Lists all entries in inittab lsitab (ident eg tty1) Lists the tty1 entry in inittab mkitab ("details") Creates a new inittab entry chitab ("details") Ammends an existing inittab entry rmitab (ident eg tty1) Removes an inittab entry. chitab "tty1:2:respawn:/usr/bin/getty /dev/tty1" -------------------------------------------------------------------------------- ODM -------------------------------------------------------------------------------- odmget -q "name=lp1" CuDv |more Gets lp1 info from pre-defined database. odmget -q "name-lp1" CuAt |more Gets lp1 info from customised database. odmdelete -o CuAt -q "name=lp1" Deletes lp1 info from customised db. odmget -q "name=lp1" CuAt > lp1.CuAt Export ODM info to text file. odmadd < lp1.CuAt Import ODM info from text file. -------------------------------------------------------------------------------- ERROR LOGGING -------------------------------------------------------------------------------- /usr/lib/errdemon -l Displays errorlog attributes. /usr/lib/errdemon Starts error logging. /usr/lib/errstop Stops error logging. errpt Displays summary errorlog report. errpt -a Displays detailed errorlog report. errpt -j (identifier) Displays singe errorlog report. Note : errorlog classes are H=Hardware S=Software O=Information V=Undetermined errclear (days) Deletes all error classes in the errorlog : "errclear 0" = all ; "errclear 3" = delete entries older than 3 days errclear -d (class) (days) Deletes all error class entries in errlog. Note : The errclear command will delete all entries older than the numbers of days specified in the days paramenter. To delete ALL entries used 0. errlogger "message up to 230 chrs" Enters an operator notifaction message into the errorlog. -------------------------------------------------------------------------------- PERFORMANCE MONITORING -------------------------------------------------------------------------------- vmstat (drive) (interval) (count) Reports virtual memory statistics. vmstat hdisk0 5 20 vmstat -s Diplays number of paging events since system start. vmstat -f Diplays number of forks since system start. vmstat -i Diplays number of interupts by device since system start. iostat (drive) (interval) (count) Reports i/o and cpu statistics. iostat hdisk0 5 20 iostat -d (drive) (interval) (count) Limits report to drive statistics. iostat -t (interval) (count) Limits report to tty statistics. sar -u -P ALL 10 10 Displays %usr %sys %wio %idle for all processors -------------------------------------------------------------------------------- DOS DISKETTES -------------------------------------------------------------------------------- dosdir Reads directory listing of a diskette dosdir (directory) Reads directory listing of a named directory dosread -D/dev/fd0 C41.TXT c41.txt Gets C41.TXT from diskette drive fd0 dosread -D/dev/fd0 DIRECTORY/C41.TXT c41.txt (-D option can be dropped if using fd0) doswrite -D/dev/fd0 (unixfile) (dosfile) Writes a file to diskette dosdel (dosfile) Deletes a dos file on diskette dosformat Formats the diskette -------------------------------------------------------------------------------- SENDMAIL -------------------------------------------------------------------------------- sendmail -bi Creates new aliase db from /etc/aliase file. newaliases sendmail -bp Displays the contents of the mail queue mailq sendmail -q Processe the sendmail queue NOW sendmail -bt -d0.4 < /dev/null Prints out sendmail version, compile defines and system information refresh -s sendmail Restart sendmail kill -l (sendmail PID) -------------------------------------------------------------------------------- SP / PSSP -------------------------------------------------------------------------------- dsh (command) Runs the command on all the nodes Efence Diplays which node are currently fenced Efence (node number) Fences the node Eunfence (node number) Unfences the node Estart Starts the switch spmon -q Starts SP monitor in gui spmon -d -G Diag info, lists LED and switch info for all nodes spmon -L frame1/node3 Displays LED for node 3 in frame 1 spmon -p off frame1/node3 Powers off the node spmon -p on frame1/node3 Powers on the node spled Diplays all the nodes LED's in a updating gui s1term -w (frame number) (node number) Opens serial terminal (read and write) s1term (frame number) (node number) Opens serial terminal (read only) Example :- s1term 1 1 Opens a serial terminal to console port on frame 1 node 1 which is read only. When rebooting a node use read only. splstdata -e Lists site environment database information -d Displays df command from each node -n Lists node configuration -h Diplays lscfg command from each node -s Lists switch node information -b Lists boot/installation information -a Lists LAN database information -i Displays netstat -in command from each node

url

Another (nice) resum : Sys Admin Pocket Survival Guide - AIX.


Amunt! Top Amunt!
Pending

Amunt! Top Amunt!
URLs

Ep ! Valid HTML 4.01!   Valid CSS! Escriu-me !
Updated 20140115 (a)  
Uf !