NMIS/OMK Timezone Configuration

Purpose

This page will explain how to set the time that NMIS and OMK applications use to display data.

NMIS

NMIS will display data relative to the local system time of the server that it is running on.  The best method of changing local time on the server varies based on the Operating System. 

General Method

Find the desired timezone in the /usr/share/timezone directory. 

### Confirm the current timezone
[root@opmantek ~]# date
Sat Apr 22 13:43:59 KST 2017

### Remove current timezone config
[root@opmantek ~]# rm -rf /etc/localtime 

### Set to desired timezone
[root@opmantek ~]# ln -s /usr/share/zoneinfo/UTC /etc/localtime

### Verify
[root@opmantek ~]# date
Sat Apr 22 04:46:29 UTC 2017

Debian Based Systems

Use the dpkg-reconfigure utility with the tzdata argument

root@DebTest:~#dpkg-reconfigure tzdata

This will launch a GUI in the terminal and guide the user through the process.

CentOS 7

### Find the desired timezone
[root@localhost ~]# timedatectl list-timezones

### Confirm current timezone
[root@localhost ~]# date
Sat Apr 22 01:05:47 EDT 2017

### Change to desired timezone
[root@localhost ~]# timedatectl set-timezone UTC

### Verify
[root@localhost ~]# date
Sat Apr 22 05:06:04 UTC 2017

 

OMK Applications

By default OMK applications will use the timezone that the server has been provisioned for. To change the time that OMK applications use to display data, opCommon.nmis needs to be udpated.  Any timezone declaration from one of the following sources may be used:

If the config item 'omkd_display_timezone' is not present or blank, then the server timezone is used and times are shown without the timezone suffix.
If it is set to "local", then the server timezone is used but the applications show all times with the timezone suffix appended.

To adjust the timezone settting, edit conf/opCommon.nmis and insert a key called 'omkd_display_timezone' in the omkd section.  Associate the desired timezone name with it as show below.

/usr/local/omk/conf/opCommon.nmis
 -- snip
  'omkd' => {
    'load_applications' => [
      'Open-AudIT',
      'opCharts',
      'opEvents',
      'opConfig',
      'opReports',
      'opFlow'
    ],
    'omkd_asset_dir' => '/omk/dist/',
    'omkd_display_timezone' => "UTC",
    'omkd_asset_minified' => 0,
    'omkd_auto_detect_language' => 1,
    'omkd_default_language' => 'en',
    'omkd_heartbeat_timeout' => 300,
    'omkd_inactivity_timeout' => 300,
    'omkd_listen_address' => '*',
-- snip

This method currently works for all OMK modules except Open-AudIT Enterprise.