PB with timezone in the dashboard and antivirus update


#1

Hello,

The Nethserver is the ntp for the network.
Look at this print screen ( you can see the Mac time, the Server time…
But look on the Dashboard the last update of the virus database/


#2

Weird, what does your freshclam log say?


#3

here the log…

ClamAV update process started at Tue Oct 13 12:15:36 2015
main.cvd is up to date (version: 55, sigs: 2424225, f-level: 60, builder: neo)
Downloading daily-20961.cdiff [100%]
daily.cld updated (version: 20961, sigs: 1608745, f-level: 63, builder: shurley)
bytecode.cvd is up to date (version: 268, sigs: 47, f-level: 63, builder: anvilleg)
Database updated (4033017 signatures) from db.it.clamav.net (IP: 193.206.139.34)
--------------------------------------
ClamAV update process started at Tue Oct 13 13:18:54 2015
main.cvd is up to date (version: 55, sigs: 2424225, f-level: 60, builder: neo)
daily.cld is up to date (version: 20961, sigs: 1608745, f-level: 63, builder: shurley)
bytecode.cvd is up to date (version: 268, sigs: 47, f-level: 63, builder: anvilleg)
--------------------------------------
ClamAV update process started at Tue Oct 13 14:28:33 2015
main.cvd is up to date (version: 55, sigs: 2424225, f-level: 60, builder: neo)
daily.cld is up to date (version: 20961, sigs: 1608745, f-level: 63, builder: shurley)
bytecode.cvd is up to date (version: 268, sigs: 47, f-level: 63, builder: anvilleg)

The freshclam is in localtime, the update happen at 12:15.
The two occurences after (13:18 and 14:28), there’s the verification, but no update…


#4

Today,
In the Dashboard,

Status              Updated
Last update     2015-10-14 16:15

In the freshclam log:

ClamAV update process started at Wed Oct 14 13:15:47 2015
main.cvd is up to date (version: 55, sigs: 2424225, f-level: 60, builder: neo)
Downloading daily-20965.cdiff [100%]
daily.cld updated (version: 20965, sigs: 1609861, f-level: 63, builder: neo)
bytecode.cvd is up to date (version: 268, sigs: 47, f-level: 63, builder: anvilleg)
Database updated (4034133 signatures) from db.it.clamav.net (IP: 193.206.139.34)

(Artem Fedai) #5

Time on Dashboard refreshes only when you press F5 or update the page.
show > ntpq -p


(Artem Fedai) #6

This field shows mtime of files in /var/lib/clamav/ so it is normal view :slight_smile:


#7

The ntpq -p

# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
-alpha.rueckgr.a 131.188.3.222    2 u  555 1024  377  259.283  -15.601   3.289
+c.ntp.br        200.160.7.186    2 u  230 1024  377  182.908    1.809   7.469
*aprihop.cdknnjl 200.98.196.212   2 u  611 1024  377  153.755   -4.532   4.045
+ec2-54-232-82-2 146.164.48.5     2 u  822 1024  327  131.303   -3.417  17.185

(Artem Fedai) #8

Set right time zone and server :slight_smile:


#9

I sure to have choosen the latin america/brasil/Belem…When I had installed the minimal CentOS.

Not sure I ever gone in the ntp server after the NS installation :smiley:

Edit: @Nas But the Nethserver I as the right date and time… Look at the CLI box on the screen shoot.
The server and the Mac client have the same correct time…


(Artem Fedai) #10

So there is no prob, last update shows last modified files in clamav update dir, time on Dashboard shows those time when page was loaded. It has not dynamic update feature :slight_smile:


#11

No, there’s a mistake here.

When the Dashboard show:

Status              Updated
Last update     2015-10-14 16:15

The right information should be:

Last update     2015-10-14 **13:15**

Between the Dashboard and the freshclam time… There three hours diference.
When I remember look the Dashboard to verify, I was 13:55, perhaps 14:00

To try to be clear:
At the screenshot time, it was 2015-10-13 13:36, when the Dashboard show 2015-10-13 15:15… This date and time not happen yet!!!
The correct time to be shown was 2015-10-13 12:15, not 15:15


(Artem Fedai) #12

/usr/share/nethesis/NethServer/Module/Dashboard/SystemStatus/Antivirus.php

 $fileList = glob('/var/lib/clamav/*.{cvd,cld}', GLOB_BRACE);
        foreach ($fileList as $file) {
            $changeTime = filemtime($file);
            if ($changeTime > $max) {
                $max = $changeTime;

so it shows ls -l /var/lib/clamav/.cld and ls -l /var/lib/clamav/.cvd and calculate max date of the file changes in those dir , so it migth be the situation that after reboot of the server freshclam update bases before time complitely sync.

stat /var/lib/clamav/*.cvd

(Artem Fedai) #13

If you want to see time of the real last freshclam start , you should change file :


#14

Looking at the Disk Usage, I have the same…

Actually, the date and time are 2015-10-14 22:39 ( at the top there only the time )
The update: 2015-10-15 01:38 at the butom…


(Artem Fedai) #15

$timestamp = $stat[‘mtime’];
The same behavior in DUC.php mtime, so my suggestion maybe right


(Giacomo Sanchietti) #16

Check the PHP datetime is the same sa the system:

config getprop php DateTimezone
config show TimeZone

Reference:


#17

UTC

TimeZone=America/Belem


Timezone not set properly on a new install
(Giacomo Sanchietti) #18

You just found the problem :wink:

Align the two values and you’re done.
I guess the right one is “America/Belem”.

 config setprop php DateTimezone America/Belem
 expand-template /etc/php.ini

Reference: http://php.net/manual/en/timezones.america.php


Timezone not set properly on a new install
#19

It seem the problem is deeper…

[root@microserver ~]# config setprop php DateTimezone America/Belem
[root@microserver ~]# expand-template /etc/php.ini
[root@microserver ~]# config getprop php DateTimezone
America/Belem
[root@microserver ~]# config show TimeZone
TimeZone=America/Belem

After a reconnection on the webgui, I still have the three hours of difference…
Did I need to reboot?


#20

Finally, I rebooted…

The Dashboard show the “good” time for the antivirus update… :smiley:

But the Disk Usage, still showing the UTC time… :confused: