mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
add swap check
This commit is contained in:
parent
720f0a5a0d
commit
f357060ed9
2 changed files with 9 additions and 1 deletions
|
@ -396,6 +396,10 @@ monitor:
|
|||
full: --memory
|
||||
help: Check Memory
|
||||
action: store_true
|
||||
-s:
|
||||
full: --swap
|
||||
help: Check Swap
|
||||
action: store_true
|
||||
-c:
|
||||
full: --cpu
|
||||
help: Check CPU
|
||||
|
|
|
@ -113,7 +113,7 @@ def process_check(args):
|
|||
|
||||
return { 'Status' : result }
|
||||
|
||||
def monitor_info(memory=False, cpu=False, disk=False, ifconfig=False, uptime=False, public=False):
|
||||
def monitor_info(memory=False, swap=False, cpu=False, disk=False, ifconfig=False, uptime=False, public=False):
|
||||
"""
|
||||
Check System
|
||||
|
||||
|
@ -123,12 +123,16 @@ def monitor_info(memory=False, cpu=False, disk=False, ifconfig=False, uptime=Fal
|
|||
public -- Show IP public
|
||||
cpu -- Check CPU
|
||||
memory -- Check Memory
|
||||
swap -- Check Swap
|
||||
ifconfig -- Show Ip and MAC Adress
|
||||
|
||||
"""
|
||||
if memory:
|
||||
return json.loads(s.getMem())
|
||||
|
||||
if swap:
|
||||
return json.loads(s.getMemSwap())
|
||||
|
||||
elif cpu:
|
||||
return json.loads(s.getLoad())
|
||||
|
||||
|
|
Loading…
Reference in a new issue