mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Common contexts for polling (#13158)
* Common contexts for polling Don't store contexts on the device array, use the device model Also should be easier to add different contexts later. * rename variables for consistency
This commit is contained in:
@@ -116,6 +116,17 @@ class Device extends BaseModel
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get VRF contexts to poll.
|
||||
* If no contexts are found, return the default context ''
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getVrfContexts(): array
|
||||
{
|
||||
return $this->vrfLites->isEmpty() ? [''] : $this->vrfLites->pluck('context_name')->all();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the display name of this device (hostname) unless force_ip_to_sysname is set
|
||||
* and hostname is an IP and sysName is set
|
||||
|
||||
Reference in New Issue
Block a user