Wednesday, May 28, 2014

Linux: find hba information

-bash-3.2$ nsu
Password:
[root@redhat ~]# cd /opt/hp
[root@redhat hp]# ls
hpdiags        hp-ilo       hpsmh             hpssa
hp_fibreutils  hpmouse      hp-smh-templates  hpssacli
hp-health      hp-OpenIPMI  hp-snmp-agents
[root@redhat hp]# cd hp_fibreutils
[root@redhat hp_fibreutils]# ls
adapter_info  hp_rescan  lssd  lssg  scsi_info
[root@redhat hp_fibreutils]# ./hp_rescan -h
NAME

hp_rescan

DESCRIPTION

Sends the rescan signal to all or selected Fibre Channel HBAs/CNAs.

OPTIONS

-a, --all      - Rescan all Fibre Channel HBAs
-h, --help     - Prints this help message
-i, --instance - Rescan a particular instance
-l, --list     - List all supported Fibre Channel HBAs
[root@redhat hp_fibreutils]# ./hp_rescan -l
QLogic adapters:

/sys/class/scsi_host/1
/sys/class/scsi_host/2

Emulex adapters:


Brocade adapters:

[root@redhat hp_fibreutils]# cd /sys/class/scsi_host
[root@redhat scsi_host]# ls
host0  host1  host2
[root@redhat scsi_host]# ls -la
total 0
drwxr-xr-x  5 root root 0 May 23 14:25 .
drwxr-xr-x 43 root root 0 May 23 14:26 ..
drwxr-xr-x  2 root root 0 May 26 11:13 host0
drwxr-xr-x  2 root root 0 May 26 11:13 host1
drwxr-xr-x  2 root root 0 May 26 11:13 host2
[root@redhat scsi_host]# cd host1
[root@redhat host1]# ls
84xx_fw_version   model_desc            state
beacon            model_name            subsystem
cmd_per_lun       mpi_version           total_isp_aborts
device            npiv_vports_inuse     uevent
driver_version    optrom_bios_version   unchecked_isa_dma
fabric_param      optrom_efi_version    unique_id
flash_block_size  optrom_fcode_version  vlan_id
fw_dump_size      optrom_fw_version     vn_port_mac_address
fw_state          pci_info              vport_create
fw_version        phy_version           vport_delete
host_busy         proc_name             zio
isp_id            scan                  zio_timer
isp_name          serial_num
max_npiv_vports   sg_tablesize
[root@redhat host1]# more driver_version
8.04.00.12.5.6-k2
[root@redhat host1]# more model_name
QMH2462
[root@redhat host1]#

Thursday, March 20, 2014

Solaris: nvalias

# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c1t0d0
          /pci@0/pci@0/pci@2/scsi@0/sd@0,0
       1. c1t1d0
          /pci@0/pci@0/pci@2/scsi@0/sd@1,0
       2. c4t60060E80056F110000006F11000060D4d0
          /scsi_vhci/ssd@g60060e80056f110000006f11000060d4
Specify disk (enter its number):


{0} ok printenv boot-device
boot-device =           /pci@0/pci@0/pci@2/scsi@0/disk@0,0:a disk net
{0} ok nvalias root-mirr /pci@0/pci@0/pci@2/scsi@0/disk@1,0:a
{0} ok devalias
root-mirr                /pci@0/pci@0/pci@2/scsi@0/disk@1,0:a
ttya                     /ebus@c0/serial@0,ca0000
nvram                    /virtual-devices/nvram@3
net3                     /pci@0/pci@0/pci@1/pci@0/pci@3/network@0,1
net2                     /pci@0/pci@0/pci@1/pci@0/pci@3/network@0
net1                     /pci@0/pci@0/pci@1/pci@0/pci@2/network@0,1
net0                     /pci@0/pci@0/pci@1/pci@0/pci@2/network@0
net                      /pci@0/pci@0/pci@1/pci@0/pci@2/network@0
cdrom                    /pci@0/pci@0/pci@1/pci@0/pci@1/pci@0/usb@0,2/hub@4/device@4/storage@0/disk@0:f
disk3                    /pci@0/pci@0/pci@2/scsi@0/disk@3
disk2                    /pci@0/pci@0/pci@2/scsi@0/disk@2
disk1                    /pci@0/pci@0/pci@2/scsi@0/disk@1
disk0                    /pci@0/pci@0/pci@2/scsi@0/disk@0
disk                     /pci@0/pci@0/pci@2/scsi@0/disk@0
scsi                     /pci@0/pci@0/pci@2/scsi@0
virtual-console          /virtual-devices/console@1
name                     aliases
{0} ok boot

HPUX: How to check hpux ilo firmware version

<>hpiLO-> show
status=0
status_tag=COMMAND COMPLETED


/
  Targets
    system1
    map1
  Properties
  Verbs
    cd version exit show


<>hpiLO-> show /map1

status=0
status_tag=COMMAND COMPLETED


/map1
  Targets
    firmware1
    accounts1
    log1
    enetport1
    dhcpendpt1
    dnsendpt1
    gateway1
    dnsserver1
    dnsserver2
    dnsserver3
    dhcpserver1
    settings1
    config1
    snmp1
    oemhp_dircfg1
    oemhp_vm1
    vlan1
    oemhp_ssocfg1
  Properties
    name=iLO 3 Advanced
    license=3368NY7M2BQGKTNMLDZ8KZLLH
  Verbs
    cd version exit show reset set oemhp_ping



hpiLO-> show firmware1
status=0
status_tag=COMMAND COMPLETED


/map1/firmware1
  Targets
  Properties
    version=1.10
    date=Jul 26 2010
  Verbs
    cd version exit show load set



hpiLO->

to upgrade


How to upgrade the firmware using SSH PDF Print E-mail
Written by Carlo Cacciafesta  
Thursday, 07 January 2010 13:35
How to upgrade the firmware using SSH

The following commands can be used to upgrade the firmware on an HP iLO or iLO2 interface. This procedure is particularly useful when the iLO stops working properly and it's not accessible from the server or via HTTP(S).

Use the following procedure:

    * Use SSH to access the iLO device
    * Log in to the iLO using administrative credentials
    * Type the following command and press enter: "load -source http://ip_address/path/imagename.bin /map1/firmware"
          o  Example: "load -source http://192.168.0.1/ilo2_180.bin /map1/firmware"
    * The interface will download the new image and will reset itself
    * To check the firmware version, log in again using SSH and enter the following command: "show /map1/firmware version"

Redhat: Find network device

[root@ devices]# du -a . | grep net
0       ./vmbus_0_0/vmbus_0_4/net:seth0
0       ./pci0000:00/0000:00:0a.0/net:eth0
[root@ devices]# pwd
/sys/devices
[root@ devices]#

Solaris: Restricted ftp access

groupadd partsftp
useradd -c "F1 performance project" -d /root/home/partsftp -g partsftp -m -s /usr/bin/false partsftp
svcadm -v enable ftp



Change user's home directory to /u01/network:
Code:
usermod -d /u01/network ftp_user

Then add:
Code:
restricted-uid ftp_user
to /etc/ftpd/ftpaccess file.


server1# vi /etc/shells
"/etc/shells" [New file]
/usr/bin/false



    deny-uid uid-range [uid-range...]
     deny-gid gid-range [gid-range...]
     allow-uid uid-range  [uid-range...]
     allow-gid gid-range [gid-range...]



/etc/ftpd/ftpaccess example
--------------
.
.
.
. omitted

# limit-time    anonymous       30
# limit         anonusers       10      Wk0730-1800       /etc/ftpd/toomany.msg
# limit         anonusers       50      SaSu|Any1800-0730 /etc/ftpd/toomany.msg
restricted-uid partsftp
allow-uid partsftp
deny-uid *
defumask 022
server1#

Thursday, February 20, 2014

Unix: tcpdump check connectivity

Useful commnd to run
tcpdump -nn -v -s 1500 -c 1 'ether[20:2] == 0x2000' -i ethX

Thursday, February 13, 2014

Solaris !0: How to start oracle11g with SPFILE in vcs main.cf

Below are task need to be performed.

1.       Edit cvs config file main.cf

Remove parameter Pfile from ORA_oraserver resources

Pfile = /opt/oracle/10.2.0.4_EE/dbs/initDS.ora


2.       Start vcs agent on node1. Clear any FAULT flags on resources.
3.       Start vcs agent on node2.

4.       Perform vcs failover test

bBy default if no pfile defined, vcs will look into $ORACLE_HOME/dbs ffor file below in sequence

  • SPFILEsid.ora
  • SPFILE.ora
  • initSID.ora


FFYI. hastop -all -force was already ran prior this activity

from

        Oracle ORA_server (
                Sid = DS
                Owner = oracle
                Home = "/opt/oracle/11.2.0.3_EE"
                Pfile = "/opt/oracle/11.2.0.3_EE/dbs/initDS.ora"
                EnvFile = "/tmp/env.sh"
                MonScript = "/opt/VRTSagents/ha/bin/Oracle/SqlTest.pl"

                )

to

        Oracle ORA_server (
                Sid = DS
                Owner = oracle
                Home = "/opt/oracle/11.2.0.3_EE"
                EnvFile = "/tmp/env.sh"
                MonScript = "/opt/VRTSagents/ha/bin/Oracle/SqlTest.pl"

                )

remember to run
#hacf -verify .

f







UNIX: How to print column nicely using printf

[user@hostfwnms1-oam tmp]# cat b.sh printf "%-26s %-19s %-8s %-8s %-s %-s\n" HOSTNAME IP PING SNMPWALK 0-ok 1-fail for i in `cat n...