Make DB name an argument.
This commit is contained in:
parent
4be512e6c1
commit
61dd64c0e6
1 changed files with 8 additions and 3 deletions
|
@ -4,17 +4,22 @@
|
||||||
from prometheus_client import start_http_server, Gauge
|
from prometheus_client import start_http_server, Gauge
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
import psycopg2
|
import psycopg2
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
USER = "odoo"
|
USER = "odoo"
|
||||||
HTTP_PORT = 9402
|
HTTP_PORT = 9402
|
||||||
INTERVAL = 10
|
INTERVAL = 10
|
||||||
|
|
||||||
# FIXME: Make a parameter
|
|
||||||
DBNAME = "edurable_staging"
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
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
|
# Setup prometheus Gauge
|
||||||
prom_days = Gauge(
|
prom_days = Gauge(
|
||||||
'odoo_license_remaining_days',
|
'odoo_license_remaining_days',
|
||||||
|
|
Loading…
Reference in a new issue