Archive

Archive for the ‘centos’ Category

centos 5.4 rpmforge missing subversion-ruby-1.6.6

March 15th, 2010 dwright No comments

we are using subversion.x86_64 1.6.6-0.1.el5.rf and we require the Ruby bindings, subversion-ruby.x86_64.

However only 1.4.2-4.el5_3.1 (from base) is available. (which wont install, as it breaks deps. We can roll back to the base subversion, however there were some notable changes in svn > 1.5.0, (much improved merging, for example) which we do use

rpmforge is missing subversion-ruby.x86_64 1.6.6-0.1.el5.rf.
There is this bug: rpmforge lists

yum list|grep sub
subversion.x86_64 1.6.6-0.1.el5.rf installed
subversion-devel.x86_64 1.6.6-0.1.el5.rf rpmforge
subversion-javahl.x86_64 1.4.2-4.el5_3.1 base
subversion-perl.x86_64 1.6.6-0.1.el5.rf rpmforge
subversion-ruby.x86_64 1.4.2-4.el5_3.1 base

My work around for this:
(I would rather not build this from source)

luckily, I found: http://packages.sw.be/subversion/

wget http://packages.sw.be/subversion/subversion-1.6.6-1.el5.test.x86_64.rpm
http://packages.sw.be/subversion/subversion-ruby-1.6.6-1.el5.test.x86_64.rpm

yum uninstall subversion (luckily no deps)
sudo rpm -ivh subversion-1.6.6-1.el5.test.x86_64.rpm subversion-ruby-1.6.6-1.el5.test.x86_64.rpm

(NOTE: if you are also using something like enterprise ruby in a non standard location, you will have to tell it where to find svn)
something such as:
sudo ln -s /usr/lib64/ruby/site_ruby/1.8/x86_64-linux/svn /opt/ruby-enterprise-curr/lib/ruby/1.8/x86_64-linux/svn

Nagios and nrpe setup CentOs 5.3

November 20th, 2009 dwright No comments

Nagios/nrpe how to (mini version):

For this session, I am demonstrating a basic Nagios set up of nrpe.

There are two hosts involved.
1. the nagios host. (the master node; where the nagios web ui is)
2. the remote host (the node you want to monitor remotely from the master node)

Software Versions involved:
both hosts: CentOS release 5.3 (Final) (64 bit)

master node:
NagiosĀ® Coreā„¢ Version 3.2.0
nagios.x86_64 3.2.0-1.el5.rf (yum install)

remote host:
nagios-nrpe.x86_64 2.12-1.el5.rf (yum install)

(I assume you have a basic nagios set up already - this is just to enable nrpe)

nagios host: (master)

$ sudo yum install nagios-plugins-nrpe  nrpe
$ sudo chown nagios.nagios /etc/nagios/nrpe.cfg
$ sudo vi  /etc/nagios/objects/commands.cfg
# add
define command{
        command_name    check_nrpe
        command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

$ sudo vi /etc/nagios/objects/myremote_host.cfg
# add
define service{
        use                                      remote-service
        host_name                          example.com
        service_description             Check Remote Users
        check_command                  check_nrpe!check_users
}
# nrpe (remote checks) syntax is check_nrpe(as defined above) ! 'command to
 run' (as defined on remote host, see below)

remote host: (node to be remotely monitored)
(NOTE: nagios itself should not be installed on this host)

$ sudo yum install nagios-nrpe
$ cd /etc/nagios
$ sudo chown nagios.nagios *.cfg
$ sudo vim /etc/xinetd.d/nrpe
# add
service nrpe
{
        flags           = REUSE
        type            = UNLISTED
        port            = 5666
        socket_type     = stream
        wait            = no
        user            = nagios
        group           = nagios
        server          = /usr/sbin/nrpe
        server_args     = -c /etc/nagios/nrpe.cfg --inetd
        log_on_failure  += USERID
        disable         = no    # was yes
        only_from       = NAGIOS_MASTER_IP (master nagios host you want to
connect from) # was localhost
}
$ sudo vim cat /etc/hosts.allow
# add same ip from xinetd above
NAGIOS_MASTER_IP

$ sudo vim  /etc/nagios/nrpe.cfg
#allowed_hosts=127.0.0.1   #
# add same ip from xinetd above
allowed_hosts=NAGIOS_MASTER_IP    

$ sudo vim /etc/services
# append this line to the file
# Local services
nrpe            5666/tcp                        # nrpe (nagios)
$ sudo /sbin/service nrpe start
Starting Nagios NRPE daemon (nrpe):                        [  OK  ]
$ sudo /etc/init.d/xinetd reload
$ sudo /sbin/chkconfig --list |grep nrpe
nrpe           	0:off	1:off	2:off	3:off	4:off	5:off	6:off
	nrpe:          	off
$ sudo /sbin/chkconfig --levels 35 nrpe on
$ sudo /sbin/chkconfig --list |grep nrpe
nrpe           	0:off	1:off	2:off	3:on	4:off	5:on	6:off
	nrpe:          	off

$ netstat -an | grep 5666
tcp        0      0 0.0.0.0:5666    0.0.0.0:*    LISTEN

ok, good, it's running

now from nagios (master) server:
(can we see it's running too?)
telnet REMOTE_HOST_WE_JUST_CONFIGURED_IP 5666

$ /usr/lib64/nagios/plugins/check_nrpe -H REMOTE_HOST_WE_JUST_CONFIGURED_IP -p5666 -c check_disk1

to add new commands to be run via nrpe, we must add those to the remote host, nrpe.cfg file:

added new test on remote host:
$ sudo vim /etc/nagios/nrpe.cfg
command[check_mapper]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /dev/sda5

test from master node:
$ /usr/lib64/nagios/plugins/check_nrpe -H REMOTE_HOST_WE_JUST_CONFIGURED_IP -p5666 -c check_mapper
DISK OK - free space: / 41180 MB (50% inode=99%);| /=40614MB;68993;77617;0;86242

helpful master node commands:
server config test:
$ sudo /usr/bin/nagios -v /etc/nagios/nagios.cfg
#start/stop/restart:
$ sudo /sbin/service nagios restart
#command line check commands against remote host:
$ /usr/lib64/nagios/plugins/check_nrpe -H REMOTE_SERVER_IP -p5666 -c check_disk1

ref:
http://www.crucialwebhost.com/blog/nagios-howto-using-nrpe-to-monitor-remote-services/
http://ubuntuforums.org/archive/index.php/t-498435.html - bottom comment

CentOS 5.4 (Final) Weak references are not implemented in the version of perl

November 12th, 2009 dwright No comments

I just ran a sudo yum update on my development CentOS 5.3 box. (upgrade to 5.4)

All went well, except two issues.

1. I had to rollback perl-Apache-DBI.noarch 1.07-1.el5.rf
(luckily, I knew about this one, and had an old package available, and there are no deps issues - whew)

The issue manifests itself as:
[Tue Nov 10 10:43:02 2009] [error] Global $r object is not available. Set:\n\tPerlOptions +GlobalRequest\nin httpd.conf at /usr/lib/perl5/vendor_perl/5.8.8/Apache/DBI.pm line 144.\nCompilation failed in require at (eval 2) line 1.\n
[Tue Nov 10 10:43:02 2009] [error] Can't load Perl file: perl_load.pl for server , exiting...

To rollback:
$ sudo yum remove perl-Apache-DBI
$ sudo rpm -ivh perl-Apache-DBI-1.06-1.el5.rf.noarch.rpm

2. synopsis: "Weak references are not implemented in the version of perl "

The issue manifests itself as:
Weak references are not implemented in the version of perl at /usr/lib/perl5/vendor_perl/5.8.8/SOAP/Lite.pm line 2447\nBEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/SOAP/Lite.pm line 2447.\nCompilation failed in require,...
...
...
[Wed Nov 11 16:50:01 2009] [error] Can't load Perl file: perl_load.pl for server, exiting...

which seemed me to (incorrectly) initially look in SOAP::Lite. (it's a Scalar::Util warning) Luckily I had another box I had just updated and knew that the updated did in fact work.

here is a command line test, to check with:
% perl -e"use Scalar::Util qw( weaken );"
%

should return nothing, on my box it returned:
% perl -e"use Scalar::Util qw( weaken );"
Weak references are not implemented in the version of perl at -e line 1
BEGIN failed--compilation aborted at -e line 1.

I couldn't find Scalar::Util installed!?
$ yum list|grep perl |grep -i scalar
perl-Scalar-Defer.noarch 0.20-1.el5.rf rpmforge
perl-Scalar-List-Utils.x86_64 1.21-1.el5.rf rpmforge
perl-Scalar-Properties.noarch 0.13-1.el5.rf rpmforge
perl-Set-Scalar.noarch 1.24-1.el5.rf rpmforge
perl-Tie-Scalar-Timeout.noarch 1.33-1.el5.rf rpmforge

After some searching, it appears that it's part or perl core now.

Eventually, I stumbled onto:
% locate Util.pm
/usr/lib/perl5/5.8.8/CGI/Util.pm
/usr/lib/perl5/5.8.8/Hash/Util.pm
/usr/lib/perl5/5.8.8/List/Util.pm
/usr/lib/perl5/5.8.8/Scalar/Util.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Simple/Util.pm
/usr/lib/perl5/vendor_perl/5.8.8/Crypt/DSA/Util.pm
/usr/lib/perl5/vendor_perl/5.8.8/HTTP/Headers/Util.pm
/usr/lib/perl5/vendor_perl/5.8.8/Mail/Util.pm
/usr/lib/perl5/vendor_perl/5.8.8/Mail/SpamAssassin/Util.pm
/usr/lib/perl5/vendor_perl/5.8.8/Net/SFTP/Util.pm
/usr/lib/perl5/vendor_perl/5.8.8/Net/SSH/Perl/Util.pm
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/List/Util.pm
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/Scalar/Util.pm
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/APR/Util.pm
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/Apache/TestUtil.pm
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/Apache2/ConnectionUtil.pm
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/Apache2/RequestUtil.pm
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/Apache2/ServerUtil.pm
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/Apache2/Util.pm
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/ModPerl/MapUtil.pm
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/ModPerl/Util.pm
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/Params/Util.pm

The only difference in the results of this and the box that works,
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/List/Util.pm
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/Scalar/Util.pm
are not in the list, of the working box.

(I have no idea how those got there, or where they are from, except for what the obviously look like, rhel5/centos packages,...)

perl INC is loading those libs first too.

$ perl -e 'print join "\n", @INC'
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8
/usr/lib/perl5/site_perl
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8
/usr/lib/perl5/vendor_perl
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/5.8.8

so to 'resolve' the issue, I did this.

% sudo mv /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/List/Util.pm /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/List/Util.pm-1.19-broken-with-5.8.8-27
% sudo mv /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/Scalar/Util.pm /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/Scalar/Util.pm-1.19-broken-with-5.8.8-27

This worked for me, although is probably not the 'correct way'. I'm still not sure exactly what happened to get into this state, or I'd file a bug somewhere.

ref: (1)http://www.gossamer-threads.com/lists/modperl/modperl/98113

(1)http://rt.cpan.org/Public/Bug/Display.html?id=36346

(2) http://www.perlmonks.org/?node_id=424737 A different approach to the situation. (in general, we try to do everything through yum/rpm packages)
(2)http://bugs.centos.org/view.php?id=3022 an old bug, which made me realize I had to figure it out :)
(2) http://www.bluequartz.us/phpBB2/viewtopic.php?t=106577&sid=17481305416e016b01a061acb4ac3f45