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.
This commit is contained in:
Robert Nelson 2015-05-26 12:12:39 -07:00
parent e943bf0ada
commit 63a580fcfb
1 changed files with 7 additions and 5 deletions

View File

@ -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($$$$$$$) {