From 63a580fcfb93a793e038830bba0658e04d31a2d0 Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Tue, 26 May 2015 12:12:39 -0700 Subject: [PATCH] Fix bug that causes bogus agents to be created if freeipmi isn't installed If freeipmi isn't installed or problems occur running ipmiping then an agent is created for every address tested. --- pandora_server/util/recon_scripts/ipmi-recon.pl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pandora_server/util/recon_scripts/ipmi-recon.pl b/pandora_server/util/recon_scripts/ipmi-recon.pl index 8908a1b98b..f685c59e54 100644 --- a/pandora_server/util/recon_scripts/ipmi-recon.pl +++ b/pandora_server/util/recon_scripts/ipmi-recon.pl @@ -83,11 +83,13 @@ sub ipmi_ping ($$$) { my $res = `$cmd`; - if ($res =~ /100\.0% packet loss/) { - return 0; - } - - return 1; + if ($res =~ / (\d+\.\d+)% packet loss/) { + if ($1 ne '100.0') { + return 1; + } + } + + return 0; } sub create_ipmi_modules($$$$$$$) {