Tuesday, July 21, 2015

lspci equivalent in solaris world.


* lspci output from linux to displays all information from the PCI busses on your Linux system and all the devices connected to the busses.


testlab01# lspci
00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 01)
00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 01)
00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 08)
00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
00:07.7 System peripheral: VMware Virtual Machine Communication Interface (rev 10)
00:0f.0 VGA compatible controller: VMware SVGA II Adapter
00:11.0 PCI bridge: VMware PCI bridge (rev 02)
00:15.0 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.1 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.2 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.3 PCI bridge: VMware PCI Express Root Port (rev 01)

................... Output truncated

I was just wondering if there is equivalent of lspci in solaris world! Here it is with the partial output as the command throws
all the devices information from the PCI buses. The location of the binary is - /usr/X11/bin/scanpci

solarislab01#  /usr/X11/bin/scanpci

pci bus 0x0000 cardnum 0x01 function 0x00: vendor 0x108e device 0x8186
 Oracle/SUN Device unknown

pci bus 0x0000 cardnum 0x02 function 0x00: vendor 0x108e device 0x8186
 Oracle/SUN Device unknown

pci bus 0x0001 cardnum 0x00 function 0x00: vendor 0x111d device 0x807a
 Integrated Device Technology, Inc. Device unknown

pci bus 0x0003 cardnum 0x00 function 0x00: vendor 0x108e device 0xabcd
 Oracle/SUN Multithreaded 10-Gigabit Ethernet Network Controller

pci bus 0x0003 cardnum 0x00 function 0x01: vendor 0x108e device 0xabcd
 Oracle/SUN Multithreaded 10-Gigabit Ethernet Network Controller

pci bus 0x0003 cardnum 0x00 function 0x02: vendor 0x108e device 0xabcd
 Oracle/SUN Multithreaded 10-Gigabit Ethernet Network Controller

pci bus 0x0003 cardnum 0x00 function 0x03: vendor 0x108e device 0xabcd
 Oracle/SUN Multithreaded 10-Gigabit Ethernet Network Controller

pci bus 0x0004 cardnum 0x00 function 0x00: vendor 0x1000 device 0x0072
 LSI Logic / Symbios Logic SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon]

pci bus 0x0005 cardnum 0x00 function 0x00: vendor 0x108e device 0xabcd
 Oracle/SUN Multithreaded 10-Gigabit Ethernet Network Controller

pci bus 0x0005 cardnum 0x00 function 0x01: vendor 0x108e device 0xabcd
 Oracle/SUN Multithreaded 10-Gigabit Ethernet Network Controller

pci bus 0x0005 cardnum 0x00 function 0x02: vendor 0x108e device 0xabcd
 Oracle/SUN Multithreaded 10-Gigabit Ethernet Network Controller

pci bus 0x0005 cardnum 0x00 function 0x03: vendor 0x108e device 0xabcd
 Oracle/SUN Multithreaded 10-Gigabit Ethernet Network Controller

pci bus 0x0006 cardnum 0x00 function 0x00: vendor 0x10df device 0xfc40
 Emulex Corporation Saturn-X: LightPulse Fibre Channel Host Adapter

pci bus 0x0006 cardnum 0x00 function 0x01: vendor 0x10df device 0xfc40
 Emulex Corporation Saturn-X: LightPulse Fibre Channel Host Adapter

pci bus 0x0007 cardnum 0x00 function 0x00: vendor 0x111d device 0x8077
 Integrated Device Technology, Inc. Device unknown

pci bus 0x0008 cardnum 0x00 function 0x00: vendor 0x111d device 0x8077
 Integrated Device Technology, Inc. Device unknown

pci bus 0x0008 cardnum 0x04 function 0x00: vendor 0x111d device 0x8077
 Integrated Device Technology, Inc. Device unknown

pci bus 0x0008 cardnum 0x06 function 0x00: vendor 0x111d device 0x8077
 Integrated Device Technology, Inc. Device unknown

pci bus 0x0008 cardnum 0x07 function 0x00: vendor 0x111d device 0x8077
 Integrated Device Technology, Inc. Device unknown

pci bus 0x0008 cardnum 0x08 function 0x00: vendor 0x111d device 0x8077
 Integrated Device Technology, Inc. Device unknown

pci bus 0x0008 cardnum 0x0a function 0x00: vendor 0x111d device 0x8077
 Integrated Device Technology, Inc. Device unknown

pci bus 0x0008 cardnum 0x0c function 0x00: vendor 0x111d device 0x8077
 Integrated Device Technology, Inc. Device unknown

pci bus 0x0008 cardnum 0x0f function 0x00: vendor 0x111d device 0x8077
 Integrated Device Technology, Inc. Device unknown

pci bus 0x0009 cardnum 0x00 function 0x00: vendor 0x1a03 device 0x1150
 ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge

pci bus 0x000a cardnum 0x00 function 0x00: vendor 0x1a03 device 0x2000
 ASPEED Technology, Inc. ASPEED Graphics Family

pci bus 0x000b cardnum 0x00 function 0x00: vendor 0x1000 device 0x0072
 LSI Logic / Symbios Logic SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon]

pci bus 0x000c cardnum 0x00 function 0x00: vendor 0x8086 device 0x10c9
 Intel Corporation 82576 Gigabit Network Connection

pci bus 0x000c cardnum 0x00 function 0x01: vendor 0x8086 device 0x10c9
 Intel Corporation 82576 Gigabit Network Connection

pci bus 0x000d cardnum 0x00 function 0x00: vendor 0x8086 device 0x10c9
 Intel Corporation 82576 Gigabit Network Connection

pci bus 0x000d cardnum 0x00 function 0x01: vendor 0x8086 device 0x10c9
 Intel Corporation 82576 Gigabit Network Connection

pci bus 0x000e cardnum 0x00 function 0x00: vendor 0x10df device 0xfc40
 Emulex Corporation Saturn-X: LightPulse Fibre Channel Host Adapter

pci bus 0x000e cardnum 0x00 function 0x01: vendor 0x10df device 0xfc40
 Emulex Corporation Saturn-X: LightPulse Fibre Channel Host Adapter

pci bus 0x0011 cardnum 0x00 function 0x00: vendor 0x10b5 device 0x8112
 PLX Technology, Inc. PEX8112 x1 Lane PCI Express-to-PCI Bridge

pci bus 0x0012 cardnum 0x00 function 0x00: vendor 0x1033 device 0x0035
 NEC Corporation USB

pci bus 0x0012 cardnum 0x00 function 0x01: vendor 0x1033 device 0x0035
 NEC Corporation USB

pci bus 0x0012 cardnum 0x00 function 0x02: vendor 0x1033 device 0x00e0
 NEC Corporation USB 2.0

device unknown is nothing but the device is not in use or attached. Once the device
is in use or active the details will be shown like ex. NEC Corporation USB 2.0 as above.

Thanks.

Thursday, March 12, 2015

generate FQDN - with one liner

# cat hostname.txt

host1
host2
host3
host4

Once you run the for loop you should see something like below:

# for host in `cat hostname.txt`; do  ssh -oStrictHostKeyChecking=no $host host $host ; done | awk '{print $1}'

host1.example.com
host2.example.com
host3.example.com
host4.example.com

The output will change based on the domain name your servers are in.

Wednesday, February 25, 2015

PORT CONNECTIVITY TESTING METHODS:

Checking the port connectivity in case telnet is not installed.

Many times telnet is not installed on the production systems so in
this case port connectivity testing can be done with alternative method
by using Wget - The non-interactive network downloader Linux utility
usually available on the production systems. You can run this as regular
user without being "root" user and test the connectivity to the desired
port. Here is the example:


prodone-t> wget 10.22.176.3:5222

--2015-02-25 10:50:08--  http://10.22.176.3:5222/
Connecting to 10.22.176.3:5222... connected.
HTTP request sent, awaiting response... 200 No headers, assuming HTTP/0.9
Length: unspecified
Saving to: “index.html”

    [ <=>                                                                                                                 ] 305         --.-K/s   in 0s

2015-02-25 10:50:09 (29.3 MB/s) - “index.html” saved [305]

Don't worry about the error you see in index.html. That is not our goal, focus on the line-
Connecting to 10.22.176.3:5222... connected.

-------------------------------------------------------

Here is nmap example if in case you do not have either of telnet & wget:
In example 1 is checking the status of the running port. In example 2
nmap is checking the status of the port which you can make out is a non-standard
port.

example 1:

sateprod-1> nmap 10.11.160.5 -sT -p 5222

Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2015-02-25 10:57 PST
Interesting ports on sateprod-1.capgroup.com (10.11.160.5):

PORT     STATE SERVICE
5222/tcp open  unknown

Nmap finished: 1 IP address (1 host up) scanned in 0.118 seconds

example 2:

sateprod-1> nmap 10.11.160.5 -sT -p 522

Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2015-02-25 10:57 PST
Interesting ports on iosatprd-v1.capgroup.com (10.11.160.5):

PORT    STATE  SERVICE
522/tcp closed ulp

Nmap finished: 1 IP address (1 host up) scanned in 0.106 seconds

example 3:

Another way to test the connectivity is wget

# wget 10.120.33.23:22
# wget 10.120.33.23:69




Friday, January 2, 2015

Avoid typing bash every time on the command line

linuxhost-v1> echo $SHELL
/bin/ksh

I like bash shell while running the commands, that way I can use the key board shortcuts and the
features like command completion, Ctrl l, CTRL e, CTRL a etc...
To avoid every time typing bash on the command line just included /bin/bash by creating a .kshrc file
in the home directory of the user

linuxhost-v1> cat .kshrc

/bin/bash

So next time whenever the automatic login is completed from the desktop my new session would switch
my shell to bash.