Posts Tagged ‘portage’

Portage Errors: media-libs/mesa-10.0.4 failed

Mesa 10.0.4 requires LLVM < 3.x to compile correctly or it will complain about missing header files.

Add LLVM to package.mask:

# echo ">sys-devel/llvm-2.9-r2" >> /etc/portage/package.mask

Gentoo Prefix Errors: Aborting due to QA concerns: there are files installed outside the prefix

Just like it sounds, the package you are trying to emerge is attempting to write files outside of your prefix. Depending on the situation it may be that there is no fix, but it is possible that upgrading eselect or portage and re-syncing the portage tree will solve the problem – as was the case for me this morning when attempting to emerge -e system with the distributed portage snapshot:

>>> Completed installing ncurses-5.9-r02.1 into /Users/karma/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/image/

ecompressdir: bzip2 -9 /usr/share/man
 * QA Notice: the following files are outside of the prefix:
 * /usr
 * /usr/lib
 * /usr/lib/pkgconfig
 * /usr/lib/pkgconfig/form.pc
 * /usr/lib/pkgconfig/formw.pc
 * /usr/lib/pkgconfig/menu.pc
 * /usr/lib/pkgconfig/menuw.pc
 * /usr/lib/pkgconfig/ncurses++.pc
 * /usr/lib/pkgconfig/ncurses++w.pc
 * /usr/lib/pkgconfig/ncurses.pc
 * /usr/lib/pkgconfig/ncursesw.pc
 * /usr/lib/pkgconfig/panel.pc
 * /usr/lib/pkgconfig/panelw.pc
 * ERROR: sys-libs/ncurses-5.9-r02.1 failed:
 *   Aborting due to QA concerns: there are files installed outside the prefix
 * 
 * Call stack:
 *   misc-functions.sh, line 1877:  Called install_qa_check
 *   misc-functions.sh, line  253:  Called install_qa_check_prefix
 *   misc-functions.sh, line  900:  Called die
 * The specific snippet of code:
 *   			die 

 * 
 * If you need support, post the output of `emerge --info '=sys-libs/ncurses-5.9-r02.1'`,
 * the complete build log and the output of `emerge -pqv '=sys-libs/ncurses-5.9-r02.1'`.
 * The complete build log is located at '/Users/karma/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/temp/build.log'.
 * The ebuild environment file is located at '/Users/karma/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/temp/environment'.
 * Working directory: '/Users/karma/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/image'
 * S: '/Users/karma/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/work/ncurses-5.9'
!!! post install failed; exiting.

>>> Failed to emerge sys-libs/ncurses-5.9-r02.1, Log file:

>>>  '/Users/karma/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/temp/build.log'

 * Messages for package sys-libs/ncurses-5.9-r02.1:

 * ERROR: sys-libs/ncurses-5.9-r02.1 failed:
 *   Aborting due to QA concerns: there are files installed outside the prefix
 * 
 * Call stack:
 *   misc-functions.sh, line 1877:  Called install_qa_check
 *   misc-functions.sh, line  253:  Called install_qa_check_prefix
 *   misc-functions.sh, line  900:  Called die
 * The specific snippet of code:
 *   			die "Aborting due to QA concerns: there are files installed outside the prefix"
 * 
 * If you need support, post the output of `emerge --info '=sys-libs/ncurses-5.9-r02.1'`,
 * the complete build log and the output of `emerge -pqv '=sys-libs/ncurses-5.9-r02.1'`.
 * The complete build log is located at '/Users/karma/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/temp/build.log'.
 * The ebuild environment file is located at '/Users/karma/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/temp/environment'.
 * Working directory: '/Users/karma/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/image'
 * S: '/Users/karma/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/work/ncurses-5.9'

 * GNU info directory index is up-to-date.

 * IMPORTANT: 2 news items need reading for repository 'gentoo_prefix'.
 * Use eselect news to read news items.

ioss-macbook:~ karma$ 

Installing NRPE for Nagios/Icinga on Gentoo

You have two options for monitoring things like load average and logged in users on a remote host with Nagios or Icinga: SNMP (which you are probably already using for Cacti or a similar graphing/monitoring solution) or the Nagios Remote Plugin Executor (NRPE). NRPE gives one greater flexibility in the kind of data collected and actions executed. Unfortunately, NRPE is not included in Portage so we must compile and configure it on our own.

UPDATE It is now possible to emerge NRPE via net-analyzer/nrpe

First, download the NRPE source tarball to your core monitoring server and install check_nrpe:

# mkdir /usr/src/nrpe
# cd /usr/src/nrpe
# wget [tarball]
# tar xf [tarball]
# cd nrpe-[version]
# ./configure
# make all
# cp src/check_nrpe /usr/[lib|lib64]/nagios/plugins/

Now add the command to your Icinga or Nagios config:

define command{
        command_name check_nrpe
        command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

Compile and install the nrpe server on the target host:

# mkdir /usr/src/nrpe
# cd /usr/src/nrpe
# wget [tarball]
# tar xf [tarball]
# cd nrpe-[version]
# ./configure
# make all
# mkdir /etc/nrpe
# cp src/nrpe /usr/bin/
# cp sample-config/nrpe.cfg /etc/nrpe/

Install the nagios-plugins package from portage:

# emerge nagios-plugins

Edit /etc/nrpe/nrpe.cfg with a mind to security (particularly the allowed_hosts directive). The nagios-plugins package has already created the nagios user and group so there is no need to change the defaults. Update the command paths at the end of the file to reflect the location nagios-plugins installed to:

command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10
command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
command[check_root]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/root
command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 150 -c 200

Start the server as root with the daemoniz flag:

# nrpe -c /etc/nrpe/nrpe.cfg -d

We can see it has dropped down to the nagios user:

# ps aux | grep nrpe
nagios     570  0.0  0.0   4208   948 ?        Ss   16:55   0:00 nrpe -c /etc/nrpe/nrpe.cfg -d

Now we can test the configuration on the Nagios/Icinga core monitoring server:

# /usr/lib64/nagios/plugins/check_nrpe -H [ADDRESS]
NRPE v2.13

If the remote NRPE server’s configuration is working it should respond with NRPE [version]. Now we can set up some services on the monitoring server:

define service{
        host_name               myhost
        service_description     Users
        check_command           check_nrpe!check_users
        max_check_attempts      5
        check_interval          5
        retry_interval          1
        check_period            24x7
        notification_interval   30
        notification_period     24x7
        notification_options    w,c,r
        contact_groups          admins
        }

Note that the argument for check_command is one of the hard-coded commands in the nrpe server’s configuration file. Restart Icinga/Nagios to load the changes and begin monitoring:

# /etc/init.d/icinga restart

An init script will be required to make the NRPE daemon start on boot, create /etc/init.d/nrpe:

#!/sbin/runscript
# Copyright (c) 2012 http://foxpa.ws
# All rights released

description="Runs Nagios Remote Plugin Executor on Gentoo"

depend()
{
        need net
}

start()
{
        ebegin "Starting NRPE"
        start-stop-daemon --start --quiet --user=root --background --exec "/usr/bin/nrpe" -- -c /etc/nrpe/nrpe.cfg -d
        eend ${?}
}

stop()
{
        ebegin "Stopping NRPE"
        start-stop-daemon --stop --quiet --pidfile "/var/run/nrpe.pid"
        eend ${?}
}

Now make it executable and add it to the default runlevel:

# chmod +x /etc/init.d/nrpe
# rc-update add nrpe default

Alternatively, NRPE can be run by xinetd. From the README:

Running Under INETD or XINETD
-----------------------------

If you plan on running nrpe under inetd or xinetd and making use
of TCP wrappers, you need to do the following things:



1) Add a line to your /etc/services file as follows (modify the port
   number as you see fit)

        nrpe            5666/tcp        # NRPE



2) Add entries for the NRPE daemon to either your inetd or xinetd
   configuration files.  Which one your use will depend on which
   superserver is installed on your system.  Both methods are described
   below.  NOTE: If you run nrpe under inetd or xinetd, the server_port
   and allowed_hosts variables in the nrpe configuration file are
   ignored.


   ***** INETD *****
   If your system uses the inetd superserver WITH tcpwrappers, add an
   entry to /etc/inetd.conf as follows:

        nrpe    stream  tcp     nowait  <user> /usr/sbin/tcpd <nrpebin> -c <nrpecfg> --inetd

   If your system uses the inetd superserver WITHOUT tcpwrappers, add an
   entry to /etc/inetd.conf as follows:

        nrpe    stream  tcp     nowait  <user> <nrpebin> -c <nrpecfg> --inetd


   - Replace <user> with the name of the user that the nrpe server should run as.
        Example: nagios
   - Replace <nrpebin> with the path to the nrpe binary on your system.
        Example: /usr/local/nagios/nrpe
   - Replace <nrpecfg> with the path to the nrpe config file on your system.
        Example: /usr/local/nagios/nrpe.cfg


   ***** XINETD *****
   If your system uses xinetd instead of inetd, you'll probably
   want to create a file called 'nrpe' in your /etc/xinetd.d
   directory that contains the following entries:


        # default: on
        # description: NRPE
        service nrpe
        {
                flags           = REUSE
                socket_type     = stream        
                wait            = no
                user            = <user>
                server          = <nrpebin>
                server_args     = -c <nrpecfg> --inetd
                log_on_failure  += USERID
                disable         = no
                only_from       = <ipaddress1> <ipaddress2> ...
        }


   - Replace <user> with the name of the user that the nrpe server should run as.
   - Replace <nrpebin> with the path to the nrpe binary on your system.
   - Replace <nrpecfg> with the path to the nrpe config file on your system.
   - Replace the <ipaddress> fields with the IP addresses of hosts which
     are allowed to connect to the NRPE daemon.  This only works if xinetd was
     compiled with support for tcpwrappers.



3) Restart inetd or xinetd will the following command (pick the
   on that is appropriate for your system:

        /etc/rc.d/init.d/inet restart

        /etc/rc.d/init.d/xinetd restart

   OpenBSD users can use the following command to restart inetd:

        kill -HUP `cat /var/run/inet.pid`



4) Add entries to your /etc/hosts.allow and /etc/hosts.deny
   file to enable TCP wrapper protection for the nrpe service.
   This is optional, although highly recommended.
Return top
foxpa.ws
Online Marketing Toplist
Internet
Technology Blogs - Blog Rankings

Internet Blogs - BlogCatalog Blog Directory

Bad Karma Networks

Please Donate!


Made in Canada  •  There's a fox in the Gibson!  •  2010-12