Skip to content

Commit

Permalink
Fix attempt #1 for CT Swap reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
lsthompson committed Jun 16, 2023
1 parent 9b3e005 commit fd61bc0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 0 additions & 2 deletions modules/addons/pvewhmcs/pvewhmcs.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,12 @@ function pvewhmcs_output($vars) {
if (isset($_POST['newIPpool'])) {
save_ip_pool() ;
}

if ($_GET['action']=='removeippool') {
removeIpPool($_GET['id']) ;
}
if ($_GET['action']=='list_ips') {
list_ips();
}

if ($_GET['action']=='removeip') {
removeip($_GET['id'],$_GET['pool_id']);
}
Expand Down
7 changes: 4 additions & 3 deletions modules/servers/pvewhmcs/pvewhmcs.php
Original file line number Diff line number Diff line change
Expand Up @@ -566,9 +566,10 @@ function pvewhmcs_ClientArea($params) {
$vm_status['diskusepercent'] = intval($vm_status['disk'] * 100 / $vm_status['maxdisk']);
$vm_status['memusepercent'] = intval($vm_status['mem'] * 100 / $vm_status['maxmem']);

// if ($guest->vtype == 'lxc') {
// $vm_status['swapusepercent'] = intval($vm_status['swap'] * 100 / $vm_status['maxswap']);
// }
if ($guest->vtype == 'lxc') {
$ct_specific=$proxmox->get('/nodes/'.$first_node.'/lxc/'.$params['serviceid'] .'/status/current') ;
$vm_status['swapusepercent'] = intval($ct_specific['swap'] * 100 / $ct_specific['maxswap']);
}
} else {
// Handle the VM not found in the cluster resources (Optional)
echo "VM/CT not found in Cluster Resources.";
Expand Down

0 comments on commit fd61bc0

Please sign in to comment.