-
Notifications
You must be signed in to change notification settings - Fork 16
/
main.py
executable file
·60 lines (40 loc) · 1003 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env python
# (C) 2013 Francois Cauwe
#Global libs
import sys, time, threading
import subprocess
import Queue
#Private libs
import listen
import snmp
import XmlDict
conf=dict()
def load_config():
# logger.info("Loading Config...")
global conf
conf=XmlDict.loadXml("global.xml")
def launch_snmp():
# logger.info("Snmp service...")
global conf
snmp.launch(conf)
def launch_listen():
# logger.info("Loading Listening service...")
global conf
listen.launch(conf)
def main():
#logging.config.fileConfig("config/logger.conf")
#global logger
#logger=logging.getLogger("main")
# Loading global configuration
load_config()
# Start Snmp
snmpThread = threading.Thread(target=launch_snmp)
snmpThread.start()
# Start Snmp
listenThread = threading.Thread(target=launch_listen)
listenThread.start()
# Wait for closing
snmpThread.join()
listenThread.join()
if __name__ == '__main__':
main()