Monday, May 26, 2014

Dropped RX packets in ifconfig output

Operating System:
SLES 10 SP2 64 Bit

Problem :
Ifconfig shows dropped packets in RX packets and it keeps on increasing while working


Ifconfig output may shows as follows,

# ifconfig eth0

eth0 Link encap:Ethernet HWaddr 00:1C:C4:96:DE:EA
inet addr:192.168.39.170 Bcast:192.168.39.255 Mask:255.255.255.0
inet6 addr: fe80::21c:c4ff:fe96:deea/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5307978 errors:0 dropped:34356 overruns:0 frame:0
TX packets:1522673 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1775345955 (1693.1 Mb) TX bytes:967976568 (923.1 Mb)
Interrupt:169 Memory:dc000000-dc012100

 In above, you can see dropped packets highlighted. NIC Driver used in bnx2 and controller is Broadcom 5708 NetXtreme II in HP DL 580 G5

NIC Driver bnx2 version : 1.6.7c . This can be confirmed using command "modinfo bnx2"

filename: /lib/modules/2.6.16.60-0.33-xenpae/kernel/drivers/net/bnx2.ko
version: 1.6.7c
license: GPL
description: Broadcom NetXtreme II BCM5706/5708 Driver
author: Michael Chan
srcversion: D41ADC8BC49443A4DAE505E
alias: pci:v000014E4d0000163Asv*sd*bc*sc*i*
alias: pci:v000014E4d00001639sv*sd*bc*sc*i*
alias: pci:v000014E4d000016ACsv*sd*bc*sc*i*
alias: pci:v000014E4d000016AAsv*sd*bc*sc*i*
alias: pci:v000014E4d000016AAsv0000103Csd00003102bc*sc*i*
alias: pci:v000014E4d0000164Csv*sd*bc*sc*i*
alias: pci:v000014E4d0000164Asv*sd*bc*sc*i*
alias: pci:v000014E4d0000164Asv0000103Csd00003106bc*sc*i*
alias: pci:v000014E4d0000164Asv0000103Csd00003101bc*sc*i*
depends:
supported: yes
vermagic: 2.6.16.60-0.33-xenpae SMP Xen 686 REGPARM gcc-4.1
parm: disable_msi:Disable Message Signaled Interrupt (MSI) (int)


linux-hvb0:~ # lspci | grep -i broadcom
05:00.0 PCI bridge: Broadcom EPB PCI-Express to PCI-X Bridge (rev c3)
06:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5708 Gigabit Ethernet (rev 12)
07:00.0 PCI bridge: Broadcom EPB PCI-Express to PCI-X Bridge (rev c3)
08:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5708 Gigabit Ethernet (rev 12)
linux-hvb0:~ #


Downloaded and installed kernel 2.6.16.60-0.42.10-default for SLES 10 SP2, then NIC Driver found updated to 1.7.6b and there are no dropped packets in eth0. Same is confirmed from ifconfig output



Now there is no dropped packets. Problem solved. Enjoy the solution.

Thursday, May 15, 2014

How to transfer files through ftp without affecting the integrity of file?

How to transfer files through ftp without affecting the integrity of file?

Login to FTP Server and always select BINARY mode for transferring files.

This will allow the system to transfer files properly. Once transferred, file integrity i.e. chksum md5 value can be checked using md5sum command.

Both source file and destination files will show same md5sum value.

Wednesday, November 7, 2012

YUM Configuration fom RHEL 5 Onwards



[root@redhat5 /]# rpm ivh /public/repo/createrepo-0.4.4-2.fc6.noarch.rpm
[root@redhat5 /]# createrepo /public/repo
2179/2179 - libevent-1.1a-3.2.1.i386.rpm                                        m
Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@redhat5 ~]# vim /etc/yum.repos.d/rhel-debuginfo.repo
[rhel]
name=RHEL5
baseurl=ftp://192.168.1.5
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[root@redhat5 ~]# yum install xinetd
Loading "installonlyn" plugin
Loading "rhnplugin" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Setting up repositories
rhel                      100% |=========================|  951 B    00:00
Reading repository metadata in from local files
primary.xml.gz            100% |=========================| 751 kB    00:00
################################################## 2178/2178
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for xinetd to pack into transaction set.
xinetd-2.3.14-10.el5.i386 100% |=========================| 7.7 kB    00:00
---> Package xinetd.i386 2:2.3.14-10.el5 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 xinetd                  i386       2:2.3.14-10.el5  rhel              124 k

Transaction Summary
=============================================================================
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)

Total download size: 124 k
Is this ok [y/N]: y
Downloading Packages:
(1/1): xinetd-2.3.14-10.e 100% |=========================| 124 kB    00:00
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 37017186
Importing GPG key 0x37017186 "Red Hat, Inc. (release key) "
Is this ok [y/N]: y
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: xinetd                       ######################### [1/1]

Installed: xinetd.i386 2:2.3.14-10.el5
Complete!

MANAGING DISK IN LINUX


[root@redhat5 ~]# fdisk -l

Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14          78      522112+  82  Linux swap / Solaris
/dev/sda3              79        1044     7759395   83  Linux

Disk /dev/sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         652     5237158+  83  Linux

Disk /dev/sdc: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdc doesn't contain a valid partition table

Disk /dev/sdd: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdd doesn't contain a valid partition table

Disk /dev/sde: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sde doesn't contain a valid partition table

Disk /dev/sdf: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdf doesn't contain a valid partition table

[root@redhat5 ~]# fdisk /dev/sdc
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-130, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-130, default 130):
Using default value 130

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

 [root@redhat5 ~]# fdisk -l

Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14          78      522112+  82  Linux swap / Solaris
/dev/sda3              79        1044     7759395   83  Linux

Disk /dev/sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         652     5237158+  83  Linux

Disk /dev/sdc: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1         130     1044193+  83  Linux

Disk /dev/sdd: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1         130     1044193+  83  Linux

Disk /dev/sde: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1         130     1044193+  83  Linux

Disk /dev/sdf: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               1         130     1044193+  83  Linux

[root@redhat5 ~]# partprobe /dev/sdc
[root@redhat5 ~]# partprobe /dev/sdd
[root@redhat5 ~]# partprobe /dev/sde
[root@redhat5 ~]# partprobe /dev/sdf

Setup Passwordless login through SSH




Server 1 == IP 192.16.0.1    Application
Server 2 == IP 192.16.0.2    Backup

Step 1: Create SSH keys in both servers
Server1: 192.16.0.1:
# cd /root/.ssh
# rm -rf /root/.ssh/*
# ssh-keygen

Server 2: 192.16.0.2:
# cd /root/.ssh
# rm -rf /root/.ssh/*
# ssh-keygen

Step 2: Copy the public keys to other server
Server 1: 192.16.0.1:
# scp /root/.ssh/id_rsa.pub root@192.16.0.2:/root/.ssh/authorized_keys

Server 2: 192.16.0.2: 
# scp /root/.ssh/id_rsa.pub root@192.16.0.1:/root/.ssh/authorized_keys

Step 3: Restart SSH service in both servers
Server 1: 192.16.0.1
# service sshd restart

Server 2: 192.16.0.2
# service sshd restart

Step 4: Now check login without password
Server 1: 192.16.0.1
# ssh 192.16.0.2      => check whether logging in without password

Server 2: 192.16.0.2
# ssh 192.16.0.1      => check whether logging in without password

Saturday, April 11, 2009

Network Card (RTL8168) installation in RHEL 5

Operating system: RHEL 5
Problem: Network card driver is not getting installed in RHEL 5
Error: If the command # make install is given, it is giving following error,
[root@linux r8168-8.008.00]# make install
make -C src/ install
make[1]: Entering directory `/tmp/r8168-8.008.00/src'
install -m 744 -c r8168.ko /lib/modules/2.6.18-8.el5/kernel/drivers/net/
install: cannot stat `r8168.ko': No such file or directory
make [1]: *** [install] Error 1
make[1]: Leaving directory `/tmp/r8168-8.008.00/src'
make: *** [install] Error 2

Steps to install: Unpack the tarball:
# tar vjxf r8168-8.008.00.tar.bz2
Change to the directory:
# cd r8168-8.008.00
If you are running the target kernel, then you should be able to do before doing the follow command, you need to login as root.
For installing and compiling drivers, package kernel-devel and gcc packages are to be installed.

# rpm =ivh kernel-devel-2.6.18-8.el5
After installing this package, kernel development tools will be installed inside /usr/src/kernels.A link to be created in /usr/src for the kernel tools. For that, execute following command,
# ln -s /usr/src/kernels/2.6.18-8.el5-i686 /usr/src/linux
Now link "linux" is created inside /usr/src.
Now execute # make clean modules
then output will be something similar to following message,
[root@linux r8168-8.008.00]# make clean modules
make -C src/ clean
make[1]: Entering directory `/tmp/r8168-8.008.00/src'
rm -rf *.o *.ko *~ core* .dep* .*.d .*.cmd *.mod.c *.a *.s .*.flags .tmp_versions Module.symvers Modules.symvers *.order
make[1]: Leaving directory `/tmp/r8168-8.008.00/src'
make -C src/ modules
make[1]: Entering directory `/tmp/r8168-8.008.00/src'
make -C /lib/modules/2.6.18-8.el5/build SUBDIRS=/tmp/r8168-8.008.00/src modules
make[2]: Entering directory `/usr/src/kernels/2.6.18-8.el5-i686'
CC [M] /tmp/r8168-8.008.00/src/r8168_n.o
/tmp/r8168-8.008.00/src/r8168_n.c: In function ârtl8168_tx_clearâ:
/tmp/r8168-8.008.00/src/r8168_n.c:3763: warning: unused variable âdevâ
/tmp/r8168-8.008.00/src/r8168_n.c: At top level:
/tmp/r8168-8.008.00/src/r8168_n.c:2420: warning: ârtl8168_phy_power_downâ defined but not used
LD [M] /tmp/r8168-8.008.00/src/r8168.o
Building modules, stage 2.
MODPOST
CC /tmp/r8168-8.008.00/src/r8168.mod.o
LD [M] /tmp/r8168-8.008.00/src/r8168.ko
make[2]: Leaving directory `/usr/src/kernels/2.6.18-8.el5-i686'
strip --strip-debug r8168.ko
make[1]: Leaving directory `/tmp/r8168-8.008.00/src'

Then execute # make install, result will look like as follows,

[root@linux r8168-8.008.00]# make install
make -C src/ install
make[1]: Entering directory `/tmp/r8168-8.008.00/src'
install -m 744 -c r8168.ko /lib/modules/2.6.18-8.el5/kernel/drivers/net/
make[1]: Leaving directory `/tmp/r8168-8.008.00/src'


[root@linux r8168-8.008.00]# /sbin/depmod -a

[root@linux r8168-8.008.00]# insmod /lib/modules/2.6.18-.el5/kernel/drivers/net/r8168.ko

After successful installation,
[root@linux r8168-8.008.00]# lsmod grep r8168 and check for driver is linked with kernel.
Using ifconfig or system-config-network utility, configure the network parameters.

Wednesday, April 8, 2009

Telnet in RHEL5

First check whether telnet-server rpm in installed,
# rpm -q telnet-s
erver
telnet-server-0.17-38.el5
If it is installed, then edit
# vi /etc/xinet.d/telnet
change the line disable= yes to disable = no
Then # service xinetd restart
Now We can able to telnet connection of linux system.
Note : It works for the system which is not protected with IPtables and Selinux
If you have iptables enabled. then please follow as below,
Make a rule to allow telnet from external clients
# iptables -I INPUT -p tcp --dport 23 -j ACCEPT
# service iptables save
# service iptables restart
Just give following command and make sure that rule is saved.

# iptables -L
This rule is to allow request coming to port number 23 i.e. telnet connections from any client.

Ansible Playbook to collect uptime of servers

Hi,  This is to explain how we can write a small playbook to collect uptime of all servers in our environment. We can use our own server l...