Avoid unnecessary net-snmp long options for version info (#10405)

Long option support in net-snmp relies on non-portable usage of getopt(3) with "-:" in the argument string, this doesn't work on all OS. Replace with the alternative -V which works everywhere.
This commit is contained in:
Stuart Henderson
2019-07-02 16:52:55 +01:00
committed by Neil Lathwood
parent 1183318ba3
commit 161849219e

View File

@@ -1143,7 +1143,7 @@ function version_info($remote = false)
Config::get('rrdtool', 'rrdtool') . ' --version |head -n1'
)), 1, 1)));
$output['netsnmp_ver'] = str_replace('version: ', '', rtrim(shell_exec(
Config::get('snmpget', 'snmpget') . ' --version 2>&1'
Config::get('snmpget', 'snmpget') . ' -V 2>&1'
)));
return $output;