mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Add feature to capture a full snmprec (#12706)
This commit is contained in:
@@ -23,6 +23,7 @@ $options = getopt(
|
||||
'file:',
|
||||
'debug',
|
||||
'snmpsim',
|
||||
'full',
|
||||
'help',
|
||||
]
|
||||
);
|
||||
@@ -83,10 +84,14 @@ Optional:
|
||||
-f, --file Save data to file instead of the standard location
|
||||
-d, --debug Enable debug output
|
||||
--snmpsim Run snmpsimd.py using the collected data for manual testing.
|
||||
--full Walk the whole device (default: only used OIDs)
|
||||
Useful when adding device support when you don\'t have access to it directly,
|
||||
or when discovery/poller causes errors when capturing normally.
|
||||
Do NOT use this to submit test data!
|
||||
|
||||
Example:
|
||||
Examples:
|
||||
./collect-snmp-data.php -h 192.168.0.1 -v 2960x
|
||||
./collect-snmp-data.php -h 127.0.0.1 -v freeradius -m freeradius
|
||||
./collect-snmp-data.php -h 127.0.0.1 -v freeradius -m applications
|
||||
';
|
||||
exit;
|
||||
}
|
||||
@@ -125,10 +130,11 @@ try {
|
||||
}
|
||||
|
||||
$prefer_new_snmprec = isset($options['n']) || isset($options['prefer-new']);
|
||||
$full = isset($options['full']);
|
||||
|
||||
echo 'Capturing Data: ';
|
||||
\LibreNMS\Util\OS::updateCache(true); // Force update of OS Cache
|
||||
$capture->captureFromDevice($device['device_id'], true, $prefer_new_snmprec);
|
||||
$capture->captureFromDevice($device['device_id'], true, $prefer_new_snmprec, $full);
|
||||
} catch (InvalidModuleException $e) {
|
||||
echo $e->getMessage() . PHP_EOL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user