[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Nagios XI - Manual Installation on RedHat Enterprise Linux 5.4

Posted on 2010-03-29
4
Medium Priority
?
3,993 Views
Last Modified: 2013-12-06
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?
0
Comment
Question by:bobstits
  • 2
  • 2
4 Comments
 
LVL 30

Accepted Solution

by:
Kerem ERSOY earned 500 total points
ID: 29014691
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
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 29014733
Don2t forget you should use the second version that I've suggested once you've reset the root password of MySQL account
0
 

Author Comment

by:bobstits
ID: 29126330
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
 

Author Closing Comment

by:bobstits
ID: 31709427
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

Featured Post

Evaluating UTMs? Here's what you need to know!

Evaluating a UTM appliance and vendor can prove to be an overwhelming exercise.  How can you make sure that you're getting the security that your organization needs without breaking the bank? Check out our UTM Buyer's Guide for more information on what you should be looking for!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Transparency shows that a company is the kind of business that it wants people to think it is.
Outsource Your Fax Infrastructure to the Cloud (And come out looking like an IT Hero!) Relative to the many demands on today’s IT teams, spending capital, time and resources to maintain physical fax servers and infrastructure is not a high priority.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses

590 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question