diff --git a/misp_api.py b/misp_api.py index 261ef40..3c29a5b 100644 --- a/misp_api.py +++ b/misp_api.py @@ -46,6 +46,10 @@ def doRestQuery(authkey: str, request_method: str, url: str, payload: dict = {}) return get(url, payload, api_key=authkey) +def getVersion() -> Union[None, dict]: + return get(f'/servers/getVersion.json') + + def getSettings() -> Union[None, dict]: SETTING_TO_QUERY = [ 'Plugin.ZeroMQ_enable', diff --git a/server.py b/server.py index a806f69..03d36aa 100755 --- a/server.py +++ b/server.py @@ -124,10 +124,15 @@ def get_context(data: dict) -> dict: def getDiagnostic() -> dict: + diagnostic = {} + misp_version = misp_api.getVersion() + if misp_version is None: + diagnostic['online'] = False + return diagnostic + diagnostic['version'] = misp_version misp_settings = misp_api.getSettings() - return { - 'settings': misp_settings, - } + diagnostic['settings'] = misp_settings + return diagnostic # Function to forward zmq messages to Socket.IO @@ -152,4 +157,4 @@ if __name__ == "__main__": eventlet.spawn_n(forward_zmq_to_socketio) # Run the Socket.IO server - eventlet.wsgi.server(eventlet.listen(('0.0.0.0', 4000)), app) + eventlet.wsgi.server(eventlet.listen(('0.0.0.0', 3000)), app) diff --git a/src/components/TheAdminPanel.vue b/src/components/TheAdminPanel.vue index 9a9202b..2f2c71f 100644 --- a/src/components/TheAdminPanel.vue +++ b/src/components/TheAdminPanel.vue @@ -1,11 +1,14 @@