Hello,
i am trying to expant existing device metrics. I want to add connected clients (sta) signals and mac addresses into Librenms/OS/Airos.php to have this metrics by default on all devices.
I have added this lines to the bottom
/**
* Discover wireless STA signal strength using SNMP bulk walk.
* This function will retrieve all signal strengths in the subtree.
* @return array
*/
public function discoverWirelessStaSignal()
{
$oid = '.1.3.6.1.4.1.41112.1.4.7.1.3'; // OID for STA signal
$results = snmp2_walk($this->getDeviceIpAddress(), $this->getSnmpCommunity(), $oid);
// Process the results and create WirelessSensor objects
$sensorArray = [];
foreach ($results as $key => $value) {
// Convert $key to the OID format you want, e.g., append the last number.
$sensorArray[] = new WirelessSensor('signal', $this->getDeviceId(), $key, 'airos', 1, 'STA Signal Strength');
}
return $sensorArray;
}
/**
* Discover wireless STA MAC addresses using SNMP bulk walk.
* This function will retrieve all MAC addresses in the subtree.
* @return array
*/
public function discoverWirelessStaMac()
{
$oid = '.1.3.6.1.4.1.41112.1.4.7.1.1'; // OID for STA MAC
$results = snmp2_walk($this->getDeviceIpAddress(), $this->getSnmpCommunity(), $oid);
// Process the results and create an array of MAC addresses
$macArray = [];
foreach ($results as $key => $value) {
// Convert $key to the OID format you want if needed.
// You may need to format or validate the MAC address in $value.
$macArray[] = $value;
}
return $macArray;
}
But i still cant see any info about this OIDs while i am polling the device.
Aby idea how to add new metrics for cpecific device OS?
ubntStaMac 1.3.6.1.4.1.41112.1.4.7.1.1
ubntStaMac 1.3.6.1.4.1.41112.1.4.7.1.1