lunes, 17 de octubre de 2016

Get lists of LPAR's from HMC

Very usefull if you need to get a full list of LPAR's with some attributes...


for MSYS in `lssyscfg -r sys -F name`
do
lssyscfg -r lpar -m $MSYS  -F name,lpar_id,os_version,lpar_env
done

output:

lpar1,1,AIX 6.1 6100-09-03-1415,aixlinux
vios1,2,VIOS 2.2.3.52 6100-09-04-1441,vioserver 
.
.
.
lparN,N,AIX 6.1 6100-09-03-1415,aixlinux


Yo can replace "," for ":" if you need other separator than "," (colon).-


for MSYS in `lssyscfg -r sys -F name`
do
lssyscfg -r lpar -m $MSYS  -F name:lpar_id:os_version:lpar_env
done

output:

lpar1:1:AIX 6.1 6100-09-03-1415:aixlinux
vios1:2:VIOS 2.2.3.52 6100-09-04-1441:vioserver 
.
.
.
lparN:N:AIX 6.1 6100-09-03-1415:aixlinux

viernes, 29 de julio de 2016

Refresh RMC daemon (RMC Not working???)

On the LPAR:

# /usr/sbin/rsct/bin/rmcctrl -z
                            
# /usr/sbin/rsct/bin/rmcctrl -A
                            
# /usr/sbin/rsct/bin/rmcctrl -p

Wait for, at least, 5 minutes... Check DLPAR Operation...

If NOT WORKING, then run (on the LPAR):

# /usr/sbin/rsct/install/bin/recfgct

It should solve any RMC/DLPAR problems... 

You could also check free space on /var filesystem, cause if it's full, RMC could stop working: free some space, then run the above procedure.

jueves, 28 de julio de 2016

Enabling the debug boot image

    1. Back in the SSH console session window, wait for the Open Firmware prompt "0>"
    At the 0> prompt, enter "boot -s verbose"

    2. For cdrom boot debug enter:
    0> boot cdrom:\ppc\chrp\bootfile.exe -s verbose

    At this point, the LPAR will continue to boot and debug information will be sent to the console. While the LPAR is booted in this debug state, all commands that are run will output debug information, such as exec() system calls.

jueves, 14 de julio de 2016

The AIX chrctcp command (/etc/rc.tcpip)

This command is not documented, and is used to change /etc/rc.tcpip stanzas:

To enable xntpd in /etc/rc.tcpip, and to start xntpd: 
root@server:/home/root> chrctcp -S -a xntpd


To enable xntpd in /etc/rc.tcpip, but not start xntpd: 

root@server:/home/root> chrctcp -a xntpd


To disable xntpd in /etc/rc.tcpip, and to stop xntpd: 

root@server:/home/root> chrctcp -S -d xntpd

To disable xntpd in /etc/rc.tcpip, but to not stop xntpd: 
root@server:/home/root> chrctcp -d xntpd

jueves, 23 de junio de 2016

Symantec NetBackup: Media Server Reset (Tape drives)


When having problems with Tape Drives and/or Tape Drive Paths, run this procedure:

root@server:/home/root> /opt/openv/netbackup/bin/bp.kill_all
 

root@server:/home/root> /opt/openv/netbackup/bin/admincmd/nbrbutil -resetMediaServer <media_server_name>

root@server:/home/root> /opt/openv/netbackup/bin/bp.start_all
 

root@server:/home/root> tail -f /opt/openv/volmgr/debug/ltid/log.$(date +%m%d%y) 

 Then, check for correct Tape Drive y Tape Drive Paths...

 

miércoles, 15 de junio de 2016

Memory and Paging activity on AIX


Memory:

svmon -Pt15 | perl -e 'while(<>){print if($.==2||$&&&!$s++);$.=0 if(/^-+$/)}'        top 15 processes using the most memory 

ps aux | head -1 ; ps aux | sort -rn +3 | head -20                                top memory processes (the above is better)



Paging:

svmon -Pg -t 1 |grep Pid ; svmon -Pg -t 10 |grep "N"     top 10 processes using the most paging space 
svmon -P -O sortseg=pgsp                                 shows paging space usage of processes


Memory and Paging by USER:

root@nim_server:/home/root>svmon -U -t 10 -O summary=basic,unit=MB    
Unit: MB
===============================================================================
User                                 Inuse      Pin     Pgsp  Virtual
tuxadm                             5621.69     80.6  8405.93 15109.83
root                                451.11     79.3   155.29   553.03
nagios                                96.8     50.7     0.20     96.9
daemon                                96.5     50.7     1.49     98.1
bin                                      0        0        0        0
sys                                      0        0        0        0
adm                                      0        0        0        0
uucp                                     0        0        0        0
guest                                    0        0        0        0
nobody                                   0        0        0        0 

lunes, 13 de junio de 2016

DSH on NIM Server with AIX 7.1

After upgrading my NIM Server to from AIX 6.1 to AIX 7.1, I received the following errors running dsh.
root@nim_server: / # dsh -N ALL date
0042-053 lsnim: there is no NIM object named "lpar_labo1"
The node lpar_labo1 is not defined in NIM database.
lpar_labo1: Mon Jun 13 17:00:35 ART 2016
I've found than I need to set de DSH_CONTEXT to DSH, to prevent dsh to go to NIM groups, and using my own server groups
root@nim_server: / # export DSH_CONTEXT=DSH
root@nim_server: / # dsh -N ALL date
lpar_labo1: Mon Jun 13 17:00:35 ART 2016
lpar_labo2: Mon Jun 13 17:00:35 ART 2016
lpar_labo3: Mon Jun 13 17:00:35 ART 2016 
root@nim_server: / # env | grep -i dsh
DSH_CONTEXT=DSH
DSH_NODE_RSH=/usr/bin/ssh
DSH_NODEGROUP_PATH=/rcUnix/etc/node_groups
DSH_NODE_OPTS=-q -o BatchMode=yes
root@nim_server: / # dsh -q
DSH:DCP_DEVICE_OPTS=
DSH:DCP_DEVICE_RCP=
DSH:DCP_NODE_OPTS=
DSH:DCP_NODE_RCP=
DSH:DSH_CONTEXT=DSH
DSH:DSH_DEVICE_LIST=
DSH:DSH_DEVICE_OPTS=
DSH:DSH_DEVICE_RCP=
DSH:DSH_DEVICE_RSH=
DSH:DSH_ENVIRONMENT=
DSH:DSH_FANOUT=
DSH:DSH_LOG=
DSH:DSH_NODEGROUP_PATH=/rcUnix/etc/node_groups
DSH:DSH_NODE_LIST=
DSH:DSH_NODE_OPTS=-q -o BatchMode=yes
DSH:DSH_NODE_RCP=
DSH:DSH_NODE_RSH=/usr/bin/ssh
DSH:DSH_OUTPUT=
DSH:DSH_PATH=
DSH:DSH_REPORT=
DSH:DSH_SYNTAX=
DSH:DSH_TIMEOUT=
DSH:RSYNC_RSH=

Other useful Tip to use DSH through any port, not just 22 (Default SSH Port)

DSH_REMOTE_OPTS=-p6666

viernes, 10 de junio de 2016

/var/adm/wtmp file handling in AIX...

Examples
       1    To convert a binary record in wtmp format to an ASCII record called dummy.file, enter:

            /usr/sbin/acct/fwtmp  <  /var/adm/wtmp  >  dummy.file
            The content of a binary wtmp file is redirected to a dummy ASCII file.
       2    To convert an ASCII dummy.file to a binary file in wtmp format called /var/adm/wtmp, enter the fwtmp command with the
            -ic switch:

            /usr/sbin/acct/fwtmp -ic < dummy.file > /var/adm/wtmp 

            The dummy ASCII file is redirected to a binary wtmp file.

miércoles, 8 de junio de 2016

Remove files with "special characters" on their name....

If you've something like this:

root@server1:/tmp/test_dir>ls -l
total 0
-rw-r-----    1 root     system            0 Jun 08 12:51 --f
-rw-r-----    1 root     system            0 Jun 08 12:51 -f
-rw-r-----    1 root     system            0 Jun 08 12:50 \     j
-rw-r-----    1 root     system            0 Jun 08 12:50 \-f
-rw-r-----    1 root     system            0 Jun 08 12:49 \n\tk
-rw-r-----    1 root     system            0 Jun 08 12:51 normal_file
-rw-r-----    1 root     system            0 Jun 08 12:51 space file
root@server1:/tmp/test_dir>


Don't run!!!! It's a piece of cake...

"ls -li" gives us the inode the file is using...

root@server1:/tmp/test_dir>ls -li
total 0
57357 -rw-r-----    1 root     system            0 Jun 08 12:51 --f
57356 -rw-r-----    1 root     system            0 Jun 08 12:51 -f
57354 -rw-r-----    1 root     system            0 Jun 08 12:50 \       j
57355 -rw-r-----    1 root     system            0 Jun 08 12:50 \-f
57348 -rw-r-----    1 root     system            0 Jun 08 12:49 \n\tk
57358 -rw-r-----    1 root     system            0 Jun 08 12:51 normal_file
57359 -rw-r-----    1 root     system            0 Jun 08 12:51 space file
root@server1:/tmp/test_dir>


Then, the "magic"....

root@server1:/tmp/test_dir>find . -inum 57357 -exec rm {} \;
root@server1:/tmp/test_dir>ls -l
total 0
-rw-r-----    1 root     system            0 Jun 08 12:51 -f
-rw-r-----    1 root     system            0 Jun 08 12:50 \     j
-rw-r-----    1 root     system            0 Jun 08 12:50 \-f
-rw-r-----    1 root     system            0 Jun 08 12:49 \n\tk
-rw-r-----    1 root     system            0 Jun 08 12:51 normal_file
-rw-r-----    1 root     system            0 Jun 08 12:51 space file
root@server1:/tmp/test_dir>


Repeat the operation for each "wierd file" you've found...





jueves, 31 de marzo de 2016

IBM SDS v6.4 and SDI v7.2 on AIX - GLPSSL019E GLPSRV004I

A couple of days ago, I've found this errors on  ibmslapd.log:


2016-03-30T19:46:22.915680-3:00 GLPSSL019E The SSL layer has reported an unidentified internal error, SSL extended error code:4.
2016-03-30T19:46:22.915742-3:00 GLPSRV004I Terminating server.

SSL extended error code:4 means:  "Main memory is insufficient to perform the operation" (See link)


After searcvhing a lot, I've found that the error is due to an incorrect setting of ulimit rss parameter (It was set to default for root, which is the user I use to run SDS).

Then I've changed ulimit as follow:
   
#>grep -p root /etc/security/limits
root:
        fsize = -1
        core = 2097151
        cpu = -1
        data = -1
        nofiles = 4000
        rss = -1
        stack = -1

Relogin, chequed ulimit with "ulimit -a", and restarted SDS: The error was gone...

Hello and Welcome...


I'll try to post useful and original information (IMHO)... So , enjoy...