mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
some new things!
git-svn-id: http://www.observium.org/svn/observer/trunk@221 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -33,10 +33,15 @@
|
||||
mysql_query("INSERT INTO `interfaces` (`device_id`,`ifIndex`,`ifDescr`) VALUES ('".$device['device_id']."','$ifIndex','$ifName')");
|
||||
# Add Interface
|
||||
echo("+");
|
||||
} else {
|
||||
# Interface Already Exists
|
||||
echo(".");
|
||||
} else {
|
||||
mysql_query("UPDATE `interfaces` SET `deleted` = '0' WHERE `device_id` = '".$device['device_id']."' AND `ifIndex` = '$ifIndex' AND `deleted` = '1'");
|
||||
if(mysql_affected_rows()) {
|
||||
echo("*");
|
||||
} else {
|
||||
echo(".");
|
||||
}
|
||||
}
|
||||
$int_exists[] = "$ifIndex";
|
||||
} else {
|
||||
# Ignored ifName
|
||||
echo("X");
|
||||
@@ -44,6 +49,25 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$sql = "SELECT * FROM `interfaces` WHERE `device_id` = '".$device['device_id']."' AND `deleted` = '0'";
|
||||
$query = mysql_query($sql);
|
||||
|
||||
while ($test_if = mysql_fetch_array($query)) {
|
||||
unset($exists);
|
||||
$i = 0;
|
||||
while ($i < count($int_exists) && !$exists) {
|
||||
$this_if = $test_if['ifIndex'];
|
||||
if ($int_exists[$i] == $this_if) { $exists = 1; }
|
||||
$i++;
|
||||
}
|
||||
if(!$exists) {
|
||||
echo("-");
|
||||
mysql_query("UPDATE `interfaces` SET `deleted` = '1' WHERE interface_id = '" . $test_if['interface_id'] . "'");
|
||||
}
|
||||
}
|
||||
|
||||
unset($temp_exists);
|
||||
echo("\n");
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
include("graphing/screenos.php");
|
||||
include("graphing/fortigate.php");
|
||||
|
||||
function graph_multi_bits ($interfaces, $graph, $from, $to, $width, $height) {
|
||||
global $config, $rrdtool, $installdir, $mono_font;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
if(!$os) {
|
||||
|
||||
$sysObjectId = shell_exec($config['snmpget'] . " -Ovq -m ".$config['mibs_dir']."/NS-PRODUCTS.mib -v2c -c ". $community ." ". $hostname ." .1.3.6.1.2.1.1.2.0");
|
||||
$sysObjectId = shell_exec($config['snmpget'] . " -Ovq -v2c -c ". $community ." ". $hostname ." .1.3.6.1.2.1.1.2.0");
|
||||
if(strstr($sysObjectId, "netscreen")) { $os = "ScreenOS"; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
<?
|
||||
|
||||
echo("Doing Juniper Netscreen ScreenOS");
|
||||
echo("Doing Juniper Netscreen (ScreenOS)");
|
||||
|
||||
$version = preg_replace("/(.+)\ version\ (.+)\ \(SN:\ (.+)\,\ (.+)\)/", "Juniper Netscreen \\1||\\2||\\3||\\4", $sysDescr);
|
||||
echo("$version\n");
|
||||
list($hardware,$version,$serial,$features) = explode("||", $version);
|
||||
|
||||
$cpurrd = $rrd_dir . "/" . $device['hostname'] . "/netscreen-cpu.rrd";
|
||||
$memrrd = $rrd_dir . "/" . $device['hostname'] . "/netscreen-memory.rrd";
|
||||
|
||||
Reference in New Issue
Block a user