mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
- Removed hardcoded binaries.
- Restricted nmap to level 10 - Replaced traceroute with mtr (report mode) - Also edited the Installation Wiki to include whois, mtr and nmap. git-svn-id: http://www.observium.org/svn/observer/trunk@1040 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -22,18 +22,25 @@ if($_GET['query'] && $_GET['cmd']) {
|
||||
if(Net_IPv6::checkIPv6($host)||Net_IPv4::validateip($host)||preg_match("/^[a-zA-Z0-9.-]*$/", $host)) {
|
||||
switch ($_GET['cmd']) {
|
||||
case 'whois':
|
||||
$output = `/usr/bin/whois $host | grep -v \%`;
|
||||
$cmd = $config['whois'] . " $host | grep -v \%";
|
||||
break;
|
||||
case 'ping':
|
||||
$output = `/bin/ping $host`;
|
||||
$cmd = $config['ping'] . " -c 5 $host";
|
||||
break;
|
||||
case 'tracert':
|
||||
$output = `/usr/sbin/traceroute $host`;
|
||||
$cmd = $config['mtr'] . " -r -c 5 $host";
|
||||
break;
|
||||
case 'nmap':
|
||||
$output = `/usr/bin/nmap $host`;
|
||||
if ($_SESSION['userlevel'] != '10') {
|
||||
echo("insufficient privileges");
|
||||
} else {
|
||||
$cmd = $config['nmap'] . " $host";
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!empty($cmd)) {
|
||||
$output = `$cmd`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -12,6 +12,10 @@ $config['ipcalc'] = "/usr/bin/ipcalc";
|
||||
$config['snmpwalk'] = "/usr/bin/snmpwalk";
|
||||
$config['snmpget'] = "/usr/bin/snmpget";
|
||||
$config['snmpbulkwalk'] = "/usr/bin/snmpbulkwalk";
|
||||
$config['whois'] = "/usr/bin/whois";
|
||||
$config['ping'] = "/bin/ping";
|
||||
$config['mtr'] = "/usr/bin/mtr";
|
||||
$config['nmap'] = "/usr/bin/nmap";
|
||||
|
||||
$config['nagios_plugins'] = "/usr/lib/nagios/plugins";
|
||||
|
||||
|
Reference in New Issue
Block a user