h1

Missing Dependency: perl(URI)

November 10, 2010

Solution with an example below
###########################################

-bash-3.2# yum install subversion
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: centos.mirror.netriplex.com
* base: mirror.sanctuaryhost.com
* extras: mirror.steadfast.net
* updates: mirrors.serveraxis.net
addons                                                                                                                                           |  951 B     00:00
base                                                                                                                                             | 2.1 kB     00:00
extras                                                                                                                                           | 2.1 kB     00:00
updates                                                                                                                                          | 1.9 kB     00:00
Excluding Packages in global exclude list
Finished
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package subversion.i386 0:1.4.2-4.el5_3.1 set to be updated
–> Processing Dependency: perl(URI) >= 1.17 for package: subversion
–> Processing Dependency: neon >= 0.25.5-6.el5 for package: subversion
–> Processing Dependency: libneon.so.25 for package: subversion
–> Running transaction check
—> Package neon.i386 0:0.25.5-10.el5_4.1 set to be updated
—> Package subversion.i386 0:1.4.2-4.el5_3.1 set to be updated
–> Processing Dependency: perl(URI) >= 1.17 for package: subversion
–> Finished Dependency Resolution
subversion-1.4.2-4.el5_3.1.i386 from base has depsolving problems
–> Missing Dependency: perl(URI) >= 1.17 is needed by package subversion-1.4.2-4.el5_3.1.i386 (base)
Error: Missing Dependency: perl(URI) >= 1.17 is needed by package subversion-1.4.2-4.el5_3.1.i386 (base)
You could try using –skip-broken to work around the problem
You could try running: package-cleanup –problems
package-cleanup –dupes
rpm -Va –nofiles –nodigest
The program package-cleanup is found in the yum-utils package.

Solution
#########################
Get the latest perl-URI rpm from http://packages.sw.be/perl-URI/ and install it:


-bash-3.2# wget http://packages.sw.be/perl-URI/perl-URI-1.17-1.el2.rf.noarch.rpm
–2010-11-09 19:43:20–  http://packages.sw.be/perl-URI/perl-URI-1.17-1.el2.rf.noarch.rpm
Resolving packages.sw.be… 85.13.226.40
Connecting to packages.sw.be|85.13.226.40|:80… connected.
HTTP request sent, awaiting response… 302 Found
Location: http://rpmforge.sw.be/redhat/el2.1/en/i386/rpmforge/RPMS/perl-URI-1.17-1.el2.rf.noarch.rpm [following]
–2010-11-09 19:43:20–  http://rpmforge.sw.be/redhat/el2.1/en/i386/rpmforge/RPMS/perl-URI-1.17-1.el2.rf.noarch.rpm
Resolving rpmforge.sw.be… 85.13.226.40
Reusing existing connection to packages.sw.be:80.
HTTP request sent, awaiting response… 200 OK
Length: 94140 (92K) [application/x-rpm]
Saving to: `perl-URI-1.17-1.el2.rf.noarch.rpm’

100%[==============================================================================================================================>] 94,140       193K/s   in 0.5s

2010-11-09 19:43:21 (193 KB/s) – `perl-URI-1.17-1.el2.rf.noarch.rpm’ saved [94140/94140]

-bash-3.2# rpm -ivh perl-URI-1.17-1.el2.rf.noarch.rpm
Preparing…                ########################################### [100%]
1:perl-URI               ########################################### [100%]

-bash-3.2# yum install subversion
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: centos.mirror.netriplex.com
* base: mirror.sanctuaryhost.com
* extras: mirror.steadfast.net
* updates: mirrors.serveraxis.net
addons                                                                                                                                           |  951 B     00:00
base                                                                                                                                             | 2.1 kB     00:00
extras                                                                                                                                           | 2.1 kB     00:00
updates                                                                                                                                          | 1.9 kB     00:00
Excluding Packages in global exclude list
Finished
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package subversion.i386 0:1.4.2-4.el5_3.1 set to be updated
–> Processing Dependency: neon >= 0.25.5-6.el5 for package: subversion
–> Processing Dependency: libneon.so.25 for package: subversion
–> Running transaction check
—> Package neon.i386 0:0.25.5-10.el5_4.1 set to be updated
–> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
Package                                  Arch                               Version                                           Repository                          Size
========================================================================================================================================================================
Installing:
subversion                               i386                               1.4.2-4.el5_3.1                                   base                               2.3 M
Installing for dependencies:
neon                                     i386                               0.25.5-10.el5_4.1                                 base                               101 k

Transaction Summary
========================================================================================================================================================================
Install       2 Package(s)
Upgrade       0 Package(s)

Total download size: 2.4 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): neon-0.25.5-10.el5_4.1.i386.rpm                                                                                                           | 101 kB     00:00
(2/2): subversion-1.4.2-4.el5_3.1.i386.rpm                                                                                                       | 2.3 MB     00:01
————————————————————————————————————————————————————————
Total                                                                                                                                   1.2 MB/s | 2.4 MB     00:02
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing     : neon                                                                                                                                             1/2
Installing     : subversion                                                                                                                                       2/2

Installed:
subversion.i386 0:1.4.2-4.el5_3.1

Dependency Installed:
neon.i386 0:0.25.5-10.el5_4.1

Complete!
-bash-3.2#

h1

Virtuozo : Clone container Within Hardware Node

October 19, 2010

[root@vps001 ~]# vzmlocal -C 149:150
Moving/copying CT#149 -> CT#150, [], [] …
Check disk space
Tracker started
Syncing private area ‘/vz/private/149′->’/vz/private/150′
done
OfflineManagement CT#149 …
done
Stopping CT#149 …
done
Syncing tracked files from ‘/vz/private/149/fs’ to ‘/vz/private/150/fs’
done
Copying/modifying config scripts of CT#149 …
OfflineManagement CT#149 …
done
Starting CT#149 …
vzctl : Hostname for Container set: server1.SOMENAME.org
vzctl : File resolv.conf was modified
done
Successfully completed
[root@vps001 ~]#

However, before starting to use Container 150, you should set another IP address and another hostname for this Container which are currently identical to those of Container 149.

Ref: http://download.swsoft.com/virtuozzo/virtuozzo4.0/docs/en/lin/VzLinuxUG/16260.htm

h1

Automated Process monitoring during high server load

August 26, 2010

root@myServer [/root]# cat load-process-monitor.sh
#!/bin/bash

# Define Variables
DT=`date +”%A %b %e %r”`
HOSTNAME=`hostname`

# Create dir to store data
mkdir -p /opt/loadcheck/

# Retrieve the load average of the past 1 minute
LAVG=`uptime | awk {‘print $10}’ | cut -d. -f1`
LCURRENT=`uptime | awk {‘print $10,$11,$12}’`

# Define Threshold. This value will be compared with the current load average. Set the value as per your wish.
LIMIT=-1

# Compare the current load average with Threshold and email the server administrator if threshold is greater.

if [ $LAVG -gt $LIMIT ]
then

#Save the current running processes in a file
/bin/ps -auxf >> /opt/ps_output

echo “Current Time :: $DT. >> /tmp/loadmon.txt
echo “Current Load Average :: $LCURRENT. >> /tmp/loadmon.txt
echo “current processes list attached with the email 1 instance. >> /tmp/loadmon.txt
echo “Also check loadps.txt :: loadtop.txt :: netstat_all.txt :: netstat_port80.txt inside /opt/loadcheck/ on the server” >> /tmp/loadmon.txt
# Send email to support
/usr/bin/mutt -s “Server Load ALERT!!! High 1 minute load average on ‘$HOSTNAME’” -a /opt/ps_output support@somedomain.com > /opt/ps_output

echo “Current Time :: $DT” >> /tmp/loadmon.txt
echo “Current Load Average :: $LCURRENT” >> /tmp/loadmon.txt
echo “current processes list attached with the email 1 instance” >> /tmp/loadmon.txt
echo “Also check loadps.txt :: loadtop.txt :: netstat_all.txt :: netstat_port80.txt inside /opt/loadcheck/ on the server” >> /tmp/loadmon.txt
# Send email to support
/usr/bin/mutt -s ” Server Load ALERT ::: High 1 minute load average on ‘$HOSTNAME’ ” -a /opt/ps_output support@integrityhost.com > /opt/loadcheck/loadps.txt
echo “#########################################################################################################################” >> /opt/loadcheck/loadps.txt
/bin/top -c -n1 >> /opt/loadcheck/loadtop.txt
echo “#########################################################################################################################” >> /opt/loadcheck/loadtop.txt
/bin/netstat -ntu | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n >> /opt/loadcheck/netstat_all.txt
echo “#########################################################################################################################” >> /opt/loadcheck/netstat_all.txt
/bin/netstat -alntp | grep :80 | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n >> /opt/loadcheck/netstat_port80.txt
echo “#########################################################################################################################” >> /opt/loadcheck/netstat_port80.txt

/bin/ps -auxf >> /opt/loadcheck/loadps.txt
echo “#########################################################################################################################” >> /opt/loadcheck/loadps.txt
/bin/top -c -n1 >> /opt/loadcheck/loadtop.txt
echo “#########################################################################################################################” >> /opt/loadcheck/loadtop.txt
/bin/netstat -ntu | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n >> /opt/loadcheck/netstat_all.txt
echo “#########################################################################################################################” >> /opt/loadcheck/netstat_all.txt
/bin/netstat -alntp | grep :80 | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n >> /opt/loadcheck/netstat_port80.txt
echo “#########################################################################################################################” >> /opt/loadcheck/netstat_port80.txt

/bin/ps -auxf >> /opt/loadcheck/loadps.txt
echo “#########################################################################################################################” >> /opt/loadcheck/loadps.txt
/bin/top -c -n1 >> /opt/loadcheck/loadtop.txt
echo “#########################################################################################################################” >> /opt/loadcheck/loadtop.txt
/bin/netstat -ntu | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n >> /opt/loadcheck/netstat_all.txt
echo “#########################################################################################################################” >> /opt/loadcheck/netstat_all.txt
/bin/netstat -alntp | grep :80 | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n >> /opt/loadcheck/netstat_port80.txt
echo “#########################################################################################################################” >> /opt/loadcheck/netstat_port80.txt

/bin/ps -auxf >> /opt/loadcheck/loadps.txt
echo “#########################################################################################################################” >> /opt/loadcheck/loadps.txt
/bin/top -c -n1 >> /opt/loadcheck/loadtop.txt
echo “#########################################################################################################################” >> /opt/loadcheck/loadtop.txt
/bin/netstat -ntu | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n >> /opt/loadcheck/netstat_all.txt
echo “#########################################################################################################################” >> /opt/loadcheck/netstat_all.txt
/bin/netstat -alntp | grep :80 | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n >> /opt/loadcheck/netstat_port80.txt
echo “#########################################################################################################################” >> /opt/loadcheck/netstat_port80.txt

/bin/ps -auxf >> /opt/loadcheck/loadps.txt
echo “#########################################################################################################################” >> /opt/loadcheck/loadps.txt
/bin/top -c -n1 >> /opt/loadcheck/loadtop.txt
echo “#########################################################################################################################” >> /opt/loadcheck/loadtop.txt
/bin/netstat -ntu | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n >> /opt/loadcheck/netstat_all.txt
echo “#########################################################################################################################” >> /opt/loadcheck/netstat_all.txt
/bin/netstat -alntp | grep :80 | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n >> /opt/loadcheck/netstat_port80.txt
echo ” ######################################################################################################################### ” >> /opt/loadcheck/netstat_port80.txt

fi

# Remove residue logs
/bin/rm -f /tmp/loadmon.txt
/bin/rm -f /opt/ps_output

root@myServer [/root]#

Add a cron to run load-process-monitor.sh ( * * * * * /bin/sh /path-to/load-process-monitor.sh ) every min and when server load goes beyond 4, it will send you email and log some important details, which can help to some extent to find some pointers to load issue from process and netstat listings.

h1

write a message to a particular user through terminal

April 21, 2010

We use wall to broadcast any message to all users logged in at any point of time through terminal

We can use ‘write’ command to send or write a message to a particular user through terminal.


root@server1056 [/root]# w
18:23:38 up 22 days, 17:03, 3 users, load average: 0.47, 0.22, 0.12
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 1x.3x.7x.53-sta 17:48 0.00s 0.06s 0.06s -bash
root pts/3 12x.16x.6x.138 16:14 40:29 0.19s 0.19s -bash
obama pts/4 adsl-7x-4x-1x-18 Mon18 47:18m 0.00s 0.01s sshd: obama [priv]


root@server1056 [/root]# write obama pts/4

hey bud, please call me, I lost your no. since my cell was stolen.

root@server1056 [/root]#

After typing “write obama pts/4″ as the command hit enter key once,

then type your message and hit your enter key once to push the message.

then hit ctrl+d to exit out of the write session.

h1

Error: Missing Dependency: perl(Convert::ASN1) is needed by package samba

April 1, 2010

Error
root@server276 [~]# yum -y install samba samba-client samba-common
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: hpc.arc.georgetown.edu
* base: mirror.trouble-free.net
* extras: ftp.lug.udel.edu
* rpmforge: apt.sw.be
* updates: mirror.clarkson.edu
Excluding Packages in global exclude list
Finished
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package samba.x86_64 0:3.0.33-3.15.el5_4.1 set to be updated
–> Processing Dependency: perl(Convert::ASN1) for package: samba
—> Package samba-client.x86_64 0:3.0.33-3.15.el5_4.1 set to be updated
—> Package samba-common.i386 0:3.0.33-3.15.el5_4.1 set to be updated
—> Package samba-common.x86_64 0:3.0.33-3.15.el5_4.1 set to be updated
–> Finished Dependency Resolution
samba-3.0.33-3.15.el5_4.1.x86_64 from updates has depsolving problems
–> Missing Dependency: perl(Convert::ASN1) is needed by package samba-3.0.33-3.15.el5_4.1.x86_64 (updates)
Error: Missing Dependency: perl(Convert::ASN1) is needed by package samba-3.0.33-3.15.el5_4.1.x86_64 (updates)
You could try using –skip-broken to work around the problem
You could try running: package-cleanup –problems
package-cleanup –dupes
rpm -Va –nofiles –nodigest
The program package-cleanup is found in the yum-utils package.

Soln

root@server276 [~]# wget http://dag.wieers.com/rpm/packages/perl-Convert-ASN1/perl-Convert-ASN1-0.21-2.el5.rf.noarch.rpm
root@server276 [~]# rpm -Uvh perl-Convert-ASN1-0.21-2.el5.rf.noarch.rpm
Preparing… ########################################### [100%]
1:perl-Convert-ASN1 ########################################### [100%]
root@server276 [~]# yum -y install samba samba-client samba-common
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: hpc.arc.georgetown.edu
* base: mirror.trouble-free.net
* extras: ftp.lug.udel.edu
* rpmforge: apt.sw.be
* updates: mirror.clarkson.edu
Excluding Packages in global exclude list
Finished
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package samba.x86_64 0:3.0.33-3.15.el5_4.1 set to be updated
—> Package samba-client.x86_64 0:3.0.33-3.15.el5_4.1 set to be updated
—> Package samba-common.i386 0:3.0.33-3.15.el5_4.1 set to be updated
—> Package samba-common.x86_64 0:3.0.33-3.15.el5_4.1 set to be updated
–> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================
Installing:
samba x86_64 3.0.33-3.15.el5_4.1 updates 16 M
samba-client x86_64 3.0.33-3.15.el5_4.1 updates 5.7 M
samba-common i386 3.0.33-3.15.el5_4.1 updates 8.7 M
samba-common x86_64 3.0.33-3.15.el5_4.1 updates 8.8 M

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

Total download size: 40 M
Downloading Packages:
(1/4): samba-client-3.0.33-3.15.el5_4.1.x86_64.rpm | 5.7 MB 00:03
(2/4): samba-common-3.0.33-3.15.el5_4.1.i386.rpm | 8.7 MB 00:03
(3/4): samba-common-3.0.33-3.15.el5_4.1.x86_64.rpm | 8.8 MB 00:02
(4/4): samba-3.0.33-3.15.el5_4.1.x86_64.rpm | 16 MB 00:04
————————————————————————————————————————————————————–
Total 2.7 MB/s | 40 MB 00:14
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : samba-common 1/4
Installing : samba-common 2/4
Installing : samba-client 3/4
Installing : samba 4/4

Installed:
samba.x86_64 0:3.0.33-3.15.el5_4.1 samba-client.x86_64 0:3.0.33-3.15.el5_4.1 samba-common.i386 0:3.0.33-3.15.el5_4.1
samba-common.x86_64 0:3.0.33-3.15.el5_4.1

Complete!
root@server276 [~]#

h1

Updating OS EZ Template Caches

August 24, 2009

#####################################

[root@vps ~]# ls /vz/template/cache
centos-5-x86.tar.gz fedora-core-9-x86.tar.gz ubuntu-8.04-x86.tar.gz
[root@vps ~]#

[root@vps ~]# vzpkg update cache centos-5-x86
Update OS template cache for centos-5-x86 template

Loading “rpm2vzrpm” plugin
Cleaning up xml metadata
16 metadata files removed

Loading “rpm2vzrpm” plugin
Making cache files for all metadata files.
This may take a while depending on the speed of this computer
Setting up repositories
base0 100% |=========================| 1.1 kB 00:00
base1 100% |=========================| 951 B 00:00
base2 100% |=========================| 951 B 00:00
base3 100% |=========================| 951 B 00:00
primary.xml.gz 100% |=========================| 878 kB 00:00
primary.xml.gz 100% |=========================| 306 kB 00:00
base1 : ################################################## 465/465
Added 296 new packages, deleted 0 old in 4.80 seconds
primary.xml.gz 100% |=========================| 1.7 kB 00:00
primary.xml.gz 100% |=========================| 1.0 kB 00:00
filelists.xml.gz 100% |=========================| 2.8 MB 00:00
filelists.xml.gz 100% |=========================| 2.2 MB 00:00
base1 : 2/465
=== == == == ==
=== == == == ==
=== == == == ==
=== == == == ==
ev.i386 0:095-14.20.el5_3 usermode.i386 0:1.88-3.el5.2 util-linux.i386 0:2.13-0.50.el5 vim-common.i386 2:7.0.109-4.el5_2.4z zlib.i386 0:1.2.3-3
Complete!
grep: /tmp/pam/*: No such file or directory
OS template centos-5-x86 cache was updated
[root@vps ~]#

[root@vps ~]# ls /vz/template/cache
centos-5-x86.tar.gz centos-5-x86.tar.gz-old fedora-core-9-x86.tar.gz fedora-core-9-x86.tar.gz-old ubuntu-8.04-x86.tar.gz
[root@vps ~]#

[root@vps ~]# vzup2date

h1

CenOS 5.3 yum installation in VPS

August 21, 2009

-bash-3.2# cd /root/
-bash-3.2# mkdir yumfiles
-bash-3.2# cd yumfiles/
-bash-3.2# ls
-bash-3.2# vi yumdload.sh

wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/elfutils-libs-0.137-3.el5.i386.rpm
wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/elfutils-libelf-0.137-3.el5.i386.rpm
wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/expat-1.95.8-8.2.1.i386.rpm
wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/gmp-4.1.4-10.el5.i386.rpm
wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/libxml2-2.6.26-2.1.2.7.i386.rpm
wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/libxml2-python-2.6.26-2.1.2.7.i386.rpm
wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/m2crypto-0.16-6.el5.3.i386.rpm
wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/python-elementtree-1.2.6-5.i386.rpm
wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm
wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/python-sqlite-1.1.7-1.2.1.i386.rpm
wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/python-urlgrabber-3.1.0-5.el5.noarch.rpm
wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/readline-5.1-1.1.i386.rpm
wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/rpm-4.4.2.3-9.el5.i386.rpm
wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/rpm-libs-4.4.2.3-9.el5.i386.rpm
wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/rpm-python-4.4.2.3-9.el5.i386.rpm
wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/sqlite-3.3.6-2.i386.rpm
wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/yum-3.2.19-18.el5.centos.noarch.rpm
wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/yum-fastestmirror-1.1.16-13.el5.centos.noarch.rpm
wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/yum-metadata-parser-1.1.2-2.el5.i386.rpm
wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/popt-1.10.2.3-9.el5.i386.rpm

rpm -Uvh rpm-4.4.2.3-9.el5.i386.rpm rpm-libs-4.4.2.3-9.el5.i386.rpm popt-1.10.2.3-9.el5.i386.rpm –force
rpm -Uvh rpm-python-4.4.2.3-9.el5.i386.rpm
rpm -Uvh m2crypto-0.16-6.el5.3.i386.rpm python-*.rpm yum*.rpm

-bash-3.2# sh yumdload.sh
-bash-3.2#

Follow

Get every new post delivered to your Inbox.