git-svn-id: http://www.observium.org/svn/observer/trunk@915 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-02-21 11:58:07 +00:00
parent 56988b48f3
commit 679c0f3079
7 changed files with 10 additions and 10 deletions

View File

@@ -74,7 +74,7 @@ if (isset($peerlist))
$add = mysql_query("INSERT INTO bgpPeers (`device_id`, `bgpPeerIdentifier`, `bgpPeerRemoteAS`) VALUES ('".$device['device_id']."','".$peer['ip']."','".$peer['as']."')");
echo("+");
} else {
$update = mysql_query("UPDATE `bgpPeers` SET bgpPeerRemoteAs = " . $peer['as'] . ", astext = '" . mysql_real_escape_string($astext) . "' WHERE `device_id` = '".$device['device_id']."' AND bgpPeerIdentifier = '".$peer['ip']."'");
$update = mysql_query("UPDATE `bgpPeers` SET bgpPeerRemoteAs = " . $peer['as'] . ", astext = '" . mres($astext) . "' WHERE `device_id` = '".$device['device_id']."' AND bgpPeerIdentifier = '".$peer['ip']."'");
echo(".");
}

View File

@@ -28,11 +28,11 @@
$vlan_descr = trim(str_replace("\"", "", $vlan_descr));
if(mysql_result(mysql_query("SELECT COUNT(vlan_id) FROM `vlans` WHERE `device_id` = '" . $device['device_id'] . "' AND `vlan_domain` = '" . $vtp_domain . "' AND `vlan_vlan` = '" . $vlan . "'"), 0) == '0') {
mysql_query("INSERT INTO `vlans` (`device_id`,`vlan_domain`,`vlan_vlan`, `vlan_descr`) VALUES (" . $device['device_id'] . ",'" . mysql_real_escape_string($vtp_domain) . "','$vlan', '" . mysql_real_escape_string($vlan_descr) . "')");
mysql_query("INSERT INTO `vlans` (`device_id`,`vlan_domain`,`vlan_vlan`, `vlan_descr`) VALUES (" . $device['device_id'] . ",'" . mres($vtp_domain) . "','$vlan', '" . mres($vlan_descr) . "')");
echo("+");
} else {
echo(".");
mysql_query("UPDATE `vlans` SET `vlan_descr`='" . mysql_real_escape_string($vlan_descr) . "' WHERE `device_id`='" . $device['device_id'] . "' AND `vlan_vlan`='" . $vlan . "' AND `vlan_domain`='" . $vtp_domain . "'");
mysql_query("UPDATE `vlans` SET `vlan_descr`='" . mres($vlan_descr) . "' WHERE `device_id`='" . $device['device_id'] . "' AND `vlan_vlan`='" . $vlan . "' AND `vlan_domain`='" . $vtp_domain . "'");
}
$this_vlans[] = $vlan;

View File

@@ -1,6 +1,6 @@
<?php
## JUNOSe Processors
## JUNOS Processors
if($device['os'] == "junos")
{
echo("JUNOS : ");

View File

@@ -28,10 +28,10 @@
$vlan_descr = trim(str_replace("\"", "", $vlan_descr));
if(mysql_result(mysql_query("SELECT COUNT(vlan_id) FROM `vlans` WHERE `device_id` = '" . $device['device_id'] . "' AND `vlan_domain` = '' AND `vlan_vlan` = '" . $vlan . "'"), 0) == '0') {
mysql_query("INSERT INTO `vlans` (`device_id`,`vlan_domain`,`vlan_vlan`, `vlan_descr`) VALUES (" . $device['device_id'] . ",'','$vlan', '" . mysql_real_escape_string($vlan_descr) . "')");
mysql_query("INSERT INTO `vlans` (`device_id`,`vlan_domain`,`vlan_vlan`, `vlan_descr`) VALUES (" . $device['device_id'] . ",'','$vlan', '" . mres($vlan_descr) . "')");
echo("+");
} else {
mysql_query("UPDATE `vlans` SET `vlan_descr`='" . mysql_real_escape_string($vlan_descr) . "' WHERE `device_id`='" . $device['device_id'] . "' AND `vlan_vlan`='" . $vlan . "'");
mysql_query("UPDATE `vlans` SET `vlan_descr`='" . mres($vlan_descr) . "' WHERE `device_id`='" . $device['device_id'] . "' AND `vlan_vlan`='" . $vlan . "'");
echo(".");
}
@@ -48,7 +48,7 @@
if(!$vlan_exists) {
mysql_query("DELETE FROM `vlans` WHERE `vlan_id` = '" . $dev_vlan['vlan_id'] . "'");
echo("-");
#echo("Deleted VLAN ". $dev_vlan['vlan_vlan'] ."\n");
if ($debug) { echo("Deleted VLAN ". $dev_vlan['vlan_vlan'] ."\n"); }
}
}
}

View File

@@ -98,7 +98,7 @@ while ($interface = mysql_fetch_array($interface_query)) {
}
if ( $interface['ifAlias'] != $ifAlias && $ifAlias != "" ) {
$update .= $seperator . "`ifAlias` = '".mysql_real_escape_string($ifAlias)."'";
$update .= $seperator . "`ifAlias` = '".mres($ifAlias)."'";
$seperator = ", ";
eventlog("ifAlias -> $ifAlias", $interface['device_id'], $interface['interface_id']);
}

View File

@@ -86,7 +86,7 @@
eventlog($oid . ": ".$port[$oid]." -> NULL", $device['device_id'], $port['interface_id']);
if($debug) { echo($oid . ": ".$port[$oid]." -> NULL "); } else { echo($oid . " "); }
} elseif ( $port[$oid] != $this_port[$oid] ) {
$update .= ", `$oid` = '".mysql_real_escape_string($this_port[$oid])."'";
$update .= ", `$oid` = '".mres($this_port[$oid])."'";
eventlog($oid . ": ".$port[$oid]." -> " . $this_port[$oid], $device['device_id'], $port['interface_id']);
if($debug) { echo($oid . ": ".$port[$oid]." -> " . $this_port[$oid]." "); } else { echo($oid . " "); }
}

View File

@@ -57,7 +57,7 @@ function process_syslog ($entry, $update) {
list($entry['program'], $entry['msg']) = explode("||", $entry['msg']);
}
}
$x = "UPDATE `syslog` set `device_id` = '".$entry['device_id']."', `program` = '".$entry['program']."', `msg` = '" . mysql_real_escape_string($entry['msg']) . "', processed = '1' WHERE `seq` = '" . $entry['seq'] . "'";
$x = "UPDATE `syslog` set `device_id` = '".$entry['device_id']."', `program` = '".$entry['program']."', `msg` = '" . mres($entry['msg']) . "', processed = '1' WHERE `seq` = '" . $entry['seq'] . "'";
$x = "INSERT INTO `syslog` (`device_id`,`program`,`facility`,`priority`, `level`, `tag`, `msg`, `timestamp`) ";
$x .= "VALUES ('".$entry['device_id']."','".$entry['program']."','".$entry['facility']."','".$entry['priority']."', '".$entry['level']."', '".$entry['tag']."', '".$entry['msg']."','".$entry['timestamp']."')";
if($update && $entry['device_id']) { mysql_query($x); }