2014-06-03 Alejandro Gallardo <alejandro.gallardo@artica.es>
* include/functions_visual_map.php: Now the linked visual maps are opened as a popup. * include/functions_snmp.php: Added a best way to call the snmpwalk binary. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10090 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
3ed05d2402
commit
b2c9926daf
|
@ -25,6 +25,24 @@
|
|||
* @param string Snmp especific OID.
|
||||
*/
|
||||
function snmp_generate_trap($snmp_host_address, $snmp_community, $snmp_oid, $snmp_agent, $snmp_data, $snmp_type) {
|
||||
// Call snmptrap
|
||||
if (empty($config['snmptrap'])) {
|
||||
switch (PHP_OS) {
|
||||
case "FreeBSD":
|
||||
$snmpwalk_bin = '/usr/local/bin/snmptrap';
|
||||
break;
|
||||
case "NetBSD":
|
||||
$snmpwalk_bin = '/usr/pkg/bin/snmptrap';
|
||||
break;
|
||||
default:
|
||||
$snmpwalk_bin = 'snmptrap';
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$snmpwalk_bin = $config['snmptrap'];
|
||||
}
|
||||
|
||||
$command = "snmptrap -v 1 -c " . escapeshellarg($snmp_community) . " " . escapeshellarg($snmp_host_address) . " " . escapeshellarg($snmp_oid) . " "
|
||||
. escapeshellarg($snmp_agent) . " " . escapeshellarg($snmp_type) . " " . escapeshellarg($snmp_data) . " 0 2>&1";
|
||||
|
||||
|
|
|
@ -1283,13 +1283,12 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
|
|||
elseif ($layout_data['id_layout_linked'] > 0) {
|
||||
// Link to a map
|
||||
if (empty($layout_data['id_metaconsole'])) {
|
||||
echo '<a target="_blank" href="' . $config['homeurl'] . 'index.php?sec=reporting&sec2=operation/visual_console/render_view&pure='.$config["pure"].'&id='.$layout_data["id_layout_linked"].'">';
|
||||
$url_vc = $config['homeurl'] . "index.php?sec=reporting&sec2=operation/visual_console/render_view&pure=1&id=" . $layout_data["id_layout_linked"];
|
||||
}
|
||||
else {
|
||||
$pure = get_parameter('pure', 0);
|
||||
echo '<a target="_blank" href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure=' . $pure . '&id_visualmap=' . $layout_data["id_layout_linked"] . '&refr=0">';
|
||||
$url_vc = "index.php?sec=screen&sec2=screens/screens&action=visualmap&pure=1&id_visualmap=" . $layout_data["id_layout_linked"] . "&refr=0";
|
||||
}
|
||||
|
||||
echo "<a href=\"javascript:open('$url_vc', 'visual_console_" . $layout_data["id_layout_linked"] . "', 'status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes')\">";
|
||||
}
|
||||
else {
|
||||
// A void object
|
||||
|
|
Loading…
Reference in New Issue