Signed-off-by: Thomas Lamprecht <[email protected]>
---
 src/PVE/HA/Config.pm | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/src/PVE/HA/Config.pm b/src/PVE/HA/Config.pm
index f7440c0..7c673e4 100644
--- a/src/PVE/HA/Config.pm
+++ b/src/PVE/HA/Config.pm
@@ -192,4 +192,24 @@ sub service_is_ha_managed {
 
     return undef;
 }
+
+sub get_service_status {
+    my ($sid) = @_;
+
+    my $status = { managed => 0 };
+
+    if (service_is_ha_managed($sid, undef, 1)) {
+       my $cfg = read_resources_config();
+       my $sc = $cfg->{ids}->{$sid};
+
+       my $manager_status = read_manager_status();
+
+       $status->{managed} = 1;
+       $status->{group} = $sc->{group};
+       $status->{state} = $manager_status->{service_status}->{$sid}->{state};
+    }
+
+    return $status;
+}
+
 1;
-- 
2.1.4


_______________________________________________
pve-devel mailing list
[email protected]
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to