Nagios fusion failed to install on RHEL 9 with DB related error.

This support forum board is for questions relating to Nagios Fusion.
Post Reply
SBhambri
Posts: 10
Joined: Sun Mar 29, 2020 9:34 pm

Nagios fusion failed to install on RHEL 9 with DB related error.

Post by SBhambri »

o Nagios fusion failed to install on RHEL 9.
o I tried to run DB command to create table manually, below and got same error "ERROR 1067 (42000): Invalid default value for 'scheduled_time'"


[root@xxxx nagiosfusion]# mysql -pfusion
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.5.22-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> CREATE TABLE IF NOT EXISTS `fusion`.`commands` (
-> `command_id` int unsigned auto_increment,
-> `user_id` int unsigned not null default 0,
-> `command` smallint unsigned not null default 0,
-> `submission_time` timestamp not null default current_timestamp,
-> `scheduled_time` timestamp not null default '1970-01-01 01:00:00',
-> `start_time` timestamp not null default '1970-01-01 01:00:00',
-> `processing_time` int,
-> `status_code` int not null default 0,
-> `result_code` int not null default 0,
-> `command_data` text,
-> `result` text,
-> primary key (`command_id`)
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
ERROR 1067 (42000): Invalid default value for 'scheduled_time'
MariaDB [(none)]>
Last edited by SBhambri on Thu May 02, 2024 12:33 am, edited 1 time in total.
SBhambri
Posts: 10
Joined: Sun Mar 29, 2020 9:34 pm

Re: Nagios fusion failed to install on RHEL 9 with DB related error.

Post by SBhambri »

Hi Team,

I looked at my old fusion server (On RHEL 7) that I am replacing and found below DB Table settings:

##############
MariaDB [fusion]> SHOW COLUMNS FROM commands
-> ;
+-----------------+----------------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+----------------------+------+-----+---------------------+----------------+
| command_id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| user_id | int(10) unsigned | NO | | 0 | |
| command | smallint(5) unsigned | NO | | 0 | |
| submission_time | timestamp | NO | | CURRENT_TIMESTAMP | |
| scheduled_time | timestamp | NO | | 0000-00-00 00:00:00 | |
| start_time | timestamp | NO | | 0000-00-00 00:00:00 | |
| processing_time | int(11) | YES | | NULL | |
| status_code | int(11) | NO | | 0 | |
| result_code | int(11) | NO | | 0 | |
| command_data | text | YES | | NULL | |
| result | text | YES | | NULL | |
+-----------------+----------------------+------+-----+---------------------+----------------+
##############

I modified the current installation script to execute the modified "db/schemas/fusion.sql"

FROM:
##############################################################################
CREATE TABLE IF NOT EXISTS `fusion`.`commands` (
`command_id` int unsigned auto_increment,

`user_id` int unsigned not null default 0,

`command` smallint unsigned not null default 0,

`submission_time` timestamp not null default current_timestamp,
`scheduled_time` timestamp not null default '1970-01-01 01:00:00',
`start_time` timestamp not null default '1970-01-01 01:00:00',
`processing_time` int,

`status_code` int not null default 0,
`result_code` int not null default 0,

`command_data` text,
`result` text,

primary key (`command_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;


[root@geqmfu01 nagiosfusion]# cat setup/db/schemas/fusion.sql.org2

CREATE DATABASE IF NOT EXISTS `fusion`;
GRANT ALL ON fusion.* TO 'fusion'@'localhost';


##############################################################################

TO:

##############################################################################
CREATE TABLE IF NOT EXISTS `fusion`.`commands` (
`command_id` int unsigned auto_increment,

`user_id` int unsigned not null default 0,

`command` smallint unsigned not null default 0,

`submission_time` timestamp not null default current_timestamp,
`scheduled_time` timestamp not null default '0000-00-00 00:00:00',
`start_time` timestamp not null default '0000-00-00 00:00:00',
`processing_time` int,

`status_code` int not null default 0,
`result_code` int not null default 0,

`command_data` text,
`result` text,

primary key (`command_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;


[root@geqmfu01 nagiosfusion]# cat setup/db/schemas/fusion.sql.org2

CREATE DATABASE IF NOT EXISTS `fusion`;
GRANT ALL ON fusion.* TO 'fusion'@'localhost';


##############################################################################

Please confirm if this approach is okay.

With Regards,

SB
User avatar
swolf
Developer
Posts: 361
Joined: Tue Jun 06, 2017 9:48 am

Re: Nagios fusion failed to install on RHEL 9 with DB related error.

Post by swolf »

Hi @SBhambri,

Thanks for reaching out. If you're able to get to the end of the install process, your approach looks reasonable to me for your system. I've filed a bug report for this issue.

-Sebastian
Developer @ Nagios 2017-05-15 thru 2024-08-06
HuckleberryHound
Posts: 1
Joined: Wed Jul 24, 2024 9:31 am

Re: Nagios fusion failed to install on RHEL 9 with DB related error.

Post by HuckleberryHound »

I've had the same issue on a fresh install of Oracle Linux 9.3. I've selected a 'Minimal' install of the OS and then installed the 'net-tools' package, configured the network and then run the curl command to perform the installation:

curl https://assets.nagios.com/downloads/nag ... install.sh | sh

The end of my install.log file shows:

Complete!
Prerequisites installed OK
Adding users and groups...
groupadd: group 'nagios' already exists
Users and Groups installed OK
MySQL installed OK - continuing...
Starting MySQL...
Redirecting to /bin/systemctl restart mariadb.service
Initializing MySQL...
Saved password 'fusion' worked...
Updated the following MySQL/MariaDB configuration files successfully:
/etc/my.cnf.d/mariadb-server.cnf
Setting up the Nagios Fusion database...
ERROR 1067 (42000) at line 31: Invalid default value for 'scheduled_time'


I've attached my install.log file
You do not have the required permissions to view the files attached to this post.
User avatar
ajcoil
Posts: 88
Joined: Wed Aug 09, 2023 10:30 am

Re: Nagios fusion failed to install on RHEL 9 with DB related error.

Post by ajcoil »

Hello @HuckleberryHound,

Thank you for reaching out, and I am sorry to hear you are running into this issue as well.

This issue is indeed on my radar and I would highly recommend keeping an eye on the Nagios Fusion changelog to see when a fix is implemented!


If you have any other questions, comments, or concerns, feel free to reach out!
Post Reply