Tuesday, 30 June 2009

hummingbird exceed

Below is the text of a document I wrote to setup Exceed.
****************************
Using Exceed X Server with SSH X11 Tunneling

Step 1: Install and configure Exceed on your PC

Step 2: Configure Exceed for Passive Mode and Multiple Windows

Exceed’s passive mode allows you to start the X Server on your PC without it making any initial attempt to connect to a specific remote host.

Set Exceed to use Passive Mode and Multiple Windows Mode. Both of these settings are Exceed defaults, but check the settings if Exceed has been used before.

1. Start -> Programs -> Hummingbird Connectivity 9.0 -> Exceed -> Xconfig
2. Set Passive Communications:
a. Click the Network and Communication link. This will open the Communications dialog box.
b. Select Passive from the mode field’s drop-down list.
c. Validate and apply changes (green checkmark on toolbar).
3. Set Multiple Windows Screen Definition:
a. Click the Display and Video link. This will open the Screen 0 dialog box.
b. Click the radio button beside Multiple in the Window Mode box in the upper left.
c. Validate and apply changes (green checkmark on toolbar).

Step 3: Configure Localhost Security

When using SSH X11 tunneling, the only host that Exceed will ever talk to is your own PC – the localhost. Thus, regardless of which or how many machines or accounts you’re going to use Exceed with, you only have to tell Exceed to answer to one machine – your local host.

1. Click the Security, Access Control and System Administration link. This will open the Security dialog box.
2. In the Host Access Control List section of the Security dialog box, click the radio button that is to the immediate left of the word File.
3. Click the Edit box to the right of the name xhost.txt. A NotePad editing session will be initiated, editing the xhost.txt file.
4. Type localhost on a new line in the file.
a. If your xhost.txt file already has other specific hosts listed, delete those lines.
5. Save your changes to xhost.txt by clicking File in the menu bar, then selecting Save.
6. Leave NotePad by clicking File in the menu bar, then selecting Exit.
7. Validate and apply changes (green checkmark on toolbar).

Step 4: Unconfigure your Unix Account

If you have set your account to talk to your X Server, you have to remove these settings before you can use it with SSH X11 tunneling.

For Korn/Bourne shell users, check your .profile file, and remove any lines that look like this:
export DISPLAY=xxx.xxx.xxx.xxx:0

After that, and X-Windows window will automatically open whenever you start an X-Windows program on any remote Unix host.

A good X-Windows program to test with when you first setup Exceed is xclock. On your Unix host using your Unix account, enter: /usr/X/bin/xclock &
and a small X-Windows window containing a clock will open on your PC’s screen.

Using Exceed X Server with SSH

When using telnet, passwords will be sent across the network in plain text and can be viewed with other network traffic using a sniffer or other methods. This is an example of the password being intercepted using the Solaris snoop utility:

158 12.50892 xxx.xx.xx.xxx -> myhost TELNET C port=665 X&d2k7GG\r

Where “X&d2k7GG\r” is your password with a return at the end. Using the Secure Shell start method will eliminate sending your password in plain text across the network.

1. Start -> Programs -> Hummingbird Connectivity 9.0 -> Exceed -> Xstart
2. In the Start Method box in the upper left, select Secure Shell (Set Display).
3. Enter the host in the box to the right of the word Host.
4. Enter the host type in the box to the right of the words Host Type by selecting Sun in the drop-down box. Then select the command to use by clicking on the ellipsis button and selecting XTerm. This will populate the command line with a predefined xterm command line.
5. To the right of the Information prompt, select the radio button labeled None.
6. In the Secure Shell Profile: field in the upper section of the xstart session, click on the ellipsis button. This will launch the Open Tunnel application.
7. In the lower left corner, click on the Add New Tunnel button. In the Tunnel name: box enter the name for your new tunnel.
8. Using the drop-down list in the Host name: field, select the host for your new tunnel.
9. Enter your Unix account login in the User name: field.
10. In the TCP port: field leave the default of 22.
11. After entering the information for the new tunnel, click OK.
12. This will add the new tunnel to the list. With your new tunnel highlighted, click Open in the lower right. The Secure Shell Profile: will now use this tunnel when opening a connection to your Unix host.

When you start Unix client connection using the Xstart Client Startup Application, you will be prompted for a Password Authentication. Enter your Unix account password and you will receive a secure connection to your Unix host.

Monday, 29 June 2009

If you cannot find an emulex or qlogic HBA driver on Red hat Linux

well, this driver might be the answer;

cpq_cciss 2.4.60 Jun 26 2006 HP cciss 2.4.60 HBA driver RPM

Friday, 26 June 2009

How to resize a volume within a diskgroup and add that storage to another volume in that diskgroup

Say you added space to a volume and it was the wrong volume. Luckily, both volumes are in the same diskgroup. Here is how you can move the storage from one vol to another. Very simple really;

you can do a vxdg free to see how much free space you have prior to this, then you can proceed;

# vxresize -F vxfs -g your_dg your_vol -100g

# vxresize -F vxfs -g your_dg your_other_vol +100g

How to resize a filesystem with specific disks under vxvm

A VxVM question:

I have a volume/filesystem spread over 4*146G disks. Now I want to shrink the filesystem - which I can do using vxresize. However, I want to shrink so that two of the four disks that the filesystem occupies are removed from the volume. Can I do that?

Yes, you can.

Assuming disks called disk1, disk2, disk3, disk4, volume "vol" and diskgroup "mydg" , and that you want to free disks 3 and 4.
Code:
vxassist -g mydg move vol disk1 disk2 \!disk3 \!disk4



So I should run vxresize to resize the filesystem to, say, 200G and then run vxassist? I just want to know exactly what I am going to have to do, because there is a netbackup master server running on that filesystem and obviously we do not want any data loss...

Yes, that's exactly it.

Do the resize to make sure you are under the capacity of two of the four disks, then the vxassist. I have had to do this recently when someone decided to grow a volume on a systems where the second plex in a mirror was detached and disassociated and a someone else decided to grow the volume and allocated all of the disks is the diskgroup as available. As a result an additional subdisks were allocated on on of the disks that should only have been assigned to the mirror plex.

I'll see if I have a machine handy and I'll a screen dump of this scenario, and the exact sequence.

Thursday, 25 June 2009

Search for installed linux packages

rpm -qa | grep whateveryouarelookingfor

EMC Client installation and checking for linux and solaris

EMC Client installation and checking

This web page is a quick guide on what to install and how to check that EMC SAN is attached and working

Solaris

Installing
==========================================================
Install Emulex driver/firmware, san packages (SANinfo, HBAinfo, lputil), EMC powerpath
Use lputil to update firmware
Use lputil to disable boot bios
Update /kernel/drv/lpfc.conf
Update /kernel/drv/sd.conf
Reboot
Install ECC agent

Note: when adding disks on different FA had to reboot server?

List HBA's /usr/sbin/hbanyware/hbacmd listHBAS (use to get WWN's)

/opt/HBAinfo/bin/gethbainfo (script wrapped around hbainfo)

grep 'WWN' /var/adm/messages
HBA attributes /opt/EMLXemlxu/bin/emlxadm

/usr/sbin/hbanyware/hbacmd HBAAttrib 10:00:00:00:c9:49:28:47
HBA port /opt/EMLXemlxu/bin/emlxadm

/usr/sbin/hbanyware/hbacmd PortAttrib 10:00:00:00:c9:49:28:47
HBA firmware /opt/EMLXemlxu/bin/emlxadm
Fabric login /opt/HBAinfo/bin/gethbainfo (script wrapped around hbainfo)
Adding Additional Disks cfgadm -c configure c2
Disk available cfgadm -al -o show_SCSI_lun

echo|format

inq (use to get serial numbers)
Labelling format
Partitioning vxdiskadm

format
Filesystem newfs or mkfs
Linux

Installing
==========================================================
Install Emulex driver, san packages (saninfo, hbanyware), firmware (lputil)
Configure /etc/modprobe.conf
Use lputil to update firmware
Use lputil to disable boot bios
Create new ram disk so changes to modprobe.conf can take affect.
Reboot
Install ECC agent

List HBA's
/usr/sbin/hbanyware/hbacmd listHBAS (use to get WWN's)

cat /proc/scsi/lpfc/*

HBA attributes /usr/sbin/hbanyware/hbacmd HBAAttrib 10:00:00:00:c9:49:28:47

cat /sys/class/scsi_host/host*/info
HBA port /usr/sbin/hbanyware/hbacmd PortAttrib 10:00:00:00:c9:49:28:47
HBA firmware lputil
Fabric login cat /sys/class/scsi_host/host*/state
Disk available cat /proc/scsi/scsi

fdisk -l |grep -I Disk |grep sd

inq (use to get serial numbers)
Labelling parted -s /dev/sda mklabel msdos (like labelling in solaris)
parted -s /dev/sda print
Partitioning fdisk

parted
Filesystem mkfs -j -L /dev/vx/dsk/datadg/vol01
PowerPath

HBA Info /etc/powermt display
Disk Info /etc/powermt display dev=all
Rebuild /kernel/drv/emcp.conf /etc/powercf -q
Reconfigure powerpath using emcp.conf /etc/powermt config
Save the configuration /etc/powermt save
Enable and Disable HBA cards used for testing
/etc/powermt display (get card ID)

/etc/powermt disable hba=3072
/etc/powermt enable hba=3072

Thursday, 11 June 2009

vxvm - what should you see if the disk is not under Vxvm control

cxtxdx auto:none online invalid

That is what you should see when a disk has been uninitialised;

you can uninitialise a disk from vxvm with the following

vxdiskunsetup -C cxtxdx

Wednesday, 10 June 2009

restoring a file with networker

in this example, I restore an oracle cron file, and then later on show how to restore an earlier oracle cron file
so - first thing I did was invoke the recover command, specifying the networker server (cluster) and client;

eudt0201:root /tmp/cronoratab > /opt/networker/bin/recover -s ukprbknws001 -c eudt0201-bk

/tmp/cronoratab/ not in index

will exit.

and then entered the directory I needed to recover the file from;

Enter directory to browse: /var/spool/cron/crontabs/

recover: Current working directory is /var/spool/cron/crontabs/

help is our friend!

recover> help

Available commands are:

add [-q] [filename] - add `filename' to list of files to be recovered

cd [dir] - change directory to dir

changetime [date] - change the time that you are browsing

debug

delete [filename] - delete `filename' from the recover list

destination - print destination location for recovered files

dir [/w] [filename...] - list filename

exit - immediately exit program

force - overwrite existing files

help or `?' - print this list

lf [-aAcCdfFgilLqrRsStu1] [filename...] - list filename type

list [-c | -l] - list the files marked for recover

ll [-aAcCdfFgilLqrRsStu1] [filename...] - long list filename

ls [-aAcCdfFgilLqrRsStu1] [filename...] - list filename

noforce - do not overwrite existing files

pwd - print current directory

quit - immediately exit program

recover - recover requested files

relocate [dir] - specify new location for recovered files

verbose - toggle verbose mode; feedback about what is going on

versions [filename] - report on each version of file `filename

volumes [filename] - report volumes needed to recover marked files

`filename' can be either a file or a directory

I used 'destination' to check where the file was going to be recovered to;

recover> destination

recover files into their original location

and then changed the destination using relocate;

recover> relocate

will recover files into their original location

New destination directory: /tmp/cronoratab

and confirmed that with the destination command;

recover> destination

recover files into /tmp/cronoratab

listed the files in the direcotry I want to restore from

recover> ls

adm oracle root sys

recover> ls -lrt

total 32

-r-------- root 61 Jun 07 2007 sys

-r-------- root 771 Apr 30 2008 adm

-r-------- root 1157 Jul 04 2008 root

-r-------- root 1 May 21 09:27 oracle

and then added the file I want to recover with the add command

recover> add oracle

1 file(s) marked for recovery

and then recovered it with the recover command

recover> recover

recover: Total estimated disk space needed for recover is 8 KB.

Recovering 1 file from /var/spool/cron/crontabs/ into /tmp/cronoratab

Volumes needed (all on-line):

AD0085 at ACSLS01_D

Requesting 1 file(s), this may take a while...

./oracle

Received 1 file(s) from NSR server `ukprbknws001'

Recover completion time: Wed Jun 10 11:00:28 2009

recover> quit

eudt0201:root /tmp/cronoratab > ls

oracle

and then there is this other example where I needed an earlier file;

recover> ls -lrt

total 32

-r-------- root 61 Jun 07 2007 sys

-r-------- root 771 Apr 30 2008 adm

-r-------- root 1157 Jul 04 2008 root

-r-------- root 1 May 21 09:27 oracle

by using the changetime command and specifying a date in May

recover> changetime May 19

time changed to Tue May 19 23:59:59 2009

recover> ls

adm oracle root sys

recover> ls -lrt

total 32

-r-------- root 61 Jun 07 2007 sys

-r-------- root 771 Apr 30 2008 adm

-r-------- root 1157 Jul 04 2008 root

-r-------- root 3377 Mar 31 07:45 oracle

recover> add oracle

1 file(s) marked for recovery

recover> destination

recover files into /tmp/cronoratab

recover> recover

recover: Total estimated disk space needed for recover is 8 KB.

Recovering 1 file from /var/spool/cron/crontabs/ into /tmp/cronoratab

Volumes needed (all on-line):

AD0630 at ACSLS01_D

Requesting 1 file(s), this may take a while...

./oracle

./oracle file exists, overwrite (n, y, N, Y) or rename (r, R) [n]? y

overwriting ./oracle

Received 1 file(s) from NSR server `ukprbknws001'

Recover completion time: Wed Jun 10 11:17:46 2009

recover> quit

Hope this helps!

Darren

Monday, 8 June 2009

Quick example of resizing a fs with vxvm

NOTE - this is on a HPUX server

Before

eupr0201:root /root > bdf |grep -i pwdcli01
/dev/vx/dsk/dgpwdcli01/oracledev01
6291456 3398357 2719643 56% /opt/oracle/PWDCLI01
/dev/vx/dsk/dgpwdcli01/oradatadev01
35651584 34456224 1186032 97% /oradata/PWDCLI01
/dev/vx/dsk/dgpwdcli01/archivedev01
12582912 4325 11792561 0% /archive/PWDCLI01

check what you can increase it to;

eupr0201:root /root > vxdg -g dgpwdcli01 free

DISK DEVICE TAG OFFSET LENGTH FLAGS

dgpwdcl02 c14t11d3 c14t11d3 18835744 16854464 -


after addition of 10Gb on oradata filesystem for pwdcli01 on the eupr0201/eupr0202

eupr0201:root /root > /etc/vx/bin/vxresize -F vxfs -g dgpwdcli01 oradatadev01 +10485760

eupr0201:root /root > bdf |grep -i pwdcli01
/dev/vx/dsk/dgpwdcli01/oracledev01
6291456 3398358 2719642 56% /opt/oracle/PWDCLI01
/dev/vx/dsk/dgpwdcli01/oradatadev01
46137344 34456544 11589552 75% /oradata/PWDCLI01
/dev/vx/dsk/dgpwdcli01/archivedev01
12582912 4325 11792561 0% /archive/PWDCLI01

Saturday, 6 June 2009

hp ilo trouble shooting

can you ping its ip address
can someone physically attach to it locally
is the cable attached? is it a good cable?
are the network settings correct?
is the activity light on (the blue light)
does a reboot shift the issue
does a cold reset shift the issue

Shutting down the linux system

Shutting Down the Linux System

If you look at the scripts in runlevel 0, you'll find a number of services being shut down, followed by the killing of all active processes, and finally, the halt script in /etc/rc.d/init.d directory executing the shutdown.

The halt script is used to either halt or reboot your system, depending on how it is called. What happens during a shutdown? If you're familiar with other operating systems (such as DOS), you remember that all you had to do was close any active application and then turn off the computer. Although Linux is easy to use, shutting down your computer is not as simple as turning it off. (You can try this, but you do so at your own risk.) A number of processes must take place before you or Linux turns off your computer. The following sections take a look at some of the commands involved.

shutdown
Although many people use Linux as single users on a single computer, many of us use computers on either a distributed or shared network. If you've ever been working under a tight deadline in a networked environment, you know the dreadful experience of seeing a System is going down in 5 minutes! message from the system administrator. You might also know the frustration of working on a system on which the system administrator is trying to perform maintenance, suffering seemingly random downtimes or frozen tasks.

Luckily for most users, maintenance jobs are performed during off hours, when most people are home with their loved ones or fast asleep in bed. Unluckily for sysadmins, this is the perfect time for system administration or backups, and one of the top reasons for the alt.sysadmin.recovery newsgroup.

The primary command to stop Linux is the shutdown command. Like most UNIX commands, shutdown has a number of options. A man page for the shutdown command is included with Red Hat Linux, but you can quickly read its command-line syntax if you use an illegal option, such as -z. Thanks to the programmer, here it is:

Usage: shutdown [-akrhfnc] [-t secs] time [warning message]
-a: use /etc/shutdown.allow
-k: don't really shutdown, only warn.
-r: reboot after shutdown.
-h: halt after shutdown.
-f: do a 'fast'reboot (skip fsck).
-F: Force fsck on reboot.
-n: do not go through "init" but go down real fast.
-c: cancel a running shutdown.
-t secs: delay between warning and kill signal.
** the "time" argument is mandatory! (try "now") **
To properly shut down your system immediately, use the -h option, followed by the word now or the numeral 0:


# shutdown -h now

or


# shutdown -h 0

If you want to wait for a while, use the -t option, followed by a number (in seconds) before shutdown or reboot. If you want to restart your computer, use the -r option, along with the word now or the numeral 0:


# shutdown -r now

or


# shutdown -r 0

NOTE

You'll find two curious text strings embedded in the shutdown program:

"You don't exist. Go away."
"Oh hello Mr. Tyler - going DOWN?"
Both are found by executing this:


# strings /sbin/shutdown


To find out about "You don't exist. Go away", see Robert Kiesling's Linux Frequently Asked Questions with Answers. You should be able to find a copy at http://www.linuxdoc.org/FAQ.

You can also use linuxconf to shut down your computer. If you're logged in as the root operator, enter the following from the command line of your console or an X11 terminal window:


# linuxconf --shutdown

linuxconf presents a shutdown dialog box, as shown in Figure 9.4. To restart your system, press the Tab key until you highlight the Accept button, and then press the Enter key. You can also enter a time delay or halt your system immediately, and specify a message to broadcast to all your users when you execute the shutdown.


Figure 9.4 The linuxconf command will perform a system reboot or shutdown.

halt and reboot
Two other commands also stop or restart your system: halt and reboot. reboot is a symbolic link to halt, which notifies the kernel of a shutdown or reboot. Although you should always use shutdown to restart your system, you can use the "Vulcan neck pinch": Ctrl+Alt+Del.

If you use the keyboard form of this command, you'll find that Linux uses the following command:


# shutdown -t3 -r now

NOTE

This command is defined in your system's initialization table, /etc/inittab.

Restarting your computer with the shutdown command calls the sync command, which updates the inodes (structure representations)of each of your files. If you exit Linux without updating this information, Linux could lose track of your files on disk, and that spells disaster!

NOTE

The only time you'll want to risk shutting down Linux through a hard reset or the power-off switch on your computer is if you can't quickly kill a destructive process, such as an accidental rm -fr /*. Yet another reason to never run Linux as the root operator all the time!

By now you should know that exiting Linux properly can help you avoid problems with your system. What happens if something goes wrong? In the next section you learn preventive measures, how to maintain your filesystem, and how to recover and overcome problems.

Thursday, 4 June 2009

cancelling an at job

In Unix, how do I cancel a batch job?

In Unix, if you scheduled a job with at or batch, you can cancel it at the Unix prompt by entering:

at -r
Replace with the number of the job that at or batch reported when you submitted the job. On some systems, you may use atrm instead of at -r .

If you don't remember the job number, you can get a listing of your jobs by entering:

at -l
Each job will be listed with its job number queue and the time it was originally scheduled to execute.

On some systems, the atq command is available to list all the jobs on the system. To use this command, at the Unix prompt, enter:

atq
If your job is already running, you will need to find the process ID and kill it. On System V implementations (including all UITS central systems at Indiana University), list all running processes by entering:

ps -fu username
Replace username with your username. The equivalent BSD command is:

ps x
Once you have the process ID, enter:

kill
Replace with the process ID. If it still will not terminate, try entering:

kill -9

how to run an at job

state the at command with the time and press return
test0029:root /opt/sysadmin/ttt > at 10:00am tomorrow

then specify the command to execute at that time

cp -p /opt/sysadmin/bcv/PWDSLI02BCVbackup.ksh.amended.jun042009 PWDSLI02BCVbackup.ksh

then CTRL-D to finish

warning: commands will be executed using /usr/bin/sh
job 1244192400.a at Fri Jun 5 10:00:00 2009

listing available disks on a linux rhel system

dmesg | grep disk
fdisk -l