mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-10-31 18:58:01 +00:00
initial commit
This commit is contained in:
@@ -13,17 +13,31 @@ if 'py-json' not in sys.path:
|
||||
from ws_generic_monitor import WS_Listener
|
||||
|
||||
reference = "test_ipv4_connection.py"
|
||||
|
||||
class GenericMonitorTest(Realm):
|
||||
def __init__(self,
|
||||
ssid=None,
|
||||
security=None,
|
||||
password=None,
|
||||
radio=None):
|
||||
self.ssid=ssid
|
||||
self.security=security
|
||||
self.password=password
|
||||
self.radio=radio
|
||||
|
||||
def start(self):
|
||||
pass
|
||||
|
||||
def stop(self):
|
||||
pass
|
||||
|
||||
def monitor(self):
|
||||
pass
|
||||
|
||||
def main():
|
||||
WS_Listener(lfclient_host="localhost", _scriptname=reference, _callback=TestRun)
|
||||
|
||||
|
||||
def TestRun(ws, message):
|
||||
if (str(message).__contains__(reference)):
|
||||
#print(message)
|
||||
temp = json.loads(message)
|
||||
event_message = str(temp['name']) + "/" + str(temp['details']) + "/" + str(temp['timestamp'])
|
||||
print(event_message)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user