diff --git a/src/api/index.py b/src/api/index.py index aa43b4a..eff3ac3 100644 --- a/src/api/index.py +++ b/src/api/index.py @@ -56,7 +56,7 @@ f.close() # # from threading import Thread, RLock -p = {'uri':'http://dev.the-phi.com:5984','dbname':'monitor','uid':'logs','filename':'logs.JSON'} +p = {'uri':'http://localhost:5984','dbname':'monitor','uid':'logs','filename':'logs.JSON'} factory = DataSourceFactory() gWriter = factory.instance(type='CouchdbWriter',args=p) gReader = factory.instance(type='CouchdbReader',args=p) diff --git a/src/monitor.py b/src/monitor.py index e319bc0..f1e3d14 100755 --- a/src/monitor.py +++ b/src/monitor.py @@ -141,8 +141,9 @@ class DetailProcess(Analysis): self.names = names; def split(self,name,stream): - pattern = " (\d+.{0,1}\d*)\x20*(\d+.{0,1}\d*)\x20*(\d+.{0,1}\d*)\x20".replace(":name",name) - g = re.match(pattern,stream) + + pattern = "(\d+.{0,1}\d*)\x20*(\d+.{0,1}\d*)\x20*(\d+.{0,1}\d*)".replace(":name",name).strip() + g = re.match(pattern,stream.strip()) if g : return list(g.groups())+[name] else: diff --git a/src/monitor.pyc b/src/monitor.pyc new file mode 100644 index 0000000..b5d99cd Binary files /dev/null and b/src/monitor.pyc differ diff --git a/src/utils/__init__.pyc b/src/utils/__init__.pyc new file mode 100644 index 0000000..f5ac2b4 Binary files /dev/null and b/src/utils/__init__.pyc differ diff --git a/src/utils/transport.pyc b/src/utils/transport.pyc new file mode 100644 index 0000000..a9f05bd Binary files /dev/null and b/src/utils/transport.pyc differ diff --git a/test/.TestServerMonitor.py.swp b/test/.TestServerMonitor.py.swp new file mode 100644 index 0000000..d2a5432 Binary files /dev/null and b/test/.TestServerMonitor.py.swp differ diff --git a/test/TestServerMonitor.py b/test/TestServerMonitor.py index ae6a325..47443fc 100644 --- a/test/TestServerMonitor.py +++ b/test/TestServerMonitor.py @@ -18,7 +18,7 @@ class TestMonitorServer(unittest.TestCase): self.assertTrue(p.evaluate('PATH') == 0) def test_RunningProcess(self): p = DetailProcess() - p.init(['rabbitmq-server','python','apache2']) + p.init(['kate','firefox']) #['rabbitmq-server','python','apache2','firefox']) r = p.composite() self.assertTrue(r)