Main Menu

Search

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

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 If there is Database Corruption in OVM Manager?

We can check following to see if there is corruption in Oracle VM Manager Database.


  1. Look for ONF (Object Not Found) errors in OVM DB
  2. Validate if Daily AutoFullBackup DB backups stopped working.
  3. Look for Object Not Found (ONF) and Cluster is null errors in OVM Manager Admin Server logs.

Below are detailed steps for validating above points to determine if there is OVM DB corruption.


1) Look for ONF (Object Not Found) errors in OVM DB


For this login to the Host where OVM Manager is running and follow below steps to check if there are ONF errors in OVM DB.


a. Login to EMOC Control vserver which runs OVMM as root user.


b. Login to OVM shell prompt by running below command.


/usr/bin/ovm_shell.sh -u admin -p <password>

In above command replace <password> with the OVMM admin user password. You will be logged into ">>>" OVMM shell prompt.


c. Run below commands in same order in OVMM shell prompt.

om = OvmClient.getOvmManager()
f = om.getFoundryContext()
f.fixupScan()

If there is no ONF errors we should see blank output []. If we see any output when running above steps, it means that there is corruption and inconsistencies in OVM DB.

2) Validate if Daily AutoFullBackup DB backups stopped working.

Run below command to validate if there are AutoFullBackup DB backups are happening regularly.


ls -ldt /u01/app/oracle/mysql/dbbackup/Auto*

Please note above is the default OVM DB autobackups directory. If you have changed the default directory make changes to above command as needed.


3) Check if there are any "cluster is null" or "ObjectNotFound" errors in OVM Manager Admin Server logs


For this login to the Host where you have OVM Manager running and run below command.

egrep -iR "cluster is null|ObjectNotFound" /u01/app/oracle/ovm-manager-3/domains/ovm_domain/servers/AdminServer/logs/AdminServer*

If you see ObjectNotFound or "cluster is null" errors as follows, that means that there is corruption in OVM Manager DB.
<Exception in archiver moving jobs to jpa store: No such object (level 1), cluster is null: <XXXX>

<Day> <Mon DD Time> com.oracle.odof.exception.ObjectNotFoundException: No such object (level 1), cluster is null: <XXXX>

Above is the default OVM Manager Admin Server log directory in OVM 3.3 & higher versions. In some versions of OVM Manager (old versions) the Admin Server log directory may be different.


Products to which Article Applies


Oracle VM Manager versions 3.3 & Above

Additional References

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


LINUX: How To Check NTP Synchronization and Troubleshoot any issues with NTP? ("ntpq" command)

Following command can be used to check NTP synchronization and check and troubleshoot NTP issues.
ntpq -pn

For more accurate analysis of NTP synchronization, it is best to run above command in loop for 3 times and check the output. Below is command to run above command in loop for 3 times. Command can be modified based on how many times you want to run it in loop. Just change value 3 in below command to the number you want to run in loop.

for i in {1..3};  do echo $i && ntpq -pn  && echo "=============================" ; done

Below is example output of above command.


      remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+10.10.10.1    10.30.30.1      4 u  861 1024  377    1.323  -2.567   0.526
-10.10.10.2    10.30.30.3      4 u  902 1024  377    0.528   -3.709   0.046
+10.10.10.3    10.30.30.2     4 u  159 1024  377    1.279   -2.304   0.109
*10.10.10.4    10.30.30.1      4 u 1046 1024  377    0.350   -1.573   0.005

Important things to check in this output are reach, delay, offset and jitter. Below are details.


  • reach - value should be 377. contains the results of the most recent eight NTP updates.  If all eight are successful, this field will read 377. This number is in octal, so eight successes in octal will be represented by 377
  • delay - value should be lower which means there is minimal delay in communication between local machine and NTP server. Value is in milliseconds.
  • offset - time difference between local machine and NTP server. Lower the value, healthy is NTP. Value is in milliseconds.
  • jitter - Amount of variance in time between local machine and NTP server. Lower the value, healthy is NTP. Value is in milliseconds.

Products to which Article Applies


All Linux environments


Additional References

http://www.ntp.org/ntpfaq/NTP-s-trouble.htm#Q-MON-REACH
https://www.streetdirectory.com/travel_guide/126336/computers/common_ntp_server_terminology_explained.html


LINUX: How To Capture TCP/IP Packets Information For Troubleshooting Network Issues between Two Linux Hosts? ("tcpdump" & "ip" command)

For troubleshooting network communication issues between two Linux hosts. We have to check and verify following on how the tcp/ip packets are transmitted.

  • If the source is sending the packets
  • destination is receiving the packet and sending the reply back.
  • If source is receving the reply back
  • If there are any dropped packets at source during communication.
  • If therea are any dropped packets at destination during communication.

For checking above things we have to do ping tests between Linux hosts which have communication issue and capture following data.

  • tcpdumps capture on ICMP ping protocol- which shows how the tcp/ip packets are transmitted.
  • "ip -s -s -s link" command outputs before and after capturing tcpdumps to see if there is any increase in packet loss.

Network Troubleshooting Data Gathering Steps
Below are steps to capture tcpdumps and ip link command outputs for troubleshooting network issues.

1. Identify two Linux hosts (VM's or Physical hosts) - source and destination VM's which have communication issues. Make a Note of the Linux Hostnames.

2. Identify the network bond/interface name for both source and destination Linux Hosts over which they have communication issues. For e.g. bond1 or eth1 etc.

3. Run below command on the source Linux Host which has issues and capture the ip link command output before the tcpdump test.
ip -s -s -s link>>/tmp/iplink_before_`hostname -s`.out

Above command captures the iplink command output inside /tmp/iplink_before_<hostname>.out file.


4. Run below command on the Destination Linux Host which has issues and capture the ip link command output before the tcpdump test.
ip -s -s -s link>>/tmp/iplink_before_`hostname -s`.out

Above command captures the iplink command output inside /tmp/iplink_before_<hostname>.out file.

5. Now open 2 SSH sessions for each source and destination Linux Hosts.

6. Now in one of the SSH sessions for the source Linux Host run below tcpdump command.
tcpdump -n -i bondX icmp -w /tmp/tcpdumps__$(date +%F'-'%T)_`hostname`.pcap

In above command bondX will be the bond interface of source Linux host. This command saves the tcpdumps inside /tmp with filename as tcpdump_<date/timestamps>_<hostname>. Leave the tcpdump command running and do not do Ctrl C

For e.g. if source Linux Host network is bond1, above command looks like below.
tcpdump -n -i bond1 icmp -w /tmp/tcpdumps__$(date +%F'-'%T)_`hostname`.pcap

7.  Now in one of the SSH sessions for the destination Linux Host run below tcpdump command.

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

In above command bondX will be the bond interface of destination VM. This command saves the tcpdumps inside /tmp with filename as tcpdump_<date/timestamps>_<hostname>. Leave the tcpdump command running and do not do Ctrl C


For e.g. if destination Linux Host is bond1, above command looks like below.
tcpdump -n -i bond1 icmp -w /tmp/tcpdumps__$(date +%F'-'%T)_`hostname`.pcap

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

ping -c 5 <destination Linux Host IP>

9. Now send 5 pings from another SSH session of destination Linux Host to source Linux Host IP as follows
ping -c 5 <source Linux Host IP>

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

11. Wait for about 2 minutes at this time.

12.Run below command on the source Linux Host which has issues and capture the ip link command output after the tcpdump test.
ip -s -s -s link>>/tmp/iplink_after_`hostname -s`.out

Above command captures the iplink command output inside /tmp/iplink_after_<hostname>.out file.

13. Run below command on the Destination Linux Host which has issues and capture the ip link command output after the tcpdump test.
ip -s -s -s link>>/tmp/iplink_after_`hostname -s`.out

Above command captures the iplink command output inside /tmp/iplink_after_<hostname>.out file.

14. Capture below data from above steps from both source and destination Linux hosts.


/tmp/tcpdump_*
/tmp/iplink_* 

From above data collection steps we should have below data

From source Linux Host

  • tcpdumps which were captured
  • iplink command output before tcpdump capture
  • iplink command output after tcpdump capture
From Destination Linux Host

  • tcpdumps which were captured
  • iplink command output before tcpdump capture
  • iplink command output after tcpdump capture


Analyzing Data Gathered For Network Issues
TCPDUMPS review

tcpdumps can either be reviewed using wireshark on local machine or they can reviewed on the Linux host itself where they were captured using below tcpdump command.
tcpdump -r <tcpdump filename>

Check the tcpdumps from the source Linux host to see if the packets are going out to destination Linux Host and reply is coming back.

For example in this case lets assume source Linux Host IP is 10.10.10.11 and Destination Linux Host IP is 10.10.10.22, when we look at the tcpdumps on source Linux Host (with .11 IP) we should be seeing requests going out to .22 IP and reply coming back from .22 IP as follows
13:11:13.017013 IP 10.10.10.11 > 10.10.10.22: ICMP echo request, id 6384, seq 28126, length 64
13:11:13.017049 IP 10.10.10.22 > 10.10.10.11: ICMP echo reply, id 6384, seq 28126, length 64
13:11:14.016897 IP 10.10.10.11 > 10.10.10.22: ICMP echo request, id 6384, seq 28127, length 64
13:11:14.016918 IP 10.10.10.22 > 10.10.10.11: ICMP echo reply, id 6384, seq 28127, length 64


Same way when we check the tcpdumps on destination Linux host (with .22 IP), we should see requests coming in from source .11 IP and reply sent back to .11 IP. For example below is the snippet.

13:11:57.195307 IP 10.10.10.11 > 10.10.10.22: ICMP echo request, id 28322, seq 1, length 64
13:11:57.195343 IP 10.10.10.22 > 10.10.10.11: ICMP echo reply, id 28322, seq 1, length 64
13:11:58.185332 IP 10.10.10.11 > 10.10.10.22: ICMP echo request, id 28322, seq 2, length 64
13:11:58.185353 IP 10.10.10.22 > 10.10.10.11: ICMP echo reply, id 28322, seq 2, length 64

"ip -s -s -s link" Output Review

For both source and destination Linux hosts when we review "ip -s -s -s link" in a ideal working scenario there should not be increase in dropped packets on the network interface (where troubleshooting is done) before or after the tcpdumps capture, there should NOT be increase in RX or TX packets drop. 

For example below is sample output of "ip -s -s -s link" command. We should not see increase in dropped packet numbers for RX (received) and TX (transmitted).
bond1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP mode DEFAULT qlen 1000

    link/ether 00:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast
    28070237   308525   0       0    0       4486
    RX errors: length   crc     frame   fifo    missed
               0        0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    179835757  350942   0       0       0       0
    TX errors: aborted  fifo   window heartbeat transns
               0        0       0       0       2    

Above data capture and review will give enough information where the packets are getting dropped when troubleshooting network communication related information.



Products to which Article Applies


All Linux environments

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