centreon / centreon-plugins

Collection of standard plugins to discover and gather cloud-to-edge metrics and status across your whole IT infrastructure.
https://www.centreon.com
Apache License 2.0
310 stars 274 forks source link

[apps:protocols:ftp] mode=date problem #367

Closed fixlair closed 7 years ago

fixlair commented 8 years ago

Hello,

I just test the great ftp plugin with date mode and faced to 2 issues

  1. With option --directory, it seems that it does not use the directory when checking file time On line 104 if (!($time_result = apps::protocols::ftp::lib::ftp::execute($self, command => $map_commands{mdtm}->{$self->{ssl_or_not}}->{name}, command_args => [$file]))) {

    Sometime we can't have mtime for a directory

           next;
       }

The $file does not include the $dir.$file.

  1. Do you think it may it be possible to make $current_time taking for reference local time of the server instead of unixtime directly ? In fact on my test, the remote time ($time_result) give me the local time, but as the $current_time is in GMT+2 here I got strange result...

Regards, Fix

garnier-quentin commented 8 years ago

Hi Fixlair,

It's not really clear:

fixlair commented 8 years ago

Hi Quentin,

garnier-quentin commented 8 years ago

I think, it depends of the server. I think i need to manage the case. For the second, i could add a timezone option to display it with another timezone.

fixlair commented 7 years ago

Great thanks a lot :) I will be happy to test it in the next days !

garnier-quentin commented 7 years ago

You're welcome. I have tested it with crushftp. So it should work ;)