bobstits
asked on
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 |condresta rt|condsto p|reload|f orce-reloa d}
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?
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
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
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Don2t forget you should use the second version that I've suggested once you've reset the root password of MySQL account
ASKER
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.s ql
#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.s ql
bash: nagiosxi/create_mysql_db.s ql: 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.s ql". There're no "create_mysql_db.sql" or "init_mysql_db.sql" files.
Anyone can help?
# 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.s
#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.s
bash: nagiosxi/create_mysql_db.s
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.
Anyone can help?
ASKER
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.s ql
#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.s ql
bash: nagiosxi/create_mysql_db.s ql: 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.s ql". There're no "create_mysql_db.sql" or "init_mysql_db.sql" files.
# 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.s
#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.s
bash: nagiosxi/create_mysql_db.s
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.