- 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:
Geert Hauwaerts
2010-03-22 22:13:45 +00:00
parent b8e962de5d
commit 49aa3a3951
2 changed files with 15 additions and 4 deletions

View File

@@ -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`;
}
}
}

View File

@@ -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";