mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Scrut fixes
This commit is contained in:
@@ -483,11 +483,11 @@ function isSNMPable($device) {
|
|||||||
*
|
*
|
||||||
* @param string $hostname The hostname or IP address to send ping requests to.
|
* @param string $hostname The hostname or IP address to send ping requests to.
|
||||||
* @param int $address_family The address family (AF_INET for IPv4 or AF_INET6 for IPv6) to use. Defaults to IPv4. Will *not* be autodetected for IP addresses, so it has to be set to AF_INET6 when pinging an IPv6 address or an IPv6-only host.
|
* @param int $address_family The address family (AF_INET for IPv4 or AF_INET6 for IPv6) to use. Defaults to IPv4. Will *not* be autodetected for IP addresses, so it has to be set to AF_INET6 when pinging an IPv6 address or an IPv6-only host.
|
||||||
* @param int $device_id This parameter is currently ignored.
|
* @param array $attribs The device attributes
|
||||||
*
|
*
|
||||||
* @return bool TRUE if the host responded to at least one ping request, FALSE otherwise.
|
* @return bool TRUE if the host responded to at least one ping request, FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
function isPingable($hostname, $address_family = AF_INET, $device_id = FALSE, $attribs = false) {
|
function isPingable($hostname, $address_family = AF_INET, $attribs = array()) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$response = array();
|
$response = array();
|
||||||
|
@@ -155,7 +155,7 @@ function poll_device($device, $options) {
|
|||||||
|
|
||||||
$address_family = snmpTransportToAddressFamily($device['transport']);
|
$address_family = snmpTransportToAddressFamily($device['transport']);
|
||||||
|
|
||||||
$ping_response = isPingable($device['hostname'], $address_family, $device['device_id'], $attribs);
|
$ping_response = isPingable($device['hostname'], $address_family, $attribs);
|
||||||
|
|
||||||
$device_perf = $ping_response['db'];
|
$device_perf = $ping_response['db'];
|
||||||
$device_perf['device_id'] = $device['device_id'];
|
$device_perf['device_id'] = $device['device_id'];
|
||||||
|
Reference in New Issue
Block a user