Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pyvmomi
pyvmomi pyvim
6 changes: 3 additions & 3 deletions vsanmetrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Erwan Quelin - [email protected]

from pyVim.connect import SmartConnect, Disconnect
from pyvim.connect import SmartConnect, Disconnect
from pyVmomi import VmomiSupport, SoapStubAdapter, vim, vmodl

import threading
Expand All @@ -18,7 +18,7 @@

import vsanapiutils
import vsanmgmtObjects

import calendar

def get_args():
parser = argparse.ArgumentParser(
Expand Down Expand Up @@ -246,7 +246,7 @@ def formatInfluxLineProtocol(measurement, tags, fields, timestamp):

# Convert time in string format to epoch timestamp (nanosecond)
def convertStrToTimestamp(str):
sec = time.mktime(datetime.strptime(str, "%Y-%m-%d %H:%M:%S").timetuple())
sec = calendar.timegm(datetime.strptime(str, "%Y-%m-%d %H:%M:%S").timetuple())

ns = int(sec * 1000000000)

Expand Down