[Pkg-nagios-devel] Bug#299613: nagios-mysql: Confusing installation documentation

David Greaves David Greaves <david@dgreaves.com>, 299613@bugs.debian.org
Tue, 15 Mar 2005 12:04:09 +0000


This is a multi-part MIME message sent by reportbug.

--===============0244242169==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Package: nagios-mysql
Severity: important
Tags: patch

The installation instructions are incomplete and have lead to at least 1
bug report.
I've made some minor edits which I hope will help.


-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (990, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.11.2-ash-050309-01
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

--===============0244242169==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="README.mysql.patch"

*** /usr/share/doc/nagios-mysql/README.mysql	Thu Feb 17 17:39:03 2005
--- /usr/share/doc/nagios-mysql/README.mysql.new	Tue Mar 15 12:01:29 2005
***************
*** 16,22 ****
  
  $ mysqladmin -u root -p create nagios
  
! $ zcat /usr/share/doc/nagios-mysql/create_mysql.sql.gz | mysql -u root -p nagios
  
  When prompted for a password, please enter the password you choosed when 
  configuring the package at install time... If you did not set a password,
--- 16,22 ----
  
  $ mysqladmin -u root -p create nagios
  
! $ zcat /usr/share/doc/nagios-mysql/create_mysql.gz | mysql -u root -p nagios
  
  When prompted for a password, please enter the password you choosed when 
  configuring the package at install time... If you did not set a password,
***************
*** 45,50 ****
--- 45,52 ----
  be sure to make them NOT world readable by issuing something like
  chmod o= /etc/nagios/resource.cfg.
  
+ First, how to do it by hand, then there's a sed script that may help:
+ 
  1) /etc/nagios/resource.cfg
  
  Uncomment and set the following lines to appropriate values, replacing
***************
*** 75,80 ****
--- 77,112 ----
  At the bottom of this file, you'll find the similar lines commented
  out as were in the previous one.  Do the same here.
  
+ This sed script assumes you have a local database on a standard port
+ with a database/user/password of nagios/nagios/password
+ 
+ sed -i.orig '
+ s/#x\(.\)ddb_database=somedatabase/x\1ddb_database=nagios/;
+ s/#x\(.\)ddb_username=someuser/x\1ddb_username=nagios/;
+ s/#x\(.\)ddb_password=somepassword/x\1ddb_password=password/;
+ ' /etc/nagios/cgi.cfg /etc/nagios/nagios.cfg
+ 
+ Then you want the cgi-script and the init.d script to correctly know the
+ status of nagios. You need the check_nagios_db file from
+ /usr/doc/nagios-common/, put it where you like but adjust the pathes in
+ the following examples. I REALLY suggest /etc/nagios/check_nagios_db as
+ the init-script now already looks if it is there and will use it
+ automagically.
+ If you use PostgreSQL you need to change the line
+ my $driver = "mysql"; in the script to
+ my $driver = "Pg";
+ 
+ Make it executable:
+ sudo chmod +x /etc/nagios/check_nagios_db
+ 
+ Now edit the /etc/nagios/cgi.cfg and put a # in front of the line
+ nagios_check_command=/usr/lib/nagios/plugins/check_nagios /var/log/nagios/status.log 5 'nagios'
+ 
+ and remove the # in front of the line
+ nagios_check_command=/etc/nagios/check_nagios_db
+ 
+ now start nagios
+ 
  You should now be up and running enough to get started.  You'll still
  need to edit your /etc/nagios/hosts.cfg and other files, but you'll be
  able to see that the default machines in there are now on the web

--===============0244242169==--