The bulk modification wizard works now
I tried the import via the command line and it seemed to have worked. Any idea what the php warning might be about?
./reconfigure_nagios.sh
--- reset_config_perms.sh ------------
> Setting CCM script permissions
> Setting script permissions
> Setting special component script permissions
> Setting configuration file/directory permissions
> Setting perfdata directory and RRD permissions
> Setting NOM checkpoint user:group permissions
> + Setting Nagios Core corelog.newobjects user:group permissions
> + Setting CCM configuration file user:group permissions
> + Setting Recurring Downtime file user:group permissions
> + Setting BPI configuration file user:group permissions
--------------------------------------
--- ccm_import.php -------------------
> Setting import directory: /usr/local/nagios/etc/import/
> Importing config files into the CCM
- Importing: /usr/local/nagios/etc/import/hostgroups.cfg .. PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosxi/html/includes/components/nagiosim/nagiosim.inc.php on line 491
SUCCESS
--------------------------------------
--- ccm_export.php -------------------
> Writing CCM configuration to Nagios files
PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosxi/html/includes/components/nagiosim/nagiosim.inc.php on line 491
Finished writing out configuraton
--------------------------------------
--------------------------------------
> Verifying configuration with Nagios Core
> Output:
Nagios Core 4.4.2
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2018-08-16
License: GPL
Website:
https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 18345 services.
Checked 2279 hosts.
Checked 352 host groups.
Checked 17 service groups.
Checked 310 contacts.
Checked 61 contact groups.
Checked 186 commands.
Checked 255 time periods.
Checked 995 host escalations.
Checked 118 service escalations.
Checking for circular paths...
Checked 2279 hosts
Checked 56 service dependencies
Checked 0 host dependencies
Checked 255 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
> Return Code: 0
--------------------------------------
Stopping nagios: .done.
Starting nagios: done.
Line 491 has
{
global $cfg;
if ($cfg['db_info']['nagiosxi']['dbtype'] == 'pgsql') {
$sql = "SELECT COUNT(relname) FROM pg_class WHERE relname = 'xi_incidents'";
$rs = exec_sql_query(DB_NAGIOSXI, $sql, true);
foreach ($rs as $row) {
if ($row['count'] == 0) {
// Create sequence
$sql = "
CREATE SEQUENCE xi_incidents_id_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1";
exec_sql_query(DB_NAGIOSXI, $sql, true);
// Create table
$sql = "
CREATE TABLE IF NOT EXISTS xi_incidents (
id integer DEFAULT nextval('xi_incidents_id_seq'::regclass) NOT NULL,
incident_id integer DEFAULT 0,
submitted integer DEFAULT 0,
type varchar(16),
host varchar(96),
service varchar(96),
event_time timestamp without time zone NOT NULL,
status varchar(16),
output text
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1";
exec_sql_query(DB_NAGIOSXI, $sql, true);
// Make sure we have access
$sql = "ALTER TABLE public.xi_incidents OWNER TO nagiosxi";
}
}