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...