added actionlist_template to display action list consistently on different pages
[monitor.git] / monitor / database / dborm.py
1 import sqlalchemy
2 import elixir
3 import monitor.config as config
4
5 mon_metadata = sqlalchemy.MetaData()
6 mon_metadata.bind = sqlalchemy.create_engine(config.monitor_dburi, echo=config.echo)
7 mon_session = sqlalchemy.orm.scoped_session(sqlalchemy.orm.sessionmaker(autoflush=False,autocommit=True))
8 mon_session.bind = mon_metadata.bind
9
10 if config.zabbix_enabled:
11         zab_metadata = sqlalchemy.MetaData()
12         zab_metadata.bind = sqlalchemy.create_engine(config.zabbix_dburi, echo=config.echo)
13         zab_session = sqlalchemy.orm.scoped_session(sqlalchemy.orm.sessionmaker(autoflush=False,autocommit=True))
14         zab_session.bind = zab_metadata.bind