2014-01-12

ITM CEC Base agent issue

ITM CEC Base agent重啟後,ITM無法顯示CEC的數據,解決步驟如下:

STEPS TO RECYCLE THE SHARED MEMORY:
1.
Stop all the processes which use the SPMI shared library
(xmservd,filtd, xmperf, 3dmon, ptxrlog, harmd, topas, any PSSP process)
if they are currently running your AIX LPAR. 


2.
Stop the ITM system P agents (PX, PK, PH) that you have running on
this system. 


3.
To find if any zombie processes are running on your machine.
a. Run
# ps -ef | grep Provider
Kill each one of them "kill <pid> 


b. Run
ps -ef | grep kpkagent
ps -ef | grep kpxagent
ps -ef | grep kphagent
Kill each one of them "kill <pid>" 


c.
Check if there are any defunct processes
"ps -ef | grep defunct" 


4. Kill the processes that are using the shared memory. 
genld -l | grep -p Spmi 

5.
Run "ipcs -m" command and check for any segment "KEY" that begins
with '0x78'
, as listed below:
T ID KEY
m 0 0xc76283cc
m 1 0x78002323
If there are any such segments starting with 0x78, make sure the process
which uses those shared segments is stopped (or terminate it with kill
command) 


6. Then run: "ipcrm -m <ID #>" to
clear the shared memory segments. 

7.
Run "slibclean"

8. Restart system P agents - PH PX PK 


2013-10-03

Allocate memory by Perl

仿效Java先allocate memory的作法可試著用Perl來做實驗, 作法如下:

#!/usr/bin/perl -w

for (0..10){
   my $buf = "A" x (1024 * 1024 * 100);
   print "Allocated " . length($buf) . " byte buffer\n";

}
print "Finished\n";
sleep(1000);

2013-09-16

透過HMC指令列出LPAR的資訊

hscroot@localhost:~> lssyscfg -r sys -F name
Server-9179-MHC-SN06394FR

hscroot@localhost:~> lssyscfg -m Server-9179-MHC-SN06394FR -r lpar -F name,lpar_id,state,rmc_ipaddr
TS1-1,16,Running,10.199.130.158
FGW2-1,15,Running,10.199.130.157
FGW1-1,14,Running,10.199.130.156
DEV1,13,Running,10.199.130.155
WORKING_LPAR,12,Running,10.199.130.154
NIM_Server,11,Running,10.199.130.153
DAP2-1,10,Running,10.199.130.51
DAP1-1,9,Running,10.199.130.1
DAR2-1,8,Running,10.199.130.136
DAR1-1,7,Running,10.199.130.131
LOG2,6,Running,10.199.130.122
LOG1,5,Running,10.199.130.121
MDS2,4,Running,10.199.130.112
MDS1,3,Running,10.199.130.111
VIOS2,2,Running,10.199.130.152

VIOS1,1,Running,10.199.130.151


Reference
1. http://www.aixhealthcheck.com/blog.php?id=227
2. http://santosh-aix.blogspot.tw/2008/06/creating-lpar-from-hmc-command-line.html

2013-08-06

ITM Agent change hostname

在TEP上,遇到Agent端的hostname有重複的時候,TEP管理的介面上會一直出現更新的訊息(圖1)。因此需要在Agent端做一些調整,方能解決問題。
(圖1)

On Linux/UNIX agent systems, these parameters can be added to the xx.ini file, where xx is the product code of the agent.

Example: edit the xx.ini file and add the following lines, where <your hostname> = the name you chose
to have displayed in the TEP navigator tree.
CTIRA_HOSTNAME=<your hostname>
CTIRA_SYSTEM_NAME=<your hostname>

After making the changes to the file and saving it, a restart of the agent is required.


For the Windows agents, you need to perform the following steps:

1) Stop the agent
2) In the TEP Managed System Status workspace, clear the offline entry for the agent
3) Ensure the corresponding navigator item has been removed
4) In the Manage Tivoli Enterprise Monitoring Services (MTEMS) GUI, right-click on the agent and select Advanced->Edit Variables...
5) Click on Add
6) For CTIRA_HOSTNAME, choose the variable from the list of selected variables
7) For the value, replace "%computername%" with the desired hostname, making sure to leave the remaining part of the value (typically .TYPE=REG_EXPAND_SZ) unchanged
8) For CTIRA_SYSTEM_NAME, type in the variable name and also the desired value
9) Select OK and start the Windows OS agent.

Alternative method: The following may be used to manually change the hostname on the Windows system:

1) Stop the agent
2) Clear the offline entry from Managed System Status workspace
3) Ensure the corresponding navigator item has been removed
4) Edit the <ITMHOME>\TMAITM6\kxxcma.ini file to include:
[Override Local Settings]
CTIRA_HOSTNAME=<hostname> .TYPE=REG_EXPAND_SZ
CTIRA_SYSTEM_NAME=<hostname>
where xx is the product code and <hostname> is the desired name to appear in the TEP
5) Reconfigure the agent through the MTEMS
6) Start the agent

Note that all agents running on a system must use the same values for both the CTIRA_HOSTNAME and CTIRA_SYSTEM_NAME parameters. If this construct is not followed, unpredictable results can occur. This applies to agents on all operating systems.

2013-08-01

AIX上壓縮檔處理方式

在AIX上最常見的壓縮檔就是.tar檔了順手整理了一些常見的壓縮檔格式:

.tar.Z file format
   壓縮
      # compress filename.tar
   解壓
      # zcat filename.tar.Z | tar -xvf -

.tar.gz file format
   壓縮
      # tar cvf - folder | gzip > filename.tar.gz
   解壓
      # gunzip -c filename.tar.gz | tar -xvf -

.gz file format (註1)
   解壓
      # gzip -d filename.gz
   壓縮
      # gzip -v filename

.tgz file format
   解壓
      # gzip -d filename.tgz | tar -xvf -

.zip file format (註2)
   解壓
      # unzip filename.zip


註1 : gzip 在壓縮完後,會建立一個 .gz 的檔,並清除原始未壓縮的檔。反之,解壓縮的時候,則是把 .gz 檔清除,只留解開後的檔。

註2 : 請注意,AIX預設並沒有裝unzip的程式。