Page 1 of 2

Installion Problems with 2011 Nagios XL

Posted: Tue Mar 15, 2011 12:25 pm
by mpenland
Installation went good until I ran ./B-installxi

I get the following errors.

[root@NagiosXL nagiosxi]# ./B-installxi
Installing Nagios XI base files...
Creating product directory...
Adding password for user nagiosadmin
Building latest perms binary...
~/nagiosxi/nagiosxi/basedir/scripts ~/nagiosxi
~/nagiosxi
Checking PostgresQL status...
PostgresQL running - continuing...
Creating role and database...
-bash: /root/nagiosxi/nagiosxi/create_postgres_db.sh: Permission denied
ERROR: PostgresQL user 'nagiosxi' was not created - exiting.
ERROR: Nagios XI database was not setup properly - exiting.

Any idea on how to fix?

Re: Installion Problems with 2011 Nagios XL

Posted: Tue Mar 15, 2011 1:04 pm
by mpenland
Here is the contents of the B-installxi file --Also running on centos

[root@NagiosXL nagiosxi]# vi B-installxi

Code: Select all

#!/bin/sh

source "./init.sh"

# Was previous step completed?
if [ ! -f installed.subcomponents ]; then
    echo "Subcomponents were not installed - run previous script"
    exit 1
fi

# Was this step already completed?
if [ -f installed.nagiosxi ]; then
        echo "Nagios XI base files already installed - skipping."
        exit 0
fi


##########################################
# CREATE MAIN PRODUCT DIRECTORIES
##########################################

echo "Installing Nagios XI base files..."

echo "Creating product directory..."
if [ ! -d $proddir ]; then
   `$mkdirbin $proddir`
fi

# Copy over XI files
`cp -r ./nagiosxi/basedir/* $proddir`

# Init script
cp ./nagiosxi/nagiosxi.init /etc/init.d/nagiosxi

# Logrotate entry
cp ./nagiosxi/logrotate.nagiosxi /etc/logrotate.d/nagiosxi

# Change ownership on directories and files
`$chownbin -R $nagiosuser.$nagiosgroup $proddir`

# Set permissions on temp directory
chown -R apache.nagios $proddir/tmp
chmod -R 6775 $proddir/tmp

# Set permissions on component etc directory
chown -R apache.nagios $proddir/etc/components
chmod -R 6775 $proddir/etc/components

# Set permissions on component var directory
chown -R apache.nagios $proddir/var/components
chmod -R 6775 $proddir/var/components

# Set perms on NagiosQL import script
chown root.nagios $proddir/scripts/nagiosql_importall.php
chmod u+s $proddir/scripts/nagiosql_importall.php

# Add main Apache conf file
`cp nagiosxi/httpd.nagiosxi.conf $httpdconfdir/nagiosxi.conf`

# Create Apache authentication credential file
# This is needed by Nagios Core  and PNP
$htpasswdbin -c -b $proddir/etc/htpasswd.users $nagioswebuser $nagioswebpwd

# Set permissions on htpasswd file
chown -R nagios.apache $proddir/etc/htpasswd.users


# Fix permissions on config files
chown -R apache.nagios /usr/local/nagios/etc/*.cfg
#chown apache.nagios /usr/local/nagios/etc/hosts/*.cfg
#chown apache.nagios /usr/local/nagios/etc/services/*.cfg

# Make latest config perm reset utility
./build-perms-bin

# Initialize database
./init-xidb
ret=$?
if [ $ret -ne 0 ]; then
        echo "ERROR: Nagios XI database was not setup properly - exiting."
        exit 1
fi


# Things are okay
echo "Nagios XI base files installed OK"
touch installed.nagiosxi

Re: Installion Problems with 2011 Nagios XL

Posted: Tue Mar 15, 2011 3:14 pm
by mguthrie
Just to verify a couple of items:

Are you running this on a cleanly installed system? (No previous mysql or postgres users present)

Did you run the installer scripts from the /tmp/nagiosxi directory?

Do you have any special firewall, SSL, or proxy configurations on your system?

Re: Installion Problems with 2011 Nagios XL

Posted: Tue Mar 15, 2011 3:17 pm
by mguthrie
Oh, nevermind, I see the problem:
/root/nagiosxi/nagiosxi/create_postgres_db.sh: Permission denied
untar to your /tmp directory and try the install scripts again.

Re: Installion Problems with 2011 Nagios XL

Posted: Tue Mar 15, 2011 3:48 pm
by rdedon

Re: Installion Problems with 2011 Nagios XL

Posted: Wed Mar 16, 2011 7:57 am
by mpenland
Thanks for the quick response. I loaded from the tmp and it worked.

Re: Installion Problems with 2011 Nagios XL

Posted: Wed Mar 16, 2011 9:36 am
by rdedon
Great! Feel free to post again if you have any additional questions or issues. Thanks! :-)

Re: Installion Problems with 2011 Nagios XL

Posted: Tue Mar 22, 2011 6:10 am
by e.kurt1979
I'm having the same problem, how to find a solution?



[root@nagiosxi nagiosxi]# ./B-installxi
Installing Nagios XI base files...
Creating product directory...
Adding password for user nagiosadmin
Building latest perms binary...
~/Desktop/nagiosxi/nagiosxi/basedir/scripts ~/Desktop/nagiosxi
~/Desktop/nagiosxi
Checking PostgresQL status...
PostgresQL running - continuing...
Creating role and database...
-bash: /root/Desktop/nagiosxi/nagiosxi/create_postgres_db.sh: Permission denied
ERROR: PostgresQL user 'nagiosxi' was not created - exiting.
ERROR: Nagios XI database was not setup properly - exiting.

Re: Installion Problems with 2011 Nagios XL

Posted: Tue Mar 22, 2011 9:49 am
by tonyyarusso
Use /tmp rather than /root.

Re: Installion Problems with 2011 Nagios XL

Posted: Wed Mar 23, 2011 2:15 pm
by mpenland
That worked thanks :D