Feeds:
Posts
Comments

Archive for the ‘Linux Comm’ Category

To find the WWPN and Other information of Qlogic HBAs without restarting the host, you can use any of the following methods.

for i in `seq 0 4` ;

do echo #####Host $i ######;

cat /sys/class/fc_host/host$i/port_name;

cat /sys/class/fc_host/host$i/port_state;

cat /sys/class/fc_host/host$i/port_type;

cat /sys/class/fc_host/host$i/speed;

cat /sys/class/fc_host/host$i/supported_speeds;

done

Your output may be the following,

0x2100001b32xxxxx
Online
NPort (fabric via point-to-point)
4 Gbit
1 Gbit, 2 Gbit, 4 Gbit

0x2101001b32xxxxx
Online
NPort (fabric via point-to-point)

4 Gbit
1 Gbit, 2 Gbit, 4 Gbit

0x2100001b32xxxxx
Online
NPort (fabric via point-to-point)unknown

4 Gbit
1 Gbit, 2 Gbit, 4 Gbit

0x2101001b32xxxxx
Online
NPort (fabric via point-to-point)
4 Gbit
1 Gbit, 2 Gbit, 4 Gbit

0x2100001b32xxxxx
Online
NPort (fabric via point-to-point)
4 Gbit
1 Gbit, 2 Gbit, 4 Gbit

You can also use systool to find Port_name

$ systool -av -c fc_host
Class = “fc_host”

Class Device = “host0”
Class Device path = “/sys/class/fc_host/host0”
fabric_name         = “0x2000001b32xxxxx”
issue_lip           = <store method only>
node_name           = “0x2000001b32xxxxx”
port_id             = “0x000000”
port_name           = “0x2100001b32xxxxx”
port_state          = “Online”
port_type           = “NPort (fabric via point-to-point)”
speed               = “4 Gbit”
supported_classes   = “Class 3”
supported_speeds    = “1 Gbit, 2 Gbit, 4 Gbit”
tgtid_bind_type     = “wwpn (World Wide Port Name)”
uevent              = <store method only>

Device = “host0”
Device path = “/sys/devices/pci0000:00/0000:00:04.0/0000:17:00.0/0000:18:01.0/0000:25:00.0/host0”
optrom_ctl          = <store method only>
uevent              = <store method only>

Class Device = “host1”
Class Device path = “/sys/class/fc_host/host1”
fabric_name         = “0x2001001b32xxxxx”
issue_lip           = <store method only>
node_name           = “0x2001001b32xxxxx”
port_id             = “0x000000”
port_name           = “0x2101001b32xxxxx”
port_state          = “Online”
port_type           = “NPort (fabric via point-to-point)”
speed               = “4 Gbit”
supported_classes   = “Class 3”
supported_speeds    = “1 Gbit, 2 Gbit, 4 Gbit”
tgtid_bind_type     = “wwpn (World Wide Port Name)”
uevent              = <store method only>

Device = “host1”
Device path = “/sys/devices/pci0000:00/0000:00:04.0/0000:17:00.0/0000:18:01.0/0000:25:00.1/host1”
optrom_ctl          = <store method only>
uevent              = <store method only>

Class Device = “host2”
Class Device path = “/sys/class/fc_host/host2”
fabric_name         = “0x2000001b32xxxxx”
issue_lip           = <store method only>
node_name           = “0x2000001b32xxxxx”
port_id             = “0x000000”
port_name           = “0x2100001b32xxxxx”
port_state          = “Online”
port_type           = “NPort (fabric via point-to-point)”
speed               = “4 Gbit”
supported_classes   = “Class 3”
supported_speeds    = “1 Gbit, 2 Gbit, 4 Gbit”
tgtid_bind_type     = “wwpn (World Wide Port Name)”
uevent              = <store method only>

Device = “host2”
Device path = “/sys/devices/pci0000:00/0000:00:04.0/0000:17:00.0/0000:18:02.0/0000:22:00.0/host2”
optrom_ctl          = <store method only>
uevent              = <store method only>

Class Device = “host3”
Class Device path = “/sys/class/fc_host/host3”
fabric_name         = “0x2001001b32xxxxx”
issue_lip           = <store method only>
node_name           = “0x2001001b32xxxxx”
port_id             = “0x000000”
port_name           = “0x2101001b32xxxxx”
port_state          = “Online”
port_type           =  “NPort (fabric via point-to-point)”
speed               = “4 Gbit”
supported_classes   = “Class 3”
supported_speeds    = “1 Gbit, 2 Gbit, 4 Gbit”
tgtid_bind_type     = “wwpn (World Wide Port Name)”
uevent              = <store method only>

Device = “host3”
Device path = “/sys/devices/pci0000:00/0000:00:04.0/0000:17:00.0/0000:18:02.0/0000:22:00.1/host3”
optrom_ctl          = <store method only>
uevent              = <store method only>

Class Device = “host4”
Class Device path = “/sys/class/fc_host/host4”
fabric_name         = “0x2000001b32xxxxx”
issue_lip           = <store method only>
node_name           = “0x2000001b32xxxxxx”
port_id             = “0x65b913”
port_name           = “0x2100001b32xxxxxx”
port_state          = “Online”
port_type           = “NPort (fabric via point-to-point)”
speed               = “4 Gbit”
supported_classes   = “Class 3”
supported_speeds    = “1 Gbit, 2 Gbit, 4 Gbit”
tgtid_bind_type     = “wwpn (World Wide Port Name)”
uevent              = <store method only>

Device = “host4”
Device path = “/sys/devices/pci0000:00/0000:00:04.0/0000:17:00.0/0000:18:09.0/0000:1c:00.0/host4”
optrom_ctl          = <store method only>
uevent              = <store method only>

There are also other ways to find the WWPNs of HBAs, Please follow the link

http://linuxshellaccount.blogspot.com/2008/09/how-to-easily-find-wwns-of-qlogic-hba.html

http://publib.boulder.ibm.com/infocenter/dsichelp/ds8000ic/index.jsp?topic=/com.ibm.storage.ssic.help.doc/f2c_loclinux_192wga.html

Advertisements

Read Full Post »

I’m using openssl-devel-0.9.7d-15.21 and openssl-0.9.7d-15.21 version to generate the key and the CSR for vsftpd FTP SSL connection on SLES9 SP3 and SP4. To do this I did the following

openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout /etc/vsftpd.key -out /etc/vsftpd.pem

and gave me following error saying

Unable to load config info
Generating a 1024 bit RSA private key
….++++++
…………………………………….++++++
writing new private key to ‘/etc/vsftpd.key’
—–
unable to find ‘distinguished_name’ in config
problems making Certificate Request
29524:error:0E06D06A:configuration file routines:NCONF_get_string:no conf or environment variable:conf_lib.c:325:

When I checked the config file , I could still see it’s under /etc/ssl/openssl.cnf but standard location for openssl.cnf is /usr/local/ssl which doesn’t exist on SLES 9. So I created a symbolic link to openssl.cnf and boom it’s working again

#mkdir /usr/local/ssl ; cd /usr/local/ssl

#ln -s /etc/ssl/openssl.cnf

# openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout /etc/vsftpd.key -out /etc/vsftpd.pem
Generating a 1024 bit RSA private key
..++++++
………++++++
writing new private key to ‘/etc/vsftpd.key’
—–
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:
Email Address []:

Read Full Post »

OpenIPMI is an effort to create a full-function IPMI system to allow full access to all IPMI information on a server and to abstract it to a level that will make it easy to use.

The Open IPMI Linux device driver is designed as a full-function IPMI device driver with the following features:

  • Allows multiple users.
  • Allows multiple interfaces.
  • Allows both kernel and userland things to use the interface.
  • Fully supports the watchdog timer.
  • It works like IPMI drivers are supposed to. It tracks outgoing messages and matches up their responses automatically. It automatically fetches events, received messages, etc.
  • It supports interrupts (I have tested them now).
  • It has backwards-compatability modules for supporting the Radisys IPMI driver and the Intel IMB driver.
  • It’s modular. You don’t have to have the standard userland interface. You don’t have to have the watchdog. Etc.
  • It supports generating an event on a panic.

 

Download OpenIPMI from http://openipmi.sourceforge.net/

Intel source http://www.intel.com/design/servers/ipmi/index.htm

IBM also now supports OpenIPMI drier beginning with the following version of servers.

The OpenIPMI driver ships with these and later operating systems and IBM’s applications will talk directly to the OpenIPMI driver without requiring a mapping layer.These operating systems also ship with an OS Watchdog application, which interfaces to the OpenIPMI driver, so that native watchdog application should be used in place of IBM’s Automatic Server Restart-IPMI application on these and later operating systems.

  • Red Hat Enterprise Linux 3.7
  • Red Hat Enterprise Linux 4.3
  • Red Hat Enterprise Linux 5
  • SUSE Linux Enterprise Server 9.3
  • SUSE Linux Enterprise Server 10
  • VMware ESX Server 2.5.4 (32-bit operating system)
  • VMware ESX Server 3 (32-bit operating system)

IBM Source: http://www-304.ibm.com/systems/support/supportsite.wss/docdisplay?lndocid=MIGR-66668&brandind=5000008

# rpm -qa | grep -i ipmi
OpenIPMI-1.4.19-1.8
OpenIPMI-devel-1.4.19-1.8
ipmitool-1.8.2-0.5

ipmitool download: http://www-304.ibm.com/systems/support/supportsite.wss/docdisplay?lndocid=MIGR-5069538&brandind=5000008

http://ipmitool.sourceforge.net

ipmitool – utility for controlling IPMI-enabled devices

You can use IPMItool to configure and manage devices that support the Intelligent Platform Management Interface versions 1.5 and 2.0. IPMItool provides a simple, command-line interface to the Baseboard Management Controller, featuring the ability to read the sensor data repository (SDR) and print sensor values, display the contents of a system event log, print field-replaceable unit inventory information, read and set LAN configuration parameters, and perform remote chassis power control.

To check the Management Controller status and global enables using ipmitool utility

# ipmitool mc info
Device ID                 : 32
Device Revision           : 0
Firmware Revision         : 3.10
IPMI Version              : 2.0
Manufacturer ID           : 2
Product ID                : 251 (0x00e8)
Device Available          : yes
Provides Device SDRs      : no
Additional Device Support :
    Sensor Device
    SDR Repository Device
    SEL Device
    FRU Inventory Device
    IPMB Event Receiver
    IPMB Event Generator
    Chassis Device
Aux Firmware Rev Info     :
    0x5a
    0x53
    0x42
    0x54

Use sensor option to Print detailed sensor information

# ipmitool sensor
Ambient Temp     | 16.000     | degrees C  | ok    | 64.000    | na        | 64.000    | -128.000  | na        | na
Fan 1 Tach       | 2888.000   | RPM        | ok    | 760.000   | 1976.000  | 1976.000  | na        | na        | na
Fan 2 Tach       | 2888.000   | RPM        | ok    | 760.000   | 1976.000  | 1976.000  | na        | na        | na
Fan 3 Tach       | 2618.000   | RPM        | ok    | 770.000   | 2002.000  | 2002.000  | na        | na        | na
Fan 4 Tach       | 2541.000   | RPM        | ok    | 770.000   | 2002.000  | 2002.000  | na        | na        | na
Fan 5 Tach       | 2888.000   | RPM        | ok    | 760.000   | 1976.000  | 1976.000  | na        | na        | na
Fan 6 Tach       | 2964.000   | RPM        | ok    | 760.000   | 1976.000  | 1976.000  | na        | na        | na
Fan 7 Tach       | 2541.000   | RPM        | ok    | 770.000   | 2002.000  | 2002.000  | na        | na        | na
Fan 8 Tach       | 2618.000   | RPM        | ok    | 770.000   | 2002.000  | 2002.000  | na        | na        | na
CPU 1 Temp       | 31.000     | degrees C  | ok    | na        | na        | na        | 85.000    | na        | 95.000
Fan 1 Presence   | 0x0        | discrete   | 0x0280| na        | na        | na        | na        | na        | na
Fan 2 Presence   | 0x0        | discrete   | 0x0280| na        | na        | na        | na        | na        | na
Fan 3 Presence   | 0x0        | discrete   | 0x0280| na        | na        | na        | na        | na        | na
Fan 4 Presence   | 0x0        | discrete   | 0x0280| na        | na        | na        | na        | na        | na
Fan 5 Presence   | 0x0        | discrete   | 0x0280| na        | na        | na        | na        | na        | na
Fan 6 Presence   | 0x0        | discrete   | 0x0280| na        | na        | na        | na        | na        | na
Fan 7 Presence   | 0x0        | discrete   | 0x0280| na        | na        | na        | na        | na        | na
Fan 8 Presence   | 0x0        | discrete   | 0x0280| na        | na        | na        | na        | na        | na

…. truncated

Some available options for ipmitool util

# ipmitool help
Commands:
        raw           Send a RAW IPMI request and print response
        i2c           Send an I2C Master Write-Read command and print response
        lan           Configure LAN Channels
        chassis       Get chassis status and set power state
        event         Send pre-defined events to MC
        mc            Management Controller status and global enables
        sdr           Print Sensor Data Repository entries and readings
        sensor        Print detailed sensor information
        fru           Print built-in FRU and scan SDR for FRU locators
        sel           Print System Event Log (SEL)
        pef           Configure Platform Event Filtering (PEF)
        sol           Configure IPMIv2.0 Serial-over-LAN
        isol          Configure IPMIv1.5 Serial-over-LAN
        user          Configure Management Controller users
        channel       Configure Management Controller channels
        session       Print session information
        sunoem        OEM Commands for Sun servers
        exec          Run list of commands from file
        set           Set runtime variable for shell and exec

Find the following link to set up the IPMI watchdog Timer , Turning off the Watchdog and additional commands for Watchdog Timer administration

http://publib.boulder.ibm.com/infocenter/systems/index.jsp?topic=/liaai/ipmi/liaaiipmisetupwatchdog.htm&tocNode=toc%3Afront%2Ffront.cmb%2F0%2F2%2F7%2F5%2F5%2F0%2F

Read Full Post »

To find the current version of the ServeRAID device driver under Linux use the following.

Eg from IBM xSeries server

$ cat /proc/scsi/aacraid/0
Adaptec Raid Controller: 1.1-5[2434]custom-IBM
Vendor: IBM  Model: ServeRAID 8i
flags=SAI_READ_CAPACITY_16
kernel: 5.2-0[15421]
monitor: 5.2-0[15421]
bios: 5.2-0[15421]
serial: 83xxx

Read Full Post »

Normally, df and du will report with closest usage on a specific file system. But there might be some open file was opened and deleted by  other process but it does not exist in the directory structure. This tech note are for specific Linux O/S and if your OS is Solaris , please look at the tech note 249385.

As an example: we have

# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/vx/dsk/datadg/apps
                     503G  278G  211G  57% /apps
# du -sh /apps
87G     /apps
To see what file was meant to delete and still holding on by the process id , please run
#lsof /apps | grep deleted
oracle   5332 oracle    7u   REG 199,65533         0 18418 /apps/VRT/dbs/lkinstorcl (deleted)
oracle   5334 oracle    7u   REG 199,65533         0 18418 /apps/VRT/dbs/lkinstorcl (deleted)
oracle   5336 oracle    7u   REG 199,65533         0 18418 /apps/VRT/dbs/lkinstorcl (deleted)
oracle   5338 oracle    7u   REG 199,65533         0 18418 /apps/VRT/dbs/lkinstorcl (deleted)
oracle   5340 oracle    7u   REG 199,65533         0 18418 /apps/VRT/dbs/lkinstorcl (deleted)
oracle   5342 oracle    7u   REG 199,65533         0 18418 /apps/VRT/dbs/lkinstorcl (deleted)
oracle   5344 oracle    7u   REG 199,65533         0 18418 /apps/VRT/dbs/lkinstorcl (deleted)
oracle   5346 oracle    7u   REG 199,65533         0 18418 /apps/VRT/dbs/lkinstorcl (deleted)
oracle   5348 oracle    7u   REG 199,65533         0 18418 /apps/VRT/dbs/lkinstorcl (deleted)
You can use the following commands to get all pid

#PIDLIST=`lsof /apps | grep delete | awk ‘ { print $2 } ‘`

#ps -p $PIDLIST
PID TTY      STAT   TIME COMMAND
5332 ?        Ss     1:25 ora_pmon_orcl
5334 ?        Ss     0:46 ora_psp0_orcl
5336 ?        Ss     0:04 ora_mman_orcl
5338 ?        Ss     2:55 ora_dbw0_orcl
5340 ?        Ss     2:01 ora_lgwr_orcl
5342 ?        Ss     6:00 ora_ckpt_orcl
5344 ?        Ss     9:19 ora_smon_orcl
5346 ?        Ss     0:01 ora_reco_orcl
5348 ?        Ss    11:54 ora_cjq0_orcl
5350 ?        Ss     8:57 ora_mmon_orcl
5352 ?        Ss     2:24 ora_mmnl_orcl
5354 ?        Ss     0:00 ora_d000_orcl
5356 ?        Ss     0:00 ora_s000_orcl
5362 ?        Ss     0:00 ora_qmnc_orcl
5467 ?        Ss     0:00 ora_q000_orcl
5475 ?        Ss     4:21 ora_q001_orcl
12952 ?        Ss     0:00 ora_j000_orcl
Normally, unmount and remount the file system will flush the inode structure and will provide the correct usage. In case if you can not unmount the file system,  you can kill these processes with permission from cust , all these open file can be remove and df and du will show a correct usage

Read Full Post »

# find . -print -depth | cpio -pdm filesystem2

or

#find . -depth -print0 | cpio –null –sparse -pvd /media/filesystem2/

. Starts in the current working directory.
-print Prints the file names.
-depth Descends the directory hierarchy and prints file names from the bottom up.
-p Creates a list of files.
-d Creates directories as needed.
-m Sets the correct modification times on directories.
For more information, see cpio(1).

The files from the directory name you specify are copied. The symbolic links are preserved.
You might also specify the -u option. This option forces an unconditional copy. Otherwise, older files
do not replace newer files. This option might be useful if you want an exact copy of a directory, and
some of the files being copied might already exist in the target directory.

Example:

Copying Directories Between File Systems (cpio)
# cd /impdata
# find . -print -depth | cpio -pdm /impdata2
19013 blocks
# cd /data2
# ls
# rm -rf /impdata

Read Full Post »

Follow the steps:

  • Become superuser or assume an equivalent role.
  • List all the processes that are accessing the file system so that you know which processes you are
    going to stop.

# fuser -c [ -u ] /mount-point
-c Reports on files that are mount points for file systems

and any files within those mounted file systems.
-u Displays the user login name for each process ID.
/mount-point Specifies the name of the file system for which you want to stop processes.

  • Stop all processes that are accessing the file system.

# fuser -c -k /mount-point
ASIGKILL is sent to each process that is using the file system.
Note – You should not stop a user’s processes without first warning the user.
Verify that no processes are accessing the file system.
# fuser -c /mount-point

  • StoppingAll ProcessesAccessing a File System
    The following example shows how to stop process 4006c that is using the /export/home file system.

#fuser -c /export/home
/export/home: 4006c
# fuser -c -k/export/home

Example:

bash-2.03$ sudo fuser -c /home
/home:     3702c    3701c    3008c

bash-2.03$ sudo fuser -c -k /home

/home:     3702c     3710c    3008c

bash-2.03$ sudo fuser -c /home

/home:

Read Full Post »

Older Posts »