centreon-plugins icon indicating copy to clipboard operation
centreon-plugins copied to clipboard

[apps::vmware::connector::plugin] mode=snapshot-vm

Open JBElect opened this issue 2 years ago • 5 comments

Hello

We have an issue with apps::vmware::connector::plugin plugin and snapshot-vm mode.

The vcenter is not on the same GMT hour with our centreon server. The vcenter has one hour more.

When a snapshot has been created on 12/6/23, 5:27PM on the vcenter in reality on our centreon server it's 12/6/23 4:27PM

If we execute :

/usr/lib/centreon/plugins/centreon_vmware_connector_client.pl --plugin=apps::vmware::connector::plugin --mode=snapshot-vm --custommode=connector --connector-hostname='xxx.xxxx.xxx.xx' --connector-port='5700' --container='yyyyyyyyy' --vm-hostname='.*' --filter --unit=h --warning='72' --critical='168' --scope-host='^.' --verbose

during the first hour the result is CRITICAL :

'MYDCSERVER02' snapshot create time: 2023-12-06T16:27:16.

From our centreon server :

date
Wed Dec 6 16:27:27 CET 2023

After one hour the result is OK.

Could you please take a look at this? I'm available if it's necessary.

JBElect avatar Dec 07 '23 15:12 JBElect

Hi @JBElect Have you tried the --time-shift option? I am not sure but I think the option must be passed in seconds (I could not find much information about it), so can you try with the following values

  • --time-shift=-3600
  • --time-shift=3600

omercier avatar Dec 11 '23 08:12 omercier

Hello and thanks you for your message. Unfortunately it's not working better with --time-shift option :

[root@xxxx]# /usr/lib/centreon/plugins/centreon_vmware_connector_client.pl --plugin=apps::vmware::connector::plugin --mode=snapshot-vm --custommode=connector --connector-hostname='y.y.y.y' --connector-port='5700' --container='my_container' --vm-hostname='.*' --filter --filter-uuid='' --unit 'h' --warning='72' --critical='168' --scope-host='^..' --time-shift=3600 --verbose

CRITICAL: Snapshots for VM older than 168 hours: [my_server] | 'num_warning'=0;;;0; 'num_critical'=1;;;0; 'my_server' snapshot create time: 2023-12-20T11:31:15.185966Z [test]

[root@xxxx]# date Wed Dec 20 11:34:38 CET 2023

[root@xxxx]# /usr/lib/centreon/plugins/centreon_vmware_connector_client.pl --plugin=apps::vmware::connector::plugin --mode=snapshot-vm --custommode=connector --connector-hostname='y.y.y.y' --connector-port='5700' --container='my_container' --vm-hostname='.*' --filter --filter-uuid='' --unit 'h' --warning='72' --critical='168' --scope-host='^..' --time-shift=-3600 --verbose

CRITICAL: Snapshots for VM older than 168 hours: [my_server] | 'num_warning'=0;;;0; 'num_critical'=1;;;0; 'my_server' snapshot create time: 2023-12-20T11:31:15.185966Z [test]

[root@xxxx]# date Wed Dec 20 11:34:53 CET 2023

Regards,

JBElect avatar Dec 20 '23 10:12 JBElect

Thank you @JBElect We'll have a look at it.

omercier avatar Dec 20 '23 15:12 omercier

Hello @JBElect, I could not reproduce this problem on my environnement. On my vcenter (an old version for now) the data sent back is VM-NAME' snapshot create time: 2024-06-07T12:54:48.951999Z

Notice the Z which indicate an utc time, your output don't seem to specify the milisecondes nor the timezone the vcenter is using.

Can you show me the vcenter and centreon_vmware daemon version you currently use ? Can you also run the plugin with the option --verbose --debug which will allow to show the vcenter output given to the plugin ?

Evan-Adam avatar Jun 07 '24 16:06 Evan-Adam

Hello :)

Without additional information we are not able to provide a solution or resolve a possible bug. So @JBElect if you still need a response / solution to this issue, can you take a look at @Evan-Adam's message above?

lucie-tirand avatar Jul 02 '24 13:07 lucie-tirand