getDeviceArray(), [ 'sonicCurrentConnCacheEntries.0', 'sonicMaxConnCacheEntries.0', ], '-OQUs', 'SONICWALL-FIREWALL-IP-STATISTICS-MIB'); if (is_numeric($data)) { $rrd_def = RrdDefinition::make() ->addDataset('activesessions', 'GAUGE', 0) ->addDataset('maxsessions', 'GAUGE', 0); $fields = [ 'activesessions' => $data[0]['sonicCurrentConnCacheEntries'], 'maxsessions' => $data[0]['sonicMaxConnCacheEntries'], ]; $tags = compact('rrd_def'); data_update($this->getDeviceArray(), 'sonicwall_sessions', $tags, $fields); $this->enableGraph('sonicwall_sessions'); } } /** * Discover processors. * Returns an array of LibreNMS\Device\Processor objects that have been discovered * * @return array Processors */ public function discoverProcessors() { if (Str::startsWith($this->getDeviceArray()['sysObjectID'], '.1.3.6.1.4.1.8741.1')) { return [ Processor::discover( 'sonicwall', $this->getDeviceId(), '.1.3.6.1.4.1.8741.1.3.1.3.0', // SONICWALL-FIREWALL-IP-STATISTICS-MIB::sonicCurrentCPUUtil.0 0, 'CPU', 1 ), ]; } else { return [ Processor::discover( 'sonicwall', $this->getDeviceId(), $this->getDeviceArray()['sysObjectID'] . '.2.1.3.0', // different OID for each model 0, 'CPU', 1 ), ]; } } }