Skip to content

Commit

Permalink
Merge pull request #2466 from Tatermen/1865
Browse files Browse the repository at this point in the history
Juniper Hardware Inventory Fix (issue 1865)
  • Loading branch information
laf committed Nov 20, 2015
2 parents 7a1f9e4 + 22f8456 commit 69c4f8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,5 @@ Contributors to LibreNMS:
- Tony Murray <murraytony@gmail.com> (murrant)
- Peter Lamperud <peter.lamperud@gmail.com> (vizay)
- Louis Bailleul <louis.bailleul@gmail.com> (alucardfh)
- Rick Hodger <rick@fuzzi.org.uk> (Tatermen)
[1]: http://observium.org/ "Observium web site"
16 changes: 4 additions & 12 deletions includes/discovery/entity-physical.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
$entPhysicalIsFRU = $entry['jnxFruType'];
$entPhysicalAlias = $entry['entPhysicalAlias'];
$entPhysicalAssetID = $entry['entPhysicalAssetID'];
// fix for issue 1865, $entPhysicalIndex, as it contains a quad dotted number on newer Junipers
// using str_replace to remove all dots should fix this even if it changes in future
$entPhysicalIndex = str_replace('.','',$entPhysicalIndex);
}
else {
$entPhysicalDescr = $entry['entPhysicalDescr'];
Expand Down Expand Up @@ -127,18 +130,7 @@
echo '+';
}//end if

if ($device['os'] == 'junos') {
// $entPhysicalIndex appears as a numeric OID fragment
// (string), so convert it to an "integer" for the
// validation step below since it is stored in the DB as
// an integer. This should be fixed.
list($first,$second) = explode('.', $entPhysicalIndex);
$entPhysicalIndexNoDots = $first.$second;
$valid[$entPhysicalIndexNoDots] = 1;
}
else {
$valid[$entPhysicalIndex] = 1;
}
$valid[$entPhysicalIndex] = 1;
}//end if
}//end foreach
}
Expand Down

0 comments on commit 69c4f8b

Please sign in to comment.