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

2 commenti:

Sainz ha detto...

w
sync

:D

Alessandro Torchia ha detto...

ma quelli per fortuna ci sono :)

Visite