mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
more code cleanup
git-svn-id: http://www.observium.org/svn/observer/trunk@2517 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -3,23 +3,23 @@
|
|||||||
## List of real names for cisco entities
|
## List of real names for cisco entities
|
||||||
|
|
||||||
$entPhysicalVendorTypes = array (
|
$entPhysicalVendorTypes = array (
|
||||||
'cevC7xxxIo1feTxIsl' => 'C7200-IO-FE-MII',
|
'cevC7xxxIo1feTxIsl' => 'C7200-IO-FE-MII',
|
||||||
'cevChassis7140Dualfe' => 'C7140-2FE',
|
'cevChassis7140Dualfe' => 'C7140-2FE',
|
||||||
'cevChassis7204' => "C7204",
|
'cevChassis7204' => "C7204",
|
||||||
'cevChassis7204Vxr' => 'C7204VXR',
|
'cevChassis7204Vxr' => 'C7204VXR',
|
||||||
'cevChassis7206' => 'C7206',
|
'cevChassis7206' => 'C7206',
|
||||||
'cevChassis7206Vxr' => 'C7206VXR',
|
'cevChassis7206Vxr' => 'C7206VXR',
|
||||||
'cevCpu7200Npe200' => 'NPE-200',
|
'cevCpu7200Npe200' => 'NPE-200',
|
||||||
'cevCpu7200Npe225' => 'NPE-225',
|
'cevCpu7200Npe225' => 'NPE-225',
|
||||||
'cevCpu7200Npe300' => 'NPE-300',
|
'cevCpu7200Npe300' => 'NPE-300',
|
||||||
'cevCpu7200Npe400' => 'NPE-400',
|
'cevCpu7200Npe400' => 'NPE-400',
|
||||||
'cevCpu7200Npeg1' => 'NPE-G1',
|
'cevCpu7200Npeg1' => 'NPE-G1',
|
||||||
'cevCpu7200Npeg2' => 'NPE-G2',
|
'cevCpu7200Npeg2' => 'NPE-G2',
|
||||||
'cevPa1feTxIsl' => 'PA-FE-TX-ISL',
|
'cevPa1feTxIsl' => 'PA-FE-TX-ISL',
|
||||||
'cevPa2feTxI82543' => 'PA-2FE-TX',
|
'cevPa2feTxI82543' => 'PA-2FE-TX',
|
||||||
'cevPa8e' => 'PA-8E',
|
'cevPa8e' => 'PA-8E',
|
||||||
'cevPaA8tX21' => 'PA-8T-X21',
|
'cevPaA8tX21' => 'PA-8T-X21',
|
||||||
'cevMGBIC1000BaseLX' => '1000BaseLX GBIC',
|
'cevMGBIC1000BaseLX' => '1000BaseLX GBIC',
|
||||||
'cevPort10GigBaseLR' => '10GigBaseLR');
|
'cevPort10GigBaseLR' => '10GigBaseLR');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
function isCli() {
|
function isCli() {
|
||||||
|
|
||||||
if(php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR'])) {
|
if (php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR'])) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -13,7 +13,7 @@ function isCli() {
|
|||||||
|
|
||||||
function print_error($text)
|
function print_error($text)
|
||||||
{
|
{
|
||||||
if(isCli()) {
|
if (isCli()) {
|
||||||
print Console_Color::convert("%r".$text."%n\n", false);
|
print Console_Color::convert("%r".$text."%n\n", false);
|
||||||
} else {
|
} else {
|
||||||
echo('<div class="errorbox"><img src="/images/16/exclamation.png" align="absmiddle"> '.$text.'</div>');
|
echo('<div class="errorbox"><img src="/images/16/exclamation.png" align="absmiddle"> '.$text.'</div>');
|
||||||
@@ -22,7 +22,7 @@ function print_error($text)
|
|||||||
|
|
||||||
function print_message($text)
|
function print_message($text)
|
||||||
{
|
{
|
||||||
if(isCli()) {
|
if (isCli()) {
|
||||||
print Console_Color::convert("%g".$text."%n\n", false);
|
print Console_Color::convert("%g".$text."%n\n", false);
|
||||||
} else {
|
} else {
|
||||||
echo('<div class="messagebox"><img src="/images/16/tick.png" align="absmiddle"> '.$text.'</div>');
|
echo('<div class="messagebox"><img src="/images/16/tick.png" align="absmiddle"> '.$text.'</div>');
|
||||||
|
@@ -22,29 +22,30 @@ Usage
|
|||||||
* Used by the other _query functions.
|
* Used by the other _query functions.
|
||||||
* */
|
* */
|
||||||
function dbQuery($sql, $parameters = array()) {
|
function dbQuery($sql, $parameters = array()) {
|
||||||
global $fullSql, $debug;
|
global $fullSql, $debug;
|
||||||
$fullSql = dbMakeQuery($sql, $parameters);
|
|
||||||
if($debug) { echo(" SQL[".$fullSql."] "); }
|
|
||||||
/*
|
|
||||||
if($this->logFile)
|
|
||||||
$time_start = microtime(true);
|
|
||||||
*/
|
|
||||||
|
|
||||||
# echo($fullSql);
|
$fullSql = dbMakeQuery($sql, $parameters);
|
||||||
|
if ($debug) { echo(" SQL[".$fullSql."] "); }
|
||||||
|
/*
|
||||||
|
if($this->logFile)
|
||||||
|
$time_start = microtime(true);
|
||||||
|
*/
|
||||||
|
|
||||||
$result = mysql_query($fullSql); // sets $this->result
|
# echo($fullSql);
|
||||||
/*
|
|
||||||
if($this->logFile) {
|
|
||||||
$time_end = microtime(true);
|
|
||||||
fwrite($this->logFile, date('Y-m-d H:i:s') . "\n" . $fullSql . "\n" . number_format($time_end - $time_start, 8) . " seconds\n\n");
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
if($result === false && (error_reporting() & 1)) {
|
$result = mysql_query($fullSql); // sets $this->result
|
||||||
// aye. this gets triggers on duplicate Contact insert
|
/*
|
||||||
//trigger_error('QDB - Error in query: ' . $fullSql . ' : ' . mysql_error(), E_USER_WARNING);
|
if($this->logFile) {
|
||||||
}
|
$time_end = microtime(true);
|
||||||
return $result;
|
fwrite($this->logFile, date('Y-m-d H:i:s') . "\n" . $fullSql . "\n" . number_format($time_end - $time_start, 8) . " seconds\n\n");
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
if($result === false && (error_reporting() & 1)) {
|
||||||
|
// aye. this gets triggers on duplicate Contact insert
|
||||||
|
//trigger_error('QDB - Error in query: ' . $fullSql . ' : ' . mysql_error(), E_USER_WARNING);
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -52,37 +53,39 @@ function dbQuery($sql, $parameters = array()) {
|
|||||||
* Check for boolean false to determine whether insert failed
|
* Check for boolean false to determine whether insert failed
|
||||||
* */
|
* */
|
||||||
function dbInsert($data, $table) {
|
function dbInsert($data, $table) {
|
||||||
global $fullSql;
|
global $fullSql;
|
||||||
global $db_stats;
|
|
||||||
// the following block swaps the parameters if they were given in the wrong order.
|
|
||||||
// it allows the method to work for those that would rather it (or expect it to)
|
|
||||||
// follow closer with SQL convention:
|
|
||||||
// insert into the TABLE this DATA
|
|
||||||
if(is_string($data) && is_array($table)) {
|
|
||||||
$tmp = $data;
|
|
||||||
$data = $table;
|
|
||||||
$table = $tmp;
|
|
||||||
//trigger_error('QDB - Parameters passed to insert() were in reverse order, but it has been allowed', E_USER_NOTICE);
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = 'INSERT INTO `' . $table . '` (`' . implode('`,`', array_keys($data)) . '`) VALUES (' . implode(',', dbPlaceHolders($data)) . ')';
|
global $db_stats;
|
||||||
|
|
||||||
|
// the following block swaps the parameters if they were given in the wrong order.
|
||||||
|
// it allows the method to work for those that would rather it (or expect it to)
|
||||||
|
// follow closer with SQL convention:
|
||||||
|
// insert into the TABLE this DATA
|
||||||
|
if(is_string($data) && is_array($table)) {
|
||||||
|
$tmp = $data;
|
||||||
|
$data = $table;
|
||||||
|
$table = $tmp;
|
||||||
|
//trigger_error('QDB - Parameters passed to insert() were in reverse order, but it has been allowed', E_USER_NOTICE);
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = 'INSERT INTO `' . $table . '` (`' . implode('`,`', array_keys($data)) . '`) VALUES (' . implode(',', dbPlaceHolders($data)) . ')';
|
||||||
|
|
||||||
$time_start = microtime(true);
|
$time_start = microtime(true);
|
||||||
dbBeginTransaction();
|
dbBeginTransaction();
|
||||||
$result = dbQuery($sql, $data);
|
$result = dbQuery($sql, $data);
|
||||||
if($result) {
|
if($result) {
|
||||||
$id = mysql_insert_id();
|
$id = mysql_insert_id();
|
||||||
dbCommitTransaction();
|
dbCommitTransaction();
|
||||||
#return $id;
|
#return $id;
|
||||||
} else {
|
} else {
|
||||||
if($table != 'Contact') {
|
if($table != 'Contact') {
|
||||||
trigger_error('QDB - Insert failed.', E_USER_WARNING);
|
trigger_error('QDB - Insert failed.', E_USER_WARNING);
|
||||||
}
|
}
|
||||||
dbRollbackTransaction();
|
dbRollbackTransaction();
|
||||||
#$id = false;
|
#$id = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#logfile($fullSql);
|
#logfile($fullSql);
|
||||||
|
|
||||||
$time_end = microtime(true);
|
$time_end = microtime(true);
|
||||||
$db_stats['insert_sec'] += number_format($time_end - $time_start, 8);
|
$db_stats['insert_sec'] += number_format($time_end - $time_start, 8);
|
||||||
@@ -97,40 +100,42 @@ function dbInsert($data, $table) {
|
|||||||
* Returns the number of affected rows
|
* Returns the number of affected rows
|
||||||
* */
|
* */
|
||||||
function dbUpdate($data, $table, $where = null, $parameters = array()) {
|
function dbUpdate($data, $table, $where = null, $parameters = array()) {
|
||||||
global $fullSql;
|
global $fullSql;
|
||||||
|
|
||||||
global $db_stats;
|
global $db_stats;
|
||||||
// the following block swaps the parameters if they were given in the wrong order.
|
|
||||||
// it allows the method to work for those that would rather it (or expect it to)
|
|
||||||
// follow closer with SQL convention:
|
|
||||||
// update the TABLE with this DATA
|
|
||||||
if(is_string($data) && is_array($table)) {
|
|
||||||
$tmp = $data;
|
|
||||||
$data = $table;
|
|
||||||
$table = $tmp;
|
|
||||||
//trigger_error('QDB - The first two parameters passed to update() were in reverse order, but it has been allowed', E_USER_NOTICE);
|
|
||||||
}
|
|
||||||
|
|
||||||
// need field name and placeholder value
|
// the following block swaps the parameters if they were given in the wrong order.
|
||||||
// but how merge these field placeholders with actual $parameters array for the WHERE clause
|
// it allows the method to work for those that would rather it (or expect it to)
|
||||||
$sql = 'UPDATE `' . $table . '` set ';
|
// follow closer with SQL convention:
|
||||||
foreach($data as $key => $value) {
|
// update the TABLE with this DATA
|
||||||
|
if(is_string($data) && is_array($table)) {
|
||||||
|
$tmp = $data;
|
||||||
|
$data = $table;
|
||||||
|
$table = $tmp;
|
||||||
|
//trigger_error('QDB - The first two parameters passed to update() were in reverse order, but it has been allowed', E_USER_NOTICE);
|
||||||
|
}
|
||||||
|
|
||||||
|
// need field name and placeholder value
|
||||||
|
// but how merge these field placeholders with actual $parameters array for the WHERE clause
|
||||||
|
$sql = 'UPDATE `' . $table . '` set ';
|
||||||
|
foreach($data as $key => $value) {
|
||||||
$sql .= "`".$key."` ". '=:' . $key . ',';
|
$sql .= "`".$key."` ". '=:' . $key . ',';
|
||||||
}
|
}
|
||||||
$sql = substr($sql, 0, -1); // strip off last comma
|
$sql = substr($sql, 0, -1); // strip off last comma
|
||||||
|
|
||||||
if($where) {
|
if($where) {
|
||||||
$sql .= ' WHERE ' . $where;
|
$sql .= ' WHERE ' . $where;
|
||||||
$data = array_merge($data, $parameters);
|
$data = array_merge($data, $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
$time_start = microtime(true);
|
$time_start = microtime(true);
|
||||||
if(dbQuery($sql, $data)) {
|
if(dbQuery($sql, $data)) {
|
||||||
$return = mysql_affected_rows();
|
$return = mysql_affected_rows();
|
||||||
} else {
|
} else {
|
||||||
#echo("$fullSql");
|
#echo("$fullSql");
|
||||||
trigger_error('QDB - Update failed.', E_USER_WARNING);
|
trigger_error('QDB - Update failed.', E_USER_WARNING);
|
||||||
$return = false;
|
$return = false;
|
||||||
}
|
}
|
||||||
$time_end = microtime(true);
|
$time_end = microtime(true);
|
||||||
$db_stats['update_sec'] += number_format($time_end - $time_start, 8);
|
$db_stats['update_sec'] += number_format($time_end - $time_start, 8);
|
||||||
$db_stats['update']++;
|
$db_stats['update']++;
|
||||||
@@ -140,15 +145,15 @@ function dbUpdate($data, $table, $where = null, $parameters = array()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function dbDelete($table, $where = null, $parameters = array()) {
|
function dbDelete($table, $where = null, $parameters = array()) {
|
||||||
$sql = 'DELETE FROM `' . $table.'`';
|
$sql = 'DELETE FROM `' . $table.'`';
|
||||||
if($where) {
|
if($where) {
|
||||||
$sql .= ' WHERE ' . $where;
|
$sql .= ' WHERE ' . $where;
|
||||||
}
|
}
|
||||||
if(dbQuery($sql, $parameters)) {
|
if(dbQuery($sql, $parameters)) {
|
||||||
return mysql_affected_rows();
|
return mysql_affected_rows();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -159,16 +164,16 @@ function dbFetchRows($sql, $parameters = array()) {
|
|||||||
global $db_stats;
|
global $db_stats;
|
||||||
|
|
||||||
$time_start = microtime(true);
|
$time_start = microtime(true);
|
||||||
$result = dbQuery($sql, $parameters);
|
$result = dbQuery($sql, $parameters);
|
||||||
|
|
||||||
if(mysql_num_rows($result) > 0) {
|
if(mysql_num_rows($result) > 0) {
|
||||||
$rows = array();
|
$rows = array();
|
||||||
while($row = mysql_fetch_assoc($result)) {
|
while ($row = mysql_fetch_assoc($result)) {
|
||||||
$rows[] = $row;
|
$rows[] = $row;
|
||||||
}
|
}
|
||||||
mysql_free_result($result);
|
mysql_free_result($result);
|
||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
mysql_free_result($result);
|
mysql_free_result($result);
|
||||||
|
|
||||||
@@ -176,26 +181,26 @@ function dbFetchRows($sql, $parameters = array()) {
|
|||||||
$db_stats['fetchrows_sec'] += number_format($time_end - $time_start, 8);
|
$db_stats['fetchrows_sec'] += number_format($time_end - $time_start, 8);
|
||||||
$db_stats['fetchrows']++;
|
$db_stats['fetchrows']++;
|
||||||
|
|
||||||
// no records, thus return empty array
|
// no records, thus return empty array
|
||||||
// which should evaluate to false, and will prevent foreach notices/warnings
|
// which should evaluate to false, and will prevent foreach notices/warnings
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* This is intended to be the method used for large result sets.
|
* This is intended to be the method used for large result sets.
|
||||||
* It is intended to return an iterator, and act upon buffered data.
|
* It is intended to return an iterator, and act upon buffered data.
|
||||||
* */
|
* */
|
||||||
function dbFetch($sql, $parameters = array()) {
|
function dbFetch($sql, $parameters = array()) {
|
||||||
return dbFetchRows($sql, $parameters);
|
return dbFetchRows($sql, $parameters);
|
||||||
/*
|
/*
|
||||||
// for now, don't do the iterator thing
|
// for now, don't do the iterator thing
|
||||||
$result = dbQuery($sql, $parameters);
|
$result = dbQuery($sql, $parameters);
|
||||||
if($result) {
|
if($result) {
|
||||||
// return new iterator
|
// return new iterator
|
||||||
return new dbIterator($result);
|
return new dbIterator($result);
|
||||||
} else {
|
} else {
|
||||||
return null; // ??
|
return null; // ??
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -206,19 +211,19 @@ function dbFetchRow($sql = null, $parameters = array()) {
|
|||||||
global $db_stats;
|
global $db_stats;
|
||||||
|
|
||||||
$time_start = microtime(true);
|
$time_start = microtime(true);
|
||||||
$result = dbQuery($sql, $parameters);
|
$result = dbQuery($sql, $parameters);
|
||||||
if($result) {
|
if($result) {
|
||||||
$row = mysql_fetch_assoc($result);
|
$row = mysql_fetch_assoc($result);
|
||||||
mysql_free_result($result);
|
mysql_free_result($result);
|
||||||
$time_end = microtime(true);
|
$time_end = microtime(true);
|
||||||
|
|
||||||
$db_stats['fetchrow_sec'] += number_format($time_end - $time_start, 8);
|
$db_stats['fetchrow_sec'] += number_format($time_end - $time_start, 8);
|
||||||
$db_stats['fetchrow']++;
|
$db_stats['fetchrow']++;
|
||||||
|
|
||||||
return $row;
|
return $row;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
$time_start = microtime(true);
|
$time_start = microtime(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -228,17 +233,18 @@ function dbFetchRow($sql = null, $parameters = array()) {
|
|||||||
* */
|
* */
|
||||||
function dbFetchCell($sql, $parameters = array()) {
|
function dbFetchCell($sql, $parameters = array()) {
|
||||||
global $db_stats;
|
global $db_stats;
|
||||||
|
|
||||||
$time_start = microtime(true);
|
$time_start = microtime(true);
|
||||||
$row = dbFetchRow($sql, $parameters);
|
$row = dbFetchRow($sql, $parameters);
|
||||||
if($row) {
|
if($row) {
|
||||||
return array_shift($row); // shift first field off first row
|
return array_shift($row); // shift first field off first row
|
||||||
}
|
}
|
||||||
$time_end = microtime(true);
|
$time_end = microtime(true);
|
||||||
|
|
||||||
$db_stats['fetchcell_sec'] += number_format($time_end - $time_start, 8);
|
$db_stats['fetchcell_sec'] += number_format($time_end - $time_start, 8);
|
||||||
$db_stats['fetchcell']++;
|
$db_stats['fetchcell']++;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -247,17 +253,18 @@ function dbFetchCell($sql, $parameters = array()) {
|
|||||||
* */
|
* */
|
||||||
function dbFetchColumn($sql, $parameters = array()) {
|
function dbFetchColumn($sql, $parameters = array()) {
|
||||||
global $db_stats;
|
global $db_stats;
|
||||||
|
|
||||||
$time_start = microtime(true);
|
$time_start = microtime(true);
|
||||||
$cells = array();
|
$cells = array();
|
||||||
foreach(dbFetch($sql, $parameters) as $row) {
|
foreach(dbFetch($sql, $parameters) as $row) {
|
||||||
$cells[] = array_shift($row);
|
$cells[] = array_shift($row);
|
||||||
}
|
}
|
||||||
$time_end = microtime(true);
|
$time_end = microtime(true);
|
||||||
|
|
||||||
$db_stats['fetchcol_sec'] += number_format($time_end - $time_start, 8);
|
$db_stats['fetchcol_sec'] += number_format($time_end - $time_start, 8);
|
||||||
$db_stats['fetchcol']++;
|
$db_stats['fetchcol']++;
|
||||||
|
|
||||||
return $cells;
|
return $cells;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -266,18 +273,18 @@ function dbFetchColumn($sql, $parameters = array()) {
|
|||||||
* The second the key's value
|
* The second the key's value
|
||||||
*/
|
*/
|
||||||
function dbFetchKeyValue($sql, $parameters = array()) {
|
function dbFetchKeyValue($sql, $parameters = array()) {
|
||||||
$data = array();
|
$data = array();
|
||||||
foreach(dbFetch($sql, $parameters) as $row) {
|
foreach(dbFetch($sql, $parameters) as $row) {
|
||||||
$key = array_shift($row);
|
$key = array_shift($row);
|
||||||
if(sizeof($row) == 1) { // if there were only 2 fields in the result
|
if(sizeof($row) == 1) { // if there were only 2 fields in the result
|
||||||
// use the second for the value
|
// use the second for the value
|
||||||
$data[ $key ] = array_shift($row);
|
$data[ $key ] = array_shift($row);
|
||||||
} else { // if more than 2 fields were fetched
|
} else { // if more than 2 fields were fetched
|
||||||
// use the array of the rest as the value
|
// use the array of the rest as the value
|
||||||
$data[ $key ] = $row;
|
$data[ $key ] = $row;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -286,69 +293,69 @@ function dbFetchKeyValue($sql, $parameters = array()) {
|
|||||||
*/
|
*/
|
||||||
function dbMakeQuery($sql, $parameters) {
|
function dbMakeQuery($sql, $parameters) {
|
||||||
// bypass extra logic if we have no parameters
|
// bypass extra logic if we have no parameters
|
||||||
if(sizeof($parameters) == 0)
|
if (sizeof($parameters) == 0)
|
||||||
return $sql;
|
return $sql;
|
||||||
|
|
||||||
$parameters = dbPrepareData($parameters);
|
$parameters = dbPrepareData($parameters);
|
||||||
// separate the two types of parameters for easier handling
|
// separate the two types of parameters for easier handling
|
||||||
$questionParams = array();
|
$questionParams = array();
|
||||||
$namedParams = array();
|
$namedParams = array();
|
||||||
foreach($parameters as $key => $value) {
|
foreach($parameters as $key => $value) {
|
||||||
if(is_numeric($key)) {
|
if(is_numeric($key)) {
|
||||||
$questionParams[] = $value;
|
$questionParams[] = $value;
|
||||||
} else {
|
} else {
|
||||||
$namedParams[ ':' . $key ] = $value;
|
$namedParams[ ':' . $key ] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// sort namedParams in reverse to stop substring squashing
|
// sort namedParams in reverse to stop substring squashing
|
||||||
krsort($namedParams);
|
krsort($namedParams);
|
||||||
|
|
||||||
// split on question-mark and named placeholders
|
// split on question-mark and named placeholders
|
||||||
$result = preg_split('/(\?|:[a-zA-Z0-9_-]+)/', $sql, -1, PREG_SPLIT_NO_EMPTY|PREG_SPLIT_DELIM_CAPTURE);
|
$result = preg_split('/(\?|:[a-zA-Z0-9_-]+)/', $sql, -1, PREG_SPLIT_NO_EMPTY|PREG_SPLIT_DELIM_CAPTURE);
|
||||||
|
|
||||||
// every-other item in $result will be the placeholder that was found
|
// every-other item in $result will be the placeholder that was found
|
||||||
|
|
||||||
$query = '';
|
$query = '';
|
||||||
for($i = 0; $i < sizeof($result); $i+=2) {
|
for($i = 0; $i < sizeof($result); $i+=2) {
|
||||||
$query .= $result[ $i ];
|
$query .= $result[ $i ];
|
||||||
|
|
||||||
$j = $i+1;
|
$j = $i+1;
|
||||||
if(array_key_exists($j, $result)) {
|
if(array_key_exists($j, $result)) {
|
||||||
$test = $result[ $j ];
|
$test = $result[ $j ];
|
||||||
if($test == '?') {
|
if($test == '?') {
|
||||||
$query .= array_shift($questionParams);
|
$query .= array_shift($questionParams);
|
||||||
} else {
|
} else {
|
||||||
$query .= $namedParams[ $test ];
|
$query .= $namedParams[ $test ];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function dbPrepareData($data) {
|
function dbPrepareData($data) {
|
||||||
$values = array();
|
$values = array();
|
||||||
|
|
||||||
foreach($data as $key=>$value) {
|
foreach($data as $key=>$value) {
|
||||||
$escape = true;
|
$escape = true;
|
||||||
// don't quote or esc if value is an array, we treat it
|
// don't quote or esc if value is an array, we treat it
|
||||||
// as a "decorator" that tells us not to escape the
|
// as a "decorator" that tells us not to escape the
|
||||||
// value contained in the array
|
// value contained in the array
|
||||||
if(is_array($value) && !is_object($value)) {
|
if(is_array($value) && !is_object($value)) {
|
||||||
$escape = false;
|
$escape = false;
|
||||||
$value = array_shift($value);
|
$value = array_shift($value);
|
||||||
}
|
}
|
||||||
// it's not right to worry about invalid fields in this method because we may be operating on fields
|
// it's not right to worry about invalid fields in this method because we may be operating on fields
|
||||||
// that are aliases, or part of other tables through joins
|
// that are aliases, or part of other tables through joins
|
||||||
//if(!in_array($key, $columns)) // skip invalid fields
|
//if(!in_array($key, $columns)) // skip invalid fields
|
||||||
// continue;
|
// continue;
|
||||||
if($escape) {
|
if($escape) {
|
||||||
$values[$key] = "'" . mysql_real_escape_string($value) . "'";
|
$values[$key] = "'" . mysql_real_escape_string($value) . "'";
|
||||||
} else
|
} else
|
||||||
$values[$key] = $value;
|
$values[$key] = $value;
|
||||||
}
|
}
|
||||||
return $values;
|
return $values;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -356,61 +363,61 @@ function dbPrepareData($data) {
|
|||||||
* These may be question marks, or ":email" type
|
* These may be question marks, or ":email" type
|
||||||
*/
|
*/
|
||||||
function dbPlaceHolders($values) {
|
function dbPlaceHolders($values) {
|
||||||
$data = array();
|
$data = array();
|
||||||
foreach($values as $key => $value) {
|
foreach($values as $key => $value) {
|
||||||
if(is_numeric($key))
|
if(is_numeric($key))
|
||||||
$data[] = '?';
|
$data[] = '?';
|
||||||
else
|
else
|
||||||
$data[] = ':' . $key;
|
$data[] = ':' . $key;
|
||||||
}
|
}
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
function dbBeginTransaction() {
|
function dbBeginTransaction() {
|
||||||
mysql_query('begin');
|
mysql_query('begin');
|
||||||
}
|
}
|
||||||
|
|
||||||
function dbCommitTransaction() {
|
function dbCommitTransaction() {
|
||||||
mysql_query('commit');
|
mysql_query('commit');
|
||||||
}
|
}
|
||||||
|
|
||||||
function dbRollbackTransaction() {
|
function dbRollbackTransaction() {
|
||||||
mysql_query('rollback');
|
mysql_query('rollback');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
class dbIterator implements Iterator {
|
class dbIterator implements Iterator {
|
||||||
private $result;
|
private $result;
|
||||||
private $i;
|
private $i;
|
||||||
|
|
||||||
public function __construct($r) {
|
public function __construct($r) {
|
||||||
$this->result = $r;
|
$this->result = $r;
|
||||||
$this->i = 0;
|
$this->i = 0;
|
||||||
}
|
}
|
||||||
public function rewind() {
|
public function rewind() {
|
||||||
mysql_data_seek($this->result, 0);
|
mysql_data_seek($this->result, 0);
|
||||||
$this->i = 0;
|
$this->i = 0;
|
||||||
}
|
}
|
||||||
public function current() {
|
public function current() {
|
||||||
$a = mysql_fetch_assoc($this->result);
|
$a = mysql_fetch_assoc($this->result);
|
||||||
return $a;
|
return $a;
|
||||||
}
|
}
|
||||||
public function key() {
|
public function key() {
|
||||||
return $this->i;
|
return $this->i;
|
||||||
}
|
}
|
||||||
public function next() {
|
public function next() {
|
||||||
$this->i++;
|
$this->i++;
|
||||||
$a = mysql_data_seek($this->result, $this->i);
|
$a = mysql_data_seek($this->result, $this->i);
|
||||||
if($a === false) {
|
if($a === false) {
|
||||||
$this->i = 0;
|
$this->i = 0;
|
||||||
}
|
}
|
||||||
return $a;
|
return $a;
|
||||||
}
|
}
|
||||||
public function valid() {
|
public function valid() {
|
||||||
return ($this->current() !== false);
|
return ($this->current() !== false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -34,13 +34,13 @@ $config['virsh'] = "/usr/bin/virsh";
|
|||||||
|
|
||||||
if (isset($_SERVER["SERVER_NAME"]) && isset($_SERVER["SERVER_PORT"]))
|
if (isset($_SERVER["SERVER_NAME"]) && isset($_SERVER["SERVER_PORT"]))
|
||||||
{
|
{
|
||||||
$config['base_url'] = "http://" . $_SERVER["SERVER_NAME"] .":".$_SERVER["SERVER_PORT"]."/";
|
$config['base_url'] = "http://" . $_SERVER["SERVER_NAME"] .":".$_SERVER["SERVER_PORT"]."/";
|
||||||
}
|
}
|
||||||
|
|
||||||
$config['title_image'] = "images/observium-logo.png";
|
$config['title_image'] = "images/observium-logo.png";
|
||||||
$config['stylesheet'] = "css/styles.css";
|
$config['stylesheet'] = "css/styles.css";
|
||||||
$config['mono_font'] = "DejaVuSansMono";
|
$config['mono_font'] = "DejaVuSansMono";
|
||||||
#$config['mono_font'] = "LiberationMono";
|
#$config['mono_font'] = "LiberationMono";
|
||||||
$config['favicon'] = "images/observium-icon.png";
|
$config['favicon'] = "images/observium-icon.png";
|
||||||
$config['header_color'] = "#1F334E";
|
$config['header_color'] = "#1F334E";
|
||||||
$config['page_refresh'] = "300"; ## Refresh the page every xx seconds
|
$config['page_refresh'] = "300"; ## Refresh the page every xx seconds
|
||||||
@@ -48,7 +48,7 @@ $config['front_page'] = "pages/front/default.php";
|
|||||||
$config['page_title'] = "Observium :: Network Observation and Monitoring";
|
$config['page_title'] = "Observium :: Network Observation and Monitoring";
|
||||||
$config['timestamp_format'] = 'd-m-Y H:i:s';
|
$config['timestamp_format'] = 'd-m-Y H:i:s';
|
||||||
$config['page_gen'] = 1;
|
$config['page_gen'] = 1;
|
||||||
$config['web_header'] = "header.inc.php"; # in html/includes
|
$config['web_header'] = "header.inc.php"; # in html/includes
|
||||||
$config['login_message'] = "Unauthorised access or use shall render the user liable to criminal and/or civil prosecution.";
|
$config['login_message'] = "Unauthorised access or use shall render the user liable to criminal and/or civil prosecution.";
|
||||||
|
|
||||||
$config['int_customers'] = 1; # Enable Customer Port Parsing
|
$config['int_customers'] = 1; # Enable Customer Port Parsing
|
||||||
@@ -66,23 +66,23 @@ $config['ports_page_default'] = "details"; ## eg "details" "graphs/bits" ##
|
|||||||
#$config['snmp']['timeout'] = 1; # timeout in seconds
|
#$config['snmp']['timeout'] = 1; # timeout in seconds
|
||||||
#$config['snmp']['retries'] = 5; # how many times to retry the query
|
#$config['snmp']['retries'] = 5; # how many times to retry the query
|
||||||
$config['snmp']['community'][0] = "public"; # Communities to try during adding hosts and discovery
|
$config['snmp']['community'][0] = "public"; # Communities to try during adding hosts and discovery
|
||||||
$config['snmp']['internal'] = false; # Enable php_snmp functions to make gets faster
|
$config['snmp']['internal'] = false; # Enable php_snmp functions to make gets faster
|
||||||
$config['snmp']['transports'] = array('udp', 'udp6', 'tcp', 'tcp6');
|
$config['snmp']['transports'] = array('udp', 'udp6', 'tcp', 'tcp6');
|
||||||
|
|
||||||
### Autodiscovery Settings
|
### Autodiscovery Settings
|
||||||
|
|
||||||
$config['autodiscovery']['xdp'] = true; ## Autodiscover hosts via discovery protocols
|
$config['autodiscovery']['xdp'] = true; ## Autodiscover hosts via discovery protocols
|
||||||
$config['autodiscovery']['ospf'] = true; ## Autodiscover hosts via OSPF
|
$config['autodiscovery']['ospf'] = true; ## Autodiscover hosts via OSPF
|
||||||
$config['autodiscovery']['bgp'] = true; ## Autodiscover hosts via BGP
|
$config['autodiscovery']['bgp'] = true; ## Autodiscover hosts via BGP
|
||||||
$config['autodiscovery']['snmpscan'] = true; ## autodiscover hosts via SNMP scanning
|
$config['autodiscovery']['snmpscan'] = true; ## autodiscover hosts via SNMP scanning
|
||||||
|
|
||||||
$config['discover_services'] = false; ## Autodiscover services via SNMP on devices of type "server"
|
$config['discover_services'] = false; ## Autodiscover services via SNMP on devices of type "server"
|
||||||
|
|
||||||
### Alerting Settings
|
### Alerting Settings
|
||||||
|
|
||||||
$config['alerts']['email']['default'] = NULL; ## Default alert recipient
|
$config['alerts']['email']['default'] = NULL; ## Default alert recipient
|
||||||
$config['alerts']['email']['default_only'] = FALSE; ## Only use default recipient
|
$config['alerts']['email']['default_only'] = FALSE; ## Only use default recipient
|
||||||
$config['alerts']['email']['enable'] = TRUE; ## Enable email alerts
|
$config['alerts']['email']['enable'] = TRUE; ## Enable email alerts
|
||||||
$config['uptime_warning'] = "84600"; ## Time in seconds to display a "Device Rebooted" Alert. 0 to disable warnings.
|
$config['uptime_warning'] = "84600"; ## Time in seconds to display a "Device Rebooted" Alert. 0 to disable warnings.
|
||||||
|
|
||||||
### Cosmetics
|
### Cosmetics
|
||||||
@@ -139,16 +139,16 @@ $config['version_check'] = 1; # Enable checking of version in dis
|
|||||||
|
|
||||||
### Poller/Discovery Modules
|
### Poller/Discovery Modules
|
||||||
|
|
||||||
$config['enable_bgp'] = 1; # Enable BGP session collection and display
|
$config['enable_bgp'] = 1; # Enable BGP session collection and display
|
||||||
$config['enable_rip'] = 1; # Enable RIP session collection and display
|
$config['enable_rip'] = 1; # Enable RIP session collection and display
|
||||||
$config['enable_ospf'] = 1; # Enable OSPF session collection and display
|
$config['enable_ospf'] = 1; # Enable OSPF session collection and display
|
||||||
$config['enable_isis'] = 1; # Enable ISIS session collection and display
|
$config['enable_isis'] = 1; # Enable ISIS session collection and display
|
||||||
$config['enable_eigrp'] = 1; # Enable EIGRP session collection and display
|
$config['enable_eigrp'] = 1; # Enable EIGRP session collection and display
|
||||||
$config['enable_syslog'] = 0; # Enable Syslog
|
$config['enable_syslog'] = 0; # Enable Syslog
|
||||||
$config['enable_inventory'] = 1; # Enable Inventory
|
$config['enable_inventory'] = 1; # Enable Inventory
|
||||||
$config['enable_pseudowires'] = 1; # Enable Pseudowires
|
$config['enable_pseudowires'] = 1; # Enable Pseudowires
|
||||||
$config['enable_vrfs'] = 1; # Enable VRFs
|
$config['enable_vrfs'] = 1; # Enable VRFs
|
||||||
$config['enable_printers'] = 0; # Enable Printer support
|
$config['enable_printers'] = 0; # Enable Printer support
|
||||||
|
|
||||||
### Ports extension modules
|
### Ports extension modules
|
||||||
|
|
||||||
@@ -162,15 +162,15 @@ $config['enable_ports_poe'] = 0; # Enable PoE stats collection
|
|||||||
### Billing System Configuration
|
### Billing System Configuration
|
||||||
|
|
||||||
$config['enable_billing'] = 0; # Enable Billing
|
$config['enable_billing'] = 0; # Enable Billing
|
||||||
$config['billing']['customer_autoadd'] = 0; # Enable Auto-add bill per customer
|
$config['billing']['customer_autoadd'] = 0; # Enable Auto-add bill per customer
|
||||||
$config['billing']['circuit_autoadd'] = 0; # Enable Auto-add bill per circuit_id
|
$config['billing']['circuit_autoadd'] = 0; # Enable Auto-add bill per circuit_id
|
||||||
$config['billing']['bill_autoadd'] = 0; # Enable Auto-add bill per bill_id
|
$config['billing']['bill_autoadd'] = 0; # Enable Auto-add bill per bill_id
|
||||||
|
|
||||||
### External Integration
|
### External Integration
|
||||||
|
|
||||||
#$config['rancid_configs'][] = '/var/lib/rancid/network/configs/';
|
#$config['rancid_configs'][] = '/var/lib/rancid/network/configs/';
|
||||||
$config['rancid_ignorecomments'] = 0; # Ignore lines starting with #
|
$config['rancid_ignorecomments'] = 0; # Ignore lines starting with #
|
||||||
#$config['collectd_dir'] = '/var/lib/collectd/rrd';
|
#$config['collectd_dir'] = '/var/lib/collectd/rrd';
|
||||||
|
|
||||||
# NFSen RRD dir.
|
# NFSen RRD dir.
|
||||||
$config['nfsen_enable'] = 0;
|
$config['nfsen_enable'] = 0;
|
||||||
@@ -245,7 +245,7 @@ $config['irc_chan'][] = "#observium";
|
|||||||
|
|
||||||
### Authentication
|
### Authentication
|
||||||
|
|
||||||
$config['allow_unauth_graphs'] = 0; ## Allow graphs to be viewed by anyone
|
$config['allow_unauth_graphs'] = 0; ## Allow graphs to be viewed by anyone
|
||||||
$config['allow_unauth_graphs_cidr'] = array(); # Allow graphs to be viewed without authorisation from certain IP ranges
|
$config['allow_unauth_graphs_cidr'] = array(); # Allow graphs to be viewed without authorisation from certain IP ranges
|
||||||
$config['auth_mechanism'] = "mysql"; # Available mechanisms: mysql (default), ldap, http-auth
|
$config['auth_mechanism'] = "mysql"; # Available mechanisms: mysql (default), ldap, http-auth
|
||||||
|
|
||||||
@@ -342,7 +342,7 @@ $config['poller_modules']['cisco-ipsec-flow-monitor'] = 1;
|
|||||||
$config['poller_modules']['cisco-remote-access-monitor'] = 1;
|
$config['poller_modules']['cisco-remote-access-monitor'] = 1;
|
||||||
$config['poller_modules']['cisco-cef'] = 1;
|
$config['poller_modules']['cisco-cef'] = 1;
|
||||||
$config['poller_modules']['cisco-mac-accounting'] = 1;
|
$config['poller_modules']['cisco-mac-accounting'] = 1;
|
||||||
$config['poller_modules']['cipsec-tunnels'] = 1;
|
$config['poller_modules']['cipsec-tunnels'] = 1;
|
||||||
|
|
||||||
#include("includes/polling/altiga-ssl.inc.php");
|
#include("includes/polling/altiga-ssl.inc.php");
|
||||||
|
|
||||||
|
@@ -31,12 +31,12 @@ if (is_array($cefs))
|
|||||||
echo(" | |-".$path.": ".$path_name['cefSwitchingPath']."\n");
|
echo(" | |-".$path.": ".$path_name['cefSwitchingPath']."\n");
|
||||||
|
|
||||||
|
|
||||||
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `cef` WHERE `device_id` = '".$device['device_id']."' AND `entPhysicalIndex` = '".$entity."'
|
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `cef` WHERE `device_id` = '".$device['device_id']."' AND `entPhysicalIndex` = '".$entity."'
|
||||||
AND `afi` = '".$afi."' AND `cef_index` = '".$path."'"),0) != "1")
|
AND `afi` = '".$afi."' AND `cef_index` = '".$path."'"),0) != "1")
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO `cef` (`device_id`, `entPhysicalIndex`, `afi`, `cef_index`, `cef_path`)
|
$sql = "INSERT INTO `cef` (`device_id`, `entPhysicalIndex`, `afi`, `cef_index`, `cef_path`)
|
||||||
VALUES ('".$device['device_id']."', '".$entity."', '".$afi."', '".$path."', '".$path_name['cefSwitchingPath']."')";
|
VALUES ('".$device['device_id']."', '".$entity."', '".$afi."', '".$path."', '".$path_name['cefSwitchingPath']."')";
|
||||||
mysql_query($sql);
|
mysql_query($sql);
|
||||||
echo("+");
|
echo("+");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -77,7 +77,7 @@ if ($device['os'] == "ios" || $device['os_group'] == "ios")
|
|||||||
}
|
}
|
||||||
|
|
||||||
### Bit dirty also, clean later
|
### Bit dirty also, clean later
|
||||||
$descr = str_replace("Temp: ", "", $descr);
|
$descr = str_replace("Temp: ", "", $descr);
|
||||||
$descr = str_ireplace("temperature ", "", $descr);
|
$descr = str_ireplace("temperature ", "", $descr);
|
||||||
|
|
||||||
$oid = ".1.3.6.1.4.1.9.9.91.1.1.1.1.4.".$index;
|
$oid = ".1.3.6.1.4.1.9.9.91.1.1.1.1.4.".$index;
|
||||||
@@ -132,9 +132,9 @@ if ($device['os'] == "ios" || $device['os_group'] == "ios")
|
|||||||
|
|
||||||
$ok = TRUE;
|
$ok = TRUE;
|
||||||
|
|
||||||
if ($current == "-127") { $ok = FALSE; } ## False reading
|
if ($current == "-127") { $ok = FALSE; } ## False reading
|
||||||
# if ($type == "temperature" && $current < 1) { $ok = FALSE; } ## False reading. Temperature <1 :)
|
# if ($type == "temperature" && $current < 1) { $ok = FALSE; } ## False reading. Temperature <1 :)
|
||||||
if ($descr == "") { $ok = FALSE; } ## Invalid description. Lots of these on Nexus
|
if ($descr == "") { $ok = FALSE; } ## Invalid description. Lots of these on Nexus
|
||||||
|
|
||||||
if ($ok) {
|
if ($ok) {
|
||||||
# echo("\n".$valid['sensor'].", $type, $device, $oid, $index, 'cisco-entity-sensor', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $limit, $warn_limit, $current");
|
# echo("\n".$valid['sensor'].", $type, $device, $oid, $index, 'cisco-entity-sensor', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $limit, $warn_limit, $current");
|
||||||
|
@@ -21,19 +21,19 @@ if ($config['enable_pseudowires'] && $device['os_group'] == "ios")
|
|||||||
|
|
||||||
if ($cpwOid)
|
if ($cpwOid)
|
||||||
{
|
{
|
||||||
list($cpw_remote_id) = explode(":", shell_exec($config['snmpget'] . " -M " . $config['mibdir'] . " -m CISCO-IETF-PW-MPLS-MIB -Ln -Osqnv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " cpwVcMplsPeerLdpID." . $cpwOid));
|
list($cpw_remote_id) = explode(":", shell_exec($config['snmpget'] . " -M " . $config['mibdir'] . " -m CISCO-IETF-PW-MPLS-MIB -Ln -Osqnv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " cpwVcMplsPeerLdpID." . $cpwOid));
|
||||||
$interface_descr = trim(shell_exec($config['snmpwalk'] . " -M " . $config['mibdir'] . " -m CISCO-IETF-PW-MIB -Oqvn -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " cpwVcName." . $cpwOid));
|
$interface_descr = trim(shell_exec($config['snmpwalk'] . " -M " . $config['mibdir'] . " -m CISCO-IETF-PW-MIB -Oqvn -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " cpwVcName." . $cpwOid));
|
||||||
$cpw_remote_device = @mysql_result(mysql_query("SELECT device_id FROM ipv4_addresses AS A, ports AS I WHERE A.ipv4_address = '".$cpw_remote_id."' AND A.interface_id = I.interface_id"),0);
|
$cpw_remote_device = @mysql_result(mysql_query("SELECT device_id FROM ipv4_addresses AS A, ports AS I WHERE A.ipv4_address = '".$cpw_remote_id."' AND A.interface_id = I.interface_id"),0);
|
||||||
$if_id = @mysql_result(mysql_query("SELECT `interface_id` FROM `ports` WHERE `ifDescr` = '$interface_descr' AND `device_id` = '".$device['device_id']."'"),0);
|
$if_id = @mysql_result(mysql_query("SELECT `interface_id` FROM `ports` WHERE `ifDescr` = '$interface_descr' AND `device_id` = '".$device['device_id']."'"),0);
|
||||||
|
|
||||||
if ($cpw_remote_device && $if_id)
|
if ($cpw_remote_device && $if_id)
|
||||||
{
|
{
|
||||||
$hostname = gethostbyid($cpw_remote_device);
|
$hostname = gethostbyid($cpw_remote_device);
|
||||||
#echo("\nOid: " . $cpwOid . " cpwVcID: " . $cpwVcID . " Remote Id: " . $cpw_remote_id . "($hostname(".$cpw_remote_device.") -> $interface_descr($if_id))");
|
#echo("\nOid: " . $cpwOid . " cpwVcID: " . $cpwVcID . " Remote Id: " . $cpw_remote_id . "($hostname(".$cpw_remote_device.") -> $interface_descr($if_id))");
|
||||||
if (mysql_result(mysql_query("SELECT count(*) FROM pseudowires WHERE `interface_id` = '$if_id'
|
if (mysql_result(mysql_query("SELECT count(*) FROM pseudowires WHERE `interface_id` = '$if_id'
|
||||||
AND `cpwVcID`='".$cpwVcID."'"),0))
|
AND `cpwVcID`='".$cpwVcID."'"),0))
|
||||||
{
|
{
|
||||||
echo(".");
|
echo(".");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -44,7 +44,7 @@ if ($config['enable_pseudowires'] && $device['os_group'] == "ios")
|
|||||||
#echo($device['device_id'] . " $cpwOid $cpw_remote_device $if_id $cpwVcID\n");
|
#echo($device['device_id'] . " $cpwOid $cpw_remote_device $if_id $cpwVcID\n");
|
||||||
}
|
}
|
||||||
$cpw_exists[] = $device['device_id'] . " $cpwOid $cpw_remote_device $if_id $cpwVcID";
|
$cpw_exists[] = $device['device_id'] . " $cpwOid $cpw_remote_device $if_id $cpwVcID";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -21,17 +21,17 @@ if ($device['os'] == "apc")
|
|||||||
$split_oid = explode('.',$oid);
|
$split_oid = explode('.',$oid);
|
||||||
$index = $split_oid[count($split_oid)-1];
|
$index = $split_oid[count($split_oid)-1];
|
||||||
|
|
||||||
$current_oid = "1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.".$index; #rPDULoadStatusLoad
|
$current_oid = "1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.".$index; #rPDULoadStatusLoad
|
||||||
$phase_oid = "1.3.6.1.4.1.318.1.1.12.2.3.1.1.4.".$index; #rPDULoadStatusPhaseNumber
|
$phase_oid = "1.3.6.1.4.1.318.1.1.12.2.3.1.1.4.".$index; #rPDULoadStatusPhaseNumber
|
||||||
$limit_oid = "1.3.6.1.4.1.318.1.1.12.2.2.1.1.4.".$index; #rPDULoadPhaseConfigOverloadThreshold
|
$limit_oid = "1.3.6.1.4.1.318.1.1.12.2.2.1.1.4.".$index; #rPDULoadPhaseConfigOverloadThreshold
|
||||||
$lowlimit_oid = "1.3.6.1.4.1.318.1.1.12.2.2.1.1.2.".$index; #rPDULoadPhaseConfigLowLoadThreshold
|
$lowlimit_oid = "1.3.6.1.4.1.318.1.1.12.2.2.1.1.2.".$index; #rPDULoadPhaseConfigLowLoadThreshold
|
||||||
$warnlimit_oid = "1.3.6.1.4.1.318.1.1.12.2.2.1.1.3.".$index; #rPDULoadPhaseConfigNearOverloadThreshold
|
$warnlimit_oid = "1.3.6.1.4.1.318.1.1.12.2.2.1.1.3.".$index; #rPDULoadPhaseConfigNearOverloadThreshold
|
||||||
|
|
||||||
$phase = snmp_get($device, $phase_oid, "-Oqv", "");
|
$phase = snmp_get($device, $phase_oid, "-Oqv", "");
|
||||||
$current = snmp_get($device, $current_oid, "-Oqv", "") / $precision;
|
$current = snmp_get($device, $current_oid, "-Oqv", "") / $precision;
|
||||||
$limit = snmp_get($device, $limit_oid, "-Oqv", ""); # No / $precision here! Nice, APC!
|
$limit = snmp_get($device, $limit_oid, "-Oqv", ""); # No / $precision here! Nice, APC!
|
||||||
$lowlimit = snmp_get($device, $lowlimit_oid, "-Oqv", ""); # No / $precision here! Nice, APC!
|
$lowlimit = snmp_get($device, $lowlimit_oid, "-Oqv", ""); # No / $precision here! Nice, APC!
|
||||||
$warnlimit = snmp_get($device, $warnlimit_oid, "-Oqv", ""); # No / $precision here! Nice, APC!
|
$warnlimit = snmp_get($device, $warnlimit_oid, "-Oqv", ""); # No / $precision here! Nice, APC!
|
||||||
if (count(explode("\n",$oids)) != 1)
|
if (count(explode("\n",$oids)) != 1)
|
||||||
{
|
{
|
||||||
$descr = "Phase $phase";
|
$descr = "Phase $phase";
|
||||||
@@ -48,7 +48,7 @@ if ($device['os'] == "apc")
|
|||||||
unset($oids);
|
unset($oids);
|
||||||
|
|
||||||
#v2 firmware- first bank is total, v3 firmware, 3rd bank is total
|
#v2 firmware- first bank is total, v3 firmware, 3rd bank is total
|
||||||
$oids = snmp_walk($device, "rPDULoadBankConfigIndex", "-OsqnU", "PowerNet-MIB"); # should work with firmware v2 and v3
|
$oids = snmp_walk($device, "rPDULoadBankConfigIndex", "-OsqnU", "PowerNet-MIB"); # should work with firmware v2 and v3
|
||||||
if ($oids)
|
if ($oids)
|
||||||
{
|
{
|
||||||
echo("APC PowerNet-MIB Banks ");
|
echo("APC PowerNet-MIB Banks ");
|
||||||
@@ -83,11 +83,11 @@ if ($device['os'] == "apc")
|
|||||||
if ($index == "1") { $descr = "Bank Total"; }
|
if ($index == "1") { $descr = "Bank Total"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
$current_oid = "1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.".$index; #rPDULoadStatusLoad
|
$current_oid = "1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.".$index; #rPDULoadStatusLoad
|
||||||
$bank_oid = "1.3.6.1.4.1.318.1.1.12.2.3.1.1.5.".$index; #rPDULoadStatusBankNumber
|
$bank_oid = "1.3.6.1.4.1.318.1.1.12.2.3.1.1.5.".$index; #rPDULoadStatusBankNumber
|
||||||
$limit_oid = "1.3.6.1.4.1.318.1.1.12.2.4.1.1.4.".$index; #rPDULoadBankConfigOverloadThreshold
|
$limit_oid = "1.3.6.1.4.1.318.1.1.12.2.4.1.1.4.".$index; #rPDULoadBankConfigOverloadThreshold
|
||||||
$lowlimit_oid = "1.3.6.1.4.1.318.1.1.12.2.4.1.1.2.".$index; #rPDULoadBankConfigLowLoadThreshold
|
$lowlimit_oid = "1.3.6.1.4.1.318.1.1.12.2.4.1.1.2.".$index; #rPDULoadBankConfigLowLoadThreshold
|
||||||
$warnlimit_oid = "1.3.6.1.4.1.318.1.1.12.2.4.1.1.3.".$index; #rPDULoadBankConfigNearOverloadThreshold
|
$warnlimit_oid = "1.3.6.1.4.1.318.1.1.12.2.4.1.1.3.".$index; #rPDULoadBankConfigNearOverloadThreshold
|
||||||
|
|
||||||
$bank = snmp_get($device, $bank_oid, "-Oqv", "");
|
$bank = snmp_get($device, $bank_oid, "-Oqv", "");
|
||||||
$current = snmp_get($device, $current_oid, "-Oqv", "") / $precision;
|
$current = snmp_get($device, $current_oid, "-Oqv", "") / $precision;
|
||||||
@@ -112,16 +112,16 @@ if ($device['os'] == "apc")
|
|||||||
if ($debug) { print_r($oids); }
|
if ($debug) { print_r($oids); }
|
||||||
$oids = trim($oids);
|
$oids = trim($oids);
|
||||||
if ($oids) echo("APC PowerNet-MIB ATS ");
|
if ($oids) echo("APC PowerNet-MIB ATS ");
|
||||||
$current_oid = "1.3.6.1.4.1.318.1.1.8.5.4.3.1.4.1.1.1"; #atsOutputCurrent
|
$current_oid = "1.3.6.1.4.1.318.1.1.8.5.4.3.1.4.1.1.1"; #atsOutputCurrent
|
||||||
$limit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.5.1"; #atsConfigPhaseOverLoadThreshold
|
$limit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.5.1"; #atsConfigPhaseOverLoadThreshold
|
||||||
$lowlimit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.3.1"; #atsConfigPhaseLowLoadThreshold
|
$lowlimit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.3.1"; #atsConfigPhaseLowLoadThreshold
|
||||||
$warnlimit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.4.1"; #atsConfigPhaseNearOverLoadThreshold
|
$warnlimit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.4.1"; #atsConfigPhaseNearOverLoadThreshold
|
||||||
$index = 1;
|
$index = 1;
|
||||||
|
|
||||||
$current = snmp_get($device, $current_oid, "-Oqv", "") / $precision;
|
$current = snmp_get($device, $current_oid, "-Oqv", "") / $precision;
|
||||||
$limit = snmp_get($device, $limit_oid, "-Oqv", ""); # No / $precision here! Nice, APC!
|
$limit = snmp_get($device, $limit_oid, "-Oqv", ""); # No / $precision here! Nice, APC!
|
||||||
$lowlimit = snmp_get($device, $lowlimit_oid, "-Oqv", ""); # No / $precision here! Nice, APC!
|
$lowlimit = snmp_get($device, $lowlimit_oid, "-Oqv", ""); # No / $precision here! Nice, APC!
|
||||||
$warnlimit = snmp_get($device, $warnlimit_oid, "-Oqv", ""); # No / $precision here! Nice, APC!
|
$warnlimit = snmp_get($device, $warnlimit_oid, "-Oqv", ""); # No / $precision here! Nice, APC!
|
||||||
$descr = "Output Feed";
|
$descr = "Output Feed";
|
||||||
|
|
||||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, $warnlimit, $limit, $current);
|
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, $warnlimit, $limit, $current);
|
||||||
|
@@ -11,7 +11,7 @@ if ($device['os'] == 'sentry3')
|
|||||||
# These PDUs may have > 1 "tower" accessible via a single management interface
|
# These PDUs may have > 1 "tower" accessible via a single management interface
|
||||||
$tower_count = snmp_get($device,"systemTowerCount.0", "-Ovq", "Sentry3-MIB");
|
$tower_count = snmp_get($device,"systemTowerCount.0", "-Ovq", "Sentry3-MIB");
|
||||||
$towers=1;
|
$towers=1;
|
||||||
while($towers <= $tower_count) {
|
while ($towers <= $tower_count) {
|
||||||
|
|
||||||
#################################
|
#################################
|
||||||
# Check for Infeeds
|
# Check for Infeeds
|
||||||
@@ -107,7 +107,7 @@ if ($device['os'] == 'sentry3')
|
|||||||
|
|
||||||
$towers++;
|
$towers++;
|
||||||
|
|
||||||
} // while($towers <= $tower_count)
|
} // while ($towers <= $tower_count)
|
||||||
|
|
||||||
unset($towers);
|
unset($towers);
|
||||||
}
|
}
|
||||||
|
@@ -19,21 +19,21 @@ if ($device['os'] == "ironware")
|
|||||||
$fdp_if_array = $fdp_array[$key];
|
$fdp_if_array = $fdp_array[$key];
|
||||||
foreach (array_keys($fdp_if_array) as $entry_key)
|
foreach (array_keys($fdp_if_array) as $entry_key)
|
||||||
{
|
{
|
||||||
$fdp = $fdp_if_array[$entry_key];
|
$fdp = $fdp_if_array[$entry_key];
|
||||||
$remote_device_id = @mysql_result(mysql_query("SELECT `device_id` FROM `devices` WHERE `sysName` = '".$fdp['snFdpCacheDeviceId']."' OR `hostname`='".$fdp['snFdpCacheDeviceId']."'"), 0);
|
$remote_device_id = @mysql_result(mysql_query("SELECT `device_id` FROM `devices` WHERE `sysName` = '".$fdp['snFdpCacheDeviceId']."' OR `hostname`='".$fdp['snFdpCacheDeviceId']."'"), 0);
|
||||||
|
|
||||||
if(!$remote_device_id)
|
if (!$remote_device_id)
|
||||||
{
|
{
|
||||||
$remote_device_id = discover_new_device($fdp['snFdpCacheDeviceId']);
|
$remote_device_id = discover_new_device($fdp['snFdpCacheDeviceId']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($remote_device_id)
|
if ($remote_device_id)
|
||||||
{
|
{
|
||||||
$if = $fdp['snFdpCacheDevicePort'];
|
$if = $fdp['snFdpCacheDevicePort'];
|
||||||
$remote_interface_id = @mysql_result(mysql_query("SELECT interface_id FROM `ports` WHERE (`ifDescr` = '$if' OR `ifName`='$if') AND `device_id` = '".$remote_device_id."'"),0);
|
$remote_interface_id = @mysql_result(mysql_query("SELECT interface_id FROM `ports` WHERE (`ifDescr` = '$if' OR `ifName`='$if') AND `device_id` = '".$remote_device_id."'"),0);
|
||||||
} else { $remote_interface_id = "0"; }
|
} else { $remote_interface_id = "0"; }
|
||||||
|
|
||||||
discover_link($interface['interface_id'], $fdp['snFdpCacheVendorId'], $remote_interface_id, $fdp['snFdpCacheDeviceId'], $fdp['snFdpCacheDevicePort'], $fdp['snFdpCachePlatform'], $fdp['snFdpCacheVersion']);
|
discover_link($interface['interface_id'], $fdp['snFdpCacheVendorId'], $remote_interface_id, $fdp['snFdpCacheDeviceId'], $fdp['snFdpCacheDevicePort'], $fdp['snFdpCachePlatform'], $fdp['snFdpCacheVersion']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,7 @@ if ($cdp_array)
|
|||||||
$cdp = $cdp_if_array[$entry_key];
|
$cdp = $cdp_if_array[$entry_key];
|
||||||
$remote_device_id = @mysql_result(mysql_query("SELECT `device_id` FROM `devices` WHERE `sysName` = '".$cdp['cdpCacheDeviceId']."' OR `hostname`='".$cdp['cdpCacheDeviceId']."'"), 0);
|
$remote_device_id = @mysql_result(mysql_query("SELECT `device_id` FROM `devices` WHERE `sysName` = '".$cdp['cdpCacheDeviceId']."' OR `hostname`='".$cdp['cdpCacheDeviceId']."'"), 0);
|
||||||
|
|
||||||
if(!$remote_device_id)
|
if (!$remote_device_id)
|
||||||
{
|
{
|
||||||
$remote_device_id = discover_new_device($cdp['cdpCacheDeviceId']);
|
$remote_device_id = discover_new_device($cdp['cdpCacheDeviceId']);
|
||||||
}
|
}
|
||||||
@@ -98,26 +98,26 @@ if ($lldp_array)
|
|||||||
$lldp_instance = $lldp_if_array[$entry_key];
|
$lldp_instance = $lldp_if_array[$entry_key];
|
||||||
foreach (array_keys($lldp_instance) as $entry_instance)
|
foreach (array_keys($lldp_instance) as $entry_instance)
|
||||||
{
|
{
|
||||||
$lldp = $lldp_instance[$entry_instance];
|
$lldp = $lldp_instance[$entry_instance];
|
||||||
$remote_device_id = @mysql_result(mysql_query("SELECT `device_id` FROM `devices` WHERE `sysName` = '".$lldp['lldpRemSysName']."' OR `hostname`='".$lldp['lldpRemSysName']."'"), 0);
|
$remote_device_id = @mysql_result(mysql_query("SELECT `device_id` FROM `devices` WHERE `sysName` = '".$lldp['lldpRemSysName']."' OR `hostname`='".$lldp['lldpRemSysName']."'"), 0);
|
||||||
|
|
||||||
if(!$remote_device_id)
|
if (!$remote_device_id)
|
||||||
{
|
{
|
||||||
$remote_device_id = discover_new_device($lldp['lldpRemSysName']);
|
$remote_device_id = discover_new_device($lldp['lldpRemSysName']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($remote_device_id)
|
if ($remote_device_id)
|
||||||
{
|
{
|
||||||
$if = $lldp['lldpRemPortDesc']; $id = $lldp['lldpRemPortId'];
|
$if = $lldp['lldpRemPortDesc']; $id = $lldp['lldpRemPortId'];
|
||||||
$remote_interface_id = @mysql_result(mysql_query("SELECT interface_id FROM `ports` WHERE (`ifDescr` = '$if' OR `ifName`='$if' OR `ifDescr`= '$id' OR `ifName`='$id') AND `device_id` = '".$remote_device_id."'"),0);
|
$remote_interface_id = @mysql_result(mysql_query("SELECT interface_id FROM `ports` WHERE (`ifDescr` = '$if' OR `ifName`='$if' OR `ifDescr`= '$id' OR `ifName`='$id') AND `device_id` = '".$remote_device_id."'"),0);
|
||||||
} else {
|
} else {
|
||||||
$remote_interface_id = "0";
|
$remote_interface_id = "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_numeric($interface['interface_id']) && isset($lldp['lldpRemSysName']) && isset($lldp['lldpRemPortId']))
|
if (is_numeric($interface['interface_id']) && isset($lldp['lldpRemSysName']) && isset($lldp['lldpRemPortId']))
|
||||||
{
|
{
|
||||||
discover_link($interface['interface_id'], 'lldp', $remote_interface_id, $lldp['lldpRemSysName'], $lldp['lldpRemPortId'], NULL, $lldp['lldpRemSysDesc']);
|
discover_link($interface['interface_id'], 'lldp', $remote_interface_id, $lldp['lldpRemSysName'], $lldp['lldpRemPortId'], NULL, $lldp['lldpRemSysDesc']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,20 +15,20 @@
|
|||||||
|
|
||||||
foreach ($entity_array as $entPhysicalIndex => $entry) {
|
foreach ($entity_array as $entPhysicalIndex => $entry) {
|
||||||
|
|
||||||
$entPhysicalDescr = $entry['entPhysicalDescr'];
|
$entPhysicalDescr = $entry['entPhysicalDescr'];
|
||||||
$entPhysicalContainedIn = $entry['entPhysicalContainedIn'];
|
$entPhysicalContainedIn = $entry['entPhysicalContainedIn'];
|
||||||
$entPhysicalClass = $entry['entPhysicalClass'];
|
$entPhysicalClass = $entry['entPhysicalClass'];
|
||||||
$entPhysicalName = $entry['entPhysicalName'];
|
$entPhysicalName = $entry['entPhysicalName'];
|
||||||
$entPhysicalSerialNum = $entry['entPhysicalSerialNum'];
|
$entPhysicalSerialNum = $entry['entPhysicalSerialNum'];
|
||||||
$entPhysicalModelName = $entry['entPhysicalModelName'];
|
$entPhysicalModelName = $entry['entPhysicalModelName'];
|
||||||
$entPhysicalMfgName = $entry['entPhysicalMfgName'];
|
$entPhysicalMfgName = $entry['entPhysicalMfgName'];
|
||||||
$entPhysicalVendorType = $entry['entPhysicalVendorType'];
|
$entPhysicalVendorType = $entry['entPhysicalVendorType'];
|
||||||
$entPhysicalParentRelPos = $entry['entPhysicalParentRelPos'];
|
$entPhysicalParentRelPos = $entry['entPhysicalParentRelPos'];
|
||||||
$entPhysicalHardwareRev = $entry['entPhysicalHardwareRev'];
|
$entPhysicalHardwareRev = $entry['entPhysicalHardwareRev'];
|
||||||
$entPhysicalFirmwareRev = $entry['entPhysicalFirmwareRev'];
|
$entPhysicalFirmwareRev = $entry['entPhysicalFirmwareRev'];
|
||||||
$entPhysicalSoftwareRev = $entry['entPhysicalSoftwareRev'];
|
$entPhysicalSoftwareRev = $entry['entPhysicalSoftwareRev'];
|
||||||
$entPhysicalIsFRU = $entry['entPhysicalIsFRU'];
|
$entPhysicalIsFRU = $entry['entPhysicalIsFRU'];
|
||||||
$entPhysicalAlias = $entry['entPhysicalAlias'];
|
$entPhysicalAlias = $entry['entPhysicalAlias'];
|
||||||
$entPhysicalAssetID = $entry['entPhysicalAssetID'];
|
$entPhysicalAssetID = $entry['entPhysicalAssetID'];
|
||||||
|
|
||||||
if (isset($entity_array['$entPhysicalIndex']['0']['entAliasMappingIdentifier'])) { $ifIndex = $entity_array['$entPhysicalIndex']['0']['entAliasMappingIdentifier']; }
|
if (isset($entity_array['$entPhysicalIndex']['0']['entAliasMappingIdentifier'])) { $ifIndex = $entity_array['$entPhysicalIndex']['0']['entAliasMappingIdentifier']; }
|
||||||
|
@@ -15,7 +15,7 @@ function discover_new_device($hostname)
|
|||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
if($config['autodiscovery']['xdp']) {
|
if ($config['autodiscovery']['xdp']) {
|
||||||
if ( isDomainResolves($hostname . "." . $config['mydomain']) ) {
|
if ( isDomainResolves($hostname . "." . $config['mydomain']) ) {
|
||||||
$dst_host = $hostname . "." . $config['mydomain'];
|
$dst_host = $hostname . "." . $config['mydomain'];
|
||||||
} else {
|
} else {
|
||||||
@@ -26,7 +26,7 @@ function discover_new_device($hostname)
|
|||||||
if ( match_network($config['nets'], $ip) )
|
if ( match_network($config['nets'], $ip) )
|
||||||
{
|
{
|
||||||
$remote_device_id = addHost ($dst_host, NULL, "v2c");
|
$remote_device_id = addHost ($dst_host, NULL, "v2c");
|
||||||
if($remote_device_id) {
|
if ($remote_device_id) {
|
||||||
$remote_device = device_by_id_cache($remote_device_id, 1);
|
$remote_device = device_by_id_cache($remote_device_id, 1);
|
||||||
echo("+[".$remote_device['hostname']."(".$remote_device['device_id'].")]");
|
echo("+[".$remote_device['hostname']."(".$remote_device['device_id'].")]");
|
||||||
discover_device($remote_device);
|
discover_device($remote_device);
|
||||||
@@ -51,10 +51,10 @@ function discover_device($device, $options = NULL)
|
|||||||
|
|
||||||
echo($device['hostname'] . " ".$device['device_id']." ".$device['os']." ");
|
echo($device['hostname'] . " ".$device['device_id']." ".$device['os']." ");
|
||||||
|
|
||||||
if($device['os'] == 'generic') // verify if OS has changed from generic
|
if ($device['os'] == 'generic') // verify if OS has changed from generic
|
||||||
{
|
{
|
||||||
$device['os']= getHostOS($device);
|
$device['os']= getHostOS($device);
|
||||||
if($device['os'] != 'generic')
|
if ($device['os'] != 'generic')
|
||||||
{
|
{
|
||||||
echo "Device os was updated to".$device['os']."!";
|
echo "Device os was updated to".$device['os']."!";
|
||||||
dbUpdate(array('os' => $device['os']), 'devices', '`device_id` = ?', array($device['device_id']));
|
dbUpdate(array('os' => $device['os']), 'devices', '`device_id` = ?', array($device['device_id']));
|
||||||
@@ -343,7 +343,7 @@ function discover_storage(&$valid, $device, $index, $type, $mib, $descr, $size,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$updated = dbUpdate(array('storage_descr' => $descr, 'storage_type' => $type, 'storage_units' => $units, 'storage_size' => $size), 'storage', '`device_id` = ? AND `storage_index` = ? AND `storage_mib` = ?', array($device['device_id'], $index, $mib));
|
$updated = dbUpdate(array('storage_descr' => $descr, 'storage_type' => $type, 'storage_units' => $units, 'storage_size' => $size), 'storage', '`device_id` = ? AND `storage_index` = ? AND `storage_mib` = ?', array($device['device_id'], $index, $mib));
|
||||||
if($updated) { echo("U"); } else { echo("."); }
|
if ($updated) { echo("U"); } else { echo("."); }
|
||||||
}
|
}
|
||||||
$valid[$mib][$index] = 1;
|
$valid[$mib][$index] = 1;
|
||||||
}
|
}
|
||||||
|
@@ -7,12 +7,12 @@ if (!$os)
|
|||||||
|
|
||||||
## Specific Linux-derivatives
|
## Specific Linux-derivatives
|
||||||
|
|
||||||
if($os == "linux") {
|
if ($os == "linux") {
|
||||||
|
|
||||||
## Check for QNAP Systems TurboNAS
|
## Check for QNAP Systems TurboNAS
|
||||||
$entPhysicalMfgName = snmp_get($device, "ENTITY-MIB::entPhysicalMfgName.1", "-Osqnv");
|
$entPhysicalMfgName = snmp_get($device, "ENTITY-MIB::entPhysicalMfgName.1", "-Osqnv");
|
||||||
|
|
||||||
if(strpos($entPhysicalMfgName, "QNAP") !== FALSE) { $os = "qnap";}
|
if (strpos($entPhysicalMfgName, "QNAP") !== FALSE) { $os = "qnap";}
|
||||||
elseif(strstr($sysObjectId, ".1.3.6.1.4.1.5528.100.20.10.2014")) { $os = "netbotz"; }
|
elseif(strstr($sysObjectId, ".1.3.6.1.4.1.5528.100.20.10.2014")) { $os = "netbotz"; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -4,7 +4,7 @@ echo("Port Stack: ");
|
|||||||
|
|
||||||
$sql = "SELECT * FROM `ports_stack` WHERE `device_id` = '".$device['device_id']."'";
|
$sql = "SELECT * FROM `ports_stack` WHERE `device_id` = '".$device['device_id']."'";
|
||||||
$query = mysql_query($sql);
|
$query = mysql_query($sql);
|
||||||
while($entry = mysql_fetch_assoc($query))
|
while ($entry = mysql_fetch_assoc($query))
|
||||||
{
|
{
|
||||||
$stack_db_array[$entry['interface_id_high']][$entry['interface_id_low']]['ifStackStatus'] = $entry['ifStackStatus'];
|
$stack_db_array[$entry['interface_id_high']][$entry['interface_id_low']]['ifStackStatus'] = $entry['ifStackStatus'];
|
||||||
}
|
}
|
||||||
@@ -16,21 +16,21 @@ foreach($stack_poll_array as $interface_id_high => $entry_high)
|
|||||||
foreach($entry_high as $interface_id_low => $entry_low)
|
foreach($entry_high as $interface_id_low => $entry_low)
|
||||||
{
|
{
|
||||||
$ifStackStatus = $entry_low['ifStackStatus'];
|
$ifStackStatus = $entry_low['ifStackStatus'];
|
||||||
if(isset($stack_db_array[$interface_id_high][$interface_id_low]))
|
if (isset($stack_db_array[$interface_id_high][$interface_id_low]))
|
||||||
{
|
{
|
||||||
if($stack_db_array[$interface_id_high][$interface_id_low]['ifStackStatus'] == $ifStackStatus)
|
if ($stack_db_array[$interface_id_high][$interface_id_low]['ifStackStatus'] == $ifStackStatus)
|
||||||
{
|
{
|
||||||
echo(".");
|
echo(".");
|
||||||
} else {
|
} else {
|
||||||
mysql_query("UPDATE `ports_stack` SET `ifStackStatus` = '".$ifStackStatus."' WHERE `device_id` = '".$device['device_id']."' AND `interface_id_high` = '".$interface_id_high."' AND `interface_id_low` = '".$interface_id_low."'");
|
mysql_query("UPDATE `ports_stack` SET `ifStackStatus` = '".$ifStackStatus."' WHERE `device_id` = '".$device['device_id']."' AND `interface_id_high` = '".$interface_id_high."' AND `interface_id_low` = '".$interface_id_low."'");
|
||||||
echo("U");
|
echo("U");
|
||||||
if($debug) { echo(mysql_error()); }
|
if ($debug) { echo(mysql_error()); }
|
||||||
}
|
}
|
||||||
unset($stack_db_array[$interface_id_high][$interface_id_low]);
|
unset($stack_db_array[$interface_id_high][$interface_id_low]);
|
||||||
} else {
|
} else {
|
||||||
mysql_query("INSERT INTO `ports_stack` (`device_id`,`interface_id_high`,`interface_id_low`,`ifStackStatus`) VALUES ('".$device['device_id']."','".$interface_id_high."','".$interface_id_low."','".$ifStackStatus."')");
|
mysql_query("INSERT INTO `ports_stack` (`device_id`,`interface_id_high`,`interface_id_low`,`ifStackStatus`) VALUES ('".$device['device_id']."','".$interface_id_high."','".$interface_id_low."','".$ifStackStatus."')");
|
||||||
echo("+");
|
echo("+");
|
||||||
if($debug) { echo(mysql_error()); }
|
if ($debug) { echo(mysql_error()); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -37,7 +37,7 @@ if (is_array($hrDevice_array))
|
|||||||
echo("Moved RRD ");
|
echo("Moved RRD ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if($device['os'] == "arista-eos" && $index == "1") { unset($descr); }
|
if ($device['os'] == "arista-eos" && $index == "1") { unset($descr); }
|
||||||
|
|
||||||
if (isset($descr) && $descr != "An electronic chip that makes the computer work.")
|
if (isset($descr) && $descr != "An electronic chip that makes the computer work.")
|
||||||
{
|
{
|
||||||
|
@@ -14,11 +14,11 @@ if ($device['os'] == "ios" || $device['os_group'] == "ios")
|
|||||||
|
|
||||||
if (isset($entry['cpmCPUTotal5minRev']))
|
if (isset($entry['cpmCPUTotal5minRev']))
|
||||||
{
|
{
|
||||||
$usage_oid = ".1.3.6.1.4.1.9.9.109.1.1.1.1.8." . $index;
|
$usage_oid = ".1.3.6.1.4.1.9.9.109.1.1.1.1.8." . $index;
|
||||||
$usage = $entry['cpmCPUTotal5minRev'];
|
$usage = $entry['cpmCPUTotal5minRev'];
|
||||||
} elseif (isset($entry['cpmCPUTotal5min'])) {
|
} elseif (isset($entry['cpmCPUTotal5min'])) {
|
||||||
$usage_oid = ".1.3.6.1.4.1.9.9.109.1.1.1.1.5." . $index;
|
$usage_oid = ".1.3.6.1.4.1.9.9.109.1.1.1.1.5." . $index;
|
||||||
$usage = $entry['cpmCPUTotal5min'];
|
$usage = $entry['cpmCPUTotal5min'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($entPhysicalIndex) {
|
if ($entPhysicalIndex) {
|
||||||
@@ -32,16 +32,16 @@ if ($device['os'] == "ios" || $device['os_group'] == "ios")
|
|||||||
|
|
||||||
if (is_file($old_rrd))
|
if (is_file($old_rrd))
|
||||||
{
|
{
|
||||||
rename($old_rrd,$new_rrd);
|
rename($old_rrd,$new_rrd);
|
||||||
if ($debug) { echo("$old_rrd $new_rrd"); }
|
if ($debug) { echo("$old_rrd $new_rrd"); }
|
||||||
echo("Moved RRD ");
|
echo("Moved RRD ");
|
||||||
}
|
}
|
||||||
|
|
||||||
#echo("|".$descr."|");
|
#echo("|".$descr."|");
|
||||||
|
|
||||||
if (!strstr($descr, "No") && !strstr($usage, "No") && $descr != "")
|
if (!strstr($descr, "No") && !strstr($usage, "No") && $descr != "")
|
||||||
{
|
{
|
||||||
discover_processor($valid['processor'], $device, $usage_oid, $index, "cpm", $descr, "1", $entry['juniSystemModuleCpuUtilPct'], $entPhysicalIndex, NULL);
|
discover_processor($valid['processor'], $device, $usage_oid, $index, "cpm", $descr, "1", $entry['juniSystemModuleCpuUtilPct'], $entPhysicalIndex, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,7 +15,7 @@ if ($device['os'] == "ironware" || $device['os_group'] == "ironware")
|
|||||||
{
|
{
|
||||||
$usage_oid = ".1.3.6.1.4.1.1991.1.1.2.11.1.1.6." . $index;
|
$usage_oid = ".1.3.6.1.4.1.1991.1.1.2.11.1.1.6." . $index;
|
||||||
$usage = $entry['snAgentCpuUtil100thPercent'];
|
$usage = $entry['snAgentCpuUtil100thPercent'];
|
||||||
$precision = 100;
|
$precision = 100;
|
||||||
} elseif ($entry['snAgentCpuUtilValue']) {
|
} elseif ($entry['snAgentCpuUtilValue']) {
|
||||||
$usage_oid = ".1.3.6.1.4.1.1991.1.1.2.11.1.1.4." . $index;
|
$usage_oid = ".1.3.6.1.4.1.1991.1.1.2.11.1.1.4." . $index;
|
||||||
$usage = $entry['snAgentCpuUtilValue'];
|
$usage = $entry['snAgentCpuUtilValue'];
|
||||||
|
@@ -3,15 +3,15 @@
|
|||||||
if ($device['os'] == "cometsystem-p85xx")
|
if ($device['os'] == "cometsystem-p85xx")
|
||||||
{
|
{
|
||||||
$regexp = '/
|
$regexp = '/
|
||||||
\.1\.3\.6\.1\.4\.1\.22626\.1\.5\.2\.
|
\.1\.3\.6\.1\.4\.1\.22626\.1\.5\.2\.
|
||||||
(?P<id>\d+)
|
(?P<id>\d+)
|
||||||
\.
|
\.
|
||||||
(?:
|
(?:
|
||||||
1\.0 (?P<name>.*)|
|
1\.0 (?P<name>.*)|
|
||||||
3\.0 (?P<temp_intval>.*)|
|
3\.0 (?P<temp_intval>.*)|
|
||||||
5\.0 (?P<limit_high>.*)|
|
5\.0 (?P<limit_high>.*)|
|
||||||
6\.0 (?P<limit_low>.*)|
|
6\.0 (?P<limit_low>.*)|
|
||||||
)
|
)
|
||||||
/x';
|
/x';
|
||||||
|
|
||||||
$oids = snmp_walk($device, ".1.3.6.1.4.1.22626.1.5.2", "-OsqnU", "");
|
$oids = snmp_walk($device, ".1.3.6.1.4.1.22626.1.5.2", "-OsqnU", "");
|
||||||
|
@@ -30,7 +30,7 @@ if ($device['os'] == "linux")
|
|||||||
$descr = snmp_get($device, $descr_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB");
|
$descr = snmp_get($device, $descr_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB");
|
||||||
$current = snmp_get($device, $volt_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB") / $divisor;
|
$current = snmp_get($device, $volt_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB") / $divisor;
|
||||||
$limit = snmp_get($device, $limit_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB") / $divisor;
|
$limit = snmp_get($device, $limit_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB") / $divisor;
|
||||||
$lowlimit = snmp_get($device, $lowlimit_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB") / $divisor;
|
$lowlimit = snmp_get($device, $lowlimit_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB") / $divisor;
|
||||||
$monitor = snmp_get($device, $monitor_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB");
|
$monitor = snmp_get($device, $monitor_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB");
|
||||||
$descr = trim(str_ireplace("Voltage", "", $descr));
|
$descr = trim(str_ireplace("Voltage", "", $descr));
|
||||||
|
|
||||||
|
@@ -22,9 +22,9 @@ function external_exec($command)
|
|||||||
{
|
{
|
||||||
global $debug;
|
global $debug;
|
||||||
|
|
||||||
if($debug) { echo($command."\n"); }
|
if ($debug) { echo($command."\n"); }
|
||||||
$output = shell_exec($command);
|
$output = shell_exec($command);
|
||||||
if($debug) { echo($output."\n"); }
|
if ($debug) { echo($output."\n"); }
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
@@ -325,6 +325,7 @@ function isSNMPable($device)
|
|||||||
function isPingable($hostname)
|
function isPingable($hostname)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$status = shell_exec($config['fping'] . " $hostname 2>/dev/null");
|
$status = shell_exec($config['fping'] . " $hostname 2>/dev/null");
|
||||||
if (strstr($status, "alive"))
|
if (strstr($status, "alive"))
|
||||||
{
|
{
|
||||||
@@ -348,6 +349,7 @@ function is_odd($number)
|
|||||||
function isValidInterface($if)
|
function isValidInterface($if)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$if = strtolower($if);
|
$if = strtolower($if);
|
||||||
$nullintf = 0;
|
$nullintf = 0;
|
||||||
foreach ($config['bad_if'] as $bi)
|
foreach ($config['bad_if'] as $bi)
|
||||||
@@ -644,7 +646,7 @@ function is_port_valid($port, $device)
|
|||||||
if (strstr($if, $bi))
|
if (strstr($if, $bi))
|
||||||
{
|
{
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
if($debug) { echo("ignored : $bi : $if"); }
|
if ($debug) { echo("ignored : $bi : $if"); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (is_array($config['bad_if_regexp']))
|
if (is_array($config['bad_if_regexp']))
|
||||||
@@ -654,7 +656,7 @@ function is_port_valid($port, $device)
|
|||||||
if (preg_match($bi ."i", $if))
|
if (preg_match($bi ."i", $if))
|
||||||
{
|
{
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
if($debug) { echo("ignored : $bi : ".$if); }
|
if ($debug) { echo("ignored : $bi : ".$if); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -25,97 +25,97 @@ for ($a=0,$n=count($data);$a<$n;$a++)
|
|||||||
if (!is_file($mysql_rrd))
|
if (!is_file($mysql_rrd))
|
||||||
{
|
{
|
||||||
rrdtool_create ($mysql_rrd, "--step 300 \
|
rrdtool_create ($mysql_rrd, "--step 300 \
|
||||||
DS:IDBLBSe:GAUGE:600:0:125000000000 \
|
DS:IDBLBSe:GAUGE:600:0:125000000000 \
|
||||||
DS:IBLFh:DERIVE:600:0:125000000000 \
|
DS:IBLFh:DERIVE:600:0:125000000000 \
|
||||||
DS:IBLWn:DERIVE:600:0:125000000000 \
|
DS:IBLWn:DERIVE:600:0:125000000000 \
|
||||||
DS:SRows:DERIVE:600:0:125000000000 \
|
DS:SRows:DERIVE:600:0:125000000000 \
|
||||||
DS:SRange:DERIVE:600:0:125000000000 \
|
DS:SRange:DERIVE:600:0:125000000000 \
|
||||||
DS:SMPs:DERIVE:600:0:125000000000 \
|
DS:SMPs:DERIVE:600:0:125000000000 \
|
||||||
DS:SScan:DERIVE:600:0:125000000000 \
|
DS:SScan:DERIVE:600:0:125000000000 \
|
||||||
DS:IBIRd:DERIVE:600:0:125000000000 \
|
DS:IBIRd:DERIVE:600:0:125000000000 \
|
||||||
DS:IBIWr:DERIVE:600:0:125000000000 \
|
DS:IBIWr:DERIVE:600:0:125000000000 \
|
||||||
DS:IBILg:DERIVE:600:0:125000000000 \
|
DS:IBILg:DERIVE:600:0:125000000000 \
|
||||||
DS:IBIFSc:DERIVE:600:0:125000000000 \
|
DS:IBIFSc:DERIVE:600:0:125000000000 \
|
||||||
DS:IDBRDd:DERIVE:600:0:125000000000 \
|
DS:IDBRDd:DERIVE:600:0:125000000000 \
|
||||||
DS:IDBRId:DERIVE:600:0:125000000000 \
|
DS:IDBRId:DERIVE:600:0:125000000000 \
|
||||||
DS:IDBRRd:DERIVE:600:0:125000000000 \
|
DS:IDBRRd:DERIVE:600:0:125000000000 \
|
||||||
DS:IDBRUd:DERIVE:600:0:125000000000 \
|
DS:IDBRUd:DERIVE:600:0:125000000000 \
|
||||||
DS:IBRd:DERIVE:600:0:125000000000 \
|
DS:IBRd:DERIVE:600:0:125000000000 \
|
||||||
DS:IBCd:DERIVE:600:0:125000000000 \
|
DS:IBCd:DERIVE:600:0:125000000000 \
|
||||||
DS:IBWr:DERIVE:600:0:125000000000 \
|
DS:IBWr:DERIVE:600:0:125000000000 \
|
||||||
DS:TLIe:DERIVE:600:0:125000000000 \
|
DS:TLIe:DERIVE:600:0:125000000000 \
|
||||||
DS:TLWd:DERIVE:600:0:125000000000 \
|
DS:TLWd:DERIVE:600:0:125000000000 \
|
||||||
DS:IBPse:GAUGE:600:0:125000000000 \
|
DS:IBPse:GAUGE:600:0:125000000000 \
|
||||||
DS:IBPDBp:GAUGE:600:0:125000000000 \
|
DS:IBPDBp:GAUGE:600:0:125000000000 \
|
||||||
DS:IBPFe:GAUGE:600:0:125000000000 \
|
DS:IBPFe:GAUGE:600:0:125000000000 \
|
||||||
DS:IBPMps:GAUGE:600:0:125000000000 \
|
DS:IBPMps:GAUGE:600:0:125000000000 \
|
||||||
DS:TOC:GAUGE:600:0:125000000000 \
|
DS:TOC:GAUGE:600:0:125000000000 \
|
||||||
DS:OFs:GAUGE:600:0:125000000000 \
|
DS:OFs:GAUGE:600:0:125000000000 \
|
||||||
DS:OTs:GAUGE:600:0:125000000000 \
|
DS:OTs:GAUGE:600:0:125000000000 \
|
||||||
DS:OdTs:GAUGE:600:0:125000000000 \
|
DS:OdTs:GAUGE:600:0:125000000000 \
|
||||||
DS:IBSRs:DERIVE:600:0:125000000000 \
|
DS:IBSRs:DERIVE:600:0:125000000000 \
|
||||||
DS:IBSWs:DERIVE:600:0:125000000000 \
|
DS:IBSWs:DERIVE:600:0:125000000000 \
|
||||||
DS:IBOWs:DERIVE:600:0:125000000000 \
|
DS:IBOWs:DERIVE:600:0:125000000000 \
|
||||||
DS:QCs:GAUGE:600:0:125000000000 \
|
DS:QCs:GAUGE:600:0:125000000000 \
|
||||||
DS:QCeFy:GAUGE:600:0:125000000000 \
|
DS:QCeFy:GAUGE:600:0:125000000000 \
|
||||||
DS:MaCs:GAUGE:600:0:125000000000 \
|
DS:MaCs:GAUGE:600:0:125000000000 \
|
||||||
DS:MUCs:GAUGE:600:0:125000000000 \
|
DS:MUCs:GAUGE:600:0:125000000000 \
|
||||||
DS:ACs:DERIVE:600:0:125000000000 \
|
DS:ACs:DERIVE:600:0:125000000000 \
|
||||||
DS:AdCs:DERIVE:600:0:125000000000 \
|
DS:AdCs:DERIVE:600:0:125000000000 \
|
||||||
DS:TCd:GAUGE:600:0:125000000000 \
|
DS:TCd:GAUGE:600:0:125000000000 \
|
||||||
DS:Cs:DERIVE:600:0:125000000000 \
|
DS:Cs:DERIVE:600:0:125000000000 \
|
||||||
DS:IBTNx:DERIVE:600:0:125000000000 \
|
DS:IBTNx:DERIVE:600:0:125000000000 \
|
||||||
DS:KRRs:DERIVE:600:0:125000000000 \
|
DS:KRRs:DERIVE:600:0:125000000000 \
|
||||||
DS:KRs:DERIVE:600:0:125000000000 \
|
DS:KRs:DERIVE:600:0:125000000000 \
|
||||||
DS:KWR:DERIVE:600:0:125000000000 \
|
DS:KWR:DERIVE:600:0:125000000000 \
|
||||||
DS:KWs:DERIVE:600:0:125000000000 \
|
DS:KWs:DERIVE:600:0:125000000000 \
|
||||||
DS:QCQICe:DERIVE:600:0:125000000000 \
|
DS:QCQICe:DERIVE:600:0:125000000000 \
|
||||||
DS:QCHs:DERIVE:600:0:125000000000 \
|
DS:QCHs:DERIVE:600:0:125000000000 \
|
||||||
DS:QCIs:DERIVE:600:0:125000000000 \
|
DS:QCIs:DERIVE:600:0:125000000000 \
|
||||||
DS:QCNCd:DERIVE:600:0:125000000000 \
|
DS:QCNCd:DERIVE:600:0:125000000000 \
|
||||||
DS:QCLMPs:DERIVE:600:0:125000000000 \
|
DS:QCLMPs:DERIVE:600:0:125000000000 \
|
||||||
DS:CTMPDTs:DERIVE:600:0:125000000000 \
|
DS:CTMPDTs:DERIVE:600:0:125000000000 \
|
||||||
DS:CTMPTs:DERIVE:600:0:125000000000 \
|
DS:CTMPTs:DERIVE:600:0:125000000000 \
|
||||||
DS:CTMPFs:DERIVE:600:0:125000000000 \
|
DS:CTMPFs:DERIVE:600:0:125000000000 \
|
||||||
DS:IBIIs:DERIVE:600:0:125000000000 \
|
DS:IBIIs:DERIVE:600:0:125000000000 \
|
||||||
DS:IBIMRd:DERIVE:600:0:125000000000 \
|
DS:IBIMRd:DERIVE:600:0:125000000000 \
|
||||||
DS:IBIMs:DERIVE:600:0:125000000000 \
|
DS:IBIMs:DERIVE:600:0:125000000000 \
|
||||||
DS:IBILog:DERIVE:602:0:125000000000 \
|
DS:IBILog:DERIVE:602:0:125000000000 \
|
||||||
DS:IBISc:DERIVE:602:0:125000000000 \
|
DS:IBISc:DERIVE:602:0:125000000000 \
|
||||||
DS:IBIFLg:DERIVE:600:0:125000000000 \
|
DS:IBIFLg:DERIVE:600:0:125000000000 \
|
||||||
DS:IBFBl:DERIVE:600:0:125000000000 \
|
DS:IBFBl:DERIVE:600:0:125000000000 \
|
||||||
DS:IBIIAo:DERIVE:600:0:125000000000 \
|
DS:IBIIAo:DERIVE:600:0:125000000000 \
|
||||||
DS:IBIAd:DERIVE:600:0:125000000000 \
|
DS:IBIAd:DERIVE:600:0:125000000000 \
|
||||||
DS:IBIAe:DERIVE:600:0:125000000000 \
|
DS:IBIAe:DERIVE:600:0:125000000000 \
|
||||||
DS:SFJn:DERIVE:600:0:125000000000 \
|
DS:SFJn:DERIVE:600:0:125000000000 \
|
||||||
DS:SFRJn:DERIVE:600:0:125000000000 \
|
DS:SFRJn:DERIVE:600:0:125000000000 \
|
||||||
DS:SRe:DERIVE:600:0:125000000000 \
|
DS:SRe:DERIVE:600:0:125000000000 \
|
||||||
DS:SRCk:DERIVE:600:0:125000000000 \
|
DS:SRCk:DERIVE:600:0:125000000000 \
|
||||||
DS:SSn:DERIVE:600:0:125000000000 \
|
DS:SSn:DERIVE:600:0:125000000000 \
|
||||||
DS:SQs:DERIVE:600:0:125000000000 \
|
DS:SQs:DERIVE:600:0:125000000000 \
|
||||||
DS:BRd:DERIVE:600:0:125000000000 \
|
DS:BRd:DERIVE:600:0:125000000000 \
|
||||||
DS:BSt:DERIVE:600:0:125000000000 \
|
DS:BSt:DERIVE:600:0:125000000000 \
|
||||||
DS:CDe:DERIVE:600:0:125000000000 \
|
DS:CDe:DERIVE:600:0:125000000000 \
|
||||||
DS:CIt:DERIVE:600:0:125000000000 \
|
DS:CIt:DERIVE:600:0:125000000000 \
|
||||||
DS:CISt:DERIVE:600:0:125000000000 \
|
DS:CISt:DERIVE:600:0:125000000000 \
|
||||||
DS:CLd:DERIVE:600:0:125000000000 \
|
DS:CLd:DERIVE:600:0:125000000000 \
|
||||||
DS:CRe:DERIVE:600:0:125000000000 \
|
DS:CRe:DERIVE:600:0:125000000000 \
|
||||||
DS:CRSt:DERIVE:600:0:125000000000 \
|
DS:CRSt:DERIVE:600:0:125000000000 \
|
||||||
DS:CSt:DERIVE:600:0:125000000000 \
|
DS:CSt:DERIVE:600:0:125000000000 \
|
||||||
DS:CUe:DERIVE:600:0:125000000000 \
|
DS:CUe:DERIVE:600:0:125000000000 \
|
||||||
DS:CUMi:DERIVE:600:0:125000000000 \
|
DS:CUMi:DERIVE:600:0:125000000000 \
|
||||||
RRA:AVERAGE:0.5:1:600 \
|
RRA:AVERAGE:0.5:1:600 \
|
||||||
RRA:AVERAGE:0.5:6:700 \
|
RRA:AVERAGE:0.5:6:700 \
|
||||||
RRA:AVERAGE:0.5:24:775 \
|
RRA:AVERAGE:0.5:24:775 \
|
||||||
RRA:AVERAGE:0.5:288:797 \
|
RRA:AVERAGE:0.5:288:797 \
|
||||||
RRA:MIN:0.5:1:600 \
|
RRA:MIN:0.5:1:600 \
|
||||||
RRA:MIN:0.5:6:700 \
|
RRA:MIN:0.5:6:700 \
|
||||||
RRA:MIN:0.5:24:775 \
|
RRA:MIN:0.5:24:775 \
|
||||||
RRA:MIN:0.5:3:600 \
|
RRA:MIN:0.5:3:600 \
|
||||||
RRA:MAX:0.5:1:600 \
|
RRA:MAX:0.5:1:600 \
|
||||||
RRA:MAX:0.5:6:700 \
|
RRA:MAX:0.5:6:700 \
|
||||||
RRA:MAX:0.5:24:775 \
|
RRA:MAX:0.5:24:775 \
|
||||||
RRA:MAX:0.5:288:797");
|
RRA:MAX:0.5:288:797");
|
||||||
}
|
}
|
||||||
|
|
||||||
rrdtool_update($mysql_rrd, "N:$nstring");
|
rrdtool_update($mysql_rrd, "N:$nstring");
|
||||||
|
@@ -13,23 +13,23 @@ echo(" nginx statistics\n");
|
|||||||
list($active, $reading, $writing, $waiting, $req) = explode("\n", $nginx);
|
list($active, $reading, $writing, $waiting, $req) = explode("\n", $nginx);
|
||||||
if (!is_file($nginx_rrd)) {
|
if (!is_file($nginx_rrd)) {
|
||||||
rrdtool_create ($nginx_rrd, "--step 300 \
|
rrdtool_create ($nginx_rrd, "--step 300 \
|
||||||
DS:Requests:DERIVE:600:0:125000000000 \
|
DS:Requests:DERIVE:600:0:125000000000 \
|
||||||
DS:Active:GAUGE:600:0:125000000000 \
|
DS:Active:GAUGE:600:0:125000000000 \
|
||||||
DS:Reading:GAUGE:600:0:125000000000 \
|
DS:Reading:GAUGE:600:0:125000000000 \
|
||||||
DS:Writing:GAUGE:600:0:125000000000 \
|
DS:Writing:GAUGE:600:0:125000000000 \
|
||||||
DS:Waiting:GAUGE:600:0:125000000000 \
|
DS:Waiting:GAUGE:600:0:125000000000 \
|
||||||
RRA:AVERAGE:0.5:1:600 \
|
RRA:AVERAGE:0.5:1:600 \
|
||||||
RRA:AVERAGE:0.5:6:700 \
|
RRA:AVERAGE:0.5:6:700 \
|
||||||
RRA:AVERAGE:0.5:24:775 \
|
RRA:AVERAGE:0.5:24:775 \
|
||||||
RRA:AVERAGE:0.5:288:797 \
|
RRA:AVERAGE:0.5:288:797 \
|
||||||
RRA:MIN:0.5:1:600 \
|
RRA:MIN:0.5:1:600 \
|
||||||
RRA:MIN:0.5:6:700 \
|
RRA:MIN:0.5:6:700 \
|
||||||
RRA:MIN:0.5:24:775 \
|
RRA:MIN:0.5:24:775 \
|
||||||
RRA:MIN:0.5:3:600 \
|
RRA:MIN:0.5:3:600 \
|
||||||
RRA:MAX:0.5:1:600 \
|
RRA:MAX:0.5:1:600 \
|
||||||
RRA:MAX:0.5:6:700 \
|
RRA:MAX:0.5:6:700 \
|
||||||
RRA:MAX:0.5:24:775 \
|
RRA:MAX:0.5:24:775 \
|
||||||
RRA:MAX:0.5:288:797");
|
RRA:MAX:0.5:288:797");
|
||||||
}
|
}
|
||||||
print "active: $active reading: $reading writing: $writing waiting: $waiting Requests: $req";
|
print "active: $active reading: $reading writing: $writing waiting: $waiting Requests: $req";
|
||||||
rrdtool_update($nginx_rrd, "N:$req:$active:$reading:$writing:$waiting");
|
rrdtool_update($nginx_rrd, "N:$req:$active:$reading:$writing:$waiting");
|
||||||
|
@@ -42,7 +42,7 @@ foreach($ipsec_array as $index => $tunnel)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(!is_array($tunnels[$tunnel['cikeTunRemoteValue']]))
|
if (!is_array($tunnels[$tunnel['cikeTunRemoteValue']]))
|
||||||
{
|
{
|
||||||
$tunnel_id = dbInsert(array('device_id' => $device['device_id'], 'peer_addr' => $tunnel['cikeTunRemoteValue'], 'local_addr' => $tunnel['cikeTunLocalValue'], 'tunnel_name' => $tunnel['cikeTunLocalName']), 'ipsec_tunnels');
|
$tunnel_id = dbInsert(array('device_id' => $device['device_id'], 'peer_addr' => $tunnel['cikeTunRemoteValue'], 'local_addr' => $tunnel['cikeTunLocalValue'], 'tunnel_name' => $tunnel['cikeTunLocalName']), 'ipsec_tunnels');
|
||||||
} else {
|
} else {
|
||||||
|
@@ -33,13 +33,13 @@ if (is_array($cefs))
|
|||||||
echo(" | |-".$path.": ".$cef_stat['cefSwitchingPath']);
|
echo(" | |-".$path.": ".$cef_stat['cefSwitchingPath']);
|
||||||
|
|
||||||
|
|
||||||
if(dbFetchCell("SELECT COUNT(*) FROM `cef_switching` WHERE `device_id` = ? AND `entPhysicalIndex` = ? AND `afi` = ? AND `cef_index` = ?", array($device['device_id'], $entity, $afi, $path)) != "1")
|
if (dbFetchCell("SELECT COUNT(*) FROM `cef_switching` WHERE `device_id` = ? AND `entPhysicalIndex` = ? AND `afi` = ? AND `cef_index` = ?", array($device['device_id'], $entity, $afi, $path)) != "1")
|
||||||
{
|
{
|
||||||
dbInsert(array('device_id' => $device['device_id'], 'entPhysicalIndex' => $entity, 'afi' => $afi, 'cef_index' => $path, 'cef_path' => $cef_stat['cefSwitchingPath']), 'cef_switching');
|
dbInsert(array('device_id' => $device['device_id'], 'entPhysicalIndex' => $entity, 'afi' => $afi, 'cef_index' => $path, 'cef_path' => $cef_stat['cefSwitchingPath']), 'cef_switching');
|
||||||
echo("+");
|
echo("+");
|
||||||
}
|
}
|
||||||
|
|
||||||
$cef_entry = dbFetchRow("SELECT * FROM `cef_switching` WHERE `device_id` = ? AND `entPhysicalIndex = ? AND `afi` = ? AND `cef_index` = ?", array($device['device_id'], $entity, $afi, $path));
|
$cef_entry = dbFetchRow("SELECT * FROM `cef_switching` WHERE `device_id` = ? AND `entPhysicalIndex = ? AND `afi` = ? AND `cef_index` = ?", array($device['device_id'], $entity, $afi, $path));
|
||||||
|
|
||||||
$filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("cefswitching-".$entity."-".$afi."-".$path.".rrd");
|
$filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("cefswitching-".$entity."-".$afi."-".$path.".rrd");
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ if (is_array($cefs))
|
|||||||
$rrd_update = "N:".$cef_stat['cefSwitchingDrop'].":".$cef_stat['cefSwitchingPunt'].":".$cef_stat['cefSwitchingPunt2Host'];
|
$rrd_update = "N:".$cef_stat['cefSwitchingDrop'].":".$cef_stat['cefSwitchingPunt'].":".$cef_stat['cefSwitchingPunt2Host'];
|
||||||
$ret = rrdtool_update("$filename", $rrd_update);
|
$ret = rrdtool_update("$filename", $rrd_update);
|
||||||
|
|
||||||
if($debug) { echo(" Values: ".$cef_stat['cefSwitchingDrop'].":".$cef_stat['cefSwitchingPunt'].":".$cef_stat['cefSwitchingPunt2Host']); }
|
if ($debug) { echo(" Values: ".$cef_stat['cefSwitchingDrop'].":".$cef_stat['cefSwitchingPunt'].":".$cef_stat['cefSwitchingPunt2Host']); }
|
||||||
|
|
||||||
echo("\n");
|
echo("\n");
|
||||||
|
|
||||||
|
@@ -8,7 +8,7 @@ function poll_sensor($device, $class, $unit)
|
|||||||
{
|
{
|
||||||
echo("Checking $class " . $sensor['sensor_descr'] . "... ");
|
echo("Checking $class " . $sensor['sensor_descr'] . "... ");
|
||||||
|
|
||||||
if($class == "temperature")
|
if ($class == "temperature")
|
||||||
{
|
{
|
||||||
for ($i = 0;$i < 5;$i++) # Try 5 times to get a valid temp reading
|
for ($i = 0;$i < 5;$i++) # Try 5 times to get a valid temp reading
|
||||||
{
|
{
|
||||||
@@ -23,7 +23,7 @@ function poll_sensor($device, $class, $unit)
|
|||||||
$sensor_value = snmp_get($device, $sensor['sensor_oid'], "-OUqnv", "SNMPv2-MIB");
|
$sensor_value = snmp_get($device, $sensor['sensor_oid'], "-OUqnv", "SNMPv2-MIB");
|
||||||
}
|
}
|
||||||
|
|
||||||
if($sensor_value == -32768) { echo("Invalid (-32768) "); $sensor_value = 0; }
|
if ($sensor_value == -32768) { echo("Invalid (-32768) "); $sensor_value = 0; }
|
||||||
|
|
||||||
if ($sensor['sensor_divisor']) { $sensor_value = $sensor_value / $sensor['sensor_divisor']; }
|
if ($sensor['sensor_divisor']) { $sensor_value = $sensor_value / $sensor['sensor_divisor']; }
|
||||||
if ($sensor['sensor_multiplier']) { $sensor_value = $sensor_value * $sensor['sensor_multiplier']; }
|
if ($sensor['sensor_multiplier']) { $sensor_value = $sensor_value * $sensor['sensor_multiplier']; }
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
#Sentry3-MIB::towerModelNumber "CW-24V2-L30M"
|
#Sentry3-MIB::towerModelNumber "CW-24V2-L30M"
|
||||||
#Sentry3-MIB::systemVersion "Sentry Switched CDU Version 6.0g"
|
#Sentry3-MIB::systemVersion "Sentry Switched CDU Version 6.0g"
|
||||||
#Sentry3-MIB::towerProductSN "ABEF0001561"
|
#Sentry3-MIB::towerProductSN "ABEF0001561"
|
||||||
|
|
||||||
$hardware = snmp_get($device, "towerModelNumber.1", "-Ovq", "Sentry3-MIB");
|
$hardware = snmp_get($device, "towerModelNumber.1", "-Ovq", "Sentry3-MIB");
|
||||||
$serial = snmp_get($device, "towerProductSN.1", "-Ovq", "Sentry3-MIB");
|
$serial = snmp_get($device, "towerProductSN.1", "-Ovq", "Sentry3-MIB");
|
||||||
|
@@ -32,8 +32,8 @@ elseif ($device['os'] == "freebsd")
|
|||||||
{
|
{
|
||||||
$poll_device[sysDescr] = str_replace(" 0 ", " ", $poll_device[sysDescr]);
|
$poll_device[sysDescr] = str_replace(" 0 ", " ", $poll_device[sysDescr]);
|
||||||
list(,,$version) = explode (" ", $poll_device[sysDescr]);
|
list(,,$version) = explode (" ", $poll_device[sysDescr]);
|
||||||
if(strstr($poll_device[sysDescr], "i386")) { $hardware = "i386"; }
|
if (strstr($poll_device[sysDescr], "i386")) { $hardware = "i386"; }
|
||||||
else if(strstr($poll_device[sysDescr], "amd64")) { $hardware = "amd64"; }
|
else if (strstr($poll_device[sysDescr], "amd64")) { $hardware = "amd64"; }
|
||||||
else { $hardware = "i386"; }
|
else { $hardware = "i386"; }
|
||||||
$features = "GENERIC";
|
$features = "GENERIC";
|
||||||
}
|
}
|
||||||
|
@@ -285,7 +285,7 @@ if (is_array($ospf_nbrs_db))
|
|||||||
|
|
||||||
if ($ospf_nbr_db['interface_id'] != $ospf_nbr_poll['interface_id'])
|
if ($ospf_nbr_db['interface_id'] != $ospf_nbr_poll['interface_id'])
|
||||||
{
|
{
|
||||||
if($ospf_nbr_poll['interface_id']) {
|
if ($ospf_nbr_poll['interface_id']) {
|
||||||
$ospf_nbr_update = array('interface_id' => $ospf_nbr_poll['interface_id']);
|
$ospf_nbr_update = array('interface_id' => $ospf_nbr_poll['interface_id']);
|
||||||
} else {
|
} else {
|
||||||
$ospf_nbr_update = array('interface_id' => array('NULL'));
|
$ospf_nbr_update = array('interface_id' => array('NULL'));
|
||||||
|
@@ -293,7 +293,7 @@ foreach ($ports as $port)
|
|||||||
{ // If data has changed, build a query
|
{ // If data has changed, build a query
|
||||||
$port['update'][$oid] = $this_port[$oid];
|
$port['update'][$oid] = $this_port[$oid];
|
||||||
echo("PAgP ");
|
echo("PAgP ");
|
||||||
log_event("$oid -> ".$this_port[$oid], $device, 'interface', $port['interface_id']);
|
log_event("$oid -> ".$this_port[$oid], $device, 'interface', $port['interface_id']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -309,14 +309,14 @@ foreach ($ports as $port)
|
|||||||
if ($config['enable_ports_poe']) { include("port-poe.inc.php"); }
|
if ($config['enable_ports_poe']) { include("port-poe.inc.php"); }
|
||||||
|
|
||||||
/// Do Alcatel Detailed Stats
|
/// Do Alcatel Detailed Stats
|
||||||
if($device['os'] == "aos") { include("port-alcatel.inc.php"); }
|
if ($device['os'] == "aos") { include("port-alcatel.inc.php"); }
|
||||||
|
|
||||||
|
|
||||||
// Update Database
|
// Update Database
|
||||||
if (count($port['update']))
|
if (count($port['update']))
|
||||||
{
|
{
|
||||||
$updated = dbUpdate($port['update'], 'ports', '`interface_id` = ?', array($port['interface_id']));
|
$updated = dbUpdate($port['update'], 'ports', '`interface_id` = ?', array($port['interface_id']));
|
||||||
if($debug) { echo("$updated updated"); }
|
if ($debug) { echo("$updated updated"); }
|
||||||
}
|
}
|
||||||
// End Update Database
|
// End Update Database
|
||||||
|
|
||||||
|
@@ -45,7 +45,7 @@ function ifLabel ($interface, $device = NULL)
|
|||||||
{
|
{
|
||||||
$interface['label'] = $interface['ifName'];
|
$interface['label'] = $interface['ifName'];
|
||||||
|
|
||||||
if($interface['ifName'] == "")
|
if ($interface['ifName'] == "")
|
||||||
{
|
{
|
||||||
$interface['label'] = $interface['ifDescr'];
|
$interface['label'] = $interface['ifDescr'];
|
||||||
} else {
|
} else {
|
||||||
@@ -977,7 +977,7 @@ function rewrite_adslLineType($adslLineType)
|
|||||||
|
|
||||||
foreach($adslLineTypes as $type => $text)
|
foreach($adslLineTypes as $type => $text)
|
||||||
{
|
{
|
||||||
if($adslLineType == $type)
|
if ($adslLineType == $type)
|
||||||
{
|
{
|
||||||
$adslLineType = $text;
|
$adslLineType = $text;
|
||||||
}
|
}
|
||||||
|
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
function callsgraphSNOM ($rrd, $graph, $from, $to, $width, $height, $title, $vertical) {
|
function callsgraphSNOM ($rrd, $graph, $from, $to, $width, $height, $title, $vertical) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$database = $config['rrd_dir'] . "/" . $rrd;
|
$database = $config['rrd_dir'] . "/" . $rrd;
|
||||||
$imgfile = "graphs/" . "$graph";
|
$imgfile = "graphs/" . "$graph";
|
||||||
$optsa = array( "--start", $from, "--end", $to, "--width", $width, "--height", $height, "--vertical-label", $vertical ,"--alt-autoscale-max",
|
$optsa = array( "--start", $from, "--end", $to, "--width", $width, "--height", $height, "--vertical-label", $vertical ,"--alt-autoscale-max",
|
||||||
@@ -16,7 +17,7 @@ function callsgraphSNOM ($rrd, $graph, $from, $to, $width, $height, $title, $ver
|
|||||||
"GPRINT:calls:LAST:Cu\: %2.0lf/min",
|
"GPRINT:calls:LAST:Cu\: %2.0lf/min",
|
||||||
"GPRINT:calls:AVERAGE:Av\: %2.0lf/min",
|
"GPRINT:calls:AVERAGE:Av\: %2.0lf/min",
|
||||||
"GPRINT:calls:MAX:Mx\: %2.0lf/min\\n");
|
"GPRINT:calls:MAX:Mx\: %2.0lf/min\\n");
|
||||||
if($width <= "300") {$optsb = array("--font", "LEGEND:7:".$config['mono_font']."",
|
if ($width <= "300") {$optsb = array("--font", "LEGEND:7:".$config['mono_font']."",
|
||||||
"--font", "AXIS:6:".$config['mono_font']."",
|
"--font", "AXIS:6:".$config['mono_font']."",
|
||||||
"--font-render-mode", "normal");}
|
"--font-render-mode", "normal");}
|
||||||
|
|
||||||
@@ -24,7 +25,7 @@ function callsgraphSNOM ($rrd, $graph, $from, $to, $width, $height, $title, $ver
|
|||||||
|
|
||||||
$ret = rrd_graph("$imgfile", $opts, count($opts));
|
$ret = rrd_graph("$imgfile", $opts, count($opts));
|
||||||
|
|
||||||
if( !is_array($ret) ) {
|
if ( !is_array($ret) ) {
|
||||||
$err = rrd_error();
|
$err = rrd_error();
|
||||||
echo("rrd_graph() ERROR: $err\n");
|
echo("rrd_graph() ERROR: $err\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@@ -6,13 +6,13 @@
|
|||||||
# YES, THAT MEANS YOU #
|
# YES, THAT MEANS YOU #
|
||||||
#########################################################
|
#########################################################
|
||||||
|
|
||||||
$config['os']['default']['over'][0]['graph'] = "device_processor";
|
$config['os']['default']['over'][0]['graph'] = "device_processor";
|
||||||
$config['os']['default']['over'][0]['text'] = "Processor Usage";
|
$config['os']['default']['over'][0]['text'] = "Processor Usage";
|
||||||
$config['os']['default']['over'][1]['graph'] = "device_mempool";
|
$config['os']['default']['over'][1]['graph'] = "device_mempool";
|
||||||
$config['os']['default']['over'][1]['text'] = "Memory Usage";
|
$config['os']['default']['over'][1]['text'] = "Memory Usage";
|
||||||
|
|
||||||
$os_group = "unix";
|
$os_group = "unix";
|
||||||
$config['os_group'][$os_group]['type'] = "server";
|
$config['os_group'][$os_group]['type'] = "server";
|
||||||
$config['os_group'][$os_group]['processor_stacked'] = 1;
|
$config['os_group'][$os_group]['processor_stacked'] = 1;
|
||||||
$config['os_group'][$os_group]['over'][0]['graph'] = "device_processor";
|
$config['os_group'][$os_group]['over'][0]['graph'] = "device_processor";
|
||||||
$config['os_group'][$os_group]['over'][0]['text'] = "Processor Usage";
|
$config['os_group'][$os_group]['over'][0]['text'] = "Processor Usage";
|
||||||
@@ -21,7 +21,7 @@ $config['os_group'][$os_group]['over'][1]['text'] = "Memory Usage";
|
|||||||
|
|
||||||
|
|
||||||
$os = "generic";
|
$os = "generic";
|
||||||
$config['os'][$os]['text'] = "Generic Device";
|
$config['os'][$os]['text'] = "Generic Device";
|
||||||
|
|
||||||
$os = "vyatta";
|
$os = "vyatta";
|
||||||
$config['os'][$os]['text'] = "Vyatta";
|
$config['os'][$os]['text'] = "Vyatta";
|
||||||
@@ -32,9 +32,9 @@ $config['os'][$os]['ifname'] = 1;
|
|||||||
|
|
||||||
$os = "linux";
|
$os = "linux";
|
||||||
$config['os'][$os]['type'] = "server";
|
$config['os'][$os]['type'] = "server";
|
||||||
$config['os'][$os]['group'] = "unix";
|
$config['os'][$os]['group'] = "unix";
|
||||||
$config['os'][$os]['text'] = "Linux";
|
$config['os'][$os]['text'] = "Linux";
|
||||||
$config['os'][$os]['ifXmcbc'] = 1;
|
$config['os'][$os]['ifXmcbc'] = 1;
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_processor";
|
$config['os'][$os]['over'][0]['graph'] = "device_processor";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Processor Usage";
|
$config['os'][$os]['over'][0]['text'] = "Processor Usage";
|
||||||
$config['os'][$os]['over'][1]['graph'] = "device_ucd_memory";
|
$config['os'][$os]['over'][1]['graph'] = "device_ucd_memory";
|
||||||
@@ -54,54 +54,54 @@ $config['os'][$os]['ifXmcbc'] = 1;
|
|||||||
|
|
||||||
$os = "freebsd";
|
$os = "freebsd";
|
||||||
$config['os'][$os]['type'] = "server";
|
$config['os'][$os]['type'] = "server";
|
||||||
$config['os'][$os]['group'] = "unix";
|
$config['os'][$os]['group'] = "unix";
|
||||||
$config['os'][$os]['text'] = "FreeBSD";
|
$config['os'][$os]['text'] = "FreeBSD";
|
||||||
|
|
||||||
$os = "openbsd";
|
$os = "openbsd";
|
||||||
$config['os'][$os]['type'] = "server";
|
$config['os'][$os]['type'] = "server";
|
||||||
$config['os'][$os]['group'] = "unix";
|
$config['os'][$os]['group'] = "unix";
|
||||||
$config['os'][$os]['text'] = "OpenBSD";
|
$config['os'][$os]['text'] = "OpenBSD";
|
||||||
|
|
||||||
$os = "netbsd";
|
$os = "netbsd";
|
||||||
$config['os'][$os]['type'] = "server";
|
$config['os'][$os]['type'] = "server";
|
||||||
$config['os'][$os]['group'] = "unix";
|
$config['os'][$os]['group'] = "unix";
|
||||||
$config['os'][$os]['text'] = "NetBSD";
|
$config['os'][$os]['text'] = "NetBSD";
|
||||||
|
|
||||||
$os = "dragonfly";
|
$os = "dragonfly";
|
||||||
$config['os'][$os]['type'] = "server";
|
$config['os'][$os]['type'] = "server";
|
||||||
$config['os'][$os]['group'] = "unix";
|
$config['os'][$os]['group'] = "unix";
|
||||||
$config['os'][$os]['text'] = "DragonflyBSD";
|
$config['os'][$os]['text'] = "DragonflyBSD";
|
||||||
|
|
||||||
$os = "netware";
|
$os = "netware";
|
||||||
$config['os'][$os]['type'] = "server";
|
$config['os'][$os]['type'] = "server";
|
||||||
$config['os'][$os]['text'] = "Novell Netware";
|
$config['os'][$os]['text'] = "Novell Netware";
|
||||||
$config['os'][$os]['icon'] = "novell";
|
$config['os'][$os]['icon'] = "novell";
|
||||||
|
|
||||||
$os = "monowall";
|
$os = "monowall";
|
||||||
$config['os'][$os]['group'] = "unix";
|
$config['os'][$os]['group'] = "unix";
|
||||||
$config['os'][$os]['text'] = "m0n0wall";
|
$config['os'][$os]['text'] = "m0n0wall";
|
||||||
$config['os'][$os]['type'] = "firewall";
|
$config['os'][$os]['type'] = "firewall";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
||||||
$config['os'][$os]['over'][1]['text'] = "CPU Usage";
|
$config['os'][$os]['over'][1]['text'] = "CPU Usage";
|
||||||
|
|
||||||
$os = "solaris";
|
$os = "solaris";
|
||||||
$config['os'][$os]['group'] = "unix";
|
$config['os'][$os]['group'] = "unix";
|
||||||
$config['os'][$os]['text'] = "Sun Solaris";
|
$config['os'][$os]['text'] = "Sun Solaris";
|
||||||
$config['os'][$os]['type'] = "server";
|
$config['os'][$os]['type'] = "server";
|
||||||
|
|
||||||
$os = "adva";
|
$os = "adva";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['text'] = "Adva Optical";
|
$config['os'][$os]['text'] = "Adva Optical";
|
||||||
|
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
|
|
||||||
$os = "opensolaris";
|
$os = "opensolaris";
|
||||||
$config['os'][$os]['type'] = "server";
|
$config['os'][$os]['type'] = "server";
|
||||||
$config['os'][$os]['group'] = "unix";
|
$config['os'][$os]['group'] = "unix";
|
||||||
$config['os'][$os]['text'] = "Sun OpenSolaris";
|
$config['os'][$os]['text'] = "Sun OpenSolaris";
|
||||||
|
|
||||||
$os = "openindiana";
|
$os = "openindiana";
|
||||||
$config['os'][$os]['type'] = "server";
|
$config['os'][$os]['type'] = "server";
|
||||||
@@ -132,23 +132,23 @@ $config['os'][$os]['icon'] = "alcatellucent";
|
|||||||
## Cisco OSes
|
## Cisco OSes
|
||||||
|
|
||||||
$os = "ios";
|
$os = "ios";
|
||||||
$config['os'][$os]['group'] = "ios";
|
$config['os'][$os]['group'] = "ios";
|
||||||
$config['os'][$os]['text'] = "Cisco IOS";
|
$config['os'][$os]['text'] = "Cisco IOS";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['ifXmcbc'] = 1;
|
$config['os'][$os]['ifXmcbc'] = 1;
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
||||||
$config['os'][$os]['over'][1]['text'] = "CPU Usage";
|
$config['os'][$os]['over'][1]['text'] = "CPU Usage";
|
||||||
$config['os'][$os]['over'][2]['graph'] = "device_mempool";
|
$config['os'][$os]['over'][2]['graph'] = "device_mempool";
|
||||||
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
||||||
$config['os'][$os]['icon'] = "cisco";
|
$config['os'][$os]['icon'] = "cisco";
|
||||||
|
|
||||||
$os = "cat1900";
|
$os = "cat1900";
|
||||||
$config['os'][$os]['group'] = "cat1900";
|
$config['os'][$os]['group'] = "cat1900";
|
||||||
$config['os'][$os]['text'] = "Cisco Catalyst 1900";
|
$config['os'][$os]['text'] = "Cisco Catalyst 1900";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['icon'] = "cisco-old";
|
$config['os'][$os]['icon'] = "cisco-old";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
||||||
@@ -157,24 +157,24 @@ $config['os'][$os]['over'][2]['graph'] = "device_mempool";
|
|||||||
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
||||||
|
|
||||||
$os = "iosxe";
|
$os = "iosxe";
|
||||||
$config['os'][$os]['group'] = "ios";
|
$config['os'][$os]['group'] = "ios";
|
||||||
$config['os'][$os]['text'] = "Cisco IOS-XE";
|
$config['os'][$os]['text'] = "Cisco IOS-XE";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['ifXmcbc'] = 1;
|
$config['os'][$os]['ifXmcbc'] = 1;
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
||||||
$config['os'][$os]['over'][1]['text'] = "CPU Usage";
|
$config['os'][$os]['over'][1]['text'] = "CPU Usage";
|
||||||
$config['os'][$os]['over'][2]['graph'] = "device_mempool";
|
$config['os'][$os]['over'][2]['graph'] = "device_mempool";
|
||||||
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
||||||
$config['os'][$os]['icon'] = "cisco";
|
$config['os'][$os]['icon'] = "cisco";
|
||||||
|
|
||||||
$os = "iosxr";
|
$os = "iosxr";
|
||||||
$config['os'][$os]['group'] = "ios";
|
$config['os'][$os]['group'] = "ios";
|
||||||
$config['os'][$os]['text'] = "Cisco IOS-XR";
|
$config['os'][$os]['text'] = "Cisco IOS-XR";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['ifXmcbc'] = 1;
|
$config['os'][$os]['ifXmcbc'] = 1;
|
||||||
$config['os'][$os]['icon'] = "cisco";
|
$config['os'][$os]['icon'] = "cisco";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
||||||
@@ -183,21 +183,21 @@ $config['os'][$os]['over'][2]['graph'] = "device_mempool";
|
|||||||
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
||||||
|
|
||||||
$os = "asa";
|
$os = "asa";
|
||||||
$config['os'][$os]['group'] = "ios";
|
$config['os'][$os]['group'] = "ios";
|
||||||
$config['os'][$os]['text'] = "Cisco ASA";
|
$config['os'][$os]['text'] = "Cisco ASA";
|
||||||
$config['os'][$os]['ifname'] = 1;
|
$config['os'][$os]['ifname'] = 1;
|
||||||
$config['os'][$os]['type'] = "firewall";
|
$config['os'][$os]['type'] = "firewall";
|
||||||
$config['os'][$os]['icon'] = "cisco";
|
$config['os'][$os]['icon'] = "cisco";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
||||||
$config['os'][$os]['over'][1]['text'] = "CPU Usage";
|
$config['os'][$os]['over'][1]['text'] = "CPU Usage";
|
||||||
|
|
||||||
$os = "pix";
|
$os = "pix";
|
||||||
$config['os'][$os]['group'] = "ios";
|
$config['os'][$os]['group'] = "ios";
|
||||||
$config['os'][$os]['text'] = "Cisco PIX-OS";
|
$config['os'][$os]['text'] = "Cisco PIX-OS";
|
||||||
$config['os'][$os]['ifname'] = 1;
|
$config['os'][$os]['ifname'] = 1;
|
||||||
$config['os'][$os]['type'] = "firewall";
|
$config['os'][$os]['type'] = "firewall";
|
||||||
$config['os'][$os]['icon'] = "cisco";
|
$config['os'][$os]['icon'] = "cisco";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
@@ -207,9 +207,9 @@ $config['os'][$os]['over'][2]['graph'] = "device_mempool";
|
|||||||
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
||||||
|
|
||||||
$os = "nxos";
|
$os = "nxos";
|
||||||
$config['os'][$os]['group'] = "ios";
|
$config['os'][$os]['group'] = "ios";
|
||||||
$config['os'][$os]['text'] = "Cisco NX-OS";
|
$config['os'][$os]['text'] = "Cisco NX-OS";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['icon'] = "cisco";
|
$config['os'][$os]['icon'] = "cisco";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
@@ -231,10 +231,10 @@ $config['os'][$os]['over'][2]['graph'] = "device_mempool";
|
|||||||
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
||||||
|
|
||||||
$os = "catos";
|
$os = "catos";
|
||||||
$config['os'][$os]['group'] = "ios";
|
$config['os'][$os]['group'] = "ios";
|
||||||
$config['os'][$os]['text'] = "Cisco CatOS";
|
$config['os'][$os]['text'] = "Cisco CatOS";
|
||||||
$config['os'][$os]['ifname'] = 1;
|
$config['os'][$os]['ifname'] = 1;
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['icon'] = "cisco-old";
|
$config['os'][$os]['icon'] = "cisco-old";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
@@ -246,16 +246,16 @@ $config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
|||||||
## Huawei
|
## Huawei
|
||||||
|
|
||||||
$os = "vrp";
|
$os = "vrp";
|
||||||
$config['os'][$os]['group'] = "vrp";
|
$config['os'][$os]['group'] = "vrp";
|
||||||
$config['os'][$os]['text'] = "Huawei VRP";
|
$config['os'][$os]['text'] = "Huawei VRP";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['icon'] = "huawei";
|
$config['os'][$os]['icon'] = "huawei";
|
||||||
|
|
||||||
# Juniper
|
# Juniper
|
||||||
|
|
||||||
$os = "junos";
|
$os = "junos";
|
||||||
$config['os'][$os]['text'] = "Juniper JunOS";
|
$config['os'][$os]['text'] = "Juniper JunOS";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
||||||
@@ -275,13 +275,13 @@ $config['os'][$os]['over'][2]['graph'] = "device_mempool";
|
|||||||
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
||||||
|
|
||||||
$os = "jwos";
|
$os = "jwos";
|
||||||
$config['os'][$os]['text'] = "Juniper JWOS";
|
$config['os'][$os]['text'] = "Juniper JWOS";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['icon'] = "junos";
|
$config['os'][$os]['icon'] = "junos";
|
||||||
|
|
||||||
$os = "screenos";
|
$os = "screenos";
|
||||||
$config['os'][$os]['text'] = "Juniper ScreenOS";
|
$config['os'][$os]['text'] = "Juniper ScreenOS";
|
||||||
$config['os'][$os]['type'] = "firewall";
|
$config['os'][$os]['type'] = "firewall";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
||||||
@@ -292,7 +292,7 @@ $config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
|||||||
$os = "fortigate";
|
$os = "fortigate";
|
||||||
$config['os'][$os]['text'] = "Fortinet Fortigate";
|
$config['os'][$os]['text'] = "Fortinet Fortigate";
|
||||||
$config['os'][$os]['type'] = "firewall";
|
$config['os'][$os]['type'] = "firewall";
|
||||||
$config['os'][$os]['icon'] = "fortinet";
|
$config['os'][$os]['icon'] = "fortinet";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
#$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
#$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
||||||
@@ -301,9 +301,9 @@ $config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
|||||||
#$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
#$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
||||||
|
|
||||||
$os = "routeros";
|
$os = "routeros";
|
||||||
$config['os'][$os]['text'] = "Mikrotik RouterOS";
|
$config['os'][$os]['text'] = "Mikrotik RouterOS";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['nobulk'] = 1;
|
$config['os'][$os]['nobulk'] = 1;
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
||||||
@@ -312,8 +312,8 @@ $config['os'][$os]['over'][2]['graph'] = "device_mempool";
|
|||||||
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
||||||
|
|
||||||
$os = "ironware";
|
$os = "ironware";
|
||||||
$config['os'][$os]['text'] = "Brocade IronWare";
|
$config['os'][$os]['text'] = "Brocade IronWare";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
||||||
@@ -322,10 +322,10 @@ $config['os'][$os]['over'][2]['graph'] = "device_mempool";
|
|||||||
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
||||||
|
|
||||||
$os = "extremeware";
|
$os = "extremeware";
|
||||||
$config['os'][$os]['text'] = "Extremeware";
|
$config['os'][$os]['text'] = "Extremeware";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['ifname'] = 1;
|
$config['os'][$os]['ifname'] = 1;
|
||||||
$config['os'][$os]['icon'] = "extreme";
|
$config['os'][$os]['icon'] = "extreme";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
||||||
@@ -334,15 +334,15 @@ $config['os'][$os]['over'][2]['graph'] = "device_mempool";
|
|||||||
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
||||||
|
|
||||||
$os = "packetshaper";
|
$os = "packetshaper";
|
||||||
$config['os'][$os]['text'] = "Blue Coat Packetshaper";
|
$config['os'][$os]['text'] = "Blue Coat Packetshaper";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
|
|
||||||
$os = "xos";
|
$os = "xos";
|
||||||
$config['os'][$os]['text'] = "Extreme XOS";
|
$config['os'][$os]['text'] = "Extreme XOS";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['ifname'] = 1;
|
$config['os'][$os]['ifname'] = 1;
|
||||||
$config['os'][$os]['group'] = "extremeware";
|
$config['os'][$os]['group'] = "extremeware";
|
||||||
$config['os'][$os]['icon'] = "extreme";
|
$config['os'][$os]['icon'] = "extreme";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
||||||
@@ -351,9 +351,9 @@ $config['os'][$os]['over'][2]['graph'] = "device_mempool";
|
|||||||
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
||||||
|
|
||||||
$os = "ftos";
|
$os = "ftos";
|
||||||
$config['os'][$os]['text'] = "Force10 FTOS";
|
$config['os'][$os]['text'] = "Force10 FTOS";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['icon'] = "force10";
|
$config['os'][$os]['icon'] = "force10";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
||||||
@@ -388,15 +388,15 @@ $config['os'][$os]['over'][0]['graph'] = "device_bits";
|
|||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
|
|
||||||
$os = "powerconnect";
|
$os = "powerconnect";
|
||||||
$config['os'][$os]['text'] = "Dell PowerConnect";
|
$config['os'][$os]['text'] = "Dell PowerConnect";
|
||||||
$config['os'][$os]['ifname'] = 1;
|
$config['os'][$os]['ifname'] = 1;
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['icon'] = "dell";
|
$config['os'][$os]['icon'] = "dell";
|
||||||
|
|
||||||
$os = "radlan";
|
$os = "radlan";
|
||||||
$config['os'][$os]['text'] = "Radlan";
|
$config['os'][$os]['text'] = "Radlan";
|
||||||
$config['os'][$os]['ifname'] = 1;
|
$config['os'][$os]['ifname'] = 1;
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
||||||
@@ -405,22 +405,22 @@ $config['os'][$os]['over'][1]['text'] = "CPU Usage";
|
|||||||
#$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
#$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
||||||
|
|
||||||
$os = "powervault";
|
$os = "powervault";
|
||||||
$config['os'][$os]['text'] = "Dell PowerVault";
|
$config['os'][$os]['text'] = "Dell PowerVault";
|
||||||
$config['os'][$os]['icon'] = "dell";
|
$config['os'][$os]['icon'] = "dell";
|
||||||
|
|
||||||
$os = "drac";
|
$os = "drac";
|
||||||
$config['os'][$os]['text'] = "Dell DRAC";
|
$config['os'][$os]['text'] = "Dell DRAC";
|
||||||
$config['os'][$os]['icon'] = "dell";
|
$config['os'][$os]['icon'] = "dell";
|
||||||
|
|
||||||
$os = "bcm963";
|
$os = "bcm963";
|
||||||
$config['os'][$os]['text'] = "Broadcom BCM963xx";
|
$config['os'][$os]['text'] = "Broadcom BCM963xx";
|
||||||
$config['os'][$os]['icon'] = "broadcom";
|
$config['os'][$os]['icon'] = "broadcom";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
|
|
||||||
$os = "netopia";
|
$os = "netopia";
|
||||||
$config['os'][$os]['text'] = "Motorola Netopia";
|
$config['os'][$os]['text'] = "Motorola Netopia";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
|
|
||||||
$os = "tranzeo";
|
$os = "tranzeo";
|
||||||
$config['os'][$os]['text'] = "Tranzeo";
|
$config['os'][$os]['text'] = "Tranzeo";
|
||||||
@@ -428,31 +428,31 @@ $config['os'][$os]['over'][0]['graph'] = "device_bits";
|
|||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
|
|
||||||
$os = "dlink";
|
$os = "dlink";
|
||||||
$config['os'][$os]['text'] = "D-Link Switch";
|
$config['os'][$os]['text'] = "D-Link Switch";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['icon'] = "dlink";
|
$config['os'][$os]['icon'] = "dlink";
|
||||||
|
|
||||||
$os = "dlinkap";
|
$os = "dlinkap";
|
||||||
$config['os'][$os]['text'] = "D-Link Access Point";
|
$config['os'][$os]['text'] = "D-Link Access Point";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['icon'] = "dlink";
|
$config['os'][$os]['icon'] = "dlink";
|
||||||
|
|
||||||
$os = "axiscam";
|
$os = "axiscam";
|
||||||
$config['os'][$os]['text'] = "AXIS Network Camera";
|
$config['os'][$os]['text'] = "AXIS Network Camera";
|
||||||
$config['os'][$os]['icon'] = "axis";
|
$config['os'][$os]['icon'] = "axis";
|
||||||
|
|
||||||
$os = "axisdocserver";
|
$os = "axisdocserver";
|
||||||
$config['os'][$os]['text'] = "AXIS Network Document Server";
|
$config['os'][$os]['text'] = "AXIS Network Document Server";
|
||||||
$config['os'][$os]['icon'] = "axis";
|
$config['os'][$os]['icon'] = "axis";
|
||||||
|
|
||||||
$os = "gamatronicups";
|
$os = "gamatronicups";
|
||||||
$config['os'][$os]['text'] = "Gamatronic UPS Stack";
|
$config['os'][$os]['text'] = "Gamatronic UPS Stack";
|
||||||
$config['os'][$os]['type'] = "power";
|
$config['os'][$os]['type'] = "power";
|
||||||
|
|
||||||
$os = "powerware";
|
$os = "powerware";
|
||||||
$config['os'][$os]['text'] = "Powerware UPS";
|
$config['os'][$os]['text'] = "Powerware UPS";
|
||||||
$config['os'][$os]['type'] = "power";
|
$config['os'][$os]['type'] = "power";
|
||||||
$config['os'][$os]['icon'] = "eaton";
|
$config['os'][$os]['icon'] = "eaton";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_voltages";
|
$config['os'][$os]['over'][0]['graph'] = "device_voltages";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Voltages";
|
$config['os'][$os]['over'][0]['text'] = "Voltages";
|
||||||
$config['os'][$os]['over'][1]['graph'] = "device_current";
|
$config['os'][$os]['over'][1]['graph'] = "device_current";
|
||||||
@@ -461,9 +461,9 @@ $config['os'][$os]['over'][2]['graph'] = "device_frequencies";
|
|||||||
$config['os'][$os]['over'][2]['text'] = "Frequencies";
|
$config['os'][$os]['over'][2]['text'] = "Frequencies";
|
||||||
|
|
||||||
$os = "deltaups";
|
$os = "deltaups";
|
||||||
$config['os'][$os]['text'] = "Delta UPS";
|
$config['os'][$os]['text'] = "Delta UPS";
|
||||||
$config['os'][$os]['type'] = "power";
|
$config['os'][$os]['type'] = "power";
|
||||||
$config['os'][$os]['icon'] = "delta";
|
$config['os'][$os]['icon'] = "delta";
|
||||||
|
|
||||||
$os = "liebert";
|
$os = "liebert";
|
||||||
$config['os'][$os]['text'] = "Liebert";
|
$config['os'][$os]['text'] = "Liebert";
|
||||||
@@ -472,18 +472,18 @@ $config['os'][$os]['icon'] = "liebert";
|
|||||||
|
|
||||||
|
|
||||||
$os = "engenius";
|
$os = "engenius";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['text'] = "EnGenius Access Point";
|
$config['os'][$os]['text'] = "EnGenius Access Point";
|
||||||
$config['os'][$os]['icon'] = "engenius";
|
$config['os'][$os]['icon'] = "engenius";
|
||||||
|
|
||||||
$os = "airport";
|
$os = "airport";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['text'] = "Apple AirPort";
|
$config['os'][$os]['text'] = "Apple AirPort";
|
||||||
$config['os'][$os]['icon'] = "apple";
|
$config['os'][$os]['icon'] = "apple";
|
||||||
|
|
||||||
$os = "windows";
|
$os = "windows";
|
||||||
$config['os'][$os]['text'] = "Microsoft Windows";
|
$config['os'][$os]['text'] = "Microsoft Windows";
|
||||||
$config['os'][$os]['ifname'] = 1;
|
$config['os'][$os]['ifname'] = 1;
|
||||||
$config['os'][$os]['processor_stacked'] = 1;
|
$config['os'][$os]['processor_stacked'] = 1;
|
||||||
|
|
||||||
|
|
||||||
@@ -493,9 +493,9 @@ $config['os'][$os]['type'] = "network";
|
|||||||
$config['os'][$os]['icon'] = "bnt";
|
$config['os'][$os]['icon'] = "bnt";
|
||||||
|
|
||||||
$os = "procurve";
|
$os = "procurve";
|
||||||
$config['os'][$os]['text'] = "HP ProCurve";
|
$config['os'][$os]['text'] = "HP ProCurve";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['icon'] = "hp";
|
$config['os'][$os]['icon'] = "hp";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Traffic";
|
||||||
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
||||||
@@ -504,68 +504,68 @@ $config['os'][$os]['over'][2]['graph'] = "device_mempool";
|
|||||||
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
||||||
|
|
||||||
$os = "speedtouch";
|
$os = "speedtouch";
|
||||||
$config['os'][$os]['text'] = "Thomson Speedtouch";
|
$config['os'][$os]['text'] = "Thomson Speedtouch";
|
||||||
$config['os'][$os]['ifname'] = 1;
|
$config['os'][$os]['ifname'] = 1;
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Traffic";
|
||||||
|
|
||||||
$os = "sonicwall";
|
$os = "sonicwall";
|
||||||
$config['os'][$os]['text'] = "SonicWALL";
|
$config['os'][$os]['text'] = "SonicWALL";
|
||||||
$config['os'][$os]['type'] = "firewall";
|
$config['os'][$os]['type'] = "firewall";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Traffic";
|
||||||
|
|
||||||
$os = "zywall";
|
$os = "zywall";
|
||||||
$config['os'][$os]['text'] = "ZyXEL ZyWALL";
|
$config['os'][$os]['text'] = "ZyXEL ZyWALL";
|
||||||
$config['os'][$os]['type'] = "firewall";
|
$config['os'][$os]['type'] = "firewall";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Traffic";
|
||||||
$config['os'][$os]['icon'] = "zyxel";
|
$config['os'][$os]['icon'] = "zyxel";
|
||||||
|
|
||||||
$os = "prestige";
|
$os = "prestige";
|
||||||
$config['os'][$os]['text'] = "ZyXEL Prestige";
|
$config['os'][$os]['text'] = "ZyXEL Prestige";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['icon'] = "zyxel";
|
$config['os'][$os]['icon'] = "zyxel";
|
||||||
|
|
||||||
$os = "zyxeles";
|
$os = "zyxeles";
|
||||||
$config['os'][$os]['text'] = "ZyXEL Ethernet Switch";
|
$config['os'][$os]['text'] = "ZyXEL Ethernet Switch";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['icon'] = "zyxel";
|
$config['os'][$os]['icon'] = "zyxel";
|
||||||
|
|
||||||
$os = "zyxelnwa";
|
$os = "zyxelnwa";
|
||||||
$config['os'][$os]['text'] = "ZyXEL NWA";
|
$config['os'][$os]['text'] = "ZyXEL NWA";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['icon'] = "zyxel";
|
$config['os'][$os]['icon'] = "zyxel";
|
||||||
|
|
||||||
$os = "ies";
|
$os = "ies";
|
||||||
$config['os'][$os]['text'] = "ZyXEL DSLAM";
|
$config['os'][$os]['text'] = "ZyXEL DSLAM";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['icon'] = "zyxel";
|
$config['os'][$os]['icon'] = "zyxel";
|
||||||
|
|
||||||
$os = "allied";
|
$os = "allied";
|
||||||
$config['os'][$os]['text'] = "AlliedWare";
|
$config['os'][$os]['text'] = "AlliedWare";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['ifname'] = 1;
|
$config['os'][$os]['ifname'] = 1;
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Traffic";
|
||||||
|
|
||||||
$os = "mgeups";
|
$os = "mgeups";
|
||||||
$config['os'][$os]['text'] = "MGE UPS";
|
$config['os'][$os]['text'] = "MGE UPS";
|
||||||
$config['os'][$os]['group'] = "ups";
|
$config['os'][$os]['group'] = "ups";
|
||||||
$config['os'][$os]['type'] = "power";
|
$config['os'][$os]['type'] = "power";
|
||||||
$config['os'][$os]['icon'] = "mge";
|
$config['os'][$os]['icon'] = "mge";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_current";
|
$config['os'][$os]['over'][0]['graph'] = "device_current";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Current";
|
$config['os'][$os]['over'][0]['text'] = "Current";
|
||||||
|
|
||||||
$os = "mgepdu";
|
$os = "mgepdu";
|
||||||
$config['os'][$os]['text'] = "MGE PDU";
|
$config['os'][$os]['text'] = "MGE PDU";
|
||||||
$config['os'][$os]['type'] = "power";
|
$config['os'][$os]['type'] = "power";
|
||||||
$config['os'][$os]['icon'] = "mge";
|
$config['os'][$os]['icon'] = "mge";
|
||||||
|
|
||||||
$os = "apc";
|
$os = "apc";
|
||||||
$config['os'][$os]['text'] = "APC Management Module";
|
$config['os'][$os]['text'] = "APC Management Module";
|
||||||
$config['os'][$os]['type'] = "power";
|
$config['os'][$os]['type'] = "power";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_current";
|
$config['os'][$os]['over'][0]['graph'] = "device_current";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Current";
|
$config['os'][$os]['over'][0]['text'] = "Current";
|
||||||
|
|
||||||
@@ -584,15 +584,15 @@ $config['os'][$os]['over'][0]['graph'] = "device_current";
|
|||||||
$config['os'][$os]['over'][0]['text'] = "Current";
|
$config['os'][$os]['over'][0]['text'] = "Current";
|
||||||
|
|
||||||
$os = "areca";
|
$os = "areca";
|
||||||
$config['os'][$os]['text'] = "Areca RAID Subsystem";
|
$config['os'][$os]['text'] = "Areca RAID Subsystem";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "";
|
$config['os'][$os]['over'][0]['graph'] = "";
|
||||||
$config['os'][$os]['over'][0]['text'] = "";
|
$config['os'][$os]['over'][0]['text'] = "";
|
||||||
|
|
||||||
$os = "netmanplus";
|
$os = "netmanplus";
|
||||||
$config['os'][$os]['text'] = "NetMan Plus";
|
$config['os'][$os]['text'] = "NetMan Plus";
|
||||||
$config['os'][$os]['group'] = "ups";
|
$config['os'][$os]['group'] = "ups";
|
||||||
$config['os'][$os]['nobulk'] = 1;
|
$config['os'][$os]['nobulk'] = 1;
|
||||||
$config['os'][$os]['type'] = "power";
|
$config['os'][$os]['type'] = "power";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_current";
|
$config['os'][$os]['over'][0]['graph'] = "device_current";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Current";
|
$config['os'][$os]['over'][0]['text'] = "Current";
|
||||||
|
|
||||||
@@ -603,8 +603,8 @@ $config['os'][$os]['over'][0]['graph'] = "device_temperature";
|
|||||||
$config['os'][$os]['over'][0]['text'] = "temperature";
|
$config['os'][$os]['over'][0]['text'] = "temperature";
|
||||||
|
|
||||||
$os = "minkelsrms";
|
$os = "minkelsrms";
|
||||||
$config['os'][$os]['text'] = "Minkels RMS";
|
$config['os'][$os]['text'] = "Minkels RMS";
|
||||||
$config['os'][$os]['type'] = "environment";
|
$config['os'][$os]['type'] = "environment";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_temperature";
|
$config['os'][$os]['over'][0]['graph'] = "device_temperature";
|
||||||
$config['os'][$os]['over'][0]['text'] = "temperature";
|
$config['os'][$os]['over'][0]['text'] = "temperature";
|
||||||
|
|
||||||
@@ -622,88 +622,88 @@ $config['os'][$os]['over'][0]['graph'] = "device_temperature";
|
|||||||
$config['os'][$os]['over'][0]['text'] = "temperature";
|
$config['os'][$os]['over'][0]['text'] = "temperature";
|
||||||
|
|
||||||
$os = "papouch-tme";
|
$os = "papouch-tme";
|
||||||
$config['os'][$os]['text'] = "Papouch TME";
|
$config['os'][$os]['text'] = "Papouch TME";
|
||||||
$config['os'][$os]['type'] = "environment";
|
$config['os'][$os]['type'] = "environment";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_temperature";
|
$config['os'][$os]['over'][0]['graph'] = "device_temperature";
|
||||||
$config['os'][$os]['over'][0]['text'] = "temperature";
|
$config['os'][$os]['over'][0]['text'] = "temperature";
|
||||||
|
|
||||||
$os = "cometsystem-p85xx";
|
$os = "cometsystem-p85xx";
|
||||||
$config['os'][$os]['text'] = "Comet System P85xx";
|
$config['os'][$os]['text'] = "Comet System P85xx";
|
||||||
$config['os'][$os]['type'] = "environment";
|
$config['os'][$os]['type'] = "environment";
|
||||||
$config['os'][$os]['icon'] = "comet";
|
$config['os'][$os]['icon'] = "comet";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_temperature";
|
$config['os'][$os]['over'][0]['graph'] = "device_temperature";
|
||||||
$config['os'][$os]['over'][0]['text'] = "temperature";
|
$config['os'][$os]['over'][0]['text'] = "temperature";
|
||||||
|
|
||||||
$os = "dell-laser";
|
$os = "dell-laser";
|
||||||
$config['os'][$os]['group'] = "printer";
|
$config['os'][$os]['group'] = "printer";
|
||||||
$config['os'][$os]['text'] = "Dell Laser";
|
$config['os'][$os]['text'] = "Dell Laser";
|
||||||
$config['os'][$os]['ifname'] = 1;
|
$config['os'][$os]['ifname'] = 1;
|
||||||
$config['os'][$os]['type'] = "printer";
|
$config['os'][$os]['type'] = "printer";
|
||||||
$config['os'][$os]['icon'] = "dell";
|
$config['os'][$os]['icon'] = "dell";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_toner";
|
$config['os'][$os]['over'][0]['graph'] = "device_toner";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Toner";
|
$config['os'][$os]['over'][0]['text'] = "Toner";
|
||||||
|
|
||||||
$os = "ricoh";
|
$os = "ricoh";
|
||||||
$config['os'][$os]['group'] = "printer";
|
$config['os'][$os]['group'] = "printer";
|
||||||
$config['os'][$os]['text'] = "Ricoh Printer";
|
$config['os'][$os]['text'] = "Ricoh Printer";
|
||||||
$config['os'][$os]['type'] = "printer";
|
$config['os'][$os]['type'] = "printer";
|
||||||
$config['os'][$os]['icon'] = "ricoh";
|
$config['os'][$os]['icon'] = "ricoh";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_toner";
|
$config['os'][$os]['over'][0]['graph'] = "device_toner";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Toner";
|
$config['os'][$os]['over'][0]['text'] = "Toner";
|
||||||
|
|
||||||
$os = "xerox";
|
$os = "xerox";
|
||||||
$config['os'][$os]['group'] = "printer";
|
$config['os'][$os]['group'] = "printer";
|
||||||
$config['os'][$os]['text'] = "Xerox Printer";
|
$config['os'][$os]['text'] = "Xerox Printer";
|
||||||
$config['os'][$os]['ifname'] = 1;
|
$config['os'][$os]['ifname'] = 1;
|
||||||
$config['os'][$os]['type'] = "printer";
|
$config['os'][$os]['type'] = "printer";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_toner";
|
$config['os'][$os]['over'][0]['graph'] = "device_toner";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Toner";
|
$config['os'][$os]['over'][0]['text'] = "Toner";
|
||||||
|
|
||||||
$os = "jetdirect";
|
$os = "jetdirect";
|
||||||
$config['os'][$os]['group'] = "printer";
|
$config['os'][$os]['group'] = "printer";
|
||||||
$config['os'][$os]['text'] = "HP Print server";
|
$config['os'][$os]['text'] = "HP Print server";
|
||||||
$config['os'][$os]['ifname'] = 1;
|
$config['os'][$os]['ifname'] = 1;
|
||||||
$config['os'][$os]['type'] = "printer";
|
$config['os'][$os]['type'] = "printer";
|
||||||
$config['os'][$os]['icon'] = "hp";
|
$config['os'][$os]['icon'] = "hp";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_toner";
|
$config['os'][$os]['over'][0]['graph'] = "device_toner";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Toner";
|
$config['os'][$os]['over'][0]['text'] = "Toner";
|
||||||
|
|
||||||
$os = "richoh";
|
$os = "richoh";
|
||||||
$config['os'][$os]['group'] = "printer";
|
$config['os'][$os]['group'] = "printer";
|
||||||
$config['os'][$os]['text'] = "Ricoh Printer";
|
$config['os'][$os]['text'] = "Ricoh Printer";
|
||||||
$config['os'][$os]['type'] = "printer";
|
$config['os'][$os]['type'] = "printer";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_toner";
|
$config['os'][$os]['over'][0]['graph'] = "device_toner";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Toner";
|
$config['os'][$os]['over'][0]['text'] = "Toner";
|
||||||
|
|
||||||
$os = "okilan";
|
$os = "okilan";
|
||||||
$config['os'][$os]['group'] = "printer";
|
$config['os'][$os]['group'] = "printer";
|
||||||
$config['os'][$os]['text'] = "OKI Printer";
|
$config['os'][$os]['text'] = "OKI Printer";
|
||||||
$config['os'][$os]['overgraph'][] = "device_toner";
|
$config['os'][$os]['overgraph'][] = "device_toner";
|
||||||
$config['os'][$os]['overtext'] = "Toner";
|
$config['os'][$os]['overtext'] = "Toner";
|
||||||
$config['os'][$os]['type'] = "printer";
|
$config['os'][$os]['type'] = "printer";
|
||||||
$config['os'][$os]['icon'] = "oki";
|
$config['os'][$os]['icon'] = "oki";
|
||||||
|
|
||||||
$os = "brother";
|
$os = "brother";
|
||||||
$config['os'][$os]['group'] = "printer";
|
$config['os'][$os]['group'] = "printer";
|
||||||
$config['os'][$os]['text'] = "Brother Printer";
|
$config['os'][$os]['text'] = "Brother Printer";
|
||||||
$config['os'][$os]['type'] = "printer";
|
$config['os'][$os]['type'] = "printer";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_toner";
|
$config['os'][$os]['over'][0]['graph'] = "device_toner";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Toner";
|
$config['os'][$os]['over'][0]['text'] = "Toner";
|
||||||
|
|
||||||
$os = "konica";
|
$os = "konica";
|
||||||
$config['os'][$os]['group'] = "printer";
|
$config['os'][$os]['group'] = "printer";
|
||||||
$config['os'][$os]['text'] = "Konica-Minolta Printer";
|
$config['os'][$os]['text'] = "Konica-Minolta Printer";
|
||||||
$config['os'][$os]['type'] = "printer";
|
$config['os'][$os]['type'] = "printer";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_toner";
|
$config['os'][$os]['over'][0]['graph'] = "device_toner";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Toner";
|
$config['os'][$os]['over'][0]['text'] = "Toner";
|
||||||
|
|
||||||
$os = "kyocera";
|
$os = "kyocera";
|
||||||
$config['os'][$os]['group'] = "printer";
|
$config['os'][$os]['group'] = "printer";
|
||||||
$config['os'][$os]['text'] = "Kyocera Mita Printer";
|
$config['os'][$os]['text'] = "Kyocera Mita Printer";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_toner";
|
$config['os'][$os]['over'][0]['graph'] = "device_toner";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Toner";
|
$config['os'][$os]['over'][0]['text'] = "Toner";
|
||||||
$config['os'][$os]['ifname'] = 1;
|
$config['os'][$os]['ifname'] = 1;
|
||||||
$config['os'][$os]['type'] = "printer";
|
$config['os'][$os]['type'] = "printer";
|
||||||
|
|
||||||
$os = "3com";
|
$os = "3com";
|
||||||
$config['os'][$os]['text'] = "3Com";
|
$config['os'][$os]['text'] = "3Com";
|
||||||
@@ -712,11 +712,11 @@ $config['os'][$os]['over'][0]['text'] = "Traffic";
|
|||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
|
|
||||||
$os = "sentry3";
|
$os = "sentry3";
|
||||||
$config['os'][$os]['text'] = "ServerTech Sentry3";
|
$config['os'][$os]['text'] = "ServerTech Sentry3";
|
||||||
$config['os'][$os]['type'] = "power";
|
$config['os'][$os]['type'] = "power";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_current";
|
$config['os'][$os]['over'][0]['graph'] = "device_current";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Current";
|
$config['os'][$os]['over'][0]['text'] = "Current";
|
||||||
$config['os'][$os]['icon'] = "servertech";
|
$config['os'][$os]['icon'] = "servertech";
|
||||||
|
|
||||||
$os = "raritan";
|
$os = "raritan";
|
||||||
$config['os'][$os]['text'] = "Raritan PDU";
|
$config['os'][$os]['text'] = "Raritan PDU";
|
||||||
@@ -733,22 +733,22 @@ $config['os'][$os]['over'][0]['graph'] = "device_bits";
|
|||||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||||
|
|
||||||
$os = "mrvld";
|
$os = "mrvld";
|
||||||
$config['os'][$os]['group'] = "mrv";
|
$config['os'][$os]['group'] = "mrv";
|
||||||
$config['os'][$os]['text'] = "MRV LambdaDriver";
|
$config['os'][$os]['text'] = "MRV LambdaDriver";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['icon'] = "mrv";
|
$config['os'][$os]['icon'] = "mrv";
|
||||||
|
|
||||||
$os = "poweralert";
|
$os = "poweralert";
|
||||||
$config['os'][$os]['text'] = "Tripp Lite PowerAlert";
|
$config['os'][$os]['text'] = "Tripp Lite PowerAlert";
|
||||||
$config['os'][$os]['type'] = "power";
|
$config['os'][$os]['type'] = "power";
|
||||||
$config['os'][$os]['over'][0]['graph'] = "device_current";
|
$config['os'][$os]['over'][0]['graph'] = "device_current";
|
||||||
$config['os'][$os]['over'][0]['text'] = "Current";
|
$config['os'][$os]['over'][0]['text'] = "Current";
|
||||||
$config['os'][$os]['icon'] = "tripplite";
|
$config['os'][$os]['icon'] = "tripplite";
|
||||||
|
|
||||||
$os = "symbol";
|
$os = "symbol";
|
||||||
$config['os'][$os]['type'] = "network";
|
$config['os'][$os]['type'] = "network";
|
||||||
$config['os'][$os]['text'] = "Symbol AP";
|
$config['os'][$os]['text'] = "Symbol AP";
|
||||||
$config['os'][$os]['icon'] = "symbol";
|
$config['os'][$os]['icon'] = "symbol";
|
||||||
|
|
||||||
foreach($config['os'] as $this_os => $blah)
|
foreach($config['os'] as $this_os => $blah)
|
||||||
{
|
{
|
||||||
|
@@ -8,13 +8,14 @@
|
|||||||
|
|
||||||
function get_cache($host, $value){
|
function get_cache($host, $value){
|
||||||
global $dev_cache;
|
global $dev_cache;
|
||||||
if(!isset($dev_cache[$host][$value])){
|
|
||||||
|
if (!isset($dev_cache[$host][$value])){
|
||||||
switch($value){
|
switch($value){
|
||||||
case 'device_id':
|
case 'device_id':
|
||||||
//Try by hostname
|
//Try by hostname
|
||||||
$dev_cache[$host]['device_id'] = dbFetchCell('SELECT `device_id` FROM devices WHERE `hostname` = ? OR `sysName` = ?', array($host, $host));
|
$dev_cache[$host]['device_id'] = dbFetchCell('SELECT `device_id` FROM devices WHERE `hostname` = ? OR `sysName` = ?', array($host, $host));
|
||||||
//If failed, try by IP
|
//If failed, try by IP
|
||||||
if(!is_numeric($dev_cache[$host]['device_id'])) {
|
if (!is_numeric($dev_cache[$host]['device_id'])) {
|
||||||
$dev_cache[$host]['device_id'] = dbFetchCell('SELECT `device_id` FROM `ipv4_addresses` AS A, `ports` AS I WHERE A.ipv4_address = ? AND I.interface_id = A.interface_id', array($host));
|
$dev_cache[$host]['device_id'] = dbFetchCell('SELECT `device_id` FROM `ipv4_addresses` AS A, `ports` AS I WHERE A.ipv4_address = ? AND I.interface_id = A.interface_id', array($host));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -34,22 +35,23 @@ function get_cache($host, $value){
|
|||||||
|
|
||||||
function process_syslog ($entry, $update) {
|
function process_syslog ($entry, $update) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
global $dev_cache;
|
global $dev_cache;
|
||||||
|
|
||||||
foreach($config['syslog_filter'] as $bi)
|
foreach($config['syslog_filter'] as $bi)
|
||||||
if(strpos($entry['msg'], $bi) !== FALSE){
|
if (strpos($entry['msg'], $bi) !== FALSE){
|
||||||
print_r($entry);
|
print_r($entry);
|
||||||
echo('D-'.$bi);
|
echo('D-'.$bi);
|
||||||
return $entry;
|
return $entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
$entry['device_id'] = get_cache($entry['host'], 'device_id');
|
$entry['device_id'] = get_cache($entry['host'], 'device_id');
|
||||||
if($entry['device_id']) {
|
if ($entry['device_id']) {
|
||||||
$os = get_cache($entry['host'], 'os');
|
$os = get_cache($entry['host'], 'os');
|
||||||
|
|
||||||
if(in_array($os, array('ios', 'iosxe', 'catos'))){
|
if (in_array($os, array('ios', 'iosxe', 'catos'))){
|
||||||
$matches = array();
|
$matches = array();
|
||||||
# if(preg_match('#%(?P<program>.*):( ?)(?P<msg>.*)#', $entry['msg'], $matches)){
|
# if (preg_match('#%(?P<program>.*):( ?)(?P<msg>.*)#', $entry['msg'], $matches)){
|
||||||
# $entry['msg'] = $matches['msg'];
|
# $entry['msg'] = $matches['msg'];
|
||||||
# $entry['program'] = $matches['program'];
|
# $entry['program'] = $matches['program'];
|
||||||
# }
|
# }
|
||||||
@@ -87,7 +89,7 @@ function process_syslog ($entry, $update) {
|
|||||||
} elseif($os == 'linux' and get_cache($entry['host'], 'version') == 'Point'){
|
} elseif($os == 'linux' and get_cache($entry['host'], 'version') == 'Point'){
|
||||||
//Cisco WAP200 and similar
|
//Cisco WAP200 and similar
|
||||||
$matches = array();
|
$matches = array();
|
||||||
if(preg_match('#Log: \[(?P<program>.*)\] - (?P<msg>.*)#', $entry['msg'], $matches)){
|
if (preg_match('#Log: \[(?P<program>.*)\] - (?P<msg>.*)#', $entry['msg'], $matches)){
|
||||||
$entry['msg'] = $matches['msg'];
|
$entry['msg'] = $matches['msg'];
|
||||||
$entry['program'] = $matches['program'];
|
$entry['program'] = $matches['program'];
|
||||||
}
|
}
|
||||||
@@ -96,7 +98,7 @@ function process_syslog ($entry, $update) {
|
|||||||
} elseif($os == 'linux'){
|
} elseif($os == 'linux'){
|
||||||
$matches = array();
|
$matches = array();
|
||||||
//User_CommonName/123.213.132.231:39872 VERIFY OK: depth=1, /C=PL/ST=Malopolska/O=VLO/CN=v-lo.krakow.pl/emailAddress=root@v-lo.krakow.pl
|
//User_CommonName/123.213.132.231:39872 VERIFY OK: depth=1, /C=PL/ST=Malopolska/O=VLO/CN=v-lo.krakow.pl/emailAddress=root@v-lo.krakow.pl
|
||||||
if($entry['facility'] == 'daemon' and preg_match('#/([0-9]{1,3}\.){3}[0-9]{1,3}:[0-9]{4,} ([A-Z]([A-Za-z])+( ?)){2,}:#', $entry['msg'])){
|
if ($entry['facility'] == 'daemon' and preg_match('#/([0-9]{1,3}\.){3}[0-9]{1,3}:[0-9]{4,} ([A-Z]([A-Za-z])+( ?)){2,}:#', $entry['msg'])){
|
||||||
$entry['program'] = 'OpenVPN';
|
$entry['program'] = 'OpenVPN';
|
||||||
}
|
}
|
||||||
//pop3-login: Login: user=<username>, method=PLAIN, rip=123.213.132.231, lip=123.213.132.231, TLS
|
//pop3-login: Login: user=<username>, method=PLAIN, rip=123.213.132.231, lip=123.213.132.231, TLS
|
||||||
@@ -126,14 +128,14 @@ function process_syslog ($entry, $update) {
|
|||||||
unset($matches);
|
unset($matches);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isset($entry['program'])){
|
if (!isset($entry['program'])){
|
||||||
$entry['program'] = $entry['msg'];
|
$entry['program'] = $entry['msg'];
|
||||||
unset($entry['msg']);
|
unset($entry['msg']);
|
||||||
}
|
}
|
||||||
$entry['program'] = strtoupper($entry['program']);
|
$entry['program'] = strtoupper($entry['program']);
|
||||||
array_walk($entry, 'trim');
|
array_walk($entry, 'trim');
|
||||||
|
|
||||||
if($update)
|
if ($update)
|
||||||
dbInsert(
|
dbInsert(
|
||||||
array(
|
array(
|
||||||
'device_id' => $entry['device_id'],
|
'device_id' => $entry['device_id'],
|
||||||
|
@@ -24,13 +24,13 @@ if($dataHandle)
|
|||||||
{
|
{
|
||||||
$data.= fread($dataHandle, 4096);
|
$data.= fread($dataHandle, 4096);
|
||||||
}
|
}
|
||||||
if($data)
|
if ($data)
|
||||||
{
|
{
|
||||||
list($omnipotence, $year, $month, $revision) = explode(".", $data);
|
list($omnipotence, $year, $month, $revision) = explode(".", $data);
|
||||||
list($cur, $tag) = explode("-", $config['version']);
|
list($cur, $tag) = explode("-", $config['version']);
|
||||||
list($cur_omnipotence, $cur_year, $cur_month, $cur_revision) = explode(".", $cur);
|
list($cur_omnipotence, $cur_year, $cur_month, $cur_revision) = explode(".", $cur);
|
||||||
|
|
||||||
if($argv[1] == "--cron" || isset($options['q'])) {
|
if ($argv[1] == "--cron" || isset($options['q'])) {
|
||||||
|
|
||||||
$fd = fopen($config['log_file'],'a');
|
$fd = fopen($config['log_file'],'a');
|
||||||
fputs($fd,$string . "\n");
|
fputs($fd,$string . "\n");
|
||||||
@@ -40,10 +40,10 @@ if($dataHandle)
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if($cur != $data) {
|
if ($cur != $data) {
|
||||||
echo("Current Version : $cur_omnipotence.$cur_year.$cur_month.$cur_revision \n");
|
echo("Current Version : $cur_omnipotence.$cur_year.$cur_month.$cur_revision \n");
|
||||||
|
|
||||||
if($omnipotence > $cur_omnipotence) {
|
if ($omnipotence > $cur_omnipotence) {
|
||||||
echo("New version : $omnipotence.$year.$month.$revision\n");
|
echo("New version : $omnipotence.$year.$month.$revision\n");
|
||||||
} elseif ($year > $cur_year) {
|
} elseif ($year > $cur_year) {
|
||||||
echo("New version : $omnipotence.$year.$month.$revision\n");
|
echo("New version : $omnipotence.$year.$month.$revision\n");
|
||||||
|
Reference in New Issue
Block a user