Nagios XI - Manual Installation on RedHat Enterprise Linux 5.4

Anyone out there have experience installing Nagios XI manually on RHEL 5.4?  I am stuck in the middle of installation.

I am attempting to run ./3-dbservers script but it gave a bunch of failed errors.  Can someone out there provide some guidance on this issue.


This is the script I'm running:

************************************************************************************************************
************************************************************************************************************
[ xi]# more 3-dbservers
#!/bin/sh

source "./init.sh"

##########################################
# INITIALIZE POSTGRES
##########################################

echo "Initializing PostgresQL..."

# Initialize Postgres
/sbin/service postgresql initdb

# Start Postgres (needed for Centos, as initdb doesnt work)
echo "Starting PostgresQL..."
/sbin/service postgresql start

# Copy over access configuration file to use trust based authentication
cp -f nagiosxi/pg_hba.conf /var/lib/pgsql/data/pg_hba.conf

echo "Restarting PostgresQL..."
/sbin/service postgresql restart

##########################################
# START MYSQL AND SET MYSQL ROOT PASSWORD
##########################################

echo "Starting MySQL..."
/sbin/service mysqld start

echo "Setting MySQL root password..."

# This is used if no root password has been set...
mysqladmin -u root password $mysqlpass

# Use this format if you need to change an old password
# Change OLDPASSWORD
#mysqladmin -u root -p'OLDPASSWORD' password $mysqlpass

echo "MySQL root password set to: $mysqlpass"
************************************************************************************************************
************************************************************************************************************

This is the result from running that script above:

[ xi]# ./3-dbservers
Initializing PostgresQL...
Usage: /etc/init.d/postgresql {start|stop|status|restart|condrestart|condstop|reload|force-reload}
Starting PostgresQL...
Starting postgresql service:                               [FAILED]
Restarting PostgresQL...
Stopping postgresql service:                               [FAILED]
Starting postgresql service:                               [FAILED]
Starting MySQL...
Starting MySQL:                                            [  OK  ]
Setting MySQL root password...
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
MySQL root password set to: nagiosxi
************************************************************************************************************
************************************************************************************************************

It looks like postgresql is not initialized.  Can you simply restart postgresql to initialize the DB?  I don't understand why it doesn't initialize.  Is the script written incorrectly?  

On another note, why Nagios XI needs to install both postgresql and mySQL?  Can you just choose one DB or do you need both of them?
bobstitsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kerem ERSOYPresidentCommented:
Hi,

It seems that you don't have postgres installed or it can not start for some reason. Anyway MySQL is just enough for Nagios.

When I look into the error mesaages you get I see that your problem is connecting to the mysql. Here:

Setting MySQL root password...mysqladmin: connect to server at 'localhost' failederror: 'Access denied for user 'root'@'localhost' (using password: NO)'
With corresponding script lines:

echo "Starting MySQL..."/sbin/service mysqld startecho "Setting MySQL root password..."# This is used if no root password has been set...mysqladmin -u root password $mysqlpass# Use this format if you need to change an old password# Change OLDPASSWORD#mysqladmin -u root -p'OLDPASSWORD' password $mysqlpass


Since you got the error when trying to set the root password I' think that your password is already set. In this case I'll suggest you to comment this line and uncoment the already commented line:


echo "Starting MySQL..."/sbin/service mysqld startecho "Setting MySQL root password..."# This is used if no root password has been set...#mysqladmin -u root password $mysqlpass# Use this format if you need to change an old password# Change OLDPASSWORDmysqladmin -u root -p'OLDPASSWORD' password $mysqlpass

if you know the root password of MySQL. If not you'll need to reset the lost rott password. Please follow thwese steps for it:

http://www.cyberciti.biz/tips/recover-mysql-root-password.html

Cheers,
K.


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Kerem ERSOYPresidentCommented:
Don2t forget you should use the second version that I've suggested once you've reset the root password of MySQL account
0
bobstitsAuthor Commented:
Okay, so I have moved ahead on the installation of Nagios XI.  I am currently at step ./B-installxi, there's one part which was commented out mySQL lines.

# Create MySQL database and add user
#echo "ENTER YOUR MYSQL ROOT PASSWORD (THREE TIMES) TO CREATE NAGIOSXI DB..."
#mysql -u root -p < nagiosxi/create_mysql_db.sql
#mysql -u root -p nagiosxi < nagiosxi/schema_mysql.sql
#mysql -u root -p nagiosxi < nagiosxi/init_mysql_db.sql

Output:
[xi]# mysql -u root -p < nagiosxi/create_mysql_db.sql
bash: nagiosxi/create_mysql_db.sql: No such file or directory

I'm guessing I'll have to uncomment it to run the script, but i cannot find "create_mysql_db.sql" file in "nagiosxi" folder.  Do I need that file to install Nagios XI?  
I only see "./nagiosxi/load_pgsql_db.sql" and "./nagiosxi/schema.pgsql.sql".  There're no "create_mysql_db.sql" or "init_mysql_db.sql" files.

Anyone can help?
0
bobstitsAuthor Commented:
Okay, so I have moved ahead on the installation of Nagios XI.  I am currently at step ./B-installxi, there's one part which was commented out mySQL lines.

# Create MySQL database and add user
#echo "ENTER YOUR MYSQL ROOT PASSWORD (THREE TIMES) TO CREATE NAGIOSXI DB..."
#mysql -u root -p < nagiosxi/create_mysql_db.sql
#mysql -u root -p nagiosxi < nagiosxi/schema_mysql.sql
#mysql -u root -p nagiosxi < nagiosxi/init_mysql_db.sql

Output:
[xi]# mysql -u root -p < nagiosxi/create_mysql_db.sql
bash: nagiosxi/create_mysql_db.sql: No such file or directory

I'm guessing I'll have to uncomment it to run the script, but i cannot find "create_mysql_db.sql" file in "nagiosxi" folder.  Do I need that file to install Nagios XI?  
I only see "./nagiosxi/load_pgsql_db.sql" and "./nagiosxi/schema.pgsql.sql".  There're no "create_mysql_db.sql" or "init_mysql_db.sql" files.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.