-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
top: Support per-node file report for remote monitoring
Signed-off-by: iipeace <[email protected]>
- Loading branch information
Showing
1 changed file
with
38 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
__credits__ = "Peace Lee" | ||
__license__ = "GPLv2" | ||
__version__ = "3.9.8" | ||
__revision__ = "240101" | ||
__revision__ = "240102" | ||
__maintainer__ = "Peace Lee" | ||
__email__ = "[email protected]" | ||
__repository__ = "https://github.com/iipeace/guider" | ||
|
@@ -34798,9 +34798,12 @@ def printHelp(force=False, isExit=True): | |
# {0:1} {1:1} -e r -N [email protected]:5555, [email protected]:5555 | ||
# {0:1} {1:1} -e r -N [email protected]:5555, [email protected]:5555 | ||
|
||
- Print monitoring data from remote server with host name filter | ||
- Print monitoring data from remote servers with host name filter | ||
# {0:1} {1:1} -x 5555 -X -q HOSTFILTER:"*LINUX*" | ||
|
||
- Save monitoring data from remote servers into a specific file | ||
# {0:1} {1:1} -x 5555 -X -o . | ||
|
||
- {3:1} {2:1} with sending signals to specific {2:1} | ||
# {0:1} {1:1} -k a.out:SIGKILL | ||
# {0:1} {1:1} -k a.out:SIGKILL:CONT | ||
|
@@ -45298,6 +45301,31 @@ def stopHandler(signum=None, frame=None): | |
if SysMgr.pipeEnable: | ||
SysMgr.reloadFileBuffer() | ||
|
||
# init summary variables # | ||
current = True | ||
|
||
# handle reports based on remote monitoring data # | ||
for n, v in SysMgr.hostList.items(): | ||
buf = v["buffer"] | ||
if not buf: | ||
continue | ||
|
||
# create a summarizing process # | ||
pid = SysMgr.createProcess() | ||
if pid > 0: | ||
continue | ||
|
||
# init environments # | ||
current = False | ||
SysMgr.procBuffer = buf | ||
SysMgr.addEnvironVar("NOHEADER") | ||
SysMgr.fileSuffix = "%s_%s_%s" % ( | ||
v["hostname"], | ||
n, | ||
SysMgr.pid, | ||
) | ||
break | ||
|
||
SysMgr.printLogo(absolute=True, big=True) | ||
|
||
# save system info # | ||
|
@@ -45311,7 +45339,7 @@ def stopHandler(signum=None, frame=None): | |
TaskAnalyzer.printFileInterval() | ||
SysMgr.printProcBuffer() | ||
else: | ||
TaskAnalyzer.printIntervalUsage() | ||
TaskAnalyzer.printIntervalUsage(current=current) | ||
|
||
# print output of last commands # | ||
if "PRINTCMD" in SysMgr.environList: | ||
|
@@ -135775,16 +135803,19 @@ def handleServerResponse(self, packet): | |
return | ||
|
||
# save host data # | ||
if hostaddr in SysMgr.hostList: | ||
SysMgr.hostList[hostaddr]["hostname"] = hostname | ||
else: | ||
if not hostaddr in SysMgr.hostList: | ||
SysMgr.hostList[hostaddr] = { | ||
"hostname": hostname, | ||
"surface": "", | ||
"buffer": [], | ||
} | ||
|
||
# save screen data # | ||
SysMgr.hostList[hostaddr]["surface"] = data.rstrip().split("\n") | ||
host = SysMgr.hostList[hostaddr] | ||
host["hostname"] = hostname | ||
host["surface"] = data.rstrip().split("\n") | ||
if SysMgr.outPath: | ||
host["buffer"].insert(0, UtilMgr.removeColor(data)) | ||
|
||
# init screen vars # | ||
nrLine = 0 | ||
|
@@ -135819,10 +135850,6 @@ def handleServerResponse(self, packet): | |
fullSurface += "\n".join(window) + "\n\n" | ||
|
||
nrSurface += 1 | ||
|
||
# handle per-node output file # | ||
if SysMgr.outPath: | ||
pass | ||
except SystemExit: | ||
sys.exit(0) | ||
except KeyboardInterrupt: | ||
|