diff --git a/action_map.yml b/action_map.yml index cf19ae7b..457ed8f6 100644 --- a/action_map.yml +++ b/action_map.yml @@ -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 diff --git a/yunohost_monitor.py b/yunohost_monitor.py index 2087d81a..8d15128f 100644 --- a/yunohost_monitor.py +++ b/yunohost_monitor.py @@ -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())