[Nagios-devel] Bug: PgSQL/MySQL tables not prefixed...

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] Bug: PgSQL/MySQL tables not prefixed...

Post by Guest »

--=-0cZbPeY5G83kpDUELB4l
Content-Type: multipart/mixed; boundary="=-0LfFQf7tg6GWINrMdbz8"


--=-0LfFQf7tg6GWINrMdbz8
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

The database tables supported in contrib/databases/create_* and xdata/*
are not namespace-prefixed (and hence are not safe to include in a
database with another application). Nagios database objects should start
with 'nagios_' or something. Patch (for 1.0b3) attached (tested with
PostgreSQL 7.2.1, but *NOT* yet with MySQL....

--=-0LfFQf7tg6GWINrMdbz8
Content-Disposition: attachment; filename=nagios-1.0b3.pgsql.patch
Content-Type: text/x-patch; name=nagios-1.0b3.pgsql.patch; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

diff -Naur nagios-1.0b3/contrib/database/create_mysql nagios-1.0b3.pgsql/co=
ntrib/database/create_mysql
--- nagios-1.0b3/contrib/database/create_mysql Tue Apr 16 20:44:50 2002
+++ nagios-1.0b3.pgsql/contrib/database/create_mysql Sun Jul 7 00:08:04 20=
02
@@ -8,7 +8,7 @@
# Table structure for table 'hostcomments'
#
=20
-CREATE TABLE hostcomments (
+CREATE TABLE nagios_hostcomments (
hostcomment_id int(11) DEFAULT '0' NOT NULL auto_increment,
host_name varchar(75) NOT NULL,
entry_time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
@@ -24,7 +24,7 @@
# Table structure for table 'hostdowntime'
#
=20
-CREATE TABLE hostdowntime (
+CREATE TABLE nagios_hostdowntime (
hostdowntime_id int(11) DEFAULT '0' NOT NULL auto_increment,
host_name varchar(75) NOT NULL,
entry_time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
@@ -43,7 +43,7 @@
# Table structure for table 'hostextinfo'
#
=20
-CREATE TABLE hostextinfo (
+CREATE TABLE nagios_hostextinfo (
host_name varchar(75) NOT NULL,
notes_url varchar(128) NOT NULL,
icon_image varchar(32) NOT NULL,
@@ -65,7 +65,7 @@
# Table structure for table 'hostretention'
#
=20
-CREATE TABLE hostretention (
+CREATE TABLE nagios_hostretention (
host_name varchar(75) NOT NULL,
host_state tinyint(4) DEFAULT '0' NOT NULL,
last_check int(11) DEFAULT '0' NOT NULL,
@@ -91,7 +91,7 @@
# Table structure for table 'hoststatus'
#
=20
-CREATE TABLE hoststatus (
+CREATE TABLE nagios_hoststatus (
host_name varchar(75) NOT NULL,
host_status varchar(16) NOT NULL,
last_update datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
@@ -121,7 +121,7 @@
# Table structure for table 'programretention'
#
=20
-CREATE TABLE programretention (
+CREATE TABLE nagios_programretention (
execute_service_checks tinyint(4) DEFAULT '0' NOT NULL,
accept_passive_checks tinyint(4) DEFAULT '0' NOT NULL,
enable_event_handlers tinyint(4) DEFAULT '0' NOT NULL,
@@ -138,7 +138,7 @@
# Table structure for table 'programstatus'
#
=20
-CREATE TABLE programstatus (
+CREATE TABLE nagios_programstatus (
last_update datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
program_start datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
daemon_mode tinyint(4) DEFAULT '0' NOT NULL,
@@ -161,7 +161,7 @@
# Table structure for table 'servicecomments'
#
=20
-CREATE TABLE servicecomments (
+CREATE TABLE nagios_servicecomments (
servicecomment_id int(11) DEFAULT '0' NOT NULL auto_increment,
host_name varchar(75) NOT NULL,
service_description varchar(128) NOT NULL,
@@ -178,7 +178,7 @@
# Table structure for table 'servicedowntime'
#
=20
-CREATE TABLE servicedowntime (
+CREATE TABLE nagios_servicedowntime (
servicedowntime_id int(11) DEFAULT '0' NOT NULL auto_increment,
host_name varchar(75) NOT NULL,
service_description varchar(128) NOT NULL,
@@ -198,7 +198,7 @@
# Table structure for table 'serviceextinfo'
#
=20
-CREATE TABLE serviceextinfo (
+CREATE TABLE nagios_serviceextinfo (
host_name varchar(75) NOT NULL,
service_description varchar(128) NOT NULL,
notes_url varchar(128) NOT NULL,
@@ -212,7 +212,7 @@
# Table structure for table 'serviceretention'
#
=20
-CREATE TABLE serviceretention (
+CREATE TABLE nagios_serviceretention (
host_name varchar(75) NOT NULL,
service_description varchar(128) NOT NULL,
service_state tinyint(4) DEFAULT '0' NOT NULL,
@@ -243,7 +243,7 @@
# Table structure for table 'servicestatus'
#
=20
-CREATE TABLE servicestatus (
+CREATE TABL

...[email truncated]...


This post was automatically imported from historical nagios-devel mailing list archives
Original poster: mattb@columbia.edu
Locked