From 65540872e7a1215cfdca1d4b480670a67cf50a77 Mon Sep 17 00:00:00 2001 From: Mark Schouten Date: Wed, 4 Nov 2015 14:30:21 +0100 Subject: [PATCH] Fix the proxmox-agent for Proxmox VE 4.0 --- agent-local/proxmox | 10 +++++++--- debian/changelog | 6 ++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/agent-local/proxmox b/agent-local/proxmox index fd1f73a..a35ade4 100755 --- a/agent-local/proxmox +++ b/agent-local/proxmox @@ -34,11 +34,15 @@ my $conn = PVE::API2Client->new( csrftoken => $csrftoken, ); -my $clustername = $conn->get("/api2/json/cluster/ha/config")->{'data'}->{'children'}[0]{'name'}; -if (!defined($clustername)) { - $clustername = $hostname; +foreach my $child (@{$conn->get("/api2/json/cluster/status")->{'data'}}) { + if ($child->{'type'} eq "cluster") { + $clustername = $child->{'name'}; + } } +if (!defined($clustername)) { + $clustername = $hostname; +} print "<<>>\n"; diff --git a/debian/changelog b/debian/changelog index a82b5bc..91f8777 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +librenms-agent (1.0.3) stable; urgency=low + + - Fix the proxmox-agent for Proxmox VE 4.0 + + -- Mark Schouten Wed, 04 Nov 2015 14:33:00 +0200 + librenms-agent (1.0.2) stable; urgency=low - Include a Proxmox-agent