Visualizzazione post con etichetta aix. Mostra tutti i post
Visualizzazione post con etichetta aix. Mostra tutti i post

venerdì 19 febbraio 2010

dmesg è sacro

Quando mi loggo su una macchina Unix, io DEVO digitare "dmesg". E' più forte di me. Ognuno ha i suoi riti, lancia ksh -o vi, da invio $random volte alternato al comando cd ...
Io digito dmesg e do invio. Su Linux, su Solaris ...

Su Aix non c'è!
E non c'è alog -o -t boot o errpt -a che tenga.
Per questo sono arrivato a farmelo da me:

root@localhost / #which dmesg
/usr/bin/dmesg
root@localhost / #file /usr/bin/dmesg
/usr/bin/dmesg: shell script
root@localhost / #cat /usr/bin/dmesg
#!/usr/bin/bash

cat /var/adm/messages
root@localhost / #dmesg
Jan 14 17:18:25 localhost user:warn|warning root: sdjskdjkjdkjkwejk
Jan 14 17:19:11 localhost auth|security:crit reboot: rebooted by root
Jan 14 17:19:12 localhost syslog:err|error syslogd: going down on signal 15
Jan 14 17:19:13 localhost mail:crit sendmail[225452]: My unqualified host name (loopback) unknown; sleeping for retry
Jan 14 17:26:01 localhost mail:crit sendmail[184410]: My unqualified host name (loopback) unknown; sleeping for retry
Jan 14 17:27:01 localhost mail:alert sendmail[184410]: unable to qualify my own domain name (loopback) -- using short name
Jan 14 17:35:56 localhost syslog:info syslogd: restart
Jan 15 00:50:10 localhost user:notice syslog: set by root
Jan 15 00:51:08 localhost user:notice last message repeated 4 times
Jan 15 00:52:27 localhost syslog:info syslogd: restart
Jan 15 01:08:40 localhost auth|security:crit halt: halted by root
Jan 15 01:08:40 localhost syslog:err|error syslogd: going down on signal 15
Jan 15 08:08:40 localhost syslog:info syslogd: restart
Jan 15 08:08:41 localhost mail:crit sendmail[184422]: My unqualified host name (loopback) unknown; sleeping for retry
Jan 15 08:08:41 localhost daemon:notice RMCdaemon[274650]: (Recorded using libct_ffdc.a cv 2):::Error ID: 6eKora0tF/I9/atf.S6.e.1...................:::Referen
ce ID: :::Template ID: a6df45aa:::Details File: :::Location: RSCT,rmcd.c,1.56,213 :::RMCD_INFO_0_ST The daemon is started.
Jan 15 08:08:45 localhost auth|security:notice su: from root to pconsole at /dev/tty??
Jan 16 03:14:33 localhost syslog:info syslogd: restart
Jan 16 03:14:35 localhost mail:crit sendmail[184410]: My unqualified host name (loopback) unknown; sleeping for retry
Jan 16 03:14:37 localhost user:info syslog: /usr/sbin/ifconfig -l
Jan 16 03:14:43 localhost daemon:notice RMCdaemon[213212]: (Recorded using libct_ffdc.a cv 2):::Error ID: 6eKora0H2GI9/npg/S6.e.1...................:::Referen
ce ID: :::Template ID: a6df45aa:::Details File: :::Location: RSCT,rmcd.c,1.56,213 :::RMCD_INFO_0_ST The daemon is started.
Jan 16 03:14:52 localhost auth|security:notice su: from root to pconsole at /dev/tty??
Jan 16 03:15:35 localhost mail:alert sendmail[184410]: unable to qualify my own domain name (loopback) -- using short name
Jan 16 03:15:35 localhost mail:info sendmail[184410]: starting daemon (AIX6.1/8.13.4): SMTP+queueing@00:30:00
Jan 16 03:17:22 localhost auth|security:info syslog: tty0: failed login attempt for alex
[ -- CUT -- ]

Ebbene si :)

Allo stesso modo pgrep:
root@localhost / #which pgrep
/usr/bin/pgrep
root@localhost / #file /usr/bin/pgrep
/usr/bin/pgrep: shell script
root@localhost / #cat /usr/bin/pgrep
#!/usr/bin/bash
# My Pgrep Work in Progress 0.1

if [ $1 = "-h" ];then
echo "Usage:\n";
echo "Useful options are f and N";
echo "ps options A and e are implicited";
echo "Es:\n";
echo "pgrep Nf blabla"
else
ps -Ae${1}|grep $2|awk '{print $1,$2,$8}'
fi

domenica 31 gennaio 2010

Aix LVM: il quorum

LVM utilizza un sistema di gestione dei VG che potrebbe essere paragonato alle repliche di SVM.
Potrebbe ... in realtà non è proprio così.
L'insieme di VGDA e VGSA di ogni disco (PV) determina la consistenza del VG.
Il quorum è fissato al 51% di VGDA funzionanti.

Queste aree vengono spartite tra i PV del VG in questo modo:
1 disco = 2 VGDA
2 dischi = 2 VGDA sul primo, 1 VGDA sul secondo
3 dischi = 1 VGDA per disco.

Il risultato di questa logica di suddivisione mi ha lasciato piuttosto "disappointed". In pratica per far stare in piedi un mirror, questo deve avere almeno tre dischi e/o essere three-ways.
Niente soluzioni, che parrebbero scontate, tipo 2 dischi in mirror. Così facendo, il guasto o la rimozione di un PV farebbe cadere il castello.
Il quorum è, comunque, disattivabile, quindi in realtà un mirror two-ways su due PV è fattibile.

venerdì 15 gennaio 2010

Mirroring rootvg su aix

Aggiungere hdisk1 al Volume Group:

# extendvg rootvg hdisk1

Dire a lvm di fare un mirror:

# mirrorvg rootvg
0516-1804 chvg: The quorum change takes effect immediately.
0516-1126 mirrorvg: rootvg successfully mirrored, user should perform
bosboot of system to initialize boot records. Then, user must modify
bootlist to include: hdisk0 hdisk1.

Aggiungere il nuovo disco a quelli bootabili:

# bootlist -m normal hdisk0 hdisk1

Installare il necessario per bootare il nuovo mirror:

# bosboot -ad hdisk0
# bosboot -ad hdisk1

Voila, les jeux sont faites:

#lspv
hdisk0 003639ba5bd2ab8f rootvg active
hdisk1 005fd68c35102992 rootvg active

Aix syslogd

Ottima questa pagina di SoftPanorama sul syslog daemon di Aix:

AIX syslogd implementation of SYSLOG has built-in log rotation capabilities that are specified with optional fields after the log destination:

facility-level destination rotate size s files n time t compress archive path

For example:

*.emerg;*.alert;*.crit;*.warning /var/adm/messages rotate files 4 time 7d compress

This is probably the most clean solution of the problem in comparison with Linux or Solaris solutions. As you can see in addition to rotation you can also specify compression

Strangely enough AIX does not provide any default syslog.conf at all. But for syslogd activation it needs to exist.

Visite