Thursday, August 23, 2007

HP-UX: Processors

[ROOT abc24]usr/sam # /usr/sbin/diag/contrib/pdcinfo -no_banner | grep "CPU("
CPU(0)  PA8700 3.1
CPU(1)  PA8700 3.1
CPU(2)  PA8700 3.1
CPU(3)  PA8700 3.1
CPU(0)  PA8700 3.1
CPU(1)  PA8700 3.1
CPU(2)  PA8700 3.1
CPU(3)  PA8700 3.1
[ROOT abc24]/tmp # echo "selclass qualifier cpu;info;wait;infolog" | cstm > /tmp/cpuinfo

[ROOT abc24]/tmp # more cpuinfo | grep "CPU Slot Number"
CPU Number:                0            CPU Slot Number:          0
CPU Number:                1            CPU Slot Number:          1
CPU Number:                2            CPU Slot Number:          2
CPU Number:                3            CPU Slot Number:          3
CPU Number:                8            CPU Slot Number:          0
CPU Number:                9            CPU Slot Number:          1
CPU Number:                11           CPU Slot Number:          3
[ROOT abc24]var/sam # icod_stat -p

Version:                   4.0
Contract type:             iCOD-purchase
License applied:           yes

Hostname:                  abc24
DNS domain name:           abc24.def.hij.com
IP address:                12.34.56.78
NIS domain name:           .
System model:              9000/800/SD64000
Serial number:             XX123456XX
Software ID:               deadbeef

Contact name:              UNIX Support
Contact e-mail:            ux@gggi.com
Contact phone:             (12)3456-6777

Total processors:                              8
Active processors:                             7
Inactive processors that can be activated:     1
Inactive processors that cannot be activated:  0
Deconfigured processors:                       0
Requested active processors:                   7

Requested active processors specified for all partitions:

Requested
Active      Total
Processors  Processors  Partition
==========  ==========  =========
0           4           ux123 (par0)
7           8           Database abc24 (par1) (local)
4           4           App6 abc26 (par2)
2           4           QA App abc21 (par4)
n/a         0           Unassigned cells
---------------------------------------------------------
13 total requested active processors specified for complex
[ROOT abc24]var/sam #

PS: PA-8700 - single core CPU

read more...

Wednesday, August 22, 2007

Commandszz

One command looks like interesting, worth to look up for this:
pax - Extracts, writes, and lists archive files; copies files and directory hierarchies

Nothing here yet!

read more...

Tuesday, August 21, 2007

HP-UX, bdf, du and ...

If you ever encounter a file system full, say, at this particular partition:
[ROOT gitu2]Z24/X41 # uname -a
HP-UX gitu2 B.11.11 U 9000/800 170187401 unlimited-user license
[ROOT gitu2]Z24/X41 # bdf /usr/sap/Z24/X41
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol30 4620288 4610752 9038 100% /usr/sap/Z24/X41
[ROOT gitu2]Z24/X41#


and you have been trimming, deleting files like crazy, say, you've delete a 1.7G file but when you issue bdf, the utilization still at 100%. But when you checked with du, it shows the current utilization on that particular partition/directory has been reduced. WTF?!

Don't worry dude/dudette. Basically, there are some processes running that currently writing on some files on that directories and until those processes are stopped finishing writting you will not see the free space in bdf.

To identify the processes, run this:
[ROOT gitu2]Z24/X41 # fuser -cu /usr/sap/Z24/X41
/usr/sap/Z24/X41: 7314co(z24adm) 15790co(z24adm) 24426co(z24adm) 10374co(z24adm) 8094mcto(z24adm) 10514co(z24adm) 24418co(z24adm) 24433co(z24adm) 24458co(z24adm) 24432co(z24adm) 24446co(z24adm) 22457co(z24adm) 24385co(z24adm) 12656co(z24adm) 24444co(z24adm) 24439co(z24adm) 24442co(z24adm) 24451co(z24adm) 24438co(z24adm) 24386co(z24adm) 26313co(z24adm) 4756co(z24adm) 24428co(z24adm) 24435co(z24adm) 17512co(z24adm) 24459co(z24adm) 20846co(z24adm) 24431co(z24adm) 24460co(z24adm) 9184co(z24adm) 3585co(z24adm) 24440co(z24adm) 24448co(z24adm) 24417co(z24adm) 24430co(z24adm) 24443co(z24adm) 24338c(z24adm) 24441co(z24adm) 12555co(z24adm) 24461co(z24adm) 24434co(z24adm) 24436co(z24adm) 24445co(z24adm) 24429co(z24adm) 4539c(root) 24437co(z24adm) 11852co(z24adm) 24449co(z24adm) 24450co(z24adm) 26830co(z24adm) 28242c(root)

[ROOT gitu2]Z24/X41 #


Ah-ha! It will listed all the eeeviiilll processes. What you need to do is kill all those processes and voila!, you'll get your free space back.

** ACHTUNG **
Don't simply kill the processes until you pretty sure it is safe to kill with the owner of the processes (backup team, or whatever). Use j00r brain d00dz.
** ACHTUNG **

read more...

Thursday, August 16, 2007

Nifty...

Are you a Firefox fan? You might wanna try this: Roll Your Own Firefox™ Search Bar

I've added search to USENET Internet FAQs Archive. Really nifty, I like!

Free Image Hosting at www.ImageShack.us

read more...

Monday, August 13, 2007

Mari Tolak Beskal Session #1: FRIM "Dream Trail"

Yesterday my friend and I went to our first Bash (bike hash) at FRIM Dream Trail. Later lah full details.

Later lah, later. Sakit bontot+bahu lagi ni.

read more...

Lesson Learned

Spending on more that 13 hrs in the office last Saturday gave us some real good lessons.

Lesson Learned:
1. Never worked on a RemoteConsole using init 5.
2. When try to trigger a system crash (echo c > /proc/sysrq-trigger - to test kdump), do it on a RemoteConsole terminal.
3. Use "Alt-Lock" on RemoteConsole for ease of navigating installation GUI.

read more...

Friday, August 10, 2007

Linux "grep -A1 -B1" in HP-UX

cat syslog.*.gz | gzip -d - | sed -n -e '/regexp/{=;x;1!p;g;$!N;p;D;}' -e h

The cat syslog.*.gz | gzip -d - can also be replaced by using this command: gzcat < syslog.*.gz

read more...

HP-UX: kthread: table is full

If you ever encounter this error in dmesg or syslog.log
[root abc12]home/root # dmesg | tail
kthread: table is full
kthread: table is full
kthread: table is full
kthread: table is full
kthread: table is full
kthread: table is full
kthread: table is full
kthread: table is full
kthread: table is full
kthread: table is full
[root abc12]home/root #
[root abc12]home/root # cat /var/adm/syslog/syslog.log | grep kthread
Aug 9 21:37:12 abc12 vmunix: kthread: table is full
Aug 9 21:37:14 abc12 vmunix: kthread: table is full
Aug 10 14:07:18 abc12 vmunix: kthread: table is full
Aug 10 14:07:20 abc12 vmunix: kthread: table is full
[root abc12]home/root #


Then what you need to do is increase the maxusers kernel param in /stand/system

Steps:
1. Log in as root and edit/add maxusers 200 (16-way systems) or maxusers 400 (large 64-way systems i.e. SuperDome) in /stand/system

2. Run these commands:
mk_kernel -v -o /stand/vmunix
kmupdate
reboot -r


3. For God sake don't copy and paste the above commands, as the last command is reboot! Make sure you're safe/authorized to do a reboot before hitting the last command, or else, you're SuperDOOM.

To monitor the processes utilization, issue this command:
[root abc12]home/root # sar -v 1 5

HP-UX abc12 B.11.11 U 9000/800 08/10/07

17:58:07 text-sz ov proc-sz ov inod-sz ov file-sz ov
17:58:08 N/A N/A 172/664 0 1087/7360 0 1209/12018 0
17:58:09 N/A N/A 172/664 0 1087/7360 0 1209/12018 0
17:58:10 N/A N/A 172/664 0 1087/7360 0 1207/12018 0
17:58:11 N/A N/A 172/664 0 1087/7360 0 1207/12018 0
17:58:12 N/A N/A 172/664 0 1087/7360 0 1207/12018 0

[root abc12]home/root #


Look under proc-sz column, the 172/664 values represent the current number of processes (172) and the maximum number of processes (664).

To view the current value of maxusers:
[root abc12]home/root # cat /stand/system | grep maxusers
maxusers 200
[root abc12]home/root #


or

[root abc12]home/root # kmtune | sed q;kmtune | grep maxusers

Parameter             Current Dyn Planned                    Module     Version
maxusers 200 - 200

[root abc12]home/root #

*2nd option tu nampak cam terrer la sikit

If you wanna choose a less-headache version, use SAM. Don't know how to use SAM? Eat yourself.

read more...

Removing blank lines using grep

When you have something like this:
[root abcux]/tmp # cat lines.txt
line 1

line 3

line 4




line 9


line 10

#line 12


#line 15
line 16

[root abcux]/tmp #


but you want to exclude the blank lines and line starting with "#", do this...

[root abcux]/tmp # cat lines.txt | egrep -v "^#" | egrep -v "^$"
line 1
line 3
line 4
line 9
line 10
line 16
[root abcux]/tmp #


--- Update at 15:19
Another set of trick is to issue this command (thanks yoe!)
[root abcux]/tmp # cat lines.txt | egrep -v "^#" | egrep "."
line 1
line 3
line 4
line 9
line 10
line 16
[root abcux]/tmp #


Tadaa.

read more...

Thursday, August 9, 2007

UNIX God

Interesting story! Must read!!

read more...

Wednesday, August 8, 2007

Command History

Linux (BASH):
1. At the terminal, press CTRL+r and type in your command to search, i.e. vi (thanks yoe)

HP-UX (POSIX):
1. At the terminal, press ESC or > arrow and press k for up or j for down.
2. You can search your command history by pressing ESC key and / followed by your command and press ENTER.

Geddit?

read more...

Monday, August 6, 2007

HP-UX Stuffs

1. List installed HP-UX patches
swlist -l product 'PH??_*'

2. ioscan command hang/slow.
Check for zombie processes of ioscan, try to kill 'em (if you know how to kill a ghost), or kill PPID (make sure PPID != 1 !!)

read more...

Thursday, August 2, 2007

New toy

read more...

Wednesday, August 1, 2007

Human Stupidity

I rest my case.

read more...

File name completion in HP-UX

Since HP-UX using POSIX shell, the file name completion is different than Linux's.

To do a file name completion, simply press ESC and =
Example:
[ux]home/saya $ cd .s<ESC>=
1) .sh_history
2) .ssh/
[ux]home/saya $ cd .s


It will list down possible filename/directory available in the pwd. Note that a directory will have trailing char "/"

To find out which shell your using, simply type:
[ux]home/saya$ echo $SHELL
/sbin/sh
[ux]home/saya$


Pathname Shell
shBourne shell
cshC shell
tcshTC shell
kshKorn shell
bashBourne Again SHell


--- Update 22 August 2007
Boleh jugak wat camnih (ESC twice):
[ux]home/saya$ cat abc<ESC><ESC>
[ux]home/saya$ cat abcdef.txt
saya suka makan nasik
[ux]home/saya$

read more...

SSH weirdness

Since this is my first time encounter this type of SSH error, so it was weird.

abc123 % ssh def456
Secure connection to def456 refused; reverting to insecure method.
Using rsh. WARNING: Connection will not be encrypted.
Password:


I was like, wtf?

As usual, I asked Google and got some insights. Basically those error generated if you're trying to ssh to a Windows NT(?) or maybe the ssh daemon on the remote server is not running.

In my case, I found out that def456 was pointing to a different IP and my intelligent guess would be that IP belongs to a Winblows machine.

read more...