When i try to add a "misc directive" on the GUI (Nagios Main Configuration Page 4), I can't commit my configuration.
Monarch add a key on the generated nagios.cfg file that not expected by Nagios (ie:key0.xxxxxxxxxxxxxxx)
So, when I run a preflight check on the GUI, I've got a error like:
"Running pre-flight check...
Results:
...Error in configuration file '/usr/local/groundwork/monarch/workspace/nagios.cfg' - Line 309 (UNKNOWN VARIABLE)
***> One or more problems was encountered while processing the config files..."
When I edit the '/usr/local/groundwork/monarch/workspace/nagios.cfg' I can see that the string "key0.xxxxxxxxxxxxxxx" as been inserted by MONARCH between the name of the directive and the "="
# MISC DIRECTIVES
event_broker_optionskey0.695572489946247=-1
broker_modulekey0.630827196016075=/usr/sbin/ndomod.o config_file=/etc/nagios3/ndomod.cfg
"misc directives" screenshot
Logged In: NO
Hi,
you can correct the value of the Directive in the datebase in the table setup.
Best regards
Simo
file
In file "MonarchStorProc.pm" add line: (monarch 2.5)
------before:
sub insert_obj(@) {
...
foreach my $val (@values) {
unless ($val) { $val = 'NULL' }
unless ($val eq 'NULL') { $val = $dbh->quote($val) }
$valstr .= "$val,";
}
------after:
sub insert_obj(@) {
...
foreach my $val (@values) {
unless ($val) { $val = 'NULL' }
if ($val=~/(.*)key(.*)/) { $val=$1; }
unless ($val eq 'NULL') { $val = $dbh->quote($val) }
$valstr .= "$val,";
}
Edit MonarchFile.pm (monarch 2.5) from line 1722:
if (%nagios_cfg_misc) {
$outfile .= "\n# MISC DIRECTIVES\n";
foreach my $misc_prop (sort {$a <=> $b} keys %nagios_cfg_misc) {
my $misc_proptmp=$misc_prop;
$misc_proptmp=~ s/key\d+.\d+//;
$outfile .= "$misc_proptmp=$nagios_cfg_misc{$misc_prop}\n";
}
}