Main Menu

Search

Showing posts with label Troubleshooting Doc. Show all posts
Showing posts with label Troubleshooting Doc. Show all posts

LINUX: NETSTAT Command To Check Communication Between Source and Destination IP's / Ports (How To Doc) (Troubleshooting Doc)

Below netstat command can be used.
netstat -ao

below is example output of above command.

# netstat -ao
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       Timer
tcp        0      0 *:768                       *:*                         LISTEN      off (0.00/0/0)
tcp        0      0 testserver03cn01.testingcompany.c:cbt *:*                         LISTEN      off (0.00/0/0)
tcp        0      0 *:teradataordbms            *:*                         LISTEN      off (0.00/0/0)
tcp        0      0 *:ssh                       *:*                         LISTEN      off (0.00/0/0)
tcp        0      0 localhost.localdoma:tambora *:*                         LISTEN      off (0.00/0/0)
tcp        0      0 192.168.21.1:mdc-portmapper 192.168.21.5:nfs            ESTABLISHED off (0.00/0/0)
tcp        0      0 192.168.6.101:792           192.168.6.131:nfs           ESTABLISHED off (0.00/0/0)


Products to which Article Applies

All Linux Operating Systems
 

Additional Reference

https://linux.die.net/man/8/netstat

SOLARIS: SNOOP Useful Commands For Network Packet Captures

Snoop is network packets capture tool for Solaris just like tcpdumps on Linux.

Below are some snoop command examples.

snoop command to capture packets on a specific interface and specific hostname from where packets are coming.

snoop -q -I <interface name> -o <filename> <IP to capture packets>

For e.g. if you want to capture the packets on ipmp3 interface coming from external IP 10.10.10.1 and save the output to /tmp/snoop.out file your command looks as follows:

snoop -q -I ipmp3 -o /tmp/snoop.out 10.10.10.1

snoop command to not want to capture the packets on port 22 which is SSH port.

snoop -q -I <interface name> -o <filename> <IP to capture packets> not port 22

For e.g. if you want to capture the packets on ipmp3 interface coming from external IP 10.10.10.1 and save the output to /tmp/snoop.out file your command looks as follows:

snoop -q -I ipmp3 -o /tmp/snoop.out 10.10.10.1 not port 22

snoop command to just see the packets on console without capturing into a file.

snoop -q -I <interface name>

For e.g. if you want to see the packets on ipmp3 interface coming from external IP 10.10.10.1, your command looks like below:

snoop -q -I ipmp3 10.10.10.1

snoop command to read the snoop capture file.

snoop -i <filename>


Products to which Article Applies

Solaris Operating Systems

Additional Reference

https://www.thegeekdiary.com/solaris-snoop-15-awesome-practical-examples/

 

LINUX: TCPDUMP: How To Capture ARP and ICMP Traffic From Particular IP?

Below tcpdump command can be used.

tcpdump -nnti <interface> arp or icmp and host <IP> -w <output filename>

For e.g. if you want to capture tcpdumps on eth1 interface to capture all ARP & ICMP traffic coming from 10.10.10.10 and save it to /tmp/netcaptures.out file, your command will look as follows:

tcpdump -nnti eth1 arp or icmp and host 10.10.10.10 -w /tmp/netcaptures.out

Products to which Article Applies


All Linux Operating Systems

Additional Reference



http://homepage.smc.edu/morgan_david/cs70/assignments/lab-arpandping.htm

Oracle VM Manager (OVMM): How To Check OVM_STATISTIC Table File Size and Records For Troubleshooting OVMM Slowness Issue?

In some cases we will see slowness from OVM Manager where jobs will take forever to complete or will hang. These kind of issues can happen if Oracle VM Manager statistics table file size grows huge in size or if there are millions of records in Oracle VM Manager statistics table.

Steps in this article will provide steps on how to validate OVM statistics table and number of records in OVM statistics table.

Verify OVM statistics table file size

Below command can be executed to check the file size of OVM statistics table file size.


ls -hlrt /u01/app/oracle/mysql/data/ovs/OVM_STATISTIC.ibd

Usually above OVM_STATISTIC.ibd file size should be few GB in size (less than 5 GB) if OVM Manager is healthy.

Verify the number of records in OVM statistics table file

Follow below steps to check the records in OVM_STATISTIC statistics table

a. Run below command. When prompted for password enter the password, default is welcome1.


mysql ovs -u ovs -p -S /u01/app/oracle/mysql/data/mysqld.sock

You will be logged into SQL prompt.

b. Run below command in SQL prompt.


select count(*) from OVM_STATISTIC;

Usually records in OVM_STATISTIC.ibd table should be less than million if OVM Manager is healthy.

Products to which Article Applies


Oracle VM Manager - All versions

Additional References


https://docs.oracle.com/cd/E50245_01/



LINUX: How to Troubleshoot DNS issues on Linux Hosts?

In some cases we notice that the SSH login does not work or is very slow when logging into Linux hosts. Often times these issues happen due to DNS issues where DNS lookup is failing or is taking longer time than expected. Below are some of the steps which can be executed to find if there is an issue with the DNS lookup in the environment.

1. Gather the DNS Servers list which is configured on the Linux Machines. The list can be obtained from /etc/resolv.conf file. Below is command to run.

cat /etc/resolv.conf

You will see entries as follows in the file. In this example lets assume DNS server IP as 10.10.20.20 and DNS server name as testing.com.

search testing.com
nameserver 10.10.20.20

2. Gather the IP address and hostname of the Linux machine which has issues by looking into /etc/hosts. lets assume hostname of the VM is testvm and IP is 10.10.10.10


3. Ping the DNS servers to see if they are reachable.

ping 10.10.20.20
If the DNS servers are not reachable thats where the issue is.

4. Run nslookup command as follows on the IP address and hostname of Linux Hosts which have issues. Below is command.

nslookup <IP/Hostname>

In a working DNS environment you should be seeing Name and Address of the Server to which you are doing nslookup.


You should NOT be seeing outputs from nslookup command which shows connection timedout, no servers count not be reached (or) IP address and hostname of Linux host being listed under "Non-authoritative answer". Below are sample outputs which shows these errors which are red flags.



# nslookup testvm
Server:         10.10.20.20
Address:        10.10.20.20#53
Non-authoritative answer:
Name:   testvm.testing.com
Address: 10.10.10.10


# nslookup 10.10.10.10
;; connection timed out; trying next origin
;; connection timed out; no servers could be reached

5. Now run dig command with -x option on Linux VM hostname and IP address which has issues. Below is command.


Check if Query time in the output (highlighted below in sample output). In a working DNS environment querytime should be in milliseconds.


If there are issues with DNS the query time will be more or we will see connection timed out or no servers could be reached errors as follows:

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-25.P1.el5_11.12 <<>> -x 10.10.10.10
;; global options:  printcmd
;; connection timed out; no servers could be reached

6. Now run below nslookup with -debug option on the Linux Host which has DNS issues.

nslookup -debug 10.10.10.10

Above command will do nslookup and provide the output in question and answer section as follows in working DNS environment.

# nslookup -debug testvm
Server:         10.10.20.20
Address:        10.10.20.20#53

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

    QUESTIONS:
        testvm., type = A, class = IN
    ANSWERS:
    ->  testvm.testing.com
        internet address = 10.10.10.10
        ttl = 10800

You should not be seeing the Linux host IP address and hostname in "Non-authoritative answer:" of above command. For example as shown in below output. This indicates that there is some issues with DNS configuration.
Non-authoritative answer:
Name:   testvm.testing.com
Address: 10.10.10.10

Above steps will help to check if there are DNS issues in the environment. Below are few additional commands which can be used as well for troubleshooting the DNS issues.
nslookup -query=any <hostname/IP>


nslookup -query=ns <hostname/IP>

Products to which Article Applies


All Linux Operating Systems

Additional Reference


https://www.cloudns.net/blog/10-most-used-nslookup-commands/


LINUX: How To Troubleshoot High I/O WAIT Issues in Linux Servers With NFS Shares?

In Linux systems with NFS shares exported from Storage servers like ZFS, Netapp etc., anytime there is significant load on the Storage than what it can handle, any new NFS requests or existing NFS requests from Linux clients are going to see slowness, because there will be I/O WAITs on the NFS devices.IO WAITs can be due to number of reasons like backups running or virus scan (which does significant reads), high IO ops coming from particular process on particular VM client etc.

In Virtualized deployments like Oracle VM Manager if repository filesystem is on NFS Shares exported from Storage Servers (for e.g. in Systems like Exalogic), any read/write operations on local disks (non NFS shares) on guest VMs will also be NFS Ops on the ZFS shares. That is because the root system disk of the Guest VMs is on Repositories shares on Dom0 Hypervisors which is exported from Storage. So any huge reads/writes done on Guest VMs local disk will also lead to NFS reads/write Ops on OVS Repositories share.


In order to narrow down on High I/O WAIT issues below things should be checked.


•     Which Linux Client is seeing increase in number of reads and writes at the time of the issue.

•     Which NFS devices are seeing longer I/O WAITs on Linux clients.
•     Which processes on the Linux Clients are having significant increase in Ops at the time of the issue.
•     From Storage level to narrow down further on the the issue get a report which shows NFSv3/NFSv4 operations per client,  NFSv3/NFSv4 operations per share drilled down by client. Steps and methods to get the report may vary depending on the Storage server being used. In case of ZFS Storage Appliance and ZFS analytics can be enabled from ZFS BUI console.

Following are steps for troubleshooting I/O WAIT issues.

1. On the affected Linux client VM's run below iostat command to get the device stats like number of reads/writes, utilization and wait times.

iostat
Below is the sample snippet of iostat command. You will see the overall I/O WAIT from iostat command and also individual waits from each device.

If you see the utilization as very less and await times higher that means that the response is slower from Storage side which is causing slowness from Linux client sides.

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.04    0.00    0.15    0.02    0.00   99.79

Device:         rrqm/s   wrqm/s   r/s   w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await  svctm  %util
sda               0.00     0.00  0.00  1.00     0.00     4.00     8.00     0.00    0.00   0.00   0.00
sda1              0.00     0.00  0.00  0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sda2              0.00     0.00  0.00  0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sda3              0.00     0.00  0.00  0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sda4              0.00     0.00  0.00  0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sda5              0.00     0.00  0.00  1.00     0.00     4.00     8.00     0.00    0.00   0.00   0.00
sda6              0.00     0.00  0.00  0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
dm-0              0.00     0.00  1.00  1.00     2.00     0.50     2.50     0.00    0.50   0.50   0.10
dm-1              0.00     0.00  0.00  4.00     0.00    44.00    22.00     0.01    2.25   1.75   0.70
dm-2              0.00     0.00  0.00  0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
dm-3              0.00     0.00  0.00  3.00     0.00    16.00    10.67     0.00    1.33   1.33   0.40

2. On the affected Linux clients run below nfsiostat command.

nfsiostat

nfsiostat command will show number of reads/writes bytes an ops on each of the devices. Below is sample snippet of above command.

Device:                   rkB_nor/s    wkB_nor/s    rkB_dir/s    wkB_dir/s    rkB_svr/s    wkB_svr/s     ops/s    ro
ps/s    wops/s
192.168.21.5:/export/general/         0.00         0.00         0.00         0.00         0.00         0.00
   85.00      0.00      0.00

You can then compare read/write ops of NFS shares from nfsiostat with read/writes and compare them to I/O wait, read/writes details of devices from iostat command and then narrow down on which NFS share has significant writes, ops, and I/O WAIT.


3. Run below iotop command on the affected Linux client.

iotop -n 3 -d 5 -t  
iotop command will show which process is seeing significant increase in ops and reads/writes at the time of the issue. This way we can narrow down if there is a particular process on the client VMs which is causing high IO ops and reads/writes. Below is sample output of iotop.


Total DISK READ :       0.00 B/s | Total DISK WRITE :       0.00 B/s
Actual DISK READ:       0.00 B/s | Actual DISK WRITE:       0.00 B/s
  TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN     IO>    COMMAND
 4608 be/0 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [dm-thin]
    1 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % systemd --switched-root --system --deserialize 21
    2 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kthreadd]
    3 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [ksoftirqd/0]
    5 be/0 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kworker/0:0H]
    7 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [rcu_sched]
    8 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [rcu_bh]
Above steps will help to narrow down the issue of high I/O WAIT where it is caused due to slowness on ZFS heads, or if the issue is happening due to a particular share/device or a particular process on the Linux client.

Products to which Article Applies


All Linux Operating Systems.


Additional Reference

https://bencane.com/2012/08/06/troubleshooting-high-io-wait-in-linux/

LINUX: How to Collect TCPDUMPS With Ping Tests Between Linux Hosts For Troubleshooting Network Issues (Troubleshooting & Debugging Doc)

For troubleshooting Network related issues like ping failures, packet losses, routing issues for troubleshooting the issues we will often end up collecting the tcpdumps on Linux systems.

As a basic first step for troubleshooting the communication between source and destination hosts PING test (which goes over ICMP protocol) can be used for testing and tcpdumps can be captured on how the packets are being sent and received.

Below steps provide details on how tcpdumps can be executed on source and target for capturing packets information during PING tests. In below steps we are capturing tcpdumps on just ICMP protocol which just shows ping traffic. This way we are not looking at the other unrelated traffic data on source and target VM's.

1. Identify the  of both source and destination VM's between which there is communication issues. Make a note of interface of both source and target VM's. We will need interface name to pass it as argument for capturing tcpdumps on ICMP protocol (on which pings go)

2. Now open 2 SSH sessions for each source and destination VM's.

3. Now in one of the SSH sessions for the source VM run below tcpdump command.

tcpdump -n -i interfaceX icmp -w /tmp/`hostname`_tcpdumps__$(date +%F'-'%T).pcap

In above command interfaceX will be the interface name of source VM. This command saves the tcpdumps inside /tmp with filename as hostname_tcpdump and date/timestamps. Leave the tcpdump command running and do not do Ctrl C.


For e.g. if source VM if interface name is eth0, above command looks like below.


tcpdump -n -i eth0 icmp -w /tmp/`hostname`_tcpdumps__$(date +%F'-'%T).pcap

4.  Now in one of the SSH sessions for the destination VM run below tcpdump command. 


tcpdump -n -i interfaceX icmp -w /tmp/`hostname`_tcpdumps__$(date +%F'-'%T).pcap

In above command interfaceX will be the interface name of destination VM. This command saves the tcpdumps inside /tmp with filename as hostname_tcpdump and date/timestamps. Leave the tcpdump command running and do not do Ctrl C

For e.g. if destination VM has interface name as eth1, above command looks like below.


tcpdump -n -i eth1 icmp -w /tmp/`hostname`_tcpdumps__$(date +%F'-'%T).pcap

5. Now send 5 pings from another SSH session of source VM to destination VM IP as follows.


ping -c 5 <destination VM IP>

6. Now send 5 pings from another SSH session of destination VM to source VM IP as follows.



ping -c 5 <source VM IP>

7. Now go back to the SSH sessions for source and destination VM's where tcpdump is running in above steps 3 & 4 and then do CTRL C to stop tcpdumps.

8. Now you can read the tcpdumps using below command.
tcpdump -r <tcpdump filename>

In above command replace tcpdump filename with the tcpdump filenames captured in above steps 3 & 4. Below is how the tcpdump file snippet looks which shows traffic over ICMP ping protocol.

16:53:03.814888 IP 192.168.0.1 > 192.168.0.2: ICMP echo request, id 35900, seq 1, length 64
16:53:03.814943 IP 192.168.0.2 > 192.168.0.1: ICMP echo reply, id 35900, seq 1, length 64
16:53:04.804932 IP 192.168.0.1 > 192.168.0.2: ICMP echo request, id 35900, seq 2, length 64
16:53:04.804949 IP 192.168.0.2 > 192.168.0.1: ICMP echo reply, id 35900, seq 2, length 64
16:53:05.804717 IP 192.168.0.1 > 192.168.0.2: ICMP echo request, id 35900, seq 3, length 64
16:53:05.804750 IP 192.168.0.2 > 192.168.0.1: ICMP echo reply, id 35900, seq 3, length 64
16:53:06.804728 IP 192.168.0.1 > 192.168.0.2: ICMP echo request, id 35900, seq 4, length 64
16:53:06.804766 IP 192.168.0.2 > 192.168.0.1: ICMP echo reply, id 35900, seq 4, length 64

Products to which Article Applies


All Linux Operating Systems.


Additional References

http://www.cs.unh.edu/cnrg/people/lin/help/tcpdumpCookbook.htm