git-svn-id: http://www.observium.org/svn/observer/trunk@230 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2008-04-10 15:30:05 +00:00
parent df4d9942a2
commit 697a4d6fea

View File

@@ -1,9 +1,7 @@
<?
include("common.php");
include("ipv6.php");
include("generic.php");
include("ios.php");
include("unix.php");
@@ -14,11 +12,9 @@ include("graphing.php");
include("print-functions.php");
include("billing-functions.php");
include("cisco-entities.php");
include("syslog.php");
function write_dev_attrib($device_id, $attrib_type, $attrib_value) {
$count_sql = "SELECT COUNT(*) FROM devices_attribs WHERE `device_id` = '" . $device_id . "' AND `attrib_type` = '$attrib_type'";
if(mysql_result(mysql_query($count_sql),0)) {
$update_sql = "UPDATE devices_attribs SET attrib_value = '$attrib_value' WHERE `device_id` = '$device_id' AND `attrib_type` = '$attrib_type'";
@@ -28,10 +24,8 @@ function write_dev_attrib($device_id, $attrib_type, $attrib_value) {
mysql_query($insert_sql);
}
return mysql_affected_rows();
}
function shorthost($hostname, $len=16) {
list ($first, $second, $third, $fourth, $fifth) = explode(".", $hostname);