mirror of
https://github.com/librenms/librenms-agent.git
synced 2024-05-09 09:54:52 +00:00
Something like this @einarjh ?
This commit is contained in:
@@ -54,10 +54,18 @@ foreach my $vm (@{$conn->get("/api2/json/nodes/$hostname/netstat")->{'data'}}) {
|
|||||||
my $vmid = $vm->{'vmid'};
|
my $vmid = $vm->{'vmid'};
|
||||||
eval {
|
eval {
|
||||||
my $vmname = $conn->get("/api2/json/nodes/$hostname/qemu/$vmid/config")->{'data'}->{'name'};
|
my $vmname = $conn->get("/api2/json/nodes/$hostname/qemu/$vmid/config")->{'data'}->{'name'};
|
||||||
|
my $tmpl = $conn->get("/api2/json/nodes/$hostname/qemu/$vmid/config")->{'data'}->{'template'};
|
||||||
|
if (defined($tmpl) && $tmpl == 1) {
|
||||||
|
die;
|
||||||
|
}
|
||||||
print "$vmid/$vm->{'dev'}/$vm->{'in'}/$vm->{'out'}/$vmname\n";
|
print "$vmid/$vm->{'dev'}/$vm->{'in'}/$vm->{'out'}/$vmname\n";
|
||||||
};
|
};
|
||||||
eval {
|
eval {
|
||||||
my $vmname = $conn->get("/api2/json/nodes/$hostname/lxc/$vmid/config")->{'data'}->{'name'};
|
my $vmname = $conn->get("/api2/json/nodes/$hostname/lxc/$vmid/config")->{'data'}->{'hostname'};
|
||||||
|
my $tmpl = $conn->get("/api2/json/nodes/$hostname/lxc/$vmid/config")->{'data'}->{'template'};
|
||||||
|
if (defined($tmpl) && $tmpl == 1) {
|
||||||
|
die;
|
||||||
|
}
|
||||||
print "$vmid/$vm->{'dev'}/$vm->{'in'}/$vm->{'out'}/$vmname\n";
|
print "$vmid/$vm->{'dev'}/$vm->{'in'}/$vm->{'out'}/$vmname\n";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user