Bug#303422: [Pkg-nagios-devel] Bug#303422: nagios: Error: Could not lock status data tables in database ''

Chris Teachworth Chris Teachworth <cteachworth@gmail.com>, 303422@bugs.debian.org
Thu, 7 Apr 2005 10:26:42 -0800


Sean,

If it not reproducible it's likely it's something I'm doing. It
doesn't appear to be causing any issues in functionality it's just
driving me a bit nutty by writing that message to the log repeatedly
like that.

I checked the status tables (programstatus,hoststatus, and
servicestatus) in the db and they're all being populated with data
from nagios so I'm not sure what, if anything is failing when I get
that message about the status data tables.

The only things I thought I needed or even could do in the nagios.cfg
for database support was to comment out the lines that referred to the
files nagios would use if database support was not being used. ie from
nagios.cfg:

#status_file=/var/log/nagios/status.log

Here's the permissions of the files in /etc/nagios:

/etc/nagios# ls -l
total 144
-rw-r-----  1 nagios www-data  1139 Feb 17 08:37 apache.conf
-rw-r-----  1 nagios www-data 13185 Apr  7 09:58 cgi.cfg
-rwxr-xr-x  1 nagios www-data  2349 Apr  7 10:13 check_nagios_db
-rw-r-----  1 nagios www-data   292 Feb 17 08:37 checkcommands.cfg
-rw-r-----  1 nagios www-data   765 Apr  5 20:37 contactgroups.cfg
-rw-r-----  1 nagios www-data  1395 Apr  5 22:42 contacts.cfg
-rw-r-----  1 nagios www-data  1808 Apr  5 16:37 dependencies.cfg
-rw-r-----  1 nagios www-data  2049 Apr  5 20:38 escalations.cfg
-rw-r-----  1 nagios www-data  2251 Apr  6 07:59 hostgroups.cfg
-rw-r-----  1 nagios www-data  6867 Apr  6 07:59 hosts.cfg
-rw-r-----  1 nagios www-data    26 Mar 31 02:44 htpasswd.users
-rw-r-----  1 nagios www-data 13544 Mar  8 16:05 minimal.cfg
-rw-r-----  1 nagios www-data  4250 Mar  8 16:05 misccommands.cfg
-rw-r-----  1 nagios www-data 21441 Apr  6 16:27 nagios.cfg
-rw-r-----  1 nagios www-data  2990 Apr  7 09:58 resource.cfg
-rw-r-----  1 nagios www-data 20647 Apr  6 08:02 services.cfg
drwxr-x--x  2 nagios www-data  4096 Mar 31 02:44 stylesheets
-rw-r-----  1 nagios www-data  1589 Mar  8 16:05 timeperiods.cfg

I setup the references to xsddb in cgi.cfg and resource.cfg 
Here's an fgrep for every line that contains xsddb in /etc/nagios/*:

/etc/nagios# fgrep xsddb *
cgi.cfg:xsddb_host=localhost
cgi.cfg:xsddb_port=3306
cgi.cfg:xsddb_database=nagios
cgi.cfg:xsddb_username=nagios
cgi.cfg:xsddb_password=somepassword
check_nagios_db:        if (/^xsddb_host=(.+)/) { $dbhost = $1; next; };
check_nagios_db:        if (/^xsddb_port=(.+)/) { $dbport = $1; next; };
check_nagios_db:        if (/^xsddb_database=(.+)/) { $dbname = $1; next; };
check_nagios_db:        if (/^xsddb_username=(.+)/) { $dbuser = $1; next; };
check_nagios_db:        if (/^xsddb_password=(.+)/) { $dbpass = $1; next; };
resource.cfg:xsddb_host=localhost
resource.cfg:xsddb_port=3306
resource.cfg:xsddb_database=nagios
resource.cfg:xsddb_username=nagios
resource.cfg:xsddb_password=somepassword
resource.cfg:xsddb_optimize_data=1
resource.cfg:xsddb_optimize_interval=3600

If you've got any ideas I'd love to hear 'em.

Thanks for your help Sean,
    Chris



On Apr 6, 2005 3:44 PM, sean finney <seanius@debian.org> wrote:
> tags  moreinfo
> tags  unreproducible
> thanks
> 
> hi chris,
> 
> On Wed, Apr 06, 2005 at 07:41:44AM -0800, Chris Teachworth wrote:
> > The following error is writtent to /var/log/syslog and /var/log messages once
> > every minute:
> >
> > Error: Could not lock status data tables in database ''
> 
> are you sure you have all the information supplied in each place in
> each file?  there's like a total of 8 different places you have to specify
> it (4 in each file--a pain, i know).  i can't reproduce the problem
> after specifying it in each place and restarting nagios.
> 
> something else to verify is that the file permissions allow the users
> nagios and www-data to read the files.
> 
> > I followed all of the instructions in README.Debian and README.mysql from the
> > /usr/share/doc/nagios-mysql dir and verfied that the user I'm specifying in
> > /etc/nagios/cgi.cfg for the xsddb_database has SELECT, INSERT, UPDATE, DELETE,
> > and LOCK privileges on the nagios database.
> 
> and also in nagios.cfg?  sorry to be a pain about this but i can't
> reproduce it.
> 
>         sean
> 
> --
> 
> 
>