mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-11-02 02:42:08 +00:00
fix(monitor): do not warn about volume groups without active volumes
This commit is contained in:
@@ -2306,20 +2306,8 @@ class HealthMonitor:
|
||||
if 'a' in parts[2]:
|
||||
volumes.append(f'{vg_name}/{lv_name}')
|
||||
|
||||
# If LVM is configured but no active volumes are found, it might be an issue or just not used
|
||||
if not volumes:
|
||||
# Check if any VGs exist to determine if LVM is truly unconfigured or just inactive
|
||||
vg_result = subprocess.run(
|
||||
['vgs', *dev_args, '--noheadings', '--options', 'vg_name'],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=3
|
||||
)
|
||||
if vg_result.returncode == 0 and vg_result.stdout.strip():
|
||||
return {'status': 'WARNING', 'reason': 'No active LVM volumes detected'}
|
||||
else:
|
||||
return {'status': 'OK'} # No VGs found, LVM not in use
|
||||
|
||||
# No active volume is normal for a leftover disk, stopped guests or
|
||||
# shared LVM; the storage check reports a storage Proxmox cannot use.
|
||||
return {'status': 'OK', 'volumes': len(volumes)}
|
||||
|
||||
except Exception:
|
||||
|
||||
@@ -54,6 +54,7 @@ A special thank you goes to [@Vaso73](https://github.com/Vaso73), [@f3rs3n](http
|
||||
- **The Intel GPU view ends `intel_gpu_top` with each reading** ([#568](https://github.com/MacRimi/ProxMenux/issues/568), reported by [@FromTheCToTheG](https://github.com/FromTheCToTheG)), which also makes the reading half a second faster.
|
||||
- **VM disk usage counts every filesystem of the guest** ([#559](https://github.com/MacRimi/ProxMenux/issues/559), with the fix proposed by [@TheFoxCraft](https://github.com/TheFoxCraft)), also on guests whose agent reports no device name, such as Alpine.
|
||||
- **The LVM check keeps the Proxmox filter for zvols and RBD images** on hosts whose only volume groups belong to their VMs ([#552](https://github.com/MacRimi/ProxMenux/issues/552), reported by [@osipovdm-dot](https://github.com/osipovdm-dot)).
|
||||
- **A volume group with no active volumes counts as healthy**, such as a disk left over from another installation, stopped guests or shared LVM. A storage Proxmox cannot use is still reported by the storage check.
|
||||
- **Secure Gateway installs on Proxmox hosts on BTRFS** ([#564](https://github.com/MacRimi/ProxMenux/issues/564), reported by [@78v5](https://github.com/78v5)): the Alpine template goes to an active storage that holds container templates.
|
||||
- **A disk I/O error from the kernel is recorded on its disk**, with its serial number, also when the error names a partition.
|
||||
- **The Monitor installs as an app (PWA) from the browser**: it serves its own web app manifest and service worker, with the 192 and 512 px icons Chrome requires.
|
||||
|
||||
@@ -154,6 +154,14 @@ class LvmReaderTests(unittest.TestCase):
|
||||
self.assertTrue(result["skipped"])
|
||||
self.assertEqual([call.args[0] for call in run.call_args_list], [["which", "lvs"]])
|
||||
|
||||
def test_health_accepts_a_volume_group_without_active_volumes(self):
|
||||
run = Mock(side_effect=[types.SimpleNamespace(returncode=0),
|
||||
types.SimpleNamespace(returncode=0, stdout=" data pve twi---tz--\n")])
|
||||
function = self.extract("health_monitor.py", "_check_lvm", "HealthMonitor", {
|
||||
"Dict": dict, "Any": object, "subprocess": types.SimpleNamespace(run=run), "_lvm_device_args": lambda: [],
|
||||
})
|
||||
self.assertEqual(function(None), {"status": "OK", "volumes": 0})
|
||||
|
||||
def test_storage_skips_pvs_when_no_scan_is_permitted(self):
|
||||
tree = ast.parse((SCRIPTS / "flask_server.py").read_text())
|
||||
function = next(n for n in tree.body if isinstance(n, ast.FunctionDef) and n.name == "get_system_disks")
|
||||
|
||||
@@ -54,6 +54,7 @@ Un agradecimiento especial a [@Vaso73](https://github.com/Vaso73), [@f3rs3n](htt
|
||||
- **La vista de GPU Intel termina `intel_gpu_top` con cada lectura** ([#568](https://github.com/MacRimi/ProxMenux/issues/568), reportado por [@FromTheCToTheG](https://github.com/FromTheCToTheG)), lo que además hace la lectura medio segundo más rápida.
|
||||
- **El uso de disco de una VM cuenta todos los sistemas de archivos del invitado** ([#559](https://github.com/MacRimi/ProxMenux/issues/559), con el arreglo propuesto por [@TheFoxCraft](https://github.com/TheFoxCraft)), también en invitados cuyo agente no indica el nombre del dispositivo, como Alpine.
|
||||
- **La comprobación de LVM mantiene el filtro de Proxmox para zvols e imágenes RBD** en hosts cuyos únicos grupos de volúmenes pertenecen a sus VM ([#552](https://github.com/MacRimi/ProxMenux/issues/552), reportado por [@osipovdm-dot](https://github.com/osipovdm-dot)).
|
||||
- **Un grupo de volúmenes sin volúmenes activos se considera correcto**, como un disco de otra instalación, VM o CT detenidos o un LVM compartido. Un almacenamiento que Proxmox no puede usar se sigue avisando desde la comprobación de almacenamiento.
|
||||
- **Secure Gateway se instala en hosts Proxmox sobre BTRFS** ([#564](https://github.com/MacRimi/ProxMenux/issues/564), reportado por [@78v5](https://github.com/78v5)): la plantilla de Alpine va a un almacenamiento activo que admite plantillas de contenedor.
|
||||
- **Un error de E/S de disco del kernel se registra en su disco**, con su número de serie, también cuando el error nombra una partición.
|
||||
- **El Monitor se instala como aplicación (PWA) desde el navegador**: sirve su propio manifiesto de aplicación web y su service worker, con los iconos de 192 y 512 px que exige Chrome.
|
||||
|
||||
Reference in New Issue
Block a user