Browse Source

Make DB name an argument.

master v0.1
Joachim Desroches 11 months ago
parent
commit
61dd64c0e6
Signed by: jdesroches
GPG Key ID: 6778C9C29C02D691
  1. 11
      prometheus-odoo-license-exporter

11
prometheus-odoo-license-exporter

@ -4,17 +4,22 @@
from prometheus_client import start_http_server, Gauge
from datetime import datetime
from time import sleep
import psycopg2
import sys
USER = "odoo"
HTTP_PORT = 9402
INTERVAL = 10
# FIXME: Make a parameter
DBNAME = "edurable_staging"
if __name__ == '__main__':
if len(sys.argv) == 2:
DBNAME = sys.argv[1]
else:
sys.exit("Invalid number of arguments. " +
"Usage: {} [dbname]".format(sys.argv[0]))
# Setup prometheus Gauge
prom_days = Gauge(
'odoo_license_remaining_days',

Loading…
Cancel
Save