Dears,

Blog has been moved to http://www.AlTwaijiry.com, please join us.

Blog has been moved to

http://www.AlTwaijiry.com,

please join us.



EtisalatMobily

Blog has been moved to

http://www.AlTwaijiry.com,

please join us.


1. Run the following command to get the current mount points that the cluster is controlling them (replace HAPLUS with your StorageHA-Plus resource name)

root@local# scrgadm -vvp | grep FilesystemMountPoints | grep value | grep  HAPLUS
(resourcegroup:HAPLUS:FilesystemMountPoints) Res property value: /apps /database


2. Now for example if we want this resource also to control the directory /log , AFTER we create the file system in the same metaset and we add it to /etc/vfstab and we also test it (mount and umount in all node) we run the following command:

scrgadm -c -j HAPLUS -x FileSystemMountPoints=”/apps,/database,/log

After running the command above the cluster will auto mount the filesystem /log automaticly (if it’s already mounted it will no remount it, also FYI this command can be executed while the cluster/application is running.

Blog has been moved to

http://www.AlTwaijiry.com,

please join us.


1. Run the following command create the Oracle listener resource:

scrgadm -a -j ctl-ora-lsnr-res -g ctlprod-rg -t SUNW.oracle_listener:5 \
-x ORACLE_HOME=/oracle/ctlprod/9.2.0 \
-y Resource_dependencies=ctl-db-hasp-res1,ctl-db-hasp-res2,ctl-db-hasp-res3

A. ctl-ora-lsnr-res is the new resource name for the oracle listener

B. ORACLE_HOME=/oracle/ctlprod/9.2.0 Oracle home directory.

C. Resource_dependencies:  Any resource dependency

D. ctlprod-rg: resource group name

2. The command above will create the resource and will leave it offline, you will have to online it manually.

scswitch -e -j ctl-ora-lsnr-res

3. Run the following command create the Oracle Server resource:

scrgadm -a -j ctl-ora-srv-res -g ctlprod-rg -t SUNW.oracle_server:5 \
-x ORACLE_HOME=/oracle/ctlprod/9.2.0 \
-x ORACLE_SID=ctlprod \
-x Alert_log_file=/oracle/ctlprod/admin/bdump/alert_ctlprod.log \
-x Connect_string=suncluster/password \
-y Resource_dependencies=ctl-db-hasp-res1,ctl-db-hasp-res2,ctl-db-hasp-res3

A. ctl-ora-srv-res-g: the new resource name for the oracle server/database

B. ORACLE_HOME=/oracle/ctlprod/9.2.0 Oracle home directory.

C. Resource_dependencies:  Any resource dependency

D. ctlprod-rg: resource group name

E. ORACLE_SID: Oracle database SID name

F. Alert_log_file: Oracle database alert log file full path

G. Connect_string: Connection string , the user name and the password that the cluster will use it to connect to the database in order to monitor it.

4. The command above will create the resource and will leave it offline, you will have to online it manually.

scswitch -e -j ctl-ora-srv-res

Blog has been moved to

http://www.AlTwaijiry.com,

please join us.



Few command lines you can use them when you ssh to any HMC (I usualy use it when I have a slow connection and I want to do something very fast)


1. List all th managed system in the HMC

lssyscfg -r sys -F name

2. List all the LPars running in any system

lssyscfg -m ‘SYSTEM_NAME’ -r lpar -F name

3. Run a terminal/console for any system

vtmenu

4.  Display the state of all Lpars in a system managed by the HMC

lssyscfg -m ‘SYSTEM_NAME’ -r lpar -F name,lpar_id,state

5. Reboot Lpar immediatly

chsysstate -m ‘SYSTEM_NAME’ -r lpar -n ‘LPAR_NAME’ -o shutdown –immed –restart

Blog has been moved to

http://www.AlTwaijiry.com,

please join us.



Run the following script if you want the system to forward all the mails to an SMTP server that is responsible to send all your mails:

PS: replace **SERVER** with your mail relay server (SMTP Server) and youremail@yourdomain.com with your email

#!/bin/bash

cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.org
perl -i -pe ‘s/^DS.*/DS**SERVER**/g’ /etc/mail/sendmail.cf
/etc/init.d/sendmail stop
/etc/init.d/sendmail start
banner `hostname` | /usr/lib/sendmail -v youremail@yourdomain.com

Blog has been moved to

http://www.AlTwaijiry.com,

please join us.



Simple!!

for i in `lscfg -vp |grep fcs| awk ‘{print $1}’`
do
echo $i && lscfg -vp -l $i |grep “Network Address”
done

AIX1:/>for i in `lscfg -vp |grep fcs| awk ‘{print $1}’`
> do
> echo $i && lscfg -vp -l $i |grep “Network Address”
> done
fcs1
Network Address………….10000000C95A2E3F
fcs0
Network Address………….10000000C95A31CE
AIX1:/>

Blog has been moved to

http://www.AlTwaijiry.com,

please join us.



If you try to add a LUN to a server and you are not able to do anything on this LUN (e.g.: metainit is not working) most probubly this luns was used somewhere before and the reservation key was not removed from it.

in order to remove the reservation key (BEFORE you remove it make sure the LUN has been removed from the other system and it’s not needed anymore otherwise you will lose your data and the other system will panic)

1. Check if you have reservation key in the LUN (you will need the sun cluster to be installed, if you don’t have it in the system try to mount the directory /usr/cluster from any sun cluster node to your server (nfs), I know it’s a dirty trick, but it will help :)

root@localhost# /usr/cluster/lib/sc/scsi -c inkeys -d /dev/rdsk/c8t6005076300C0B334000000000000170Ed0s2
Reservation keys(4):
0x420773ee00000001
0x420773ee00000002
0x420773ee00000004
0x420773ee00000003 <— reservation key number

root@localhost# /usr/cluster/lib/sc/scsi -c inresv -d /dev/rdsk/c8t6005076300C0B334000000000000170Ed0s2
Reservations(1):
0x420773ee00000002
type —> 5

2. Run the following command to clean/remove the reservation keys

root@localhost# /usr/cluster/lib/sc/scsi -c scrub -d  /dev/rdsk/c8t6005076300C0B334000000000000170Ed0s2
Reservation keys currently on disk:
0x420773ee00000001
0x420773ee00000002
0x420773ee00000004
0x420773ee00000003
Attempting to remove all keys from the disk…
Scrubbing complete, use ‘/usr/cluster/lib/sc/scsi -c inkeys -d /dev/rdsk/c8t6005076300C0B334000000000000170Ed0s2′ to verify success


format -e /dev/rdsk/c8t6005076300C0B334000000000000170Ed0s2
0504429967

Blog has been moved to

http://www.AlTwaijiry.com,

please join us.


1. Identify the file systems.
2. Get the disks that belong to the file system.
3. Check them in the metaset/metadevice and make sure no one else is using them (no other soft partition).
4. Clean the metadevice from the  metaset
5. REMOVE THE DISKS FROM THE METASET
6. REMOVE THE METADB FOR THE DISKS THAT YOU WANT TO REMOVE
7. ASK data storage to remove the disks
8. Configure the controllers after you confirm that the disks has been removed in all nodes
9. Run devfsadm -Cv in all nodes
9. Run scgdevs in ONE NODE (in case you are using SUN Cluster)
10. Run scdidadm -C in ONE NODE (in case you are using SUN Cluster)
11. Check all nodes have the same number of LUNS (in case you are using SUN Cluster)
For more information check http://docs.sun.com/app/docs/doc/817-1673/6mhcv6m38?a=view

Blog has been moved to

http://www.AlTwaijiry.com,

please join us.



This script will convert all firewall ACL to excel sheet, I use it sometime when I receive list of ACL and I need present it to someone, the script is very basic and it does what I need (I can’t gurrentee that it will work with you)

save the firewall rules in firewall.txt.log and then run the following perl script


#!/usr/bin/perl

$output='';

open(DATA,"&lt;firewall.txt.log") || die("File NOT FOUND (firewall.txt.log)");
@Rules = &lt;DATA&gt;;
close DATA;

foreach(@Rules){
@acl = split(/ /,$_);
if($acl[3] ne 'permit') { die("ACL format is not supported");}

$proto = $acl[4];

if($acl[5] eq 'host'){
$source=$acl[6];
}else{
$source=$acl[5] . '/' . $acl[6];
}

if($acl[7] eq 'host'){
$dest=$acl[8];
}else{
$dest=$acl[7] . '/' . $acl[8];
}

if($acl[9] ne 'object-group' &amp;&amp; $acl[9] ne 'eq' &amp;&amp; $acl[9] ne 'range') { die("ACL format not supported\n$_\n".$acl[9]."\n\n");}

if($acl[9] eq 'eq'){
$port = $acl[10];
}elsif($acl[9] eq 'range'){
$port = $acl[10] . ' to ' . $acl[11];
}elsif($acl[9] eq 'object-group'){
$port = $acl[9] . '/' . $acl[10];
}else{
die("ACL format not supported\n$_\n".$acl[9]."\n\n");
}
chomp($port);

#print $_;
$output .= "$source,$dest,$proto,$port\n";
}

if($output ne ''){
print "Source,Destination,Proto,Ports\n";
print $output;
}

#!/usr/bin/perl

$output=”;

open(DATA,”<firewall.txt.log”) || die(“File NOT FOUND (firewall.txt.log)”);
@Rules = <DATA>;
close DATA;

foreach(@Rules){
@acl = split(/ /,$_);
if($acl[3] ne ‘permit’) { die(“ACL format is not supported”);}

$proto = $acl[4];

if($acl[5] eq ‘host’){
$source=$acl[6];
}else{
$source=$acl[5] . ‘/’ . $acl[6];
}

if($acl[7] eq ‘host’){
$dest=$acl[8];
}else{
$dest=$acl[7] . ‘/’ . $acl[8];
}

if($acl[9] ne ‘object-group’ && $acl[9] ne ‘eq’ && $acl[9] ne ‘range’) { die(“ACL format not supported\n$_\n”.$acl[9].”\n\n”);}

if($acl[9] eq ‘eq’){
$port = $acl[10];
}elsif($acl[9] eq ‘range’){
$port = $acl[10] . ‘ to ‘ . $acl[11];
}elsif($acl[9] eq ‘object-group’){
$port = $acl[9] . ‘/’ . $acl[10];
}else{
die(“ACL format not supported\n$_\n”.$acl[9].”\n\n”);
}
chomp($port);

#print $_;
$output .= “$source,$dest,$proto,$port\n”;
}

if($output ne ”){
print “Source,Destination,Proto,Ports\n”;
print $output;
}

Next Page »

Follow

Get every new post delivered to your Inbox.