First do a dump of your config, in case you want to get it back. On the global zone:
# zonecfg -z zzzpit120b export -f zzzpit120b.txt
Now remove it from the config, and umount it, all this in the global zone.
# zonecfg -z zzzpit120b remove fs dir=/oracle/GYT/saptrace
# umount /zones/zzzpit120 b/root/oracle/GYT/saptrace
Thanks to Alejandro Siller
Month: May 2012
connect to a HP-ILO or Dell DRAC from your pc using a ssh tunnel
Ok, so your PC connects to a vpn, and there’s this one unix host that has access to the ilo’s and dracs, but your pc
doesn’t…
So our participants are, in order of connection:
PC-jumphost-console
46/433
that means PC cannot access console, but jumphost does.
If “console” is a HP-ILO, from your PC do:
ssh -C -g jumphost -L 443:console:443 -L 3389:console:3389 -L 9300:console:9300 -L 17990:console:17990
-L 17988:console:17998 -L 3002:console: 3002 -L 23:console:23
If “console” is a Dell DRAC, from your PC do:
ssh -C -g jumphost -L 443:console:443 -L 5900:console:5900 -L 5901:console:5901 -L 3668:console:3668 -L
3669:console:3669
And then, in your pc, use https://127.0.0.2 to connect to either DRAC or ILO.
Each time you do one of these redirections you’re using the ports exclusively, so only one drac or ilo can be
redirected at a time.
netiq agent version
For those of you that have netiq as a monitoring tool in your servers and need to know the agent version, go to
# cd /usr/netiq/UnixAgent/bin
# ./nqmagt -v
nqmagt: Unix Agent Version is – 6.5.116378.1139
big concat metadevice
If you need to create a Big concat metadevice from a bunch of EMC or HITACHI disks, you can use this script:
#!/bin/ksh
( N=`format < /dev/null | egrep -i ‘emc|hit’ | wc -l| sed ‘s/ //g’`
/usr/ucb/echo -n “metainit d1 $N ”
format < /dev/null | egrep -i ‘emc|hit’ | awk ‘{ print $2 }’ | while read d;do
/usr/ucb/echo -n “1 ${d}s2 ”
done
echo “” ) > /tmp/makevol.ksh
chmod 755 /tmp/makevol.ksh
Using “screen”
Screen is a utility to keep command line sessions in your unix
environment alive regardless of disconnects, and it can hold several
sessions inside it.
To start it run:
# screen
Once inside, you can use
Ctrl a c – Creates a new screen session so that you can use more than one screen session at once. Ctrl a n
– Switches to the
n
ext screen session (if you use more than one). Ctrl a p – Switches to the
p
revious screen
session (if you use more than one). Ctrl a d – Detaches a screen session (without killing the processes in it –
they continue).
Once you issue “ctrl a d” you are outside of screen.
To get a list of the screen sessions you have do a:
# screen -ls
There is a screen on:
9998.pts-5.myserver (Detached)
1 Socket in /tmp/uscreens/S-rdircio.
so to reconnect to it you need to do:
# screen -r 9998.pts-5.myserver
Than you use the “ctrl a ” commands listed above to use the subsessions.
ps -ef shows uids instead of usernames
This happens:
# ps -ef
oracle 31868 1 0 08:37 x y z 00:00:00 ora_p103_salerep
103 1789 1788 0 08:39 pts/2 00:00:00 -bash
103 2099 1789 0 08:39 pts/2 00:00:00 ps -ef
103 2100 1789 0 08:39 pts/2 00:00:00 grep -i 103
Notice we see “103″ in the first column instead of the username, this is because uid 103 is “siebadmin”, which
is >8 characters long. Ps has a column width of 8 on the first column, and if the username does not fit, it uses
the uid. This is not fixable, unless in source.
Adobe Central Output Server 5.5 (jetforms) remote usage
We had to install jetforms in an AIX machine, for development purposes, but didn’t have a license…
Figuring out it receives jobs and outputs pdfs in directories, well, we can just copy the jobs to a remote server
and retrieve the pdfs too.
The forms should also be placed somewhere to be replicated.
So we installed jetforms in a remote solaris machine, and wrote some daemon scripts in the AIX, to do the
job, form and result transfer.
The core of it all is /scripts/jf.ksh, a set of 3 daemons written in one script:
# cat /scripts/jf.ksh
#!/bin/ksh
echo “`date` starting…”
(while true;do
(for file in /usr/local/adobe/central/server/data/*.dat;do
echo “`date`: COPYING: $file TO REMOTE”
273/433
rcp $file wasdesa2:/usr/local/adobe/central/server/data
rm $file
done) >/dev/null 2>&1
sleep 4;
done ) &
(while true;do
(for file in `find /usr/local/adobe/central/server/etc/exprint/forms -type f -mtime -1`;do
echo “`date`: COPYING: $file TO REMOTE”
rcp $file wasdesa2:/usr/local/adobe/central/server/etc/exprint/forms
done) >/dev/null 2>&1
sleep 15;
done ) &
(while true;do
for file in `rsh wasdesa2 “find /usr/local/adobe/central/server/data -type f -mtime -100| grep -i pdf”`;do
if [ ! -f $file ];then
echo “`date`: COPYING: $file FROM REMOTE”
rcp wasdesa2:$file /usr/local/adobe/central/server/data
fi
done
sleep 4;
done ) &
The enclosed parentheses do the forking magic. We are using /.rhosts loose security for this, maybe we’ll use
keys on ssh later.
To keep the party going on and on, we wrote a “start” script
# cat /scripts/jetstart.ksh
#!/bin/ksh
P=`ps -ef | grep jf.ksh|grep -iv grep|wc -l`
if [ $P -eq 0 ];then
echo “jf is not running, starting..”
/scripts/jf.ksh > /scripts/jf.log &
echo “started”
fi
We also wrote a “stop” script:
# cat /scripts/jetstart.ksh
#!/bin/ksh
P=`ps -ef | grep jf.ksh|grep -iv grep|wc -l`
if [ $P -eq 0 ];then
echo “jf is not running, starting..”
/scripts/jf.ksh > /scripts/jf.log &
echo “started”
fi
And added a cron entry to keep it goin’
0,5,10,15,20,25,30,35,40,45,50,55
/scripts/jetstart.ksh > /dev/null 2>&1
Get asterisk music-on-hold live from an icecast+ices2 server
My asterisk version is 1.6.2.6
My freepbx version is 2.7.0.1
To get music-on-hold from a live source, i made a script (/scripts/streamx.ksh):
#!/bin/ksh
/usr/bin/ogg123 -q -b 128 -p 32 -d wav -f – http://kraftek.com:8000/stream.ogg| sox -t wav – -r 8000 -c 1 -t raw
– vol 0.10
27/433
and configured /etc/asterisk/musiconhold_additional.ksh with:
[default]
mode=custom
application=/scripts/streamx.ksh
And that is it!, just dial a conference room and you’ll get live music on hold while waiting for your friends to
join