Scheduled maintenance uses browser time

Hello!

After update from 1.47 to 1.48 versions of LibreNMS, the following issue emerged.

Time picker in alert maintenance scheduler does not allow entering start time lower than current browser time. My browser time is UTC+2, whereas all of the services that work in LibreNMS cluster are set to use UTC for operating simplicity. Thus, it is now impossible to set new schedules starting at current time.

I did try to edit timezone setting in php.ini for FPM, but this does not help. I searched for any datetime-related settings in config.php and defaults.inc.php, but could not find corresponding settings. Apparently they are missing in Global configuration in the web interface.

In order to reproduce, perform the following:

  1. Set timezone of DB, PHP-FPM and OS time to be UTC.
  2. Set browser time to UTC+2
  3. Attempt to add alert maintenance to the past.

Say please, how can I resolve this issue apart from hardcoding the change in source?

./validate.php output:

====================================
Component | Version
--------- | -------
LibreNMS  | 1.48
DB Schema | 2019_01_16_195644_add_vrf_id_and_bgpLocalAs (131)
PHP       | 7.1.26-1+0~20190113101810.12+stretch~1.gbp7077bb
MySQL     | 10.1.37-MariaDB-0+deb9u1
RRDTool   | 1.6.0
SNMP      | NET-SNMP 5.7.3
====================================

[OK]    Composer Version: 1.8.2
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[FAIL]  Database: extra table (plugin_config_rules)
[FAIL]  We have detected that your database schema may be wrong, please report the following to us on Discord (https://t.libren.ms/discord) or the community site (https://t.libren.ms/5gscd):
        [FIX]:
        Run the following SQL statements to fix.
        SQL Statements:
         DROP TABLE `plugin_config_rules`;
[WARN]  Some devices have not been polled in the last 5 minutes. You may have performance issues.
        [FIX]:
        Check your poll log and see: http://docs.librenms.org/Support/Performance/
        Devices:
         <1 device hostname>
[FAIL]  Discovery has not completed in the last 24 hours.
        [FIX]:
        Check the cron job to make sure it is running and using discovery-wrapper.py
[WARN]  Your local git contains modified files, this could prevent automatic updates.
        [FIX]:
        You can fix this with ./scripts/github-remove
        Modified Files:
         .gitignore
         LibreNMS/service.py
         bootstrap/cache/.gitignore
         logs/.gitignore
         storage/app/.gitignore
         storage/app/public/.gitignore
         storage/debugbar/.gitignore
         storage/framework/cache/.gitignore
         storage/framework/sessions/.gitignore
         storage/framework/testing/.gitignore
         storage/framework/views/.gitignore
         storage/logs/.gitignore
[FAIL]  We have found some files that are owned by a different user than librenms, this will stop you updating automatically and / or rrd files being updated causing graphs to fail.
        [FIX]:
        sudo chown -R librenms:librenms /opt/librenms
        sudo setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
        sudo chmod -R ug=rwX /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
        Files:
         /opt/librenms/composer.phar

:confused:

The way LibreNMS handles time needs to change. It shouldn’t matter the timezones…

Hello @murrant, thanks for the follow-up!

This is very strange, but today I noticed I actually can set starting datetime (without recurrence) to past hours withing the same date. Date picking form can freeze like I described previously, but the very next page refresh it actually allows setting the start time in past. This is happens in both Firefox and Chrome.

I guess this is resolved for now, I will reopen a ticket only if I find the 100% reproducing pattern.

The new device/group mapping rocks, by the way! Previous version did not allow mapping 12+ devices, but this form behaves differently. Thank you very much!

Hi All,

I have started using ‘Schedule Maintenance’ tool and hit the same issue. I am in UTC+3 but the server (both php and mysql) are in UTC, and LibreNMS doesn’t allow me to enter start time lower than my current time.

It blocks me from disabling alerting immediately, need to book them in 3 hours