Re: [Nagios-devel] NDOutils and cfg_dir
Posted: Wed Oct 17, 2007 9:59 pm
This is a multi-part message in MIME format.
--------------070702070806000306000206
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Andreas Ericsson wrote:
> Andreas Kasenides wrote:
>
>> I seem to remember reading something about this some time back,
>> but my search did not turn anything so here it goes:
>>
>> I am using Nagios 2.7, ndoutils 1.4b6 and it seems that when I use
>> several cfg_dir in my nagios.cfg the corresponding table in the DB
>> (_configvariables) will only retain one record for a cfg_dir (varname =
>> cfg_dir), the last one.
>> The exact same thing happens with cfg_file variables.
>>
>> As far as I can tell this behaviour was the same in ndoutils 1.4b2.
>> Any idea why?
>>
>
> Probably because the column has the "UNIQUE" property. I don't know
> for sure though, as I don't use ndoutils.
>
>
Oh yes indeed! Thanks a zillion!
Here is a small "patch" for db/mysql.sql of the offending table that
fixes it where
I removed the varname attribute from UNIQUE KEY line.
Thanks again.
Andreas:
=======================
--
-- Table structure for table `nagios_configfilevariables`
--
CREATE TABLE `nagios_configfilevariables` (
`configfilevariable_id` int(11) NOT NULL auto_increment,
`instance_id` smallint(6) NOT NULL default '0',
`configfile_id` int(11) NOT NULL default '0',
`varname` varchar(64) NOT NULL default '',
`varvalue` varchar(255) NOT NULL default '',
PRIMARY KEY (`configfilevariable_id`),
UNIQUE KEY `instance_id` (`instance_id`,`configfile_id`)
) ENGINE=InnoDB COMMENT='Configuration file variables';
--------------070702070806000306000206
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Andreas Ericsson wrote:
Andreas Kasenides wrote:
I seem to remember reading something about this some time back,
but my search did not turn anything so here it goes:
I am using Nagios 2.7, ndoutils 1.4b6 and it seems that when I use
several cfg_dir in my nagios.cfg the corresponding table in the DB
(_configvariables) will only retain one record for a cfg_dir (varname =
cfg_dir), the last one.
The exact same thing happens with cfg_file variables.
As far as I can tell this behaviour was the same in ndoutils 1.4b2.
Any idea why?
Probably because the column has the "UNIQUE" property. I don't know
for sure though, as I don't use ndoutils.
Oh yes indeed! Thanks a zillion!
Here is a small "patch" for db/mysql.sql of the offending table that
fixes it where
I removed the varname attribute from UNIQUE KEY line.
Thanks again.
Andreas:
=======================
--
-- Table structure for table `nagios_configfilevariables`
--
CREATE TABLE `nagios_configfilevariables` (
`configfilevariable_id` int(11) NOT NULL auto_increment,
`instance_id` smallint(6) NOT NULL default '0',
`configfile_id` int(11) NOT NULL default '0',
`varname` varchar(64) NOT NULL default '',
`varvalue` varchar(255) NOT NULL default '',
PRIMARY KEY (`configfilevariable_id`),
UNIQUE KEY `instance_id` (`instance_id`,`configfile_id`)
) ENGINE=InnoDB COMMENT='Configuration file variables';
--------------070702070806000306000206--
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
--------------070702070806000306000206
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Andreas Ericsson wrote:
> Andreas Kasenides wrote:
>
>> I seem to remember reading something about this some time back,
>> but my search did not turn anything so here it goes:
>>
>> I am using Nagios 2.7, ndoutils 1.4b6 and it seems that when I use
>> several cfg_dir in my nagios.cfg the corresponding table in the DB
>> (_configvariables) will only retain one record for a cfg_dir (varname =
>> cfg_dir), the last one.
>> The exact same thing happens with cfg_file variables.
>>
>> As far as I can tell this behaviour was the same in ndoutils 1.4b2.
>> Any idea why?
>>
>
> Probably because the column has the "UNIQUE" property. I don't know
> for sure though, as I don't use ndoutils.
>
>
Oh yes indeed! Thanks a zillion!
Here is a small "patch" for db/mysql.sql of the offending table that
fixes it where
I removed the varname attribute from UNIQUE KEY line.
Thanks again.
Andreas:
=======================
--
-- Table structure for table `nagios_configfilevariables`
--
CREATE TABLE `nagios_configfilevariables` (
`configfilevariable_id` int(11) NOT NULL auto_increment,
`instance_id` smallint(6) NOT NULL default '0',
`configfile_id` int(11) NOT NULL default '0',
`varname` varchar(64) NOT NULL default '',
`varvalue` varchar(255) NOT NULL default '',
PRIMARY KEY (`configfilevariable_id`),
UNIQUE KEY `instance_id` (`instance_id`,`configfile_id`)
) ENGINE=InnoDB COMMENT='Configuration file variables';
--------------070702070806000306000206
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Andreas Ericsson wrote:
Andreas Kasenides wrote:
I seem to remember reading something about this some time back,
but my search did not turn anything so here it goes:
I am using Nagios 2.7, ndoutils 1.4b6 and it seems that when I use
several cfg_dir in my nagios.cfg the corresponding table in the DB
(_configvariables) will only retain one record for a cfg_dir (varname =
cfg_dir), the last one.
The exact same thing happens with cfg_file variables.
As far as I can tell this behaviour was the same in ndoutils 1.4b2.
Any idea why?
Probably because the column has the "UNIQUE" property. I don't know
for sure though, as I don't use ndoutils.
Oh yes indeed! Thanks a zillion!
Here is a small "patch" for db/mysql.sql of the offending table that
fixes it where
I removed the varname attribute from UNIQUE KEY line.
Thanks again.
Andreas:
=======================
--
-- Table structure for table `nagios_configfilevariables`
--
CREATE TABLE `nagios_configfilevariables` (
`configfilevariable_id` int(11) NOT NULL auto_increment,
`instance_id` smallint(6) NOT NULL default '0',
`configfile_id` int(11) NOT NULL default '0',
`varname` varchar(64) NOT NULL default '',
`varvalue` varchar(255) NOT NULL default '',
PRIMARY KEY (`configfilevariable_id`),
UNIQUE KEY `instance_id` (`instance_id`,`configfile_id`)
) ENGINE=InnoDB COMMENT='Configuration file variables';
--------------070702070806000306000206--
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]