Skip to content
Snippets Groups Projects
Commit d27ef6b7 authored by Pavel Kácha's avatar Pavel Kácha
Browse files

More detailed getDebug call

parent 68fd3194
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@
# Use of this source is governed by a 3-clause BSD-style license, see LICENSE file.
import sys
import os
import logging
import logging.handlers
import ConfigParser
......@@ -325,16 +326,15 @@ class MySQL(Object):
def get_debug(self):
self.crs.execute("SELECT VERSION() AS VER")
row = self.crs.fetchone()
self.crs.execute("SHOW TABLE STATUS")
tablestat = self.crs.fetchall()
return {
"db": "MySQL",
"version": row["VER"]
"version": row["VER"],
"tables": tablestat
}
def get_status(self):
return {}
def generateDynamicQuery(self, section, query_string, variables, parent_cats = []):
variables_id = []
......@@ -613,10 +613,24 @@ class WardenHandler(Object):
auth = self.auth.authorize(_env, _client, 'getDebug', None, None)
if not auth:
raise Error("I'm watching. Authorize.", 403, method='getDebug', detail={"client": _client})
return {
"environment": _env,
"database": self.db.get_debug()
"database": self.db.get_debug(),
"system": {
"uname": os.uname()
},
"process": {
"cwd": os.getcwdu(),
"pid": os.getpid(),
"ppid": os.getppid(),
"pgrp": os.getpgrp(),
"uid": os.getuid(),
"gid": os.getgid(),
"euid": os.geteuid(),
"egid": os.getegid(),
"groups": os.getgroups()
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment