mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@@ -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)) {
|
||||
|
10
includes/osdiscovery/discover-junos.php
Executable file
10
includes/osdiscovery/discover-junos.php
Executable 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"; }
|
||||
|
||||
}
|
||||
|
||||
?>
|
14
includes/polling/device-junos.inc.php
Normal file
14
includes/polling/device-junos.inc.php
Normal 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");
|
||||
|
||||
|
||||
|
||||
?>
|
Reference in New Issue
Block a user