Add new UFS filesystem to existing zone from metadevice

You have to create it in the global zone, add it with zoneconfig, then mount it manually from the global zone
 bash-3.00# zonecfg -z zones004z3
 zonecfg: zones004z3> add fs
 zonecfg: zones004z3:fs> set dir=/myzone/cpbatch
 zonecfg: zones004z3:fs> set special=/dev/md/dsk/d132
 zonecfg: zones004z3:fs> set raw=/dev/md/rdsk/d132
 zonecfg: zones004z3:fs> set type=ufs
 zonecfg: zones004z3:fs> end
 zonecfg: zones004z3> verify
 zonecfg: zones004z3> commit
 zonecfg: zones004z3> exit
 bash-3.00# mount /dev/md/dsk/d132 /zones/CHB/myzone/cpbatch

resizing / on Oracle Enterprise Linux

i needed a bigger swap, its size was 2 Gb and we needed it to grow to 16gb, so we decided to shrink /. A task anybody
would say not possible.
So we tuck in the first installation CD for oracle enterprise linux and when prompted for a kernel option we
issued
: linux recover
Once asked to mount the root partition we said yes…
it ended up in /dev/VolGroup00/LogVol00
we checked a df -k, and it was mounted as /mnt/sysimage, and had a dev, proc and other directories
mounted inside, which were not evident in the df -k, so did a
# cat /etc/mtab
and found other dirs mounted, so for each entry in mtab inside /mnt/sysimage we unmounted it, and ended
up unmounting /mnt/sysimage
#umount /mnt/sysimage/selinux
#umount /mnt/sysimage/dev
#umount /mnt/sysimage/sys
#umount /mnt/sysimage/proc
#umount /mnt/sysimage/boot
#umount /mnt/sysimage
To reduce the filesystem, after unmounted and we issued:
# e2fsck -f /dev/VolGroup00/LogVol00
# resize2fs /dev/VolGroup00/LogVol00 110G
After that we needed to resize the volume, so we issued:
# lvm
> lvreduce -L -16G /dev/VolGroup00/LogVol00
And that did the trick to reduce the / filesystem
Then we booted up the server and resized the swap volume issuing:
# lvresize -L +16G /dev/VolGroup00/LogVol01
Had to remake the swap area
190/433
# swapoff /dev/VolGroup00/LogVol01
# mkswap /dev/VolGroup00/LogVol01
And remount it
# swapon -a
You can verify the new swap size with a “top”
191/433

Suntrunking Quick setup notes

This is a quick setup guide for suntrunking 1.3
– Install the Suntrunking package. Install the most recent suntrunking patch.
– grab our ce instance numbers, we can get these from path_to_inst.
phoenix# grep ce /etc/path_to_inst
“/sbus@3,0/SUNW, ce@0,8c00000” 0 “ce”
“/sbus@3,0/SUNW, ce@0,8c10000” 1 “ce”
“/sbus@3,0/SUNW, ce@0,8c20000” 2 “ce”
“/sbus@3,0/SUNW, ce@0,8c30000” 3 “ce”
– make sure the local-mac-address? setting is set to true
phoenix# eeprom local-mac-address?
local-mac-address?=false
phoenix# eeprom local-mac-address?=true
In this case we are going to choose ce0 as the head of the trunk, so we set /etc/hostname.ce0 to the hostname and
make sure that
it has an entry in our host file.
There are four possible policies:
1 – MAC Default policy, at its simplest will divide the traffic equally, ie each interface in this example will handle 25% of
the traffic
2 – Round Robin Use each interface in turn
3 – IP Destination Address Use IP Destination address to get the transmission path
4 – IP Source Address/IP Destination Address Deterministic connections
In our case we are going to choose round robin as our policy. So to enable this permanently we edit
/etc/opt/SUNWconn/bin/nettr.sh and add the following line
nettr -setup 0 device=ce policy=2 members=0,1,2,3
We now reboot the server
phoenix# init 6
INIT: New run level: 6
The system is coming down. Please wait.
System services are now being stopped.
Print services already stopped.
Sept 3 09:41:12 phoenix syslogd: going down on signal 15
The system is down.
syncing file systems… done
Program terminated
……………..
Configuring Sun Trunking devices
ce trunk members:
ce0 (head)
ce1
ce2
ce3
configuring IPv4 interfaces: hme0 ce0.
Hostname: phoenix
…….
Now let’s check the configuration
phoenix# ./nettr -conf
Key: 0; Policy: 1;
60/433
Aggr MAC address: 0:14:4f:41:f4:34
Name Original-Mac-Addr Speed Duplex Link Status
—- —————– —– —— —- ——
ce0 0:14:4f:41:f4:34 1000 full up enb
ce1 0:14:4f:41:f4:35 1000 full up enb
ce2 0:14:4f:41:f4:36 1000 full up enb
ce3 0:14:4f:41:f4:37 1000 full up enb
And let’s check the load for each interface, this server is restoring data from tape and sending it to other
servers, so it has mainly outbound traffic. It is very important to push traffic through the trunk in order to see
how is it really operating.
phoenix# ./nettr -stats 0 interval=5
Sep 16 09:16:33 2009
Name Ipkts Ierrs Opkts Oerrs Collis Crc %Ipkts %Opkts
—- —– —– —– —– —— — —— ——
ce0 6 0 26873 0 0 0 0.01 25.01
ce1 6 0 26877 0 0 0 0.01 25.01
ce2 56764 0 26862 0 0 0 99.98 25.00
ce3 0 0 26848 0 0 0 0.00 24.98
(Aggregate Throughput(Mb/sec): 252.00(New Peak) 282.00(Past Peak) 89.36%(N)
61/433

Disk contention

To see if we have disk contention problems we’d take a look at an iostat. if asvc_t >50 for sustained periods, the system
has disk contention problems.

[root@ehrpitlin001 ~]# iostat -x 3 10000 | awk '$11>=50'
Device:         rrqm/s   wrqm/s   r/s   w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util

we can also check if the %wio cpu is > 5% for more than a minute constantly

[root@ehrpitlin001 ~]# vmstat 1 3000 | awk '$16>=5'
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st

if we have SAR setup we could check it

[root@ehrpitlin001 ~]# sar | awk '$7>=3{print}' | head -5
12:10:01 AM       all      4.93      0.00      2.00     11.84      0.00     81.23
12:20:01 AM       all     22.83      0.00      4.96     14.90      0.00     57.31
12:30:01 AM       all     37.14      0.00      3.83     11.84      0.00     47.19
12:40:01 AM       all     44.26      0.00      3.88     12.71      0.00     39.16
12:50:01 AM       all     48.83      0.03      3.57      9.25      0.00     38.32

Message delivery to a dahdi line using the Manager interface with asterisk-java

You want to deliver a message to a pots line, and you don’t trust callprogress in asterisk, so you implement a dialplan
that waits for a digit, then plays a message.
The dialplan, in /etc/asterisk/extensions_custom.conf is
[mimensaje]
exten => s,1(lbl_mensaje_0),Playback(nuevo_mensaje,noanswer)
exten => s,n,WaitForSilence(10,6,10)
exten => s,n,GotoIf($[“${WAITSTATUS}” = “TIMEOUT”]?lbl_mensaje_0:)
exten => s,n,Read(CONTEXT,nuevo_mensaje,1,ni,6,3)
exten => s,n,GotoIf($[“${READSTATUS}” != “OK”]?lbl_mensaje_1:)
exten => s,n,Playback(${elmensaje},noanswer)
exten => s,n,GotoIf($[“${PLAYBACKSTATUS}” = “SUCCESS”]?:lbl_mensaje_2)
exten => s,n(lbl_mensaje_2),Hangup()
exten => s,n(lbl_mensaje_1),Playback(self-destruct,noanswer)
exten => s,n,Goto(lbl_mensaje_2)
The java class that sends the message using that dialplan is:
import java.io.IOException;
import org.asteriskjava.manager.*;
import org.asteriskjava.manager.event.*;
import org.asteriskjava.manager.action. *;
import org.asteriskjava.manager.response.ManagerResponse;
public class HelloEvents1 implements ManagerEventListener
{
private ManagerConnection managerConnection;
String number=””;
String message=””;
int i=0;
public HelloEvents1() throws IOException
{
ManagerConnectionFactory factory = new
ManagerConnectionFactory(“localhost”,”adm”,”password”);
this.managerConnection = factory.createManagerConnection();
}
public OriginateAction setupOriginate(String n,String m) {
OriginateAction originateAction = new OriginateAction();
11/433
originateAction. setChannel(“DAHDI/1/”+n);
originateAction. setVariable(“elmensaje”, m);
originateAction. setContext(“mimensaje”);
originateAction. setExten(“10”);
originateAction. setActionId(n);
originateAction. setAsync(Boolean.TRUE);
originateAction. setTimeout(new Integer(30000));
return originateAction;
}
public void start() throws IOException, AuthenticationFailedException,
TimeoutException, InterruptedException
{
// register for events
managerConnection.addEventListener(this);
// connect to Asterisk and log in
managerConnection.login();
OriginateAction originateAction;
ManagerResponse originateResponse;
originateAction = new OriginateAction();
originateAction=setupOriginate(number,message);
originateResponse = managerConnection.sendAction(originateAction, 30000);
Thread.sleep(20000);
managerConnection.sendAction(new StatusAction()) ;
Thread.sleep(80000);
managerConnection.logoff();
}
public void onManagerEvent(ManagerEvent event)
{
// just print received events
// System.out.println(“——–“+event);
String e=””+event;
if (e.indexOf(“appdata='”+message+”,noanswer'”)>0){
System.out.println(“ISSY: Mensaje recibido<br>”);
System.exit(0);
}
if (e.indexOf(“CONTEXT”)>0||e.indexOf(“nuevo_mensaje”)>0){
i++;
System.out.println(“ISSY: Esperando a que digite 1 : “+i+” de 8 intentos<br>”);
}
if (i==8){
System.out.println(“ISSY: Mensaje no enviado, usuario no digito 1<br>”);
System.exit(1);
}
if (e.indexOf(“HANGUP”)>0){
System.out.println(“ISSY: Linea Colgada, mensaje no enviado<br>”) ;
System.exit(1);
}
}
public static void main(String[] args) throws Exception {
if (args.length<2){
System.out.println(“Usage: Call <number> <message>”);
System.exit(1);
}
12/433
HelloEvents1 hello = new HelloEvents1();
hello.number=args[0];
hello.message=args[1];
hello.start();
}
}
Enjoy!
13/433

Netbackup 5.1 client on Solaris 10

If you push the netbackup client from the master server to a solaris 10 box it thinks it is solaris 8, so it writes entries to
/etc/inetd.conf
Solaris 10 does not have inetd but SMF, so the bpcd port is not activated, you can test by doing a telnet
localhost bpcd… it does not answer.
So you have to convert your /etc/inetd.conf file to SMF descriptors, you do so by running
# inetconv
You make sure it is imported by doing
# inetadm | grep -i bpcd
# telnet localhost bpcd
if you get a connection to the bpcd port you’re all set and you’re ready for backup/restore
🙂
228/433