adding juniper stuff! hurray!

git-svn-id: http://www.observium.org/svn/observer/trunk@244 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2008-07-18 12:07:51 +00:00
parent 60ee7e5141
commit 0ee570b762
3 changed files with 29 additions and 0 deletions

View File

@@ -19,6 +19,11 @@ include_once($config['install_dir'] . "/includes/billing-functions.php");
include_once($config['install_dir'] . "/includes/cisco-entities.php");
include_once($config['install_dir'] . "/includes/syslog.php");
function mres($string) {
// short function wrapper because the real one is stupidly long and ugly. aestetics.
return mysql_real_escape_string($string);
}
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)) {

View File

@@ -0,0 +1,10 @@
<?php
if(!$os) {
$sysObjectId = shell_exec($config['snmpget'] . " -Ovqn -v2c -c ". $community ." ". $hostname ." sysObjectID.0");
if(strstr($sysObjectId, ".1.3.6.1.4.1.2636")) { $os = "JunOS"; }
}
?>

View File

@@ -0,0 +1,14 @@
<?php
$jun_ver = trim(str_replace("\"", "", shell_exec($config['snmpget'] . " -".$device['snmpver']." -Oqv -c ".$device['community']." ".$device['hostname']." .1.3.6.1.2.1.25.6.3.1.2.2")));
$hardware = trim(str_replace("\"", "", shell_exec($config['snmpget'] . " -".$device['snmpver']." -Oqv -c ".$device['community']." ".$device['hostname']." .1.3.6.1.4.1.2636.3.1.2.0")));
$serial = trim(str_replace("\"", "", shell_exec($config['snmpget'] . " -".$device['snmpver']." -Oqv -c ".$device['community']." ".$device['hostname']." .1.3.6.1.4.1.2636.3.1.3.0")));
$version = preg_replace("/.+\[(.+)\].+/", "\\1", $jun_ver);
$features = preg_replace("/.+\ \((.+)\)$/", "\\1", $jun_ver);
echo("$hardware - $version - $features - $serial\n");
?>