Skip to content

Commit

Permalink
uptime and open time became <0 in python-3. Fixed now
Browse files Browse the repository at this point in the history
  • Loading branch information
ikzelf committed Feb 14, 2018
1 parent f6987af commit f325f97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions bin/zbxora.py
Expand Up @@ -28,7 +28,7 @@
import platform
# from pdb import set_trace
import cx_Oracle as db
VERSION = "1.97"
VERSION = "1.98"

def printf(format, *args):
"""just a simple c-style printf function"""
Expand Down Expand Up @@ -301,7 +301,6 @@ def output(host, ikey, values):
E = {"{#SECTION}": section}
SECTIONS_LIST.append(E)
x = dict(CHECKS.items(section))
# set_trace()
for key, sql in sorted(x.items()):
if sql and key != "minutes":
d = collections.OrderedDict()
Expand All @@ -321,8 +320,8 @@ def output(host, ikey, values):
#
# assume we are still connected. If not, exception will tell real story
output(HOSTNAME, ME[0] + "[connect,status]", 0)
output(HOSTNAME, ME[0] + "[uptime]", int(timer() - STARTTIME))
output(HOSTNAME, ME[0] + "[opentime]", int(timer() - OPENTIME))
output(HOSTNAME, ME[0] + "[uptime]", int(time.time() - STARTTIME))
output(HOSTNAME, ME[0] + "[opentime]", int(time.time() - OPENTIME))

# the connect status is only real if executed a query ....
for CHECKS in ALL_CHECKS:
Expand Down
2 changes: 1 addition & 1 deletion etc/zbxora.fsdb02.cfg
@@ -1,5 +1,5 @@
[zbxora]
db_url: //localhost:15214/fsdb02
db_url: //192.168.56.103:1521/fsdb4a
username: cistats
password: knowoneknows
role: normal
Expand Down

0 comments on commit f325f97

Please sign in to comment.