Certain applications of GroundWork Monitor Enterprise Edition may be in locations where security is an issue. As GroundWork uses MySQL database engine to store configuration, collected data, and other information which may be confidential, it might be thought necessary to protect the means of access.
As delivered, the MySQL engine and the various databases are controlled by user name password pairs, which exist in the main “mysql” database and in properties files referenced by executed modules.
The main ‘root’ access to the ‘mysql’ engine is password protected, if the customer follows instructions at install time. While customer may not set this as a matter of convenience, our consistent recommendation is always to install a root password. The procedures for setting this password, resetting it, or recovering it are all thoroughly described by MySQL documentation, e.g. http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html.
The subject of this How To article covers the procedure for changing passwords for users of the included databases to some other values.
You change the passwords in the MySQL database, and in the properties files and other referencing scripts where the passwords are kept. You must do this all at the same session, with the various programs in a non running state. If you try to change these while gwservices and the other programs are running you may loose some data, or deny access to data due to permissions errors. Take care in making these changes that you do not lock yourself out of a particular database or application.
If you make these changes you should report the fact to GroundWork Support when filing any subsequent Support case. Our ability to provide support for our products requires knowledge of such changes. Your cooperation is necessary to minimize time wasted because of undocumented changes.
This procedure is provided with the expectation that you do not wish to put passwords into a script to automate this process. We expect you will instead enter the passwords at the command line interactively, and this practice is more secure.
service groundwork stop service groundwork start mysql
source /usr/local/groundwork/scripts/setenv.sh mysqldump mysql -u root -p > /tmp/mysql.sql
Save these backup files in case you corrupt some essential table and must then want to restore the system to a known good state. Refer to the Bookshelf for complete instructions for restoring databases.
cd /usr/local/groundwork/ cp -Rp config config-backup
If you make a serious error and need to restore a file, rename the working copy, and then move the “config-backup” into place as “config”. Work with the other backup files in an appropriate manner. Remember to stop the GroundWork services before you do this copying and moving.
service groundwork start
This may complain about mysqld already running, which may be ignored.
Test the changes you have made by accessing the different functions. If a particular function has not been set up on your system, you may skip testing it.
--- NEW LOOP on Saturday, December 25, 2010 at 09:46:23 ---
Monarch query time = 0s
IP=127.0.0.1
HOST=localhost
parent=none
fping time was 0s
inserted into array: IP=127.0.0.1, State=[unknown], Perf=[unknown]
IP = 127.0.0.1, state = [unknown]
sending host check for ip 127.0.0.1, host localhost
Sending 0 results at 1293299183.
1 data packet(s) sent to host successfully.
Nagios submit time was 0s
50 23 * * * /usr/local/groundwork/core/reports/utils/dashboard_data_load.pl > /usr/local/groundwork/core/reports/utils/log/dashboard_data_load.log 2>&1 0 1 * * * /usr/local/groundwork/core/reports/utils/dashboard_avail_load.pl > /usr/local/groundwork/core/reports/utils/log/dashboard_avail_load.log 2>&1
Run each of them as user nagios and look at the indicated log files to see if there were connectivity problems with the "dashboard" database.
This completes the procedure for changing passwords on the database driven facilities in GroundWork Monitor Enterprise Edition 6.3
If you find that you have made an error and wish to recover to the state prior to the changes, do this:
source /usr/local/groundwork/scripts/setenv.sh mysql mysql -u root -p < NAME-OF-BACKUP
service groundwork start
These are the database, file, user, and host combinations for which you may wish to change access. If you have installed distributed servers you may need to change more than is described here.
/usr/local/groundwork/config/db.properties /usr/local/groundwork/config/db.properties.foundation /usr/local/groundwork/gwreports/PerformanceReports/gw-epr-host.rptdesign /usr/local/groundwork /gwreports/PerformanceReports/gw-epr-host-multi-variable.rptdesign /usr/local/groundwork /gwreports/PerformanceReports/gw-epr-hostgroup-multi-variable.rptdesign /usr/local/groundwork /gwreports/PerformanceReports/gw-epr-hostgroup.rptdesign /usr/local/groundwork/tools/gwdiags.pl /usr/local/groundwork/common/bin/gwdiags.pl /usr/local/groundwork/nagvis/etc/nagvis.ini.php
localhost, collage localhost, foundation
collage.username=collage collage.password=gwrk collage.database=GWCollageDB collage.dbhost=localhost
or, for nagvis.php.ini:
; db1: GWCollageDB - foundation database dbhost1="localhost" dbport1=3306 dbname1="GWCollageDB" dbuser1="foundation" dbpass1="gwrk"
/usr/local/groundwork/common/etc/check_cacti.conf /usr/local/groundwork/cacti/htdocs/include/config.php /usr/local/groundwork/cacti/extract_cacti.pl
localhost, cactiuser
$database_default = "cacti"; $database_hostname = "localhost"; $database_username = "cactiuser"; $database_password = "cactiuser";
/usr/local/groundwork/core/reports/etc/gwir.cfg /usr/local/groundwork/config/db.properties /usr/local/groundwork/config/db.properties.foundation
%, root localhost, ir
#Insight Reports Datasource insightreports.dbhost=localhost insightreports.database=dashboard insightreports.username=ir insightreports.password=gwrk
/usr/local/groundwork/config/db.properties
%, root localhost, logreporting
#Log reporting database logreporting.username=logreporting logreporting.password=gwrk logreporting.database=logreports logreporting.dbhost=localhost
/usr/local/groundwork/config/db.properties /usr/local/groundwork/config/db.properties.foundation
/usr/local/groundwork/nagvis/etc/nagvis.ini.php
%, root localhost, monarch
#Monarch Datasource monarch.dbhost=localhost monarch.database=monarch monarch.username=monarch monarch.password=gwrk
or, for nagvis.php.ini:
; db2: monarch - configuration database dbhost2="localhost" dbport2=3306 dbname2="monarch" dbuser2="monarch" dbpass2="gwrk"
/usr/local/groundwork/nedi/nedi.conf
localhost, nedi
# DB params dbname nedi dbuser nedi dbpass nedi
/usr/local/groundwork/foundation/container/webapps/jboss/default-ds.xml
localhost, jboss
<connection-url>jdbc:mysql://localhost:3306/jbossdb</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>jboss</user-name>
<password>jboss</password>
/usr/local/groundwork/foundation/container/webapps/jboss/portal-ds.xml
localhost, jboss
<connection-url>jdbc:mysql://localhost:3306/jbossportal?useServerPrepStmts=false&jdbcCompliantTruncation=false</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>jboss</user-name>
<password>jboss</password>