Thursday, August 21, 2014

How to get WWN on redhat server

Include the worldwide names (WWN) of the HBA cards in the server

(these can be obtained from the server's enclosure or ILO, or by
using this command:   systool -c fc_host -v | grep port_name  ).

Get the world Wide Number (WWN) of HPB cards
You can get it from server's enclousure or ILO or by using the systool command
# systool -c fs_host -v | grep port_name
 

Saturday, August 16, 2014

Wednesday, August 6, 2014

Upload file (OVA) file to datastore on VMware


How to Upload a file to datastore on VMware.

1. Click on hosts and cluster...
2. Search/Find the Datastore that you want to upload the file.
3. Click on the datastore and and click on Manage
4. Click on Files.
5. Once you click on files, you will see three icons on the right hand side corner.
    1. Upload a file to datastore
    2. Refresh Datastore Explorer Contents
    3. Create a new Folder.
6. Click on upload and select the file that you want to upload.

Changing user's home directory permission


Note: its users home dir and owner is nobody
Do the following steps, it wont allow change on client
Problem:
User home directory is owned by someone else. Changing permission is not allowed.
[root@aigunx225 ~]# ls -ld /home/weblogic
drwxr--r-- 2 nobody webgp 4096 Jun 21  2010 /home/weblogic

[root@aigunx225 ~]# chown -R weblogic:webgp /home/weblogic
chown: changing ownership of `/home/weblogic': Operation not permitted
restarted autofs still problem

Solution
Get the nfs share info
[root@aigunx225 ~]# df -h /home/weblogic
Filesystem            Size  Used Avail Use% Mounted on
aignas2:/vol/aignas512/appserv2/weblogic
                      200G  124G   77G  62% /home/weblogic

[root@aigunx225 ~]# id weblogic
uid=7253690(weblogic) gid=75154(webgp) groups=75154(webgp)

Mount same nas on homeserve01 or he2unx171 and then change the ownership.
On appserv02 server,
# mkdir /tmp/xyz
# mount aignas2:/vol/aignas512/appserv2 /tmp/xyz
# cd /tmp/xyz
# ls -ld weblogic
drwxr--r--   2 100325   webgp    4096 Jun 21  2010 weblogic
# chown -R weblogic:webgp weblogic
drwxr--r-- 2 weblogic webgp 4096 Jun 21  2010 /home/weblogic
Now, login to the client machine and verify.
[root@aigunx225 ~]# ls -ld /home/weblogic
drwxr--r-- 2 weblogic webgp 4096 Jun 21  2010 /home/weblogic
[root@aigunx225 ~]#

make sure umount the nas after your done your change
on appserv02,
# umount /tmp/xyz
# rmdir /tmp/xyz

Monday, August 4, 2014

Shutdown the multiple server using the Blade Logic script

Note: Place this script and a file with list of servers on the same directory on BL server and run the script.
1. The script
#!/opt/bladelogic/NSH/bin/nsh
# How to user it
# create a file with list of servers and save on the same dir as this file is.
# run this script on a blade logic server.
# ./server_shutdown.nsh --check file_with_list_of_servers
USER_CHOICE=$1
SERVER_FILE=$2
if [ -z $USER_CHOICE ]
then
    echo usage: server_shutdown.nsh --check  {file_with_list_of_servers}
    exit 0
fi
if [ -z $SERVER_FILE ]
then
    echo usage: server_shutdown.nsh --check  {file_with_list_of_servers}
    exit 0
fi
if [ ! -f $SERVER_FILE ]
then
    echo file $SERVER_FILE does not exist
    echo please check and try again
    exit 4
fi
if [ "$USER_CHOICE" = "--check" ]
then
    for i in $(cat $SERVER_FILE)
    do
        echo
        echo "======================================================="
        echo shutting down $i
# For Linux server shutdown
        nexec $i shutdown -h now
# For solaris server shutdown
        nexec $i 'init 5'
    done
    echo

else
    # no valid choice
    echo usage: server_shutdown.nsh --check  {file_with_list_of_servers}
fi

2. The file with script
$ more mylist
he3unxdv512
he3unxdv513
he3unxdv514
he3unxdv515
he3unxdv516
he3unxdv517

3. how to use it?
$ ./server_shutdown.nsh --check mylist
bash-3.2$