From 515b01c2bd5014f35a8eb69b3feb11016a5af3c6 Mon Sep 17 00:00:00 2001 From: f0o Date: Wed, 19 Aug 2015 19:03:26 +0000 Subject: [PATCH 001/263] Add basic Pushbullet transport. --- doc/Extensions/Alerting.md | 12 ++++++ includes/alerts/transport.pushbullet.php | 47 ++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 includes/alerts/transport.pushbullet.php diff --git a/doc/Extensions/Alerting.md b/doc/Extensions/Alerting.md index aec8ee6e5..92d264e20 100644 --- a/doc/Extensions/Alerting.md +++ b/doc/Extensions/Alerting.md @@ -17,6 +17,7 @@ Table of Content: - [PagerDuty](#transports-pagerduty) - [Pushover](#transports-pushover) - [Boxcar](#transports-boxcar) + - [Pushbullet](#transports-pushbullet) - [Entities](#entities) - [Devices](#entity-devices) - [BGP Peers](#entity-bgppeers) @@ -360,6 +361,17 @@ $config['alert']['transports']['boxcar'][] = array( ``` ~~ +## Pushbullet + +Enabling Pushbullet is a piece of cake. +Get your Access Token from your Pushbullet's settings page and set it in your config like: + +~~ +```php +$config['alert']['transports']['pushbullet'] = 'MYFANCYACCESSTOKEN'; +``` +~~ + # Entities Entities as described earlier are based on the table and column names within the database, if you are ensure of what the entity is you want then have a browse around inside MySQL using `show tables` and `desc `. diff --git a/includes/alerts/transport.pushbullet.php b/includes/alerts/transport.pushbullet.php new file mode 100644 index 000000000..c5d75f4ef --- /dev/null +++ b/includes/alerts/transport.pushbullet.php @@ -0,0 +1,47 @@ +/* Copyright (C) 2015 Daniel Preussker + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ + +/** + * Pushbullet API Transport + * @author f0o + * @copyright 2015 f0o, LibreNMS + * @license GPL + * @package LibreNMS + * @subpackage Alerts + */ + +// Note: At this point it might be useful to iterate through $obj['contacts'] and send each of them a note ? + +$data = array("type" => "note", "title" => $obj['title'], "body" => $obj['msg']); +$data = json_encode($data); + +$curl = curl_init('https://api.pushbullet.com/v2/pushes'); +curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST"); +curl_setopt($curl, CURLOPT_POSTFIELDS, $data); +curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); +curl_setopt($curl, CURLOPT_HTTPHEADER, array( + 'Content-Type: application/json', + 'Content-Length: '.strlen($data), + 'Authorization: Bearer '.$opts, +)); + +$ret = curl_exec($curl); +$code = curl_getinfo($curl, CURLINFO_HTTP_CODE); +if( $code > 201 ) { + if( $debug ) { + var_dump($ret); + } + return false; +} +return true; From 325d9cd82bce35ed4e4b1a46b60bd4e9df1fe989 Mon Sep 17 00:00:00 2001 From: f0o Date: Wed, 19 Aug 2015 19:37:41 +0000 Subject: [PATCH 002/263] First attempt to add the WebUI settings --- html/pages/settings/alerting.inc.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/html/pages/settings/alerting.inc.php b/html/pages/settings/alerting.inc.php index f3a4cf0d3..ef58465db 100644 --- a/html/pages/settings/alerting.inc.php +++ b/html/pages/settings/alerting.inc.php @@ -799,6 +799,25 @@ echo '
+
+
+

+ Pushbullet +

+
+
+
+
+ +
+
+ + +
+
+
+
+
'; From 8d929bc43cebc512e6e02231da81838f6dda134e Mon Sep 17 00:00:00 2001 From: laf Date: Sun, 23 Aug 2015 17:04:20 +0000 Subject: [PATCH 003/263] Moved the snmp query for poe outside of the loop --- includes/polling/port-poe.inc.php | 4 ++-- includes/polling/ports.inc.php | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/includes/polling/port-poe.inc.php b/includes/polling/port-poe.inc.php index 3e48e9336..1537deafc 100644 --- a/includes/polling/port-poe.inc.php +++ b/includes/polling/port-poe.inc.php @@ -35,8 +35,8 @@ $peth_oids = array( 'pethMainPseConsumptionPower', ); -$port_stats = snmpwalk_cache_oid($device, 'pethPsePortEntry', $port_stats, 'POWER-ETHERNET-MIB'); -$port_stats = snmpwalk_cache_oid($device, 'cpeExtPsePortEntry', $port_stats, 'CISCO-POWER-ETHERNET-EXT-MIB'); +//$port_stats = snmpwalk_cache_oid($device, 'pethPsePortEntry', $port_stats, 'POWER-ETHERNET-MIB'); +//$port_stats = snmpwalk_cache_oid($device, 'cpeExtPsePortEntry', $port_stats, 'CISCO-POWER-ETHERNET-EXT-MIB'); if ($port_stats[$port['ifIndex']] && $port['ifType'] == 'ethernetCsmacd' diff --git a/includes/polling/ports.inc.php b/includes/polling/ports.inc.php index ec4aa092f..e1df712ba 100644 --- a/includes/polling/ports.inc.php +++ b/includes/polling/ports.inc.php @@ -145,6 +145,11 @@ if ($device['adsl_count'] > '0') { $port_stats = snmpwalk_cache_oid($device, '.1.3.6.1.2.1.10.94.1.1.7.1.7', $port_stats, 'ADSL-LINE-MIB'); }//end if +if ($config['enable_ports_poe']) { + $port_stats = snmpwalk_cache_oid($device, 'pethPsePortEntry', $port_stats, 'POWER-ETHERNET-MIB'); + $port_stats = snmpwalk_cache_oid($device, 'cpeExtPsePortEntry', $port_stats, 'CISCO-POWER-ETHERNET-EXT-MIB'); +} + // FIXME This probably needs re-enabled. We need to clear these things when they get unset, too. // foreach ($etherlike_oids as $oid) { $port_stats = snmpwalk_cache_oid($device, $oid, $port_stats, "EtherLike-MIB"); } // foreach ($cisco_oids as $oid) { $port_stats = snmpwalk_cache_oid($device, $oid, $port_stats, "OLD-CISCO-INTERFACES-MIB"); } From 8bf254182b0b36837451b2d42045d91b775663b0 Mon Sep 17 00:00:00 2001 From: laf Date: Sun, 23 Aug 2015 17:54:55 +0000 Subject: [PATCH 004/263] Removed commented out code --- includes/polling/port-poe.inc.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/includes/polling/port-poe.inc.php b/includes/polling/port-poe.inc.php index 1537deafc..2263a1a5e 100644 --- a/includes/polling/port-poe.inc.php +++ b/includes/polling/port-poe.inc.php @@ -35,9 +35,6 @@ $peth_oids = array( 'pethMainPseConsumptionPower', ); -//$port_stats = snmpwalk_cache_oid($device, 'pethPsePortEntry', $port_stats, 'POWER-ETHERNET-MIB'); -//$port_stats = snmpwalk_cache_oid($device, 'cpeExtPsePortEntry', $port_stats, 'CISCO-POWER-ETHERNET-EXT-MIB'); - if ($port_stats[$port['ifIndex']] && $port['ifType'] == 'ethernetCsmacd' && isset($port_stats[$port['ifIndex']]['dot3StatsIndex'])) { From d825903c4efea290d312942b012a5b61d48b5a43 Mon Sep 17 00:00:00 2001 From: laf Date: Sun, 23 Aug 2015 20:01:09 +0000 Subject: [PATCH 005/263] Checks if port is permitted for user before doing neighbour lookup --- html/includes/print-interface.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html/includes/print-interface.inc.php b/html/includes/print-interface.inc.php index bfb5d1bd7..223c169fc 100644 --- a/html/includes/print-interface.inc.php +++ b/html/includes/print-interface.inc.php @@ -233,7 +233,7 @@ if (strpos($port['label'], 'oopback') === false && !$graph_type) { }//end foreach }//end if - if ($port_details && $config['enable_port_relationship'] === true) { + if ($port_details && $config['enable_port_relationship'] === true && port_permitted($int_link,$device['device_id'])) { foreach ($int_links as $int_link) { $link_if = dbFetchRow('SELECT * from ports AS I, devices AS D WHERE I.device_id = D.device_id and I.port_id = ?', array($int_link)); @@ -263,7 +263,7 @@ if (strpos($port['label'], 'oopback') === false && !$graph_type) { // unset($int_links, $int_links_v6, $int_links_v4, $int_links_phys, $br); }//end if -if ($port_details && $config['enable_port_relationship'] === true) { +if ($port_details && $config['enable_port_relationship'] === true && port_permitted($port['port_id'], $device['device_id'])) { foreach (dbFetchRows('SELECT * FROM `pseudowires` WHERE `port_id` = ?', array($port['port_id'])) as $pseudowire) { // `port_id`,`peer_device_id`,`peer_ldp_id`,`cpwVcID`,`cpwOid` $pw_peer_dev = dbFetchRow('SELECT * FROM `devices` WHERE `device_id` = ?', array($pseudowire['peer_device_id'])); From a413968eb8c2f908ea4e5ece77efb388964f1bcf Mon Sep 17 00:00:00 2001 From: laf Date: Sun, 23 Aug 2015 20:06:28 +0000 Subject: [PATCH 006/263] Also use ifHighSpeed if ifSpeed is 0 and ifHighSpeed exists --- includes/polling/ports.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/polling/ports.inc.php b/includes/polling/ports.inc.php index ec4aa092f..b05003679 100644 --- a/includes/polling/ports.inc.php +++ b/includes/polling/ports.inc.php @@ -289,7 +289,7 @@ foreach ($ports as $port) { } // Overwrite ifSpeed with ifHighSpeed if it's over 1G - if (is_numeric($this_port['ifHighSpeed']) && $this_port['ifSpeed'] > '1000000000') { + if ((is_numeric($this_port['ifHighSpeed']) && $this_port['ifSpeed'] > '1000000000') || (is_numeric($this_port['ifHighSpeed']) && $this_port['ifSpeed'] == 0)) { echo 'HighSpeed '; $this_port['ifSpeed'] = ($this_port['ifHighSpeed'] * 1000000); } From 0baa0d81e22db22206035291615c4cd174a61f5c Mon Sep 17 00:00:00 2001 From: laf Date: Sun, 23 Aug 2015 21:39:37 +0000 Subject: [PATCH 007/263] Reworked if check --- includes/polling/ports.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/polling/ports.inc.php b/includes/polling/ports.inc.php index b05003679..c102a664b 100644 --- a/includes/polling/ports.inc.php +++ b/includes/polling/ports.inc.php @@ -289,7 +289,7 @@ foreach ($ports as $port) { } // Overwrite ifSpeed with ifHighSpeed if it's over 1G - if ((is_numeric($this_port['ifHighSpeed']) && $this_port['ifSpeed'] > '1000000000') || (is_numeric($this_port['ifHighSpeed']) && $this_port['ifSpeed'] == 0)) { + if (is_numeric($this_port['ifHighSpeed']) && ($this_port['ifSpeed'] > '1000000000' || $this_port['ifSpeed'] == 0)) { echo 'HighSpeed '; $this_port['ifSpeed'] = ($this_port['ifHighSpeed'] * 1000000); } From 4e084c9632949898a559ca1480ad0c16886a173c Mon Sep 17 00:00:00 2001 From: Todd Eddy Date: Sun, 23 Aug 2015 19:01:39 -0400 Subject: [PATCH 008/263] Add netgear OID to os discovery --- includes/discovery/os/netgear.inc.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/discovery/os/netgear.inc.php b/includes/discovery/os/netgear.inc.php index 4c8e8246c..21068df05 100644 --- a/includes/discovery/os/netgear.inc.php +++ b/includes/discovery/os/netgear.inc.php @@ -4,4 +4,7 @@ if (!$os) { if (stristr($sysDescr, 'ProSafe')) { $os = 'netgear'; } + elseif (strpos($sysObjectId, '1.3.6.1.4.1.4526') !== FALSE) { + $os = 'netgear'; + } } From 103221f76515640cf5dd4af60309c2dec36cc76f Mon Sep 17 00:00:00 2001 From: f0o Date: Mon, 24 Aug 2015 14:59:43 +0100 Subject: [PATCH 009/263] Added Config-SQL --- sql-schema/064.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql-schema/064.sql diff --git a/sql-schema/064.sql b/sql-schema/064.sql new file mode 100644 index 000000000..13ebbb243 --- /dev/null +++ b/sql-schema/064.sql @@ -0,0 +1 @@ +insert into config (config_name,config_value,config_default,config_descr,config_group,config_group_order,config_sub_group,config_sub_group_order,config_hidden,config_disabled) values ('alert.transports.pushbullet','','','Pushbullet access token','alerting',0,'transports',0,'0','0'); From 59de0d1478903c0917c3f1a9ea474f33f06212d4 Mon Sep 17 00:00:00 2001 From: laf Date: Mon, 24 Aug 2015 20:54:19 +0000 Subject: [PATCH 010/263] Clean up some poller debug + added updated version and last git commit --- discovery.php | 4 ++-- includes/definitions.inc.php | 2 +- includes/polling/functions.inc.php | 3 ++- poller.php | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/discovery.php b/discovery.php index c70878054..9dc39f4fe 100755 --- a/discovery.php +++ b/discovery.php @@ -23,11 +23,11 @@ require 'includes/discovery/functions.inc.php'; $start = utime(); $runtime_stats = array(); -// Observium Device Discovery $options = getopt('h:m:i:n:d::a::q'); if (!isset($options['q'])) { - echo $config['project_name_version']." Discovery\n\n"; + echo $config['project_name_version']." Discovery\n"; + echo `git log -n 1|grep 'commit '`."\n"; } if (isset($options['h'])) { diff --git a/includes/definitions.inc.php b/includes/definitions.inc.php index e98c7b07e..0744d79c8 100644 --- a/includes/definitions.inc.php +++ b/includes/definitions.inc.php @@ -1633,7 +1633,7 @@ if (isset($config['enable_printers']) && $config['enable_printers']) { // // No changes below this line # // -$config['version'] = '2014.master'; +$config['version'] = '2015.master'; $config['project_name_version'] = $config['project_name'].' '.$config['version']; if (isset($config['rrdgraph_def_text'])) { diff --git a/includes/polling/functions.inc.php b/includes/polling/functions.inc.php index 27bf8053f..d97555d46 100644 --- a/includes/polling/functions.inc.php +++ b/includes/polling/functions.inc.php @@ -278,7 +278,8 @@ function poll_device($device, $options) { // echo("$device_end - $device_start; $device_time $device_run"); echo "Polled in $device_time seconds\n"; - d_echo('Updating '.$device['hostname'].' - '.print_r($update_array)." \n"); + d_echo('Updating '.$device['hostname']."\n"); + d_echo($update_array); $updated = dbUpdate($update_array, 'devices', '`device_id` = ?', array($device['device_id'])); if ($updated) { diff --git a/poller.php b/poller.php index 62bb94cd7..26f90c505 100755 --- a/poller.php +++ b/poller.php @@ -22,7 +22,8 @@ require 'includes/polling/functions.inc.php'; require 'includes/alerts.inc.php'; $poller_start = utime(); -echo $config['project_name_version']." Poller\n\n"; +echo $config['project_name_version']." Poller\n"; +echo `git log -n 1|grep 'commit '`."\n"; $options = getopt('h:m:i:n:r::d::a::'); From 86059f67c126f4d552e8750ea25bb04178aa93a3 Mon Sep 17 00:00:00 2001 From: laf Date: Tue, 25 Aug 2015 08:40:20 +0000 Subject: [PATCH 011/263] updated to use function for last commit --- discovery.php | 2 +- includes/functions.php | 4 ++++ poller.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/discovery.php b/discovery.php index 9dc39f4fe..3006399ff 100755 --- a/discovery.php +++ b/discovery.php @@ -27,7 +27,7 @@ $options = getopt('h:m:i:n:d::a::q'); if (!isset($options['q'])) { echo $config['project_name_version']." Discovery\n"; - echo `git log -n 1|grep 'commit '`."\n"; + echo get_last_commit()."\n"; } if (isset($options['h'])) { diff --git a/includes/functions.php b/includes/functions.php index 0027748ee..84e95af1d 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1227,3 +1227,7 @@ function fping($host,$params) { function function_check($function) { return function_exists($function); } + +function get_last_commit() { + return `git log -n 1|head -n1`; +}//end get_last_commit diff --git a/poller.php b/poller.php index 26f90c505..6412c37be 100755 --- a/poller.php +++ b/poller.php @@ -23,7 +23,7 @@ require 'includes/alerts.inc.php'; $poller_start = utime(); echo $config['project_name_version']." Poller\n"; -echo `git log -n 1|grep 'commit '`."\n"; +echo get_last_commit()."\n"; $options = getopt('h:m:i:n:r::d::a::'); From e7c51f2a80814b214ff8dccbd380b6227ec88fdb Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 6 Jul 2015 09:25:23 -0400 Subject: [PATCH 012/263] add mysql lock for polling --- includes/dbFacile.mysql.php | 28 ++++++++++++++++++++++++++++ includes/dbFacile.mysqli.php | 27 +++++++++++++++++++++++++++ poller.php | 8 +++++--- 3 files changed, 60 insertions(+), 3 deletions(-) diff --git a/includes/dbFacile.mysql.php b/includes/dbFacile.mysql.php index 0d1d7150c..44dc5d494 100644 --- a/includes/dbFacile.mysql.php +++ b/includes/dbFacile.mysql.php @@ -59,6 +59,34 @@ function dbQuery($sql, $parameters=array()) { }//end dbQuery() +/* + * Aquire a lock on a string + * */ +function dbGetLock($data, $timeout = 0) { + $sql = 'SELECT GET_LOCK(\'' . $data . '\',' . $timeout . ')'; + echo "printing sql: "; + echo "$sql\n"; + $result = dbFetchCell($sql); + echo "printing result: "; + echo "$result\n"; + return $result; +} + + +/* + * Release a lock on a string + * */ +function dbReleaseLock($data, $timeout = 0) { + $sql = 'SELECT RELEASE_LOCK(\'' . $data . '\')'; + echo "printing sql: "; + echo "$sql\n"; + $result = dbFetchCell($sql); + echo "printing result: "; + echo "$result\n"; + return $result; +} + + /* * Passed an array and a table name, it attempts to insert the data into the table. * Check for boolean false to determine whether insert failed diff --git a/includes/dbFacile.mysqli.php b/includes/dbFacile.mysqli.php index 2408ca990..7b48ad6b9 100644 --- a/includes/dbFacile.mysqli.php +++ b/includes/dbFacile.mysqli.php @@ -59,6 +59,33 @@ function dbQuery($sql, $parameters=array()) { }//end dbQuery() +/* + * Aquire a lock on a string + * */ +function dbGetLock($data, $timeout = 0) { + $sql = 'SELECT GET_LOCK(\'' . $data . '\',' . $timeout . ')'; + echo "printing sql: "; + echo "$sql\n"; + $result = dbFetchCell($sql); + echo "printing result: "; + echo "$result\n"; + return $result; +} + + +/* + * Release a lock on a string + * */ +function dbReleaseLock($data, $timeout = 0) { + $sql = 'SELECT RELEASE_LOCK(\'' . $data . '\')'; + echo "printing sql: "; + echo "$sql\n"; + $result = dbFetchCell($sql); + echo "printing result: "; + echo "$result\n"; + return $result; +} + /* * Passed an array and a table name, it attempts to insert the data into the table. * Check for boolean false to determine whether insert failed diff --git a/poller.php b/poller.php index 6412c37be..8c2b32881 100755 --- a/poller.php +++ b/poller.php @@ -110,9 +110,11 @@ if (!isset($query)) { foreach (dbFetch($query) as $device) { $device = dbFetchRow("SELECT * FROM `devices` WHERE `device_id` = '".$device['device_id']."'"); - poll_device($device, $options); - RunRules($device['device_id']); - echo "\r\n"; + if (dbGetLock('polling.' . $device['device_id'])) { + poll_device($device, $options); + RunRules($device['device_id']); + echo "\r\n"; + } $polled_devices++; } From 8e34e83d9740bea782775077ff130c5e5960e758 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 6 Jul 2015 09:59:24 -0400 Subject: [PATCH 013/263] add swp to gitignore for vim --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d56e86250..5c73ae6be 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ nbproject .alerts.lock .ircbot.alert .metadata_never_index +*.swp From b34fcf872851e0ee530aeea929dc298364d5445a Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 6 Jul 2015 10:19:05 -0400 Subject: [PATCH 014/263] remove debug echos --- includes/dbFacile.mysql.php | 11 +---------- includes/dbFacile.mysqli.php | 10 +--------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/includes/dbFacile.mysql.php b/includes/dbFacile.mysql.php index 44dc5d494..9fd82c698 100644 --- a/includes/dbFacile.mysql.php +++ b/includes/dbFacile.mysql.php @@ -64,11 +64,7 @@ function dbQuery($sql, $parameters=array()) { * */ function dbGetLock($data, $timeout = 0) { $sql = 'SELECT GET_LOCK(\'' . $data . '\',' . $timeout . ')'; - echo "printing sql: "; - echo "$sql\n"; $result = dbFetchCell($sql); - echo "printing result: "; - echo "$result\n"; return $result; } @@ -78,15 +74,10 @@ function dbGetLock($data, $timeout = 0) { * */ function dbReleaseLock($data, $timeout = 0) { $sql = 'SELECT RELEASE_LOCK(\'' . $data . '\')'; - echo "printing sql: "; - echo "$sql\n"; $result = dbFetchCell($sql); - echo "printing result: "; - echo "$result\n"; return $result; -} - + /* * Passed an array and a table name, it attempts to insert the data into the table. * Check for boolean false to determine whether insert failed diff --git a/includes/dbFacile.mysqli.php b/includes/dbFacile.mysqli.php index 7b48ad6b9..36b2208cb 100644 --- a/includes/dbFacile.mysqli.php +++ b/includes/dbFacile.mysqli.php @@ -64,11 +64,7 @@ function dbQuery($sql, $parameters=array()) { * */ function dbGetLock($data, $timeout = 0) { $sql = 'SELECT GET_LOCK(\'' . $data . '\',' . $timeout . ')'; - echo "printing sql: "; - echo "$sql\n"; $result = dbFetchCell($sql); - echo "printing result: "; - echo "$result\n"; return $result; } @@ -78,13 +74,9 @@ function dbGetLock($data, $timeout = 0) { * */ function dbReleaseLock($data, $timeout = 0) { $sql = 'SELECT RELEASE_LOCK(\'' . $data . '\')'; - echo "printing sql: "; - echo "$sql\n"; $result = dbFetchCell($sql); - echo "printing result: "; - echo "$result\n"; return $result; -} + /* * Passed an array and a table name, it attempts to insert the data into the table. From 7f262fd2cc3fcbd1b8daca8440d19fef493bab35 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 6 Jul 2015 10:47:18 -0400 Subject: [PATCH 015/263] limit sql query to amount_of_workers --- poller-service.py | 202 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 poller-service.py diff --git a/poller-service.py b/poller-service.py new file mode 100644 index 000000000..291e95534 --- /dev/null +++ b/poller-service.py @@ -0,0 +1,202 @@ +""" + poller-service A service to wrap SNMP polling. It will poll up to $threads devices at a time, and will not re-poll + devices that have been polled within the last $frequency seconds. It will prioritize devices based on + the last time polled. If resources are sufficient, this service should poll every device every + $frequency seconds, but should gracefully degrade if resources are inefficient, polling devices as + frequently as possible. This service is based on poller-wrapper.py. + + Author: Clint Armstrong + Date: July 2015 + + Usage: poller-service [threads] [frequency] + Default is 16 threads and 300 seconds. +""" + +import json +import os +import Queue +import subprocess +import sys +import threading +import time +import MySQLdb + +install_dir = os.path.dirname(os.path.realpath(__file__)) +config_file = ob_install_dir + '/config.php' + +def get_config_data(): + config_cmd = ['/usr/bin/env', 'php', '%s/config_to_json.php' % ob_install_dir] + try: + proc = subprocess.Popen(config_cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE) + except: + print "ERROR: Could not execute: %s" % config_cmd + sys.exit(2) + return proc.communicate()[0] + +try: + with open(config_file) as f: + pass +except IOError as e: + print "ERROR: Oh dear... %s does not seem readable" % config_file + sys.exit(2) + +try: + config = json.loads(get_config_data()) +except: + print "ERROR: Could not load or parse configuration, are PATHs correct?" + sys.exit(2) + +poller_path = config['install_dir'] + '/poller.php' +db_username = config['db_user'] +db_password = config['db_pass'] + +if config['db_host'][:5].lower() == 'unix:': + db_server = config['db_host'] + db_port = 0 +elif ':' in config['db_host']: + db_server = config['db_host'].rsplit(':')[0] + db_port = int(config['db_host'].rsplit(':')[1]) +else: + db_server = config['db_host'] + db_port =0 + +db_dbname = config['db_name'] + +# (c) 2015, GPLv3, Daniel Preussker << 300: + print "WARNING: the process took more than 5 minutes to finish, you need faster hardware or more threads" + print "INFO: in sequential style polling the elapsed time would have been: %s seconds" % real_duration + for device in per_device_duration: + if per_device_duration[device] > 300: + print "WARNING: device %s is taking too long: %s seconds" % (device, per_device_duration[device]) + show_stopper = True + if show_stopper: + print "ERROR: Some devices are taking more than 300 seconds, the script cannot recommend you what to do." + else: + recommend = int(total_time / 300.0 * amount_of_workers + 1) + print "WARNING: Consider setting a minimum of %d threads. (This does not constitute professional advice!)" % recommend + + sys.exit(2) From 72844d112ea00975c29ec5efb2b98dd43ec21f8c Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 6 Jul 2015 10:50:08 -0400 Subject: [PATCH 016/263] make poller-service executable --- poller-service.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 poller-service.py diff --git a/poller-service.py b/poller-service.py old mode 100644 new mode 100755 From 2ba1d9e0ece2a9c7a1446b179878cf61ddfa3e4e Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 6 Jul 2015 10:52:32 -0400 Subject: [PATCH 017/263] add shebang --- poller-service.py | 1 + 1 file changed, 1 insertion(+) diff --git a/poller-service.py b/poller-service.py index 291e95534..0bdf2a08c 100755 --- a/poller-service.py +++ b/poller-service.py @@ -1,3 +1,4 @@ +#! /usr/bin/env python """ poller-service A service to wrap SNMP polling. It will poll up to $threads devices at a time, and will not re-poll devices that have been polled within the last $frequency seconds. It will prioritize devices based on From e479d8cf69fbacc48a70c1885ebea1059ceac7e3 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 6 Jul 2015 10:52:59 -0400 Subject: [PATCH 018/263] change variables --- poller-service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poller-service.py b/poller-service.py index 0bdf2a08c..08d1a7754 100755 --- a/poller-service.py +++ b/poller-service.py @@ -23,10 +23,10 @@ import time import MySQLdb install_dir = os.path.dirname(os.path.realpath(__file__)) -config_file = ob_install_dir + '/config.php' +config_file = install_dir + '/config.php' def get_config_data(): - config_cmd = ['/usr/bin/env', 'php', '%s/config_to_json.php' % ob_install_dir] + config_cmd = ['/usr/bin/env', 'php', '%s/config_to_json.php' % install_dir] try: proc = subprocess.Popen(config_cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE) except: From bd054d7a81856796576ec406c0e921dc23700919 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 6 Jul 2015 12:00:21 -0400 Subject: [PATCH 019/263] first attempt at looping logic --- poller-service.py | 86 ++++++++++++++++++++++++++++++----------------- 1 file changed, 55 insertions(+), 31 deletions(-) diff --git a/poller-service.py b/poller-service.py index 08d1a7754..82fc7ed4c 100755 --- a/poller-service.py +++ b/poller-service.py @@ -21,6 +21,7 @@ import sys import threading import time import MySQLdb +from datetime import datetime, timedelta install_dir = os.path.dirname(os.path.realpath(__file__)) config_file = install_dir + '/config.php' @@ -70,6 +71,11 @@ else: poller_group = False # EOC1 +s_time = time.time() +real_duration = 0 +per_device_duration = {} +polled_devices = 0 + # Take the amount of threads we want to run in parallel from the commandline # if None are given or the argument was garbage, fall back to default of 16 try: @@ -100,15 +106,6 @@ except: print "ERROR: Could not connect to MySQL database!" sys.exit(2) -# Query ordering based on last polled date, so that the device with the oldest data is polled first. -query = 'select device_id from devices {} disabled = 0 order by last_polled asc limit {}'.format( - 'where poller_group IN({}) and'.format(poller_group) if poller_group else '', - amount_of_workers) - -cursor.execute(query) -devices_list = cursor.fetchall() - - # A seperate queue and a single worker for printing information to the screen prevents # the good old joke: # @@ -118,6 +115,7 @@ devices_list = cursor.fetchall() def printworker(): nodeso = 0 while True: + worker_id, device_id, elapsed_time = print_queue.get() global real_duration global per_device_duration global polled_devices @@ -130,41 +128,67 @@ def printworker(): print "WARNING: worker %s finished device %s in %s seconds" % (worker_id, device_id, elapsed_time) print_queue.task_done() -def poll_worker(): - while True: - device_id = poll_queue.get() - try: - start_time = time.time() - command = "/usr/bin/env php %s -h %s >> /dev/null 2>&1" % (poller_path, device_id) - subprocess.check_call(command, shell=True) - elapsed_time = int(time.time() - start_time) - print_queue.put([threading.current_thread().name, device_id, elapsed_time]) - except (KeyboardInterrupt, SystemExit): - raise - except: - pass - poll_queue.task_done() +def poll_worker(device_id): + try: + start_time = time.time() + command = "/usr/bin/env php %s -h %s >> /dev/null 2>&1" % (poller_path, device_id) + subprocess.check_call(command, shell=True) + elapsed_time = int(time.time() - start_time) + print_queue.put([threading.current_thread().name, device_id, elapsed_time]) + except (KeyboardInterrupt, SystemExit): + raise + except: + pass -poll_queue = Queue.Queue() print_queue = Queue.Queue() print "INFO: starting the poller at %s with %s threads, slowest devices first" % (time.strftime("%Y-%m-%d %H:%M:%S"), amount_of_workers) -for device_id in devices_list: - poll_queue.put(device_id) -for i in range(amount_of_workers): - t = threading.Thread(target=poll_worker) - t.setDaemon(True) - t.start() +def queue_feeder(): + while True: + if threading.active_count() > amount_of_workers + 1: + time.sleep(1) + continue + + query = 'select device_id,last_polled from devices {} disabled = 0 order by last_polled asc'.format( + 'where poller_group IN({}) and'.format(poller_group) if poller_group else '') + cursor.execute(query) + for device_id, last_polled in cursor.fetchall(): + cursor.execute("SELECT IS_FREE_LOCK('polling.{}')".format(device_id)) + if cursor.fetchone()[0] != 1: + continue + cursor.execute("SELECT IS_FREE_LOCK('queued.{}')".format(device_id)) + if cursor.fetchone()[0] != 1: + continue + last_polled_date = strptime(last_polled, '%Y-%m-%d %H:%M:%S') + if last_polled_date < datetime.now() - timedelta(seconds=frequency): + t = threading.Thread(target=poll_worker(device_id)) + t.setDaemon(True) + t.start() + break + else: + cursor.execute("SELECT GET_LOCK('queued.{}')".format(device_id)) + if cursor.fetchone()[0] != 1: + break + sleeptime = ((last_polled_date + timedelta(seconds=300)) - datetime.now()).seconds + datetime.sleep(sleeptime) + t = threading.Thread(target=poll_worker(device_id)) + t.setDaemon(True) + t.start() + cursor.execute("SELECT RELEASE_LOCK('queued.{}')".format(device_id)) + break p = threading.Thread(target=printworker) p.setDaemon(True) p.start() +f = threading.Thread(target=queue_feeder) +f.setDaemon(True) +f.start() + try: - poll_queue.join() print_queue.join() except (KeyboardInterrupt, SystemExit): raise From 4d3b7a3c0fe75ff31af5569714506b635bd3c748 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 6 Jul 2015 14:51:03 -0400 Subject: [PATCH 020/263] working --- poller-service.py | 140 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 98 insertions(+), 42 deletions(-) diff --git a/poller-service.py b/poller-service.py index 82fc7ed4c..60588dde6 100755 --- a/poller-service.py +++ b/poller-service.py @@ -90,17 +90,28 @@ except: # if None are given or the argument was garbage, fall back to default of 300 try: frequency = int(sys.argv[2]) - if amount_of_workers == 0: + if frequency == 0: print "ERROR: 0 seconds is not a valid value" sys.exit(2) except: frequency = 300 +# Take the down_retry value from the commandline +# if None are given or the argument was garbage, fall back to default of 15 +try: + down_retry = int(sys.argv[3]) + if down_retry == 0: + print "ERROR: 0 seconds is not a valid value" + sys.exit(2) +except: + down_retry = 15 + try: if db_port == 0: db = MySQLdb.connect(host=db_server, user=db_username, passwd=db_password, db=db_dbname) else: db = MySQLdb.connect(host=db_server, port=db_port, user=db_username, passwd=db_password, db=db_dbname) + db.autocommit(True) cursor = db.cursor() except: print "ERROR: Could not connect to MySQL database!" @@ -137,56 +148,101 @@ def poll_worker(device_id): print_queue.put([threading.current_thread().name, device_id, elapsed_time]) except (KeyboardInterrupt, SystemExit): raise - except: - pass + #except: + # pass print_queue = Queue.Queue() -print "INFO: starting the poller at %s with %s threads, slowest devices first" % (time.strftime("%Y-%m-%d %H:%M:%S"), +print "INFO: starting the poller at %s with %s threads" % (time.strftime("%Y-%m-%d %H:%M:%S"), amount_of_workers) - -def queue_feeder(): - while True: - if threading.active_count() > amount_of_workers + 1: - time.sleep(1) - continue - - query = 'select device_id,last_polled from devices {} disabled = 0 order by last_polled asc'.format( - 'where poller_group IN({}) and'.format(poller_group) if poller_group else '') - cursor.execute(query) - for device_id, last_polled in cursor.fetchall(): - cursor.execute("SELECT IS_FREE_LOCK('polling.{}')".format(device_id)) - if cursor.fetchone()[0] != 1: - continue - cursor.execute("SELECT IS_FREE_LOCK('queued.{}')".format(device_id)) - if cursor.fetchone()[0] != 1: - continue - last_polled_date = strptime(last_polled, '%Y-%m-%d %H:%M:%S') - if last_polled_date < datetime.now() - timedelta(seconds=frequency): - t = threading.Thread(target=poll_worker(device_id)) - t.setDaemon(True) - t.start() - break - else: - cursor.execute("SELECT GET_LOCK('queued.{}')".format(device_id)) - if cursor.fetchone()[0] != 1: - break - sleeptime = ((last_polled_date + timedelta(seconds=300)) - datetime.now()).seconds - datetime.sleep(sleeptime) - t = threading.Thread(target=poll_worker(device_id)) - t.setDaemon(True) - t.start() - cursor.execute("SELECT RELEASE_LOCK('queued.{}')".format(device_id)) - break - p = threading.Thread(target=printworker) p.setDaemon(True) p.start() -f = threading.Thread(target=queue_feeder) -f.setDaemon(True) -f.start() +def lockFree(lock): + global cursor + query = "SELECT IS_FREE_LOCK('{}')".format(lock) + #print 'checking lock: {}'.format(query) + cursor.execute(query) + return cursor.fetchall()[0][0] == 1 + +def getLock(lock): + global cursor + query = "SELECT GET_LOCK('{}', 0)".format(lock) + #print 'getting lock: {}'.format(query) + cursor.execute(query) + return cursor.fetchall()[0][0] == 1 + +def releaseLock(lock): + global cursor + query = "SELECT RELEASE_LOCK('{}')".format(lock) + #print 'releasing lock: {}'.format(query) + cursor.execute(query) + return cursor.fetchall()[0][0] == 1 + +recently_scanned = {} + +while True: + print '{} threads currently active'.format(threading.active_count()) + while threading.active_count() >= amount_of_workers: + time.sleep(.5) + + #print 'querying for devices' + query = 'select device_id,last_polled from devices {} disabled = 0 order by last_polled asc'.format( + 'where poller_group IN({}) and'.format(poller_group) if poller_group else '') + cursor.execute(query) + devices = cursor.fetchall() + dead_retry_in = frequency + #print "first 5 devices: {}".format(devices[:5]) + for device_id, last_polled in devices: +# print 'trying device {}'.format(device_id) +# time.sleep(1) + if not lockFree('polling.{}'.format(device_id)): +# print 'polling lock is not free on {} continuing'.format(device_id) +# time.sleep(1) + continue + if not lockFree('queued.{}'.format(device_id)): +# print 'queued lock is not free on {} continuing'.format(device_id) +# time.sleep(1) + continue + try: + if ((recently_scanned[device_id] + timedelta(seconds=down_retry)) - datetime.now()).seconds > 1: + dead_retry_in = ((recently_scanned[device_id] + timedelta(seconds=down_retry)) - datetime.now()).seconds +# print 'device {} recently scanned already'.format(device_id) +# time.sleep(1) + continue + except KeyError: + pass + + # add queue lock, so if we sleep, we lock the next device against any other pollers, break + # if aquiring lock fails + if not getLock('queued.{}'.format(device_id)): +# print 'getting queue lock on {} failed'.format(device_id) +# time.sleep(1) + break + + if last_polled > datetime.now() - timedelta(seconds=frequency): + sleeptime = ((last_polled + timedelta(seconds=300)) - datetime.now()).seconds + if sleeptime > dead_retry_in: + print 'Sleeping {} seconds before retrying failed device'.format(dead_retry_in, device_id, last_polled) + time.sleep(dead_retry_in) + break + + print 'Sleeping {} seconds before polling {}, last polled {}'.format(sleeptime, device_id, last_polled) + time.sleep(sleeptime) + + print 'Starting poll of device {}, last polled {}'.format(device_id, last_polled) + recently_scanned[device_id] = datetime.now() + t = threading.Thread(target=poll_worker, args=[device_id]) + #t.setDaemon(True) + t.start() + #print 'thread launched' + + releaseLock('queued.{}'.format(device_id)) + + # If we made it this far, break out of the loop and query again. + break try: print_queue.join() From 99cf049645fc28ee5c14b200cad6f79e3aa0ebfc Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 6 Jul 2015 15:10:48 -0400 Subject: [PATCH 021/263] cleaned up --- poller-service.py | 85 ++++++++++------------------------------------- 1 file changed, 17 insertions(+), 68 deletions(-) diff --git a/poller-service.py b/poller-service.py index 60588dde6..7150e313b 100755 --- a/poller-service.py +++ b/poller-service.py @@ -26,6 +26,7 @@ from datetime import datetime, timedelta install_dir = os.path.dirname(os.path.realpath(__file__)) config_file = install_dir + '/config.php' + def get_config_data(): config_cmd = ['/usr/bin/env', 'php', '%s/config_to_json.php' % install_dir] try: @@ -53,24 +54,17 @@ db_username = config['db_user'] db_password = config['db_pass'] if config['db_host'][:5].lower() == 'unix:': - db_server = config['db_host'] - db_port = 0 + db_server = config['db_host'] + db_port = 0 elif ':' in config['db_host']: - db_server = config['db_host'].rsplit(':')[0] - db_port = int(config['db_host'].rsplit(':')[1]) + db_server = config['db_host'].rsplit(':')[0] + db_port = int(config['db_host'].rsplit(':')[1]) else: - db_server = config['db_host'] - db_port =0 + db_server = config['db_host'] + db_port = 0 db_dbname = config['db_name'] -# (c) 2015, GPLv3, Daniel Preussker <<= amount_of_workers: time.sleep(.5) - #print 'querying for devices' query = 'select device_id,last_polled from devices {} disabled = 0 order by last_polled asc'.format( - 'where poller_group IN({}) and'.format(poller_group) if poller_group else '') + 'where poller_group IN({}) and'.format(str(config['distributed_poller_group'])) + if 'distributed_poller_group' in config else '') cursor.execute(query) devices = cursor.fetchall() dead_retry_in = frequency - #print "first 5 devices: {}".format(devices[:5]) for device_id, last_polled in devices: -# print 'trying device {}'.format(device_id) -# time.sleep(1) if not lockFree('polling.{}'.format(device_id)): -# print 'polling lock is not free on {} continuing'.format(device_id) -# time.sleep(1) continue if not lockFree('queued.{}'.format(device_id)): -# print 'queued lock is not free on {} continuing'.format(device_id) -# time.sleep(1) continue try: if ((recently_scanned[device_id] + timedelta(seconds=down_retry)) - datetime.now()).seconds > 1: dead_retry_in = ((recently_scanned[device_id] + timedelta(seconds=down_retry)) - datetime.now()).seconds -# print 'device {} recently scanned already'.format(device_id) -# time.sleep(1) continue except KeyError: pass @@ -218,8 +204,6 @@ while True: # add queue lock, so if we sleep, we lock the next device against any other pollers, break # if aquiring lock fails if not getLock('queued.{}'.format(device_id)): -# print 'getting queue lock on {} failed'.format(device_id) -# time.sleep(1) break if last_polled > datetime.now() - timedelta(seconds=frequency): @@ -235,9 +219,7 @@ while True: print 'Starting poll of device {}, last polled {}'.format(device_id, last_polled) recently_scanned[device_id] = datetime.now() t = threading.Thread(target=poll_worker, args=[device_id]) - #t.setDaemon(True) t.start() - #print 'thread launched' releaseLock('queued.{}'.format(device_id)) @@ -248,36 +230,3 @@ try: print_queue.join() except (KeyboardInterrupt, SystemExit): raise - -total_time = int(time.time() - s_time) - -print "INFO: poller-wrapper polled %s devices in %s seconds with %s workers" % (polled_devices, total_time, amount_of_workers) - -show_stopper = False - -query = "update pollers set last_polled=NOW(), devices='%d', time_taken='%d' where poller_name='%s'" % (polled_devices, - total_time, config['distributed_poller_name']) -response = cursor.execute(query) -if response == 1: - db.commit() -else: - query = "insert into pollers set poller_name='%s', last_polled=NOW(), devices='%d', time_taken='%d'" % ( - config['distributed_poller_name'], polled_devices, total_time) - cursor.execute(query) - db.commit() -db.close() - -if total_time > 300: - print "WARNING: the process took more than 5 minutes to finish, you need faster hardware or more threads" - print "INFO: in sequential style polling the elapsed time would have been: %s seconds" % real_duration - for device in per_device_duration: - if per_device_duration[device] > 300: - print "WARNING: device %s is taking too long: %s seconds" % (device, per_device_duration[device]) - show_stopper = True - if show_stopper: - print "ERROR: Some devices are taking more than 300 seconds, the script cannot recommend you what to do." - else: - recommend = int(total_time / 300.0 * amount_of_workers + 1) - print "WARNING: Consider setting a minimum of %d threads. (This does not constitute professional advice!)" % recommend - - sys.exit(2) From 1dcaa51011acb7f5d3c434746bc87d116704b009 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Tue, 7 Jul 2015 10:09:55 -0400 Subject: [PATCH 022/263] more efficient sql queries, working well all night --- poller-service.py | 96 ++++++++++++++++++++++++++++++----------------- 1 file changed, 61 insertions(+), 35 deletions(-) diff --git a/poller-service.py b/poller-service.py index 7150e313b..13c3af851 100755 --- a/poller-service.py +++ b/poller-service.py @@ -176,53 +176,79 @@ def releaseLock(lock): cursor.execute(query) return cursor.fetchall()[0][0] == 1 -recently_scanned = {} +def sleep_until(timestamp): + now = datetime.now() + if timestamp > now: + sleeptime = (timestamp - now).seconds + else: + sleeptime = 0 + time.sleep(sleeptime) + +poller_group = ('and poller_group IN({}) ' + .format(str(config['distributed_poller_group'])) if 'distributed_poller_group' in config else '') + +# Add last_polled and last_polled_timetaken so we can sort by the time the last poll started, with the goal +# of having each device complete a poll within the given time range. +dev_query = ( 'SELECT device_id, ' + 'DATE_ADD( ' + ' DATE_SUB( ' + ' last_polled, ' + ' INTERVAL last_polled_timetaken SECOND ' + ' ), ' + ' INTERVAL {0} SECOND) AS next_poll ' + 'FROM devices WHERE ' + 'disabled = 0 ' + 'AND IS_FREE_LOCK(CONCAT("polling.", device_id)) ' + 'AND IS_FREE_LOCK(CONCAT("queued.", device_id)) ' + '{1} ' + 'ORDER BY next_poll asc ').format(frequency, poller_group) + +dont_retry = {} +threads = 0 while True: - print '{} threads currently active'.format(threading.active_count()) + cur_threads = threading.active_count() + if cur_threads != threads: + threads = cur_threads + print 'INFO: {} threads currently active'.format(threads) + + dont_retry = dict((dev, time) for dev, time in dont_retry.iteritems() if time > datetime.now()) + while threading.active_count() >= amount_of_workers: time.sleep(.5) - query = 'select device_id,last_polled from devices {} disabled = 0 order by last_polled asc'.format( - 'where poller_group IN({}) and'.format(str(config['distributed_poller_group'])) - if 'distributed_poller_group' in config else '') - cursor.execute(query) + cursor.execute(dev_query) devices = cursor.fetchall() - dead_retry_in = frequency - for device_id, last_polled in devices: - if not lockFree('polling.{}'.format(device_id)): - continue - if not lockFree('queued.{}'.format(device_id)): - continue - try: - if ((recently_scanned[device_id] + timedelta(seconds=down_retry)) - datetime.now()).seconds > 1: - dead_retry_in = ((recently_scanned[device_id] + timedelta(seconds=down_retry)) - datetime.now()).seconds - continue - except KeyError: - pass - - # add queue lock, so if we sleep, we lock the next device against any other pollers, break - # if aquiring lock fails + for device_id, next_poll in devices: + # add queue lock, so we lock the next device against any other pollers + # if this fails, the device is locked by another poller already if not getLock('queued.{}'.format(device_id)): - break + continue + if not lockFree('polling.{}'.format(device_id)): + releaseLock('queued.{}'.format(device_id)) + continue + if device_id in dont_retry: + releaseLock('queued.{}'.format(device_id)) + continue - if last_polled > datetime.now() - timedelta(seconds=frequency): - sleeptime = ((last_polled + timedelta(seconds=300)) - datetime.now()).seconds - if sleeptime > dead_retry_in: - print 'Sleeping {} seconds before retrying failed device'.format(dead_retry_in, device_id, last_polled) - time.sleep(dead_retry_in) - break + if next_poll > datetime.now(): + next_retry_device = min(dont_retry, key=dont_retry.get) + next_retry_time = dont_retry[next_retry_device] + if next_retry_time < next_poll: + device_id = next_retry_device + if not getLock('queued.{}'.format(device_id)): + continue + print 'INFO: Sleeping until {} before retrying failed device {}'.format(next_retry_time, device_id) + sleep_until(next_retry_time) + else: + print 'INFO: Sleeping until {} before polling {}'.format(next_poll, device_id) + sleep_until(next_poll) - print 'Sleeping {} seconds before polling {}, last polled {}'.format(sleeptime, device_id, last_polled) - time.sleep(sleeptime) - - print 'Starting poll of device {}, last polled {}'.format(device_id, last_polled) - recently_scanned[device_id] = datetime.now() + print 'INFO: Starting poll of device {}'.format(device_id) + dont_retry[device_id] = datetime.now() + timedelta(seconds=down_retry) t = threading.Thread(target=poll_worker, args=[device_id]) t.start() - releaseLock('queued.{}'.format(device_id)) - # If we made it this far, break out of the loop and query again. break From 4736544e7e691e125265bc6194a60ed496afb8e4 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Tue, 7 Jul 2015 10:27:40 -0400 Subject: [PATCH 023/263] fix bug on retrying failed devices --- poller-service.py | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/poller-service.py b/poller-service.py index 13c3af851..b07424d83 100755 --- a/poller-service.py +++ b/poller-service.py @@ -219,6 +219,7 @@ while True: cursor.execute(dev_query) devices = cursor.fetchall() + retry_devs_found = {} for device_id, next_poll in devices: # add queue lock, so we lock the next device against any other pollers # if this fails, the device is locked by another poller already @@ -228,21 +229,27 @@ while True: releaseLock('queued.{}'.format(device_id)) continue if device_id in dont_retry: + retry_devs_found[device_id] = dont_retry[device_id] releaseLock('queued.{}'.format(device_id)) continue if next_poll > datetime.now(): - next_retry_device = min(dont_retry, key=dont_retry.get) - next_retry_time = dont_retry[next_retry_device] - if next_retry_time < next_poll: - device_id = next_retry_device - if not getLock('queued.{}'.format(device_id)): - continue - print 'INFO: Sleeping until {} before retrying failed device {}'.format(next_retry_time, device_id) - sleep_until(next_retry_time) - else: - print 'INFO: Sleeping until {} before polling {}'.format(next_poll, device_id) - sleep_until(next_poll) + poll_action = 'polling' + sleep_until_time = next_poll + try: + next_retry_device = min(retry_devs_found, key=retry_devs_found.get) + next_retry_time = retry_devs_found[next_retry_device] + if next_retry_time < next_poll: + device_id = next_retry_device + if not getLock('queued.{}'.format(device_id)): + continue + poll_action = 'retrying failed device' + sleep_until_time = next_retry_time + except ValueError: + pass + + print 'INFO: Sleeping until {0} before {1} {2}'.format(next_poll, poll_action, device_id) + sleep_until(sleep_until_time) print 'INFO: Starting poll of device {}'.format(device_id) dont_retry[device_id] = datetime.now() + timedelta(seconds=down_retry) From e9ffc7a374398134cbc435863146b6a802a921ac Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Tue, 7 Jul 2015 10:35:36 -0400 Subject: [PATCH 024/263] thread numbers are meaningless --- poller-service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poller-service.py b/poller-service.py index b07424d83..bdf9a3aea 100755 --- a/poller-service.py +++ b/poller-service.py @@ -129,9 +129,9 @@ def printworker(): per_device_duration[device_id] = elapsed_time polled_devices += 1 if elapsed_time < 300: - print "INFO: worker %s finished device %s in %s seconds" % (worker_id, device_id, elapsed_time) + print "INFO: worker finished device %s in %s seconds" % (device_id, elapsed_time) else: - print "WARNING: worker %s finished device %s in %s seconds" % (worker_id, device_id, elapsed_time) + print "WARNING: worker finished device %s in %s seconds" % (device_id, elapsed_time) print_queue.task_done() From 2b3d70e928a35c7bd2e4f80fa191ad97818db897 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Tue, 7 Jul 2015 11:20:09 -0400 Subject: [PATCH 025/263] add proper logging --- poller-service.py | 78 +++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 46 deletions(-) diff --git a/poller-service.py b/poller-service.py index bdf9a3aea..e3172e285 100755 --- a/poller-service.py +++ b/poller-service.py @@ -21,18 +21,29 @@ import sys import threading import time import MySQLdb +import logging +import logging.handlers from datetime import datetime, timedelta +log = logging.getLogger('poller-service') +log.setLevel(logging.DEBUG) + +formatter = logging.Formatter('poller-service: %(message)s') +handler = logging.handlers.SysLogHandler(address= '/dev/log') +handler.setFormatter(formatter) +log.addHandler(handler) + install_dir = os.path.dirname(os.path.realpath(__file__)) config_file = install_dir + '/config.php' +log.info('Starting poller-service') def get_config_data(): config_cmd = ['/usr/bin/env', 'php', '%s/config_to_json.php' % install_dir] try: proc = subprocess.Popen(config_cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE) except: - print "ERROR: Could not execute: %s" % config_cmd + log.critical("ERROR: Could not execute: %s" % config_cmd) sys.exit(2) return proc.communicate()[0] @@ -40,13 +51,13 @@ try: with open(config_file) as f: pass except IOError as e: - print "ERROR: Oh dear... %s does not seem readable" % config_file + log.critical("ERROR: Oh dear... %s does not seem readable" % config_file) sys.exit(2) try: config = json.loads(get_config_data()) except: - print "ERROR: Could not load or parse configuration, are PATHs correct?" + log.critical("ERROR: Could not load or parse configuration, are PATHs correct?") sys.exit(2) poller_path = config['install_dir'] + '/poller.php' @@ -65,17 +76,13 @@ else: db_dbname = config['db_name'] -s_time = time.time() -real_duration = 0 -per_device_duration = {} -polled_devices = 0 # Take the amount of threads we want to run in parallel from the commandline # if None are given or the argument was garbage, fall back to default of 16 try: amount_of_workers = int(sys.argv[1]) if amount_of_workers == 0: - print "ERROR: 0 threads is not a valid value" + log.critical("ERROR: 0 threads is not a valid value") sys.exit(2) except: amount_of_workers = 16 @@ -85,7 +92,7 @@ except: try: frequency = int(sys.argv[2]) if frequency == 0: - print "ERROR: 0 seconds is not a valid value" + log.critical("ERROR: 0 seconds is not a valid value") sys.exit(2) except: frequency = 300 @@ -95,7 +102,7 @@ except: try: down_retry = int(sys.argv[3]) if down_retry == 0: - print "ERROR: 0 seconds is not a valid value" + log.critical("ERROR: 0 seconds is not a valid value") sys.exit(2) except: down_retry = 15 @@ -108,32 +115,9 @@ try: db.autocommit(True) cursor = db.cursor() except: - print "ERROR: Could not connect to MySQL database!" + log.critical("ERROR: Could not connect to MySQL database!") sys.exit(2) -# A seperate queue and a single worker for printing information to the screen prevents -# the good old joke: -# -# Some people, when confronted with a problem, think, -# "I know, I'll use threads," and then two they hav erpoblesms. - - -def printworker(): - nodeso = 0 - while True: - worker_id, device_id, elapsed_time = print_queue.get() - global real_duration - global per_device_duration - global polled_devices - real_duration += elapsed_time - per_device_duration[device_id] = elapsed_time - polled_devices += 1 - if elapsed_time < 300: - print "INFO: worker finished device %s in %s seconds" % (device_id, elapsed_time) - else: - print "WARNING: worker finished device %s in %s seconds" % (device_id, elapsed_time) - print_queue.task_done() - def poll_worker(device_id): try: @@ -141,20 +125,15 @@ def poll_worker(device_id): command = "/usr/bin/env php %s -h %s >> /dev/null 2>&1" % (poller_path, device_id) subprocess.check_call(command, shell=True) elapsed_time = int(time.time() - start_time) - print_queue.put([threading.current_thread().name, device_id, elapsed_time]) + if elapsed_time < 300: + log.debug("DEBUG: worker finished device %s in %s seconds" % (device_id, elapsed_time)) + else: + log.warning("WARNING: worker finished device %s in %s seconds" % (device_id, elapsed_time)) except (KeyboardInterrupt, SystemExit): raise except: pass -print_queue = Queue.Queue() - -print "INFO: starting the poller at %s with %s threads" % (time.strftime("%Y-%m-%d %H:%M:%S"), amount_of_workers) - -p = threading.Thread(target=printworker) -p.setDaemon(True) -p.start() - def lockFree(lock): global cursor @@ -205,12 +184,18 @@ dev_query = ( 'SELECT device_id, ' dont_retry = {} threads = 0 +next_update = datetime.now() + timedelta(minutes=5) while True: cur_threads = threading.active_count() if cur_threads != threads: threads = cur_threads - print 'INFO: {} threads currently active'.format(threads) + log.debug('DEBUG: {} threads currently active'.format(threads)) + + if next_update < datetime.now(): + log.info('INFO: {} devices scanned in the last 5 minutes'.format(devices_scanned)) + devices_scanned = 0 + next_update = datetime.now() + timedelta(minutes=5) dont_retry = dict((dev, time) for dev, time in dont_retry.iteritems() if time > datetime.now()) @@ -248,10 +233,11 @@ while True: except ValueError: pass - print 'INFO: Sleeping until {0} before {1} {2}'.format(next_poll, poll_action, device_id) + log.debug('DEBUG: Sleeping until {0} before {1} {2}'.format(next_poll, poll_action, device_id)) sleep_until(sleep_until_time) - print 'INFO: Starting poll of device {}'.format(device_id) + log.debug('INFO: Starting poll of device {}'.format(device_id)) + devices_scanned += 1 dont_retry[device_id] = datetime.now() + timedelta(seconds=down_retry) t = threading.Thread(target=poll_worker, args=[device_id]) t.start() From f7993a204c2f1113217ddefd97bccf1fa9465c5b Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Tue, 7 Jul 2015 11:29:04 -0400 Subject: [PATCH 026/263] log level from config --- poller-service.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/poller-service.py b/poller-service.py index e3172e285..1b84e69e0 100755 --- a/poller-service.py +++ b/poller-service.py @@ -60,6 +60,13 @@ except: log.critical("ERROR: Could not load or parse configuration, are PATHs correct?") sys.exit(2) +try: + loglevel = config['poller_service_loglevel'] +except KeyError: + loglevel = 'INFO' +numeric_level = getattr(logging, loglevel.upper(), None) +log.basicConfig(level=numeric_level) + poller_path = config['install_dir'] + '/poller.php' db_username = config['db_user'] db_password = config['db_pass'] @@ -185,6 +192,7 @@ dev_query = ( 'SELECT device_id, ' dont_retry = {} threads = 0 next_update = datetime.now() + timedelta(minutes=5) +devices_scanned = 0 while True: cur_threads = threading.active_count() @@ -236,7 +244,7 @@ while True: log.debug('DEBUG: Sleeping until {0} before {1} {2}'.format(next_poll, poll_action, device_id)) sleep_until(sleep_until_time) - log.debug('INFO: Starting poll of device {}'.format(device_id)) + log.debug('DEBUG: Starting poll of device {}'.format(device_id)) devices_scanned += 1 dont_retry[device_id] = datetime.now() + timedelta(seconds=down_retry) t = threading.Thread(target=poll_worker, args=[device_id]) From e30aea0168e02c521dacd3def5de9b32bdb88722 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Tue, 7 Jul 2015 11:40:29 -0400 Subject: [PATCH 027/263] get all config from config.php --- poller-service.py | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/poller-service.py b/poller-service.py index 1b84e69e0..6492ab0bc 100755 --- a/poller-service.py +++ b/poller-service.py @@ -36,7 +36,7 @@ log.addHandler(handler) install_dir = os.path.dirname(os.path.realpath(__file__)) config_file = install_dir + '/config.php' -log.info('Starting poller-service') +log.info('INFO: Starting poller-service') def get_config_data(): config_cmd = ['/usr/bin/env', 'php', '%s/config_to_json.php' % install_dir] @@ -61,11 +61,13 @@ except: sys.exit(2) try: - loglevel = config['poller_service_loglevel'] + loglevel = logging.getLevelName(config['poller_service_loglevel'].upper()) except KeyError: - loglevel = 'INFO' -numeric_level = getattr(logging, loglevel.upper(), None) -log.basicConfig(level=numeric_level) + loglevel = logging.getLevelName('INFO') +if not isinstance(loglevel, int): + log.warning('ERROR: {} is not a valid log level'.format(str(loglevel))) + loglevel = logging.getLevelName('INFO') +log.setLevel(loglevel) poller_path = config['install_dir'] + '/poller.php' db_username = config['db_user'] @@ -84,34 +86,28 @@ else: db_dbname = config['db_name'] -# Take the amount of threads we want to run in parallel from the commandline -# if None are given or the argument was garbage, fall back to default of 16 try: - amount_of_workers = int(sys.argv[1]) + amount_of_workers = int(config['poller_service_workers']) if amount_of_workers == 0: log.critical("ERROR: 0 threads is not a valid value") sys.exit(2) -except: +except KeyError: amount_of_workers = 16 -# Take the frequency of scans we want from the commandline -# if None are given or the argument was garbage, fall back to default of 300 try: - frequency = int(sys.argv[2]) + frequency = int(config['poller_service_frequency']) if frequency == 0: log.critical("ERROR: 0 seconds is not a valid value") sys.exit(2) -except: +except KeyError: frequency = 300 -# Take the down_retry value from the commandline -# if None are given or the argument was garbage, fall back to default of 15 try: - down_retry = int(sys.argv[3]) + down_retry = int(config['poller_service_down_retry']) if down_retry == 0: log.critical("ERROR: 0 seconds is not a valid value") sys.exit(2) -except: +except KeyError: down_retry = 15 try: From 57bf214df3c5ce02127bb672fd3e08d24fb14c9d Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Tue, 7 Jul 2015 11:41:42 -0400 Subject: [PATCH 028/263] first attempt at upstart conf --- poller-service.conf | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 poller-service.conf diff --git a/poller-service.conf b/poller-service.conf new file mode 100644 index 000000000..c5a9f26d2 --- /dev/null +++ b/poller-service.conf @@ -0,0 +1,28 @@ +# poller-service - SNMP polling service for LibreNMS + +description "SNMP polling service for LibreNMS" +author "Clint Armstrong " + +# When to start the service +start on runlevel [2345] + +# When to stop the service +stop on runlevel [016] + +# Automatically restart process if crashed +respawn + +# Essentially lets upstart know the process will detach itself to the background +expect fork + +# # Run before process +# pre-start script +# [ -d /var/run/myservice ] || mkdir -p /var/run/myservice +# echo "Put bash code here" +# end script + +# Set working directory +chdir /opt/librenms + +# Start the process +exec su -u librenms poller-service.py From cf8844742ef8b5088faba17abd12b4e1f4f45b36 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Tue, 7 Jul 2015 12:04:36 -0400 Subject: [PATCH 029/263] poller service upstart conf working --- poller-service.conf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/poller-service.conf b/poller-service.conf index c5a9f26d2..36677e7d2 100644 --- a/poller-service.conf +++ b/poller-service.conf @@ -13,7 +13,7 @@ stop on runlevel [016] respawn # Essentially lets upstart know the process will detach itself to the background -expect fork +#expect fork # # Run before process # pre-start script @@ -21,8 +21,9 @@ expect fork # echo "Put bash code here" # end script -# Set working directory chdir /opt/librenms +setuid librenms +setgid librenms # Start the process -exec su -u librenms poller-service.py +exec /opt/librenms/poller-service.py From c7423d2c4e1b1ad81a9dafd4cbc87a82587666ce Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Tue, 7 Jul 2015 12:48:36 -0400 Subject: [PATCH 030/263] start docs --- doc/Extensions/Poller-Service.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 doc/Extensions/Poller-Service.md diff --git a/doc/Extensions/Poller-Service.md b/doc/Extensions/Poller-Service.md new file mode 100644 index 000000000..9c515c378 --- /dev/null +++ b/doc/Extensions/Poller-Service.md @@ -0,0 +1,2 @@ +# Poller Service +The Poller service is an alternative to polling cron jobs. From f293e3d9679b4b93965f4156f3a777ccd8886636 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Tue, 7 Jul 2015 13:02:13 -0400 Subject: [PATCH 031/263] add discovery support to service --- poller-service.py | 50 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/poller-service.py b/poller-service.py index 6492ab0bc..f1530f1b5 100755 --- a/poller-service.py +++ b/poller-service.py @@ -1,15 +1,15 @@ #! /usr/bin/env python """ poller-service A service to wrap SNMP polling. It will poll up to $threads devices at a time, and will not re-poll - devices that have been polled within the last $frequency seconds. It will prioritize devices based on + devices that have been polled within the last $poll_frequency seconds. It will prioritize devices based on the last time polled. If resources are sufficient, this service should poll every device every - $frequency seconds, but should gracefully degrade if resources are inefficient, polling devices as + $poll_frequency seconds, but should gracefully degrade if resources are inefficient, polling devices as frequently as possible. This service is based on poller-wrapper.py. Author: Clint Armstrong Date: July 2015 - Usage: poller-service [threads] [frequency] + Usage: poller-service [threads] [poll_frequency] Default is 16 threads and 300 seconds. """ @@ -70,6 +70,7 @@ if not isinstance(loglevel, int): log.setLevel(loglevel) poller_path = config['install_dir'] + '/poller.php' +discover_path = config['install_dir'] + '/discovery.php' db_username = config['db_user'] db_password = config['db_pass'] @@ -95,12 +96,20 @@ except KeyError: amount_of_workers = 16 try: - frequency = int(config['poller_service_frequency']) - if frequency == 0: + poll_frequency = int(config['poller_service_poll_frequency']) + if poll_frequency == 0: log.critical("ERROR: 0 seconds is not a valid value") sys.exit(2) except KeyError: - frequency = 300 + poll_frequency = 300 + +try: + discover_frequency = int(config['poller_service_discover_frequency']) + if poll_frequency == 0: + log.critical("ERROR: 0 seconds is not a valid value") + sys.exit(2) +except KeyError: + poll_frequency = 21600 try: down_retry = int(config['poller_service_down_retry']) @@ -122,10 +131,13 @@ except: sys.exit(2) -def poll_worker(device_id): +def poll_worker(device_id, action): try: start_time = time.time() - command = "/usr/bin/env php %s -h %s >> /dev/null 2>&1" % (poller_path, device_id) + path = poller_path + if action = 'discovery' + path = discovery_path + command = "/usr/bin/env php %s -h %s >> /dev/null 2>&1" % (path, device_id) subprocess.check_call(command, shell=True) elapsed_time = int(time.time() - start_time) if elapsed_time < 300: @@ -178,12 +190,20 @@ dev_query = ( 'SELECT device_id, ' ' INTERVAL last_polled_timetaken SECOND ' ' ), ' ' INTERVAL {0} SECOND) AS next_poll ' + 'DATE_ADD( ' + ' DATE_SUB( ' + ' last_discovered, ' + ' INTERVAL last_discovered_timetaken SECOND ' + ' ), ' + ' INTERVAL {1} SECOND) AS next_discovery ' 'FROM devices WHERE ' 'disabled = 0 ' 'AND IS_FREE_LOCK(CONCAT("polling.", device_id)) ' 'AND IS_FREE_LOCK(CONCAT("queued.", device_id)) ' - '{1} ' - 'ORDER BY next_poll asc ').format(frequency, poller_group) + '{2} ' + 'ORDER BY next_poll asc ').format( poll_frequency, + discover_frequency, + poller_group ) dont_retry = {} threads = 0 @@ -209,7 +229,7 @@ while True: cursor.execute(dev_query) devices = cursor.fetchall() retry_devs_found = {} - for device_id, next_poll in devices: + for device_id, next_poll, next_discovery in devices: # add queue lock, so we lock the next device against any other pollers # if this fails, the device is locked by another poller already if not getLock('queued.{}'.format(device_id)): @@ -240,10 +260,14 @@ while True: log.debug('DEBUG: Sleeping until {0} before {1} {2}'.format(next_poll, poll_action, device_id)) sleep_until(sleep_until_time) - log.debug('DEBUG: Starting poll of device {}'.format(device_id)) + action = 'poll' + if not next_discovery or next_discovery < datetime.now(): + action = 'discovery' + + log.debug('DEBUG: Starting {} of device {}'.format(action, device_id)) devices_scanned += 1 dont_retry[device_id] = datetime.now() + timedelta(seconds=down_retry) - t = threading.Thread(target=poll_worker, args=[device_id]) + t = threading.Thread(target=poll_worker, args=[device_id, action]) t.start() # If we made it this far, break out of the loop and query again. From 18d8914548af4d2a438ca63cd762c8a334d430fe Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Tue, 7 Jul 2015 13:10:36 -0400 Subject: [PATCH 032/263] discover integration working --- poller-service.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/poller-service.py b/poller-service.py index f1530f1b5..e6656036a 100755 --- a/poller-service.py +++ b/poller-service.py @@ -105,11 +105,11 @@ except KeyError: try: discover_frequency = int(config['poller_service_discover_frequency']) - if poll_frequency == 0: + if discover_frequency == 0: log.critical("ERROR: 0 seconds is not a valid value") sys.exit(2) except KeyError: - poll_frequency = 21600 + discover_frequency = 21600 try: down_retry = int(config['poller_service_down_retry']) @@ -135,8 +135,8 @@ def poll_worker(device_id, action): try: start_time = time.time() path = poller_path - if action = 'discovery' - path = discovery_path + if action == 'discovery': + path = discover_path command = "/usr/bin/env php %s -h %s >> /dev/null 2>&1" % (path, device_id) subprocess.check_call(command, shell=True) elapsed_time = int(time.time() - start_time) @@ -189,7 +189,7 @@ dev_query = ( 'SELECT device_id, ' ' last_polled, ' ' INTERVAL last_polled_timetaken SECOND ' ' ), ' - ' INTERVAL {0} SECOND) AS next_poll ' + ' INTERVAL {0} SECOND) AS next_poll, ' 'DATE_ADD( ' ' DATE_SUB( ' ' last_discovered, ' @@ -242,7 +242,7 @@ while True: releaseLock('queued.{}'.format(device_id)) continue - if next_poll > datetime.now(): + if next_poll and next_poll > datetime.now(): poll_action = 'polling' sleep_until_time = next_poll try: From 9ae0bc3f8319cafa1387f7c7284c12c1b172569c Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Tue, 7 Jul 2015 13:33:16 -0400 Subject: [PATCH 033/263] documentation written --- doc/Extensions/Poller-Service.md | 21 ++++++++++++++++++++- poller-service.py | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/doc/Extensions/Poller-Service.md b/doc/Extensions/Poller-Service.md index 9c515c378..8406067c6 100644 --- a/doc/Extensions/Poller-Service.md +++ b/doc/Extensions/Poller-Service.md @@ -1,2 +1,21 @@ # Poller Service -The Poller service is an alternative to polling cron jobs. +The Poller service is an alternative to polling and discovery cron jobs and provides support for distributed polling without memcache. It is multi-threaded and runs continuously discovering and polling devices with the oldest data attempting to honor the polling frequency configured in `config.php`. + +Configure the maximum number of threads for the service in `$config['poller_service_workers']`. Configure the minimum desired polling frequency in `$config['poller_service_poll_frequency']` and the minimum desired discovery frequency in `$config['poller_service_discover_frequency']`. The service will not poll or discover devices which have data newer than this this configured age in seconds. Configure how frequently the service will attempt to poll devices which are down in `$config['poller_service_down_retry']`. + +The poller service is designed to gracefully degrade. If not all devices can be polled within the configured frequency, the service will continuously poll devices refreshing as frequently as possible using the configured number of threads. + +## Configuration +```php +// Poller-Service settings +$config['poller_service_workers'] = 16; +$config['poller_service_poll_frequency'] = 300; +$config['poller_service_discover_frequency'] = 21600; +$config['poller_service_down_retry'] = 60; +``` + +## Distributed Polling +Distributed polling is possible. The database must be acessable from the distributed pollers, and properly configured. Remote access to the RRD directory must also be configured as described in the Distributed Poller documentation. Memcache is not required. Concurrency is managed using mysql GET_LOCK to ensure that devices are only being polled by one device at at time. The poller service is compatible with poller groups. + +## Service Installation +The service is tested on Ubuntu 14.04. An upstart configuration `poller-service.conf` is provided. To install copy this file to `/etc/init/poller-service.conf`. The service will start on boot and can be started manually by running `start poller-service`. The service is configured to run as the user `librenms` and will fail if that user does not exist. diff --git a/poller-service.py b/poller-service.py index e6656036a..c65c99a40 100755 --- a/poller-service.py +++ b/poller-service.py @@ -117,7 +117,7 @@ try: log.critical("ERROR: 0 seconds is not a valid value") sys.exit(2) except KeyError: - down_retry = 15 + down_retry = 60 try: if db_port == 0: From 1f0799fc03b2088a57107e26f6f7673af3892918 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Tue, 7 Jul 2015 13:34:41 -0400 Subject: [PATCH 034/263] more details about which cronjobs this replaces --- doc/Extensions/Poller-Service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Extensions/Poller-Service.md b/doc/Extensions/Poller-Service.md index 8406067c6..5248a1019 100644 --- a/doc/Extensions/Poller-Service.md +++ b/doc/Extensions/Poller-Service.md @@ -1,5 +1,5 @@ # Poller Service -The Poller service is an alternative to polling and discovery cron jobs and provides support for distributed polling without memcache. It is multi-threaded and runs continuously discovering and polling devices with the oldest data attempting to honor the polling frequency configured in `config.php`. +The Poller service is an alternative to polling and discovery cron jobs and provides support for distributed polling without memcache. It is multi-threaded and runs continuously discovering and polling devices with the oldest data attempting to honor the polling frequency configured in `config.php`. This service replaces all the required cron jobs except for `/opt/librenms/daily.sh` and `/opt/librenms/alerts.php`. Configure the maximum number of threads for the service in `$config['poller_service_workers']`. Configure the minimum desired polling frequency in `$config['poller_service_poll_frequency']` and the minimum desired discovery frequency in `$config['poller_service_discover_frequency']`. The service will not poll or discover devices which have data newer than this this configured age in seconds. Configure how frequently the service will attempt to poll devices which are down in `$config['poller_service_down_retry']`. From f8756dc956c43590929208f1acb20fbe8a187a51 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Tue, 7 Jul 2015 13:58:56 -0400 Subject: [PATCH 035/263] more details indocs --- doc/Extensions/Poller-Service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Extensions/Poller-Service.md b/doc/Extensions/Poller-Service.md index 5248a1019..0b552d6c3 100644 --- a/doc/Extensions/Poller-Service.md +++ b/doc/Extensions/Poller-Service.md @@ -15,7 +15,7 @@ $config['poller_service_down_retry'] = 60; ``` ## Distributed Polling -Distributed polling is possible. The database must be acessable from the distributed pollers, and properly configured. Remote access to the RRD directory must also be configured as described in the Distributed Poller documentation. Memcache is not required. Concurrency is managed using mysql GET_LOCK to ensure that devices are only being polled by one device at at time. The poller service is compatible with poller groups. +Distributed polling is possible, and uses the same configuration options as are described for traditional distributed polling, except that the memcached options are not necessary. The database must be acessable from the distributed pollers, and properly configured. Remote access to the RRD directory must also be configured as described in the Distributed Poller documentation. Memcache is not required. Concurrency is managed using mysql GET_LOCK to ensure that devices are only being polled by one device at at time. The poller service is compatible with poller groups. ## Service Installation The service is tested on Ubuntu 14.04. An upstart configuration `poller-service.conf` is provided. To install copy this file to `/etc/init/poller-service.conf`. The service will start on boot and can be started manually by running `start poller-service`. The service is configured to run as the user `librenms` and will fail if that user does not exist. From 4fed175935d7723f065ef5fff85cea8e07d75142 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Tue, 7 Jul 2015 14:08:30 -0400 Subject: [PATCH 036/263] document loglevel --- doc/Extensions/Poller-Service.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/Extensions/Poller-Service.md b/doc/Extensions/Poller-Service.md index 0b552d6c3..354d58c39 100644 --- a/doc/Extensions/Poller-Service.md +++ b/doc/Extensions/Poller-Service.md @@ -5,9 +5,12 @@ Configure the maximum number of threads for the service in `$config['poller_serv The poller service is designed to gracefully degrade. If not all devices can be polled within the configured frequency, the service will continuously poll devices refreshing as frequently as possible using the configured number of threads. +The service logs to syslog. A loglevel of INFO will print status updates every 5 minutes. Loglevel of DEBUG will print updates on every device as it is scanned. + ## Configuration ```php // Poller-Service settings +$config['poller_service_loglevel'] = "INFO"; $config['poller_service_workers'] = 16; $config['poller_service_poll_frequency'] = 300; $config['poller_service_discover_frequency'] = 21600; From b0c02a167ef18b7f8341b06150eba2e57b832b57 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Tue, 7 Jul 2015 14:16:55 -0400 Subject: [PATCH 037/263] add license to docstring --- poller-service.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/poller-service.py b/poller-service.py index c65c99a40..6ef51d5ae 100755 --- a/poller-service.py +++ b/poller-service.py @@ -9,8 +9,7 @@ Author: Clint Armstrong Date: July 2015 - Usage: poller-service [threads] [poll_frequency] - Default is 16 threads and 300 seconds. + License: BSD """ import json From 67b8f9f4733785b98498199b95e802ef55b2f490 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Tue, 7 Jul 2015 14:33:33 -0400 Subject: [PATCH 038/263] pep8 --- poller-service.py | 58 ++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/poller-service.py b/poller-service.py index 6ef51d5ae..07e1ea3f2 100755 --- a/poller-service.py +++ b/poller-service.py @@ -1,8 +1,8 @@ #! /usr/bin/env python """ poller-service A service to wrap SNMP polling. It will poll up to $threads devices at a time, and will not re-poll - devices that have been polled within the last $poll_frequency seconds. It will prioritize devices based on - the last time polled. If resources are sufficient, this service should poll every device every + devices that have been polled within the last $poll_frequency seconds. It will prioritize devices based + on the last time polled. If resources are sufficient, this service should poll every device every $poll_frequency seconds, but should gracefully degrade if resources are inefficient, polling devices as frequently as possible. This service is based on poller-wrapper.py. @@ -14,7 +14,6 @@ import json import os -import Queue import subprocess import sys import threading @@ -28,7 +27,7 @@ log = logging.getLogger('poller-service') log.setLevel(logging.DEBUG) formatter = logging.Formatter('poller-service: %(message)s') -handler = logging.handlers.SysLogHandler(address= '/dev/log') +handler = logging.handlers.SysLogHandler(address='/dev/log') handler.setFormatter(formatter) log.addHandler(handler) @@ -37,6 +36,7 @@ config_file = install_dir + '/config.php' log.info('INFO: Starting poller-service') + def get_config_data(): config_cmd = ['/usr/bin/env', 'php', '%s/config_to_json.php' % install_dir] try: @@ -169,6 +169,7 @@ def releaseLock(lock): cursor.execute(query) return cursor.fetchall()[0][0] == 1 + def sleep_until(timestamp): now = datetime.now() if timestamp > now: @@ -178,31 +179,31 @@ def sleep_until(timestamp): time.sleep(sleeptime) poller_group = ('and poller_group IN({}) ' - .format(str(config['distributed_poller_group'])) if 'distributed_poller_group' in config else '') + .format(str(config['distributed_poller_group'])) if 'distributed_poller_group' in config else '') # Add last_polled and last_polled_timetaken so we can sort by the time the last poll started, with the goal # of having each device complete a poll within the given time range. -dev_query = ( 'SELECT device_id, ' - 'DATE_ADD( ' - ' DATE_SUB( ' - ' last_polled, ' - ' INTERVAL last_polled_timetaken SECOND ' - ' ), ' - ' INTERVAL {0} SECOND) AS next_poll, ' - 'DATE_ADD( ' - ' DATE_SUB( ' - ' last_discovered, ' - ' INTERVAL last_discovered_timetaken SECOND ' - ' ), ' - ' INTERVAL {1} SECOND) AS next_discovery ' - 'FROM devices WHERE ' - 'disabled = 0 ' - 'AND IS_FREE_LOCK(CONCAT("polling.", device_id)) ' - 'AND IS_FREE_LOCK(CONCAT("queued.", device_id)) ' - '{2} ' - 'ORDER BY next_poll asc ').format( poll_frequency, - discover_frequency, - poller_group ) +dev_query = ('SELECT device_id, ' + 'DATE_ADD( ' + ' DATE_SUB( ' + ' last_polled, ' + ' INTERVAL last_polled_timetaken SECOND ' + ' ), ' + ' INTERVAL {0} SECOND) AS next_poll, ' + 'DATE_ADD( ' + ' DATE_SUB( ' + ' last_discovered, ' + ' INTERVAL last_discovered_timetaken SECOND ' + ' ), ' + ' INTERVAL {1} SECOND) AS next_discovery ' + 'FROM devices WHERE ' + 'disabled = 0 ' + 'AND IS_FREE_LOCK(CONCAT("polling.", device_id)) ' + 'AND IS_FREE_LOCK(CONCAT("queued.", device_id)) ' + '{2} ' + 'ORDER BY next_poll asc ').format(poll_frequency, + discover_frequency, + poller_group) dont_retry = {} threads = 0 @@ -271,8 +272,3 @@ while True: # If we made it this far, break out of the loop and query again. break - -try: - print_queue.join() -except (KeyboardInterrupt, SystemExit): - raise From 0588ff41c301a792150e3bba40a1c691e2da3606 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Tue, 7 Jul 2015 15:53:04 -0400 Subject: [PATCH 039/263] get a lock when doing discovery --- discovery.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/discovery.php b/discovery.php index 3006399ff..93ca69a09 100755 --- a/discovery.php +++ b/discovery.php @@ -106,7 +106,9 @@ if ($config['distributed_poller'] === true) { } foreach (dbFetch("SELECT * FROM `devices` WHERE status = 1 AND disabled = 0 $where ORDER BY device_id DESC") as $device) { + if (dbGetLock('polling.' . $device['device_id'])) { discover_device($device, $options); + } } $end = utime(); From c65a160c18a424058edc146f330bb8a23e4ce189 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Fri, 10 Jul 2015 16:59:16 -0400 Subject: [PATCH 040/263] log progress to db every 5 minutes --- poller-service.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/poller-service.py b/poller-service.py index 07e1ea3f2..6477ee93c 100755 --- a/poller-service.py +++ b/poller-service.py @@ -217,6 +217,15 @@ while True: log.debug('DEBUG: {} threads currently active'.format(threads)) if next_update < datetime.now(): + seconds_taken = (datetime.now() - (next_update - timedelta(minutes=5))).seconds + update_query = ("insert into pollers set " + "poller_name='%s', " + "last_polled=NOW(), " + "devices='%d', " + "time_taken='%d' ").format(config['distributed_poller_name'], + devices_scanned, + seconds_taken) + cursor.execute(update_query) log.info('INFO: {} devices scanned in the last 5 minutes'.format(devices_scanned)) devices_scanned = 0 next_update = datetime.now() + timedelta(minutes=5) From 4529ba2e7da25bb2bbe5ca4c90ddc333ff10f7e2 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Fri, 10 Jul 2015 17:19:51 -0400 Subject: [PATCH 041/263] fix stupid query --- poller-service.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/poller-service.py b/poller-service.py index 6477ee93c..e2649586e 100755 --- a/poller-service.py +++ b/poller-service.py @@ -218,13 +218,18 @@ while True: if next_update < datetime.now(): seconds_taken = (datetime.now() - (next_update - timedelta(minutes=5))).seconds - update_query = ("insert into pollers set " - "poller_name='%s', " - "last_polled=NOW(), " - "devices='%d', " - "time_taken='%d' ").format(config['distributed_poller_name'], - devices_scanned, - seconds_taken) + update_query = ("INSERT INTO pollers(poller_name, " + " last_polled, " + " devices, " + " time_taken) " + " values({0}, NOW(), {1}, {2}) " + "ON DUPLICATE KEY UPDATE " + " poller_name=values(poller_name), " + " last_polled=values(last_polled), " + " devices=values(devices) " + " time_taken=values(time_taken) ").format(config['distributed_poller_name'], + devices_scanned, + seconds_taken) cursor.execute(update_query) log.info('INFO: {} devices scanned in the last 5 minutes'.format(devices_scanned)) devices_scanned = 0 From b9c3b3cec8a7de50fa59904a70cc3071ca7d2ea7 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Fri, 10 Jul 2015 17:34:34 -0400 Subject: [PATCH 042/263] sql stuff --- poller-service.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/poller-service.py b/poller-service.py index e2649586e..c794704f1 100755 --- a/poller-service.py +++ b/poller-service.py @@ -218,16 +218,15 @@ while True: if next_update < datetime.now(): seconds_taken = (datetime.now() - (next_update - timedelta(minutes=5))).seconds - update_query = ("INSERT INTO pollers(poller_name, " - " last_polled, " - " devices, " - " time_taken) " - " values({0}, NOW(), {1}, {2}) " - "ON DUPLICATE KEY UPDATE " - " poller_name=values(poller_name), " - " last_polled=values(last_polled), " - " devices=values(devices) " - " time_taken=values(time_taken) ").format(config['distributed_poller_name'], + update_query = ('INSERT INTO pollers(poller_name, ' + ' last_polled, ' + ' devices, ' + ' time_taken) ' + ' values("{0}", NOW(), "{1}", "{2}") ' + 'ON DUPLICATE KEY UPDATE ' + ' last_polled=values(last_polled), ' + ' devices=values(devices) ' + ' time_taken=values(time_taken) ').format(config['distributed_poller_name'], devices_scanned, seconds_taken) cursor.execute(update_query) From b4c5f0a5ec38beea1711f444b28e64f3db319a74 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Fri, 10 Jul 2015 17:34:45 -0400 Subject: [PATCH 043/263] notes --- notes.txt | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 notes.txt diff --git a/notes.txt b/notes.txt new file mode 100644 index 000000000..e3a826237 --- /dev/null +++ b/notes.txt @@ -0,0 +1,6 @@ +Need to set poller_name as primary key for this to work: + +ALTER TABLE pollers + ADD PRIMARY KEY (poller_name) + +Check in beginning? From bedf425c1cabf3c0c6326ad221fd97b3893778d7 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 13 Jul 2015 08:43:18 -0400 Subject: [PATCH 044/263] update sql schema to add primary key for pollers --- notes.txt | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 notes.txt diff --git a/notes.txt b/notes.txt deleted file mode 100644 index e3a826237..000000000 --- a/notes.txt +++ /dev/null @@ -1,6 +0,0 @@ -Need to set poller_name as primary key for this to work: - -ALTER TABLE pollers - ADD PRIMARY KEY (poller_name) - -Check in beginning? From 55ad58b4e98a2d94f1c5e413d9631e04735b7e7c Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 13 Jul 2015 08:43:23 -0400 Subject: [PATCH 045/263] update sql schema to add primary key for pollers --- sql-schema/065.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql-schema/065.sql diff --git a/sql-schema/065.sql b/sql-schema/065.sql new file mode 100644 index 000000000..b201eab9a --- /dev/null +++ b/sql-schema/065.sql @@ -0,0 +1,3 @@ +ALTER TABLE `device_perf` DROP INDEX `id` , ADD INDEX `id` ( `id` ), ADD INDEX ( `device_id` ); +DELETE n1 FROM pollers n1, pollers n2 WHERE n1.last_polled < n2.last_polled and n1.poller_name = n2.poller_name; +ALTER TABLE pollers ADD PRIMARY KEY (poller_name); From 01b7648136cd692cfccfbf798a99cce683a5b9d4 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 13 Jul 2015 09:22:53 -0400 Subject: [PATCH 046/263] add last_poll_attempted column to devices table --- sql-schema/065.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-schema/065.sql b/sql-schema/065.sql index b201eab9a..ab64beca9 100644 --- a/sql-schema/065.sql +++ b/sql-schema/065.sql @@ -1,3 +1,3 @@ -ALTER TABLE `device_perf` DROP INDEX `id` , ADD INDEX `id` ( `id` ), ADD INDEX ( `device_id` ); DELETE n1 FROM pollers n1, pollers n2 WHERE n1.last_polled < n2.last_polled and n1.poller_name = n2.poller_name; ALTER TABLE pollers ADD PRIMARY KEY (poller_name); +ALTER TABLE `devices` ADD `last_poll_attempted` timestamp NULL DEFAULT NULL AFTER `last_polled`; From f12725fc814371868ad0a7e164fce7bf4cef215d Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 13 Jul 2015 09:38:03 -0400 Subject: [PATCH 047/263] store last attempted in sql for simpler down_retry --- poller-service.py | 43 ++++++++++++++++--------------------------- 1 file changed, 16 insertions(+), 27 deletions(-) diff --git a/poller-service.py b/poller-service.py index c794704f1..43ee9875c 100755 --- a/poller-service.py +++ b/poller-service.py @@ -140,9 +140,9 @@ def poll_worker(device_id, action): subprocess.check_call(command, shell=True) elapsed_time = int(time.time() - start_time) if elapsed_time < 300: - log.debug("DEBUG: worker finished device %s in %s seconds" % (device_id, elapsed_time)) + log.debug("DEBUG: worker finished %s of device %s in %s seconds" % (action, device_id, elapsed_time)) else: - log.warning("WARNING: worker finished device %s in %s seconds" % (device_id, elapsed_time)) + log.warning("WARNING: worker finished %s of device %s in %s seconds" % (action, device_id, elapsed_time)) except (KeyboardInterrupt, SystemExit): raise except: @@ -200,12 +200,14 @@ dev_query = ('SELECT device_id, ' 'disabled = 0 ' 'AND IS_FREE_LOCK(CONCAT("polling.", device_id)) ' 'AND IS_FREE_LOCK(CONCAT("queued.", device_id)) ' - '{2} ' + 'AND last_poll_attempted < DATE_SUB( ' + ' NOW(), INTERVAL {2} SECOND ) ' + '{3} ' 'ORDER BY next_poll asc ').format(poll_frequency, discover_frequency, + down_retry, poller_group) -dont_retry = {} threads = 0 next_update = datetime.now() + timedelta(minutes=5) devices_scanned = 0 @@ -220,28 +222,26 @@ while True: seconds_taken = (datetime.now() - (next_update - timedelta(minutes=5))).seconds update_query = ('INSERT INTO pollers(poller_name, ' ' last_polled, ' - ' devices, ' + ' devices, ' ' time_taken) ' ' values("{0}", NOW(), "{1}", "{2}") ' 'ON DUPLICATE KEY UPDATE ' ' last_polled=values(last_polled), ' ' devices=values(devices) ' ' time_taken=values(time_taken) ').format(config['distributed_poller_name'], - devices_scanned, - seconds_taken) + devices_scanned, + seconds_taken) cursor.execute(update_query) + cursor.fetchall() log.info('INFO: {} devices scanned in the last 5 minutes'.format(devices_scanned)) devices_scanned = 0 next_update = datetime.now() + timedelta(minutes=5) - dont_retry = dict((dev, time) for dev, time in dont_retry.iteritems() if time > datetime.now()) - while threading.active_count() >= amount_of_workers: time.sleep(.5) cursor.execute(dev_query) devices = cursor.fetchall() - retry_devs_found = {} for device_id, next_poll, next_discovery in devices: # add queue lock, so we lock the next device against any other pollers # if this fails, the device is locked by another poller already @@ -256,22 +256,8 @@ while True: continue if next_poll and next_poll > datetime.now(): - poll_action = 'polling' - sleep_until_time = next_poll - try: - next_retry_device = min(retry_devs_found, key=retry_devs_found.get) - next_retry_time = retry_devs_found[next_retry_device] - if next_retry_time < next_poll: - device_id = next_retry_device - if not getLock('queued.{}'.format(device_id)): - continue - poll_action = 'retrying failed device' - sleep_until_time = next_retry_time - except ValueError: - pass - - log.debug('DEBUG: Sleeping until {0} before {1} {2}'.format(next_poll, poll_action, device_id)) - sleep_until(sleep_until_time) + log.debug('DEBUG: Sleeping until {0} before polling {2}'.format(next_poll, device_id)) + sleep_until(next_poll) action = 'poll' if not next_discovery or next_discovery < datetime.now(): @@ -279,7 +265,10 @@ while True: log.debug('DEBUG: Starting {} of device {}'.format(action, device_id)) devices_scanned += 1 - dont_retry[device_id] = datetime.now() + timedelta(seconds=down_retry) + + cursor.execute('UPDATE devices SET last_poll_attempted = NOW() WHERE device_id = {}'.format(device_id)) + cursor.fetchall() + t = threading.Thread(target=poll_worker, args=[device_id, action]) t.start() From d23bed0af7686b08fa4a28b85bd4f2a7e1a551e6 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 13 Jul 2015 09:40:54 -0400 Subject: [PATCH 048/263] don't check dont-retry' --- poller-service.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/poller-service.py b/poller-service.py index 43ee9875c..8852a1a65 100755 --- a/poller-service.py +++ b/poller-service.py @@ -250,10 +250,6 @@ while True: if not lockFree('polling.{}'.format(device_id)): releaseLock('queued.{}'.format(device_id)) continue - if device_id in dont_retry: - retry_devs_found[device_id] = dont_retry[device_id] - releaseLock('queued.{}'.format(device_id)) - continue if next_poll and next_poll > datetime.now(): log.debug('DEBUG: Sleeping until {0} before polling {2}'.format(next_poll, device_id)) From c35a1ea750ca2dd456b285a956e109304fd4635e Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 13 Jul 2015 09:48:18 -0400 Subject: [PATCH 049/263] don't loop too fast --- poller-service.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/poller-service.py b/poller-service.py index 8852a1a65..e57f8f7ae 100755 --- a/poller-service.py +++ b/poller-service.py @@ -270,3 +270,7 @@ while True: # If we made it this far, break out of the loop and query again. break + + # Looping with no break causes the service to be killed by init. + # This point is only reached if the query is empty, so sleep half a second before querying again. + time.sleep(.5) From 4a66720969596805a7cf39207c1032c98bd2dbf2 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 13 Jul 2015 09:59:08 -0400 Subject: [PATCH 050/263] release lock for 1 device --- poller-service.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/poller-service.py b/poller-service.py index e57f8f7ae..e64c9800b 100755 --- a/poller-service.py +++ b/poller-service.py @@ -201,7 +201,7 @@ dev_query = ('SELECT device_id, ' 'AND IS_FREE_LOCK(CONCAT("polling.", device_id)) ' 'AND IS_FREE_LOCK(CONCAT("queued.", device_id)) ' 'AND last_poll_attempted < DATE_SUB( ' - ' NOW(), INTERVAL {2} SECOND ) ' + ' NOW(), INTERVAL {2} SECOND ) ' '{3} ' 'ORDER BY next_poll asc ').format(poll_frequency, discover_frequency, @@ -268,6 +268,10 @@ while True: t = threading.Thread(target=poll_worker, args=[device_id, action]) t.start() + # If there is only one device, release the queue lock, because it won't release automatically. + if len(devices) == 1: + releaseLock('queued.{}'.format(device_id)) + # If we made it this far, break out of the loop and query again. break From 6c5f71bbb583990f753b6bc3a34ee479214caf71 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 13 Jul 2015 10:06:57 -0400 Subject: [PATCH 051/263] remove queue locks on empty query --- poller-service.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/poller-service.py b/poller-service.py index e64c9800b..db20994f0 100755 --- a/poller-service.py +++ b/poller-service.py @@ -268,13 +268,12 @@ while True: t = threading.Thread(target=poll_worker, args=[device_id, action]) t.start() - # If there is only one device, release the queue lock, because it won't release automatically. - if len(devices) == 1: - releaseLock('queued.{}'.format(device_id)) - # If we made it this far, break out of the loop and query again. break # Looping with no break causes the service to be killed by init. # This point is only reached if the query is empty, so sleep half a second before querying again. time.sleep(.5) + + # Make sure we're not holding any device queue locks in this connection before querying again. + getLock('unlock.{}'.format(config['distributed_poller_name'])) From e68bebbc625fdd765d98e82934a0d2d9f089d1d4 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 13 Jul 2015 10:10:49 -0400 Subject: [PATCH 052/263] bad index --- poller-service.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/poller-service.py b/poller-service.py index db20994f0..f92eae490 100755 --- a/poller-service.py +++ b/poller-service.py @@ -246,13 +246,15 @@ while True: # add queue lock, so we lock the next device against any other pollers # if this fails, the device is locked by another poller already if not getLock('queued.{}'.format(device_id)): + time.sleep(.5) continue if not lockFree('polling.{}'.format(device_id)): releaseLock('queued.{}'.format(device_id)) + time.sleep(.5) continue if next_poll and next_poll > datetime.now(): - log.debug('DEBUG: Sleeping until {0} before polling {2}'.format(next_poll, device_id)) + log.debug('DEBUG: Sleeping until {0} before polling {1}'.format(next_poll, device_id)) sleep_until(next_poll) action = 'poll' From 5672afd0a8acf6659dc1117444235a85ee7eadbb Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 13 Jul 2015 10:15:06 -0400 Subject: [PATCH 053/263] test for null last_attempted --- poller-service.py | 48 +++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/poller-service.py b/poller-service.py index f92eae490..32d4deb32 100755 --- a/poller-service.py +++ b/poller-service.py @@ -183,30 +183,30 @@ poller_group = ('and poller_group IN({}) ' # Add last_polled and last_polled_timetaken so we can sort by the time the last poll started, with the goal # of having each device complete a poll within the given time range. -dev_query = ('SELECT device_id, ' - 'DATE_ADD( ' - ' DATE_SUB( ' - ' last_polled, ' - ' INTERVAL last_polled_timetaken SECOND ' - ' ), ' - ' INTERVAL {0} SECOND) AS next_poll, ' - 'DATE_ADD( ' - ' DATE_SUB( ' - ' last_discovered, ' - ' INTERVAL last_discovered_timetaken SECOND ' - ' ), ' - ' INTERVAL {1} SECOND) AS next_discovery ' - 'FROM devices WHERE ' - 'disabled = 0 ' - 'AND IS_FREE_LOCK(CONCAT("polling.", device_id)) ' - 'AND IS_FREE_LOCK(CONCAT("queued.", device_id)) ' - 'AND last_poll_attempted < DATE_SUB( ' - ' NOW(), INTERVAL {2} SECOND ) ' - '{3} ' - 'ORDER BY next_poll asc ').format(poll_frequency, - discover_frequency, - down_retry, - poller_group) +dev_query = ('SELECT device_id, ' + 'DATE_ADD( ' + ' DATE_SUB( ' + ' last_polled, ' + ' INTERVAL last_polled_timetaken SECOND ' + ' ), ' + ' INTERVAL {0} SECOND) AS next_poll, ' + 'DATE_ADD( ' + ' DATE_SUB( ' + ' last_discovered, ' + ' INTERVAL last_discovered_timetaken SECOND ' + ' ), ' + ' INTERVAL {1} SECOND) AS next_discovery ' + 'FROM devices WHERE ' + 'disabled = 0 ' + 'AND IS_FREE_LOCK(CONCAT("polling.", device_id)) ' + 'AND IS_FREE_LOCK(CONCAT("queued.", device_id)) ' + 'AND ( last_poll_attempted < DATE_SUB(NOW(), INTERVAL {2} SECOND ) ' + ' OR last_poll_attempted IS NULL ) ' + '{3} ' + 'ORDER BY next_poll asc ').format(poll_frequency, + discover_frequency, + down_retry, + poller_group) threads = 0 next_update = datetime.now() + timedelta(minutes=5) From c3b6fee0eb2705ef1f0fac64c590b175159904c3 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 13 Jul 2015 10:51:56 -0400 Subject: [PATCH 054/263] bad sql --- poller-service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poller-service.py b/poller-service.py index 32d4deb32..13841df20 100755 --- a/poller-service.py +++ b/poller-service.py @@ -227,8 +227,8 @@ while True: ' values("{0}", NOW(), "{1}", "{2}") ' 'ON DUPLICATE KEY UPDATE ' ' last_polled=values(last_polled), ' - ' devices=values(devices) ' - ' time_taken=values(time_taken) ').format(config['distributed_poller_name'], + ' devices=values(devices), ' + ' time_taken=values(time_taken) ').format(config['distributed_poller_name'].strip(), devices_scanned, seconds_taken) cursor.execute(update_query) From 4d832067a9ace2e921b43f1be3c600ec88e9d138 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 13 Jul 2015 10:57:49 -0400 Subject: [PATCH 055/263] change to 2 minute updates --- poller-service.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/poller-service.py b/poller-service.py index 13841df20..3f9f96082 100755 --- a/poller-service.py +++ b/poller-service.py @@ -209,7 +209,7 @@ dev_query = ('SELECT device_id, poller_group) threads = 0 -next_update = datetime.now() + timedelta(minutes=5) +next_update = datetime.now() + timedelta(minutes=2) devices_scanned = 0 while True: @@ -219,7 +219,7 @@ while True: log.debug('DEBUG: {} threads currently active'.format(threads)) if next_update < datetime.now(): - seconds_taken = (datetime.now() - (next_update - timedelta(minutes=5))).seconds + seconds_taken = (datetime.now() - (next_update - timedelta(minutes=2))).seconds update_query = ('INSERT INTO pollers(poller_name, ' ' last_polled, ' ' devices, ' @@ -235,7 +235,7 @@ while True: cursor.fetchall() log.info('INFO: {} devices scanned in the last 5 minutes'.format(devices_scanned)) devices_scanned = 0 - next_update = datetime.now() + timedelta(minutes=5) + next_update = datetime.now() + timedelta(minutes=2) while threading.active_count() >= amount_of_workers: time.sleep(.5) From 9f1c2232f02812cdcc380f9f253c13d3136e1dc0 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 13 Jul 2015 10:59:26 -0400 Subject: [PATCH 056/263] update every minute --- poller-service.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/poller-service.py b/poller-service.py index 3f9f96082..8591cdfe0 100755 --- a/poller-service.py +++ b/poller-service.py @@ -209,7 +209,7 @@ dev_query = ('SELECT device_id, poller_group) threads = 0 -next_update = datetime.now() + timedelta(minutes=2) +next_update = datetime.now() + timedelta(minutes=1) devices_scanned = 0 while True: @@ -219,7 +219,7 @@ while True: log.debug('DEBUG: {} threads currently active'.format(threads)) if next_update < datetime.now(): - seconds_taken = (datetime.now() - (next_update - timedelta(minutes=2))).seconds + seconds_taken = (datetime.now() - (next_update - timedelta(minutes=1))).seconds update_query = ('INSERT INTO pollers(poller_name, ' ' last_polled, ' ' devices, ' @@ -235,7 +235,7 @@ while True: cursor.fetchall() log.info('INFO: {} devices scanned in the last 5 minutes'.format(devices_scanned)) devices_scanned = 0 - next_update = datetime.now() + timedelta(minutes=2) + next_update = datetime.now() + timedelta(minutes=1) while threading.active_count() >= amount_of_workers: time.sleep(.5) From 3ff7a4808903a9d0ba2d0563e9d7719c0a816461 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 13 Jul 2015 11:10:14 -0400 Subject: [PATCH 057/263] catch sql errors --- poller-service.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/poller-service.py b/poller-service.py index 8591cdfe0..b1170ed58 100755 --- a/poller-service.py +++ b/poller-service.py @@ -231,7 +231,10 @@ while True: ' time_taken=values(time_taken) ').format(config['distributed_poller_name'].strip(), devices_scanned, seconds_taken) - cursor.execute(update_query) + try: + cursor.execute(update_query) + except: + log.critical('ERROR: MySQL query error. Is your schema up to date?') cursor.fetchall() log.info('INFO: {} devices scanned in the last 5 minutes'.format(devices_scanned)) devices_scanned = 0 @@ -240,7 +243,11 @@ while True: while threading.active_count() >= amount_of_workers: time.sleep(.5) - cursor.execute(dev_query) + try: + cursor.execute(dev_query) + except: + log.critical('ERROR: MySQL query error. Is your schema up to date?') + devices = cursor.fetchall() for device_id, next_poll, next_discovery in devices: # add queue lock, so we lock the next device against any other pollers From 21e9dac646da714a213ce0ec7bbbe98140b0185c Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 13 Jul 2015 11:16:51 -0400 Subject: [PATCH 058/263] exit on mysql error --- poller-service.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/poller-service.py b/poller-service.py index b1170ed58..7f94f1423 100755 --- a/poller-service.py +++ b/poller-service.py @@ -235,6 +235,7 @@ while True: cursor.execute(update_query) except: log.critical('ERROR: MySQL query error. Is your schema up to date?') + sys.exit(2) cursor.fetchall() log.info('INFO: {} devices scanned in the last 5 minutes'.format(devices_scanned)) devices_scanned = 0 @@ -247,6 +248,7 @@ while True: cursor.execute(dev_query) except: log.critical('ERROR: MySQL query error. Is your schema up to date?') + sys.exit(2) devices = cursor.fetchall() for device_id, next_poll, next_discovery in devices: From 9931d9dc442d0f3d4a1f2a2a29504f40ceec0a0b Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 13 Jul 2015 14:32:00 -0400 Subject: [PATCH 059/263] don't try to discover down devices --- poller-service.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/poller-service.py b/poller-service.py index 7f94f1423..e9aa123bc 100755 --- a/poller-service.py +++ b/poller-service.py @@ -183,7 +183,7 @@ poller_group = ('and poller_group IN({}) ' # Add last_polled and last_polled_timetaken so we can sort by the time the last poll started, with the goal # of having each device complete a poll within the given time range. -dev_query = ('SELECT device_id, ' +dev_query = ('SELECT device_id, status, ' 'DATE_ADD( ' ' DATE_SUB( ' ' last_polled, ' @@ -251,7 +251,7 @@ while True: sys.exit(2) devices = cursor.fetchall() - for device_id, next_poll, next_discovery in devices: + for device_id, status, next_poll, next_discovery in devices: # add queue lock, so we lock the next device against any other pollers # if this fails, the device is locked by another poller already if not getLock('queued.{}'.format(device_id)): @@ -267,7 +267,7 @@ while True: sleep_until(next_poll) action = 'poll' - if not next_discovery or next_discovery < datetime.now(): + if (not next_discovery or next_discovery < datetime.now()) and status == 1: action = 'discovery' log.debug('DEBUG: Starting {} of device {}'.format(action, device_id)) From b73b49bfcb36c39676fa4fd1799402918d880648 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Thu, 16 Jul 2015 11:55:04 -0400 Subject: [PATCH 060/263] remove unnecessary exit conditions --- poller-service.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/poller-service.py b/poller-service.py index e9aa123bc..c9d39b8b5 100755 --- a/poller-service.py +++ b/poller-service.py @@ -89,32 +89,28 @@ db_dbname = config['db_name'] try: amount_of_workers = int(config['poller_service_workers']) if amount_of_workers == 0: - log.critical("ERROR: 0 threads is not a valid value") - sys.exit(2) + amount_of_workers = 16 except KeyError: amount_of_workers = 16 try: poll_frequency = int(config['poller_service_poll_frequency']) if poll_frequency == 0: - log.critical("ERROR: 0 seconds is not a valid value") - sys.exit(2) + poll_frequency = 300 except KeyError: poll_frequency = 300 try: discover_frequency = int(config['poller_service_discover_frequency']) if discover_frequency == 0: - log.critical("ERROR: 0 seconds is not a valid value") - sys.exit(2) + discover_frequency = 21600 except KeyError: discover_frequency = 21600 try: down_retry = int(config['poller_service_down_retry']) if down_retry == 0: - log.critical("ERROR: 0 seconds is not a valid value") - sys.exit(2) + down_retry = 60 except KeyError: down_retry = 60 From bb697a35bd81bd71428edd6593ac49bc7332e035 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Thu, 16 Jul 2015 12:11:45 -0400 Subject: [PATCH 061/263] attribution --- poller-service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poller-service.py b/poller-service.py index c9d39b8b5..0ca3b5cd9 100755 --- a/poller-service.py +++ b/poller-service.py @@ -4,12 +4,12 @@ devices that have been polled within the last $poll_frequency seconds. It will prioritize devices based on the last time polled. If resources are sufficient, this service should poll every device every $poll_frequency seconds, but should gracefully degrade if resources are inefficient, polling devices as - frequently as possible. This service is based on poller-wrapper.py. + frequently as possible. This service is based on Job Snijders' poller-wrapper.py. Author: Clint Armstrong Date: July 2015 - License: BSD + License: BSD 2-Clause """ import json From c9a56e248d0312568318fee0b758e8d59e0db215 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Fri, 17 Jul 2015 13:33:24 -0400 Subject: [PATCH 062/263] index and limit --- poller-service.py | 9 ++++----- sql-schema/065.sql | 2 ++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/poller-service.py b/poller-service.py index 0ca3b5cd9..bbcfa7617 100755 --- a/poller-service.py +++ b/poller-service.py @@ -199,7 +199,8 @@ dev_query = ('SELECT device_id, status, 'AND ( last_poll_attempted < DATE_SUB(NOW(), INTERVAL {2} SECOND ) ' ' OR last_poll_attempted IS NULL ) ' '{3} ' - 'ORDER BY next_poll asc ').format(poll_frequency, + 'ORDER BY next_poll asc ' + 'LIMIT 5 ').format(poll_frequency, discover_frequency, down_retry, poller_group) @@ -251,11 +252,9 @@ while True: # add queue lock, so we lock the next device against any other pollers # if this fails, the device is locked by another poller already if not getLock('queued.{}'.format(device_id)): - time.sleep(.5) continue if not lockFree('polling.{}'.format(device_id)): releaseLock('queued.{}'.format(device_id)) - time.sleep(.5) continue if next_poll and next_poll > datetime.now(): @@ -278,9 +277,9 @@ while True: # If we made it this far, break out of the loop and query again. break - # Looping with no break causes the service to be killed by init. # This point is only reached if the query is empty, so sleep half a second before querying again. time.sleep(.5) - # Make sure we're not holding any device queue locks in this connection before querying again. + # Make sure we're not holding any device queue locks in this connection before querying again + # by locking a different string. getLock('unlock.{}'.format(config['distributed_poller_name'])) diff --git a/sql-schema/065.sql b/sql-schema/065.sql index ab64beca9..4fb76d358 100644 --- a/sql-schema/065.sql +++ b/sql-schema/065.sql @@ -1,3 +1,5 @@ DELETE n1 FROM pollers n1, pollers n2 WHERE n1.last_polled < n2.last_polled and n1.poller_name = n2.poller_name; ALTER TABLE pollers ADD PRIMARY KEY (poller_name); ALTER TABLE `devices` ADD `last_poll_attempted` timestamp NULL DEFAULT NULL AFTER `last_polled`; +ALTER TABLE `devices` ADD INDEX `last_polled` (`last_polled`); +ALTER TABLE `devices` ADD INDEX `last_poll_attempted` (`last_poll_attempted`); From 71c1771d8492e6ea57f710c5d9e3bb28fdd47a7d Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Sat, 18 Jul 2015 20:04:44 -0400 Subject: [PATCH 063/263] zero length field in format --- poller-service.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/poller-service.py b/poller-service.py index bbcfa7617..82b486316 100755 --- a/poller-service.py +++ b/poller-service.py @@ -64,7 +64,7 @@ try: except KeyError: loglevel = logging.getLevelName('INFO') if not isinstance(loglevel, int): - log.warning('ERROR: {} is not a valid log level'.format(str(loglevel))) + log.warning('ERROR: {0} is not a valid log level'.format(str(loglevel))) loglevel = logging.getLevelName('INFO') log.setLevel(loglevel) @@ -147,21 +147,21 @@ def poll_worker(device_id, action): def lockFree(lock): global cursor - query = "SELECT IS_FREE_LOCK('{}')".format(lock) + query = "SELECT IS_FREE_LOCK('{0}')".format(lock) cursor.execute(query) return cursor.fetchall()[0][0] == 1 def getLock(lock): global cursor - query = "SELECT GET_LOCK('{}', 0)".format(lock) + query = "SELECT GET_LOCK('{0}', 0)".format(lock) cursor.execute(query) return cursor.fetchall()[0][0] == 1 def releaseLock(lock): global cursor - query = "SELECT RELEASE_LOCK('{}')".format(lock) + query = "SELECT RELEASE_LOCK('{0}')".format(lock) cursor.execute(query) return cursor.fetchall()[0][0] == 1 @@ -174,7 +174,7 @@ def sleep_until(timestamp): sleeptime = 0 time.sleep(sleeptime) -poller_group = ('and poller_group IN({}) ' +poller_group = ('and poller_group IN({0}) ' .format(str(config['distributed_poller_group'])) if 'distributed_poller_group' in config else '') # Add last_polled and last_polled_timetaken so we can sort by the time the last poll started, with the goal @@ -213,7 +213,7 @@ while True: cur_threads = threading.active_count() if cur_threads != threads: threads = cur_threads - log.debug('DEBUG: {} threads currently active'.format(threads)) + log.debug('DEBUG: {0} threads currently active'.format(threads)) if next_update < datetime.now(): seconds_taken = (datetime.now() - (next_update - timedelta(minutes=1))).seconds @@ -234,7 +234,7 @@ while True: log.critical('ERROR: MySQL query error. Is your schema up to date?') sys.exit(2) cursor.fetchall() - log.info('INFO: {} devices scanned in the last 5 minutes'.format(devices_scanned)) + log.info('INFO: {0} devices scanned in the last 5 minutes'.format(devices_scanned)) devices_scanned = 0 next_update = datetime.now() + timedelta(minutes=1) @@ -251,10 +251,10 @@ while True: for device_id, status, next_poll, next_discovery in devices: # add queue lock, so we lock the next device against any other pollers # if this fails, the device is locked by another poller already - if not getLock('queued.{}'.format(device_id)): + if not getLock('queued.{0}'.format(device_id)): continue - if not lockFree('polling.{}'.format(device_id)): - releaseLock('queued.{}'.format(device_id)) + if not lockFree('polling.{0}'.format(device_id)): + releaseLock('queued.{0}'.format(device_id)) continue if next_poll and next_poll > datetime.now(): @@ -265,10 +265,10 @@ while True: if (not next_discovery or next_discovery < datetime.now()) and status == 1: action = 'discovery' - log.debug('DEBUG: Starting {} of device {}'.format(action, device_id)) + log.debug('DEBUG: Starting {0} of device {1}'.format(action, device_id)) devices_scanned += 1 - cursor.execute('UPDATE devices SET last_poll_attempted = NOW() WHERE device_id = {}'.format(device_id)) + cursor.execute('UPDATE devices SET last_poll_attempted = NOW() WHERE device_id = {0}'.format(device_id)) cursor.fetchall() t = threading.Thread(target=poll_worker, args=[device_id, action]) @@ -282,4 +282,4 @@ while True: # Make sure we're not holding any device queue locks in this connection before querying again # by locking a different string. - getLock('unlock.{}'.format(config['distributed_poller_name'])) + getLock('unlock.{0}'.format(config['distributed_poller_name'])) From 73ada34f306b3c8608ae544b8f19730401a4873e Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Sat, 18 Jul 2015 20:37:34 -0400 Subject: [PATCH 064/263] make logging python3 compatible --- poller-service.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/poller-service.py b/poller-service.py index 82b486316..c0c861413 100755 --- a/poller-service.py +++ b/poller-service.py @@ -44,7 +44,7 @@ def get_config_data(): except: log.critical("ERROR: Could not execute: %s" % config_cmd) sys.exit(2) - return proc.communicate()[0] + return proc.communicate()[0].decode() try: with open(config_file) as f: @@ -60,13 +60,12 @@ except: sys.exit(2) try: - loglevel = logging.getLevelName(config['poller_service_loglevel'].upper()) + log.setLevel(config['poller_service_loglevel'].upper()) except KeyError: - loglevel = logging.getLevelName('INFO') -if not isinstance(loglevel, int): - log.warning('ERROR: {0} is not a valid log level'.format(str(loglevel))) - loglevel = logging.getLevelName('INFO') -log.setLevel(loglevel) + log.setLevel('INFO') +except ValueError: + log.warning('ERROR: {0} is not a valid log level'.format(config['poller_service_loglevel'])) + log.setLevel('INFO') poller_path = config['install_dir'] + '/poller.php' discover_path = config['install_dir'] + '/discovery.php' From 9022c168367732d300b9f4552dc032e0839e71d1 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Sat, 18 Jul 2015 20:57:25 -0400 Subject: [PATCH 065/263] upper case warning --- poller-service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poller-service.py b/poller-service.py index c0c861413..fd97860e2 100755 --- a/poller-service.py +++ b/poller-service.py @@ -64,7 +64,7 @@ try: except KeyError: log.setLevel('INFO') except ValueError: - log.warning('ERROR: {0} is not a valid log level'.format(config['poller_service_loglevel'])) + log.warning('ERROR: {0} is not a valid log level'.format(config['poller_service_loglevel'].upper())) log.setLevel('INFO') poller_path = config['install_dir'] + '/poller.php' From 0f34042b84aaff7c4a5f732f027d25dc738944e4 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Sat, 18 Jul 2015 21:09:10 -0400 Subject: [PATCH 066/263] Revert "upper case warning" This reverts commit c87d626105ad80d7856e2c15f98219c43ebe0c2e. --- poller-service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poller-service.py b/poller-service.py index fd97860e2..c0c861413 100755 --- a/poller-service.py +++ b/poller-service.py @@ -64,7 +64,7 @@ try: except KeyError: log.setLevel('INFO') except ValueError: - log.warning('ERROR: {0} is not a valid log level'.format(config['poller_service_loglevel'].upper())) + log.warning('ERROR: {0} is not a valid log level'.format(config['poller_service_loglevel'])) log.setLevel('INFO') poller_path = config['install_dir'] + '/poller.php' From 85aa9ccdb8b530aac72221bcc62260b5edd31f66 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Sat, 18 Jul 2015 21:09:20 -0400 Subject: [PATCH 067/263] Revert "make logging python3 compatible" This reverts commit 74531c6e69c31c252a48d2bab90bc98e4f566111. --- poller-service.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/poller-service.py b/poller-service.py index c0c861413..82b486316 100755 --- a/poller-service.py +++ b/poller-service.py @@ -44,7 +44,7 @@ def get_config_data(): except: log.critical("ERROR: Could not execute: %s" % config_cmd) sys.exit(2) - return proc.communicate()[0].decode() + return proc.communicate()[0] try: with open(config_file) as f: @@ -60,12 +60,13 @@ except: sys.exit(2) try: - log.setLevel(config['poller_service_loglevel'].upper()) + loglevel = logging.getLevelName(config['poller_service_loglevel'].upper()) except KeyError: - log.setLevel('INFO') -except ValueError: - log.warning('ERROR: {0} is not a valid log level'.format(config['poller_service_loglevel'])) - log.setLevel('INFO') + loglevel = logging.getLevelName('INFO') +if not isinstance(loglevel, int): + log.warning('ERROR: {0} is not a valid log level'.format(str(loglevel))) + loglevel = logging.getLevelName('INFO') +log.setLevel(loglevel) poller_path = config['install_dir'] + '/poller.php' discover_path = config['install_dir'] + '/discovery.php' From 403d4c53646c11825d85cb4ac0acfb89bdf599a8 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Sat, 18 Jul 2015 21:09:49 -0400 Subject: [PATCH 068/263] decode proc --- poller-service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poller-service.py b/poller-service.py index 82b486316..3a98a6ac2 100755 --- a/poller-service.py +++ b/poller-service.py @@ -44,7 +44,7 @@ def get_config_data(): except: log.critical("ERROR: Could not execute: %s" % config_cmd) sys.exit(2) - return proc.communicate()[0] + return proc.communicate()[0].decode() try: with open(config_file) as f: From 779862601762680a120c9370fc4b17dd1c614646 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Sat, 18 Jul 2015 21:31:01 -0400 Subject: [PATCH 069/263] fix logging options --- poller-service.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/poller-service.py b/poller-service.py index 3a98a6ac2..4fcf37818 100755 --- a/poller-service.py +++ b/poller-service.py @@ -60,12 +60,14 @@ except: sys.exit(2) try: - loglevel = logging.getLevelName(config['poller_service_loglevel'].upper()) + loglevel = config['poller_service_loglevel'] except KeyError: - loglevel = logging.getLevelName('INFO') + loglevel = 20 if not isinstance(loglevel, int): - log.warning('ERROR: {0} is not a valid log level'.format(str(loglevel))) - loglevel = logging.getLevelName('INFO') + loglevel = logging.getLevelName(loglevel) +if not isinstance(loglevel, int): + log.warning('ERROR: {0} is not a valid log level. If using python 3.4.0-3.4.1 you must specify loglevel by number'.format(str(loglevel))) + loglevel = 20 log.setLevel(loglevel) poller_path = config['install_dir'] + '/poller.php' From 617e695b2012fb94303d555376b151fc83b64ff4 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Sat, 18 Jul 2015 21:38:27 -0400 Subject: [PATCH 070/263] better logging error checking --- poller-service.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/poller-service.py b/poller-service.py index 4fcf37818..0989b27a2 100755 --- a/poller-service.py +++ b/poller-service.py @@ -60,15 +60,17 @@ except: sys.exit(2) try: - loglevel = config['poller_service_loglevel'] + loglevel = int(config['poller_service_loglevel']) except KeyError: loglevel = 20 -if not isinstance(loglevel, int): - loglevel = logging.getLevelName(loglevel) -if not isinstance(loglevel, int): +except ValueError: + loglevel = logging.getLevelName(config['poller_service_loglevel']) + +try: + log.setLevel(loglevel) +except ValueError: log.warning('ERROR: {0} is not a valid log level. If using python 3.4.0-3.4.1 you must specify loglevel by number'.format(str(loglevel))) - loglevel = 20 -log.setLevel(loglevel) + log.setLevel(20) poller_path = config['install_dir'] + '/poller.php' discover_path = config['install_dir'] + '/discovery.php' From 9039dbb425555c48d9ce4ac5927e65f97ae7c803 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Wed, 22 Jul 2015 07:37:02 -0400 Subject: [PATCH 071/263] give discovery it's own lock --- discovery.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discovery.php b/discovery.php index 93ca69a09..a8e48c649 100755 --- a/discovery.php +++ b/discovery.php @@ -106,8 +106,8 @@ if ($config['distributed_poller'] === true) { } foreach (dbFetch("SELECT * FROM `devices` WHERE status = 1 AND disabled = 0 $where ORDER BY device_id DESC") as $device) { - if (dbGetLock('polling.' . $device['device_id'])) { - discover_device($device, $options); + if (dbGetLock('discovering.' . $device['device_id'])) { + discover_device($device, $options); } } From a47ae33cfd0e096bbc980e4370eca7e79f571983 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Wed, 22 Jul 2015 07:39:37 -0400 Subject: [PATCH 072/263] check for schema_update lock when poller-service runs --- poller-service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poller-service.py b/poller-service.py index 0989b27a2..178282026 100755 --- a/poller-service.py +++ b/poller-service.py @@ -242,7 +242,7 @@ while True: devices_scanned = 0 next_update = datetime.now() + timedelta(minutes=1) - while threading.active_count() >= amount_of_workers: + while threading.active_count() >= amount_of_workers or not lockFree('schema_update'): time.sleep(.5) try: From 86e0f42dc75a678d1a78b0f20a179b47c0215928 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Wed, 22 Jul 2015 07:52:58 -0400 Subject: [PATCH 073/263] bail out if we can't get a lock on schema_update --- includes/sql-schema/update.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/sql-schema/update.php b/includes/sql-schema/update.php index 4bb7df721..19b043ada 100644 --- a/includes/sql-schema/update.php +++ b/includes/sql-schema/update.php @@ -31,6 +31,11 @@ if (!isset($debug)) { } } +if (!dbGetLock('schema_update')) { + echo "Schema update already in progress. Exiting"; + exit(1); +} + $insert = 0; if ($db_rev = @dbFetchCell('SELECT version FROM `dbSchema` ORDER BY version DESC LIMIT 1')) { From 777d5d6c6f586dedaeadc2c607b172ed9c36e4a4 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Wed, 22 Jul 2015 07:58:36 -0400 Subject: [PATCH 074/263] add function to check for a lock --- includes/dbFacile.mysql.php | 13 +++++++------ includes/dbFacile.mysqli.php | 11 ++++++----- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/includes/dbFacile.mysql.php b/includes/dbFacile.mysql.php index 9fd82c698..bac21b008 100644 --- a/includes/dbFacile.mysql.php +++ b/includes/dbFacile.mysql.php @@ -60,12 +60,12 @@ function dbQuery($sql, $parameters=array()) { /* - * Aquire a lock on a string + * Check a lock on a string * */ -function dbGetLock($data, $timeout = 0) { - $sql = 'SELECT GET_LOCK(\'' . $data . '\',' . $timeout . ')'; - $result = dbFetchCell($sql); - return $result; +function dbCheckLock($data, $timeout = 0) { + $sql = 'SELECT IS_FREE_LOCK(\'' . $data . '\')'; + $result = dbFetchCell($sql); + return $result; } @@ -76,8 +76,9 @@ function dbReleaseLock($data, $timeout = 0) { $sql = 'SELECT RELEASE_LOCK(\'' . $data . '\')'; $result = dbFetchCell($sql); return $result; - +} + /* * Passed an array and a table name, it attempts to insert the data into the table. * Check for boolean false to determine whether insert failed diff --git a/includes/dbFacile.mysqli.php b/includes/dbFacile.mysqli.php index 36b2208cb..158a1dae5 100644 --- a/includes/dbFacile.mysqli.php +++ b/includes/dbFacile.mysqli.php @@ -60,12 +60,12 @@ function dbQuery($sql, $parameters=array()) { /* - * Aquire a lock on a string + * Check a lock on a string * */ -function dbGetLock($data, $timeout = 0) { - $sql = 'SELECT GET_LOCK(\'' . $data . '\',' . $timeout . ')'; - $result = dbFetchCell($sql); - return $result; +function dbCheckLock($data, $timeout = 0) { + $sql = 'SELECT IS_FREE_LOCK(\'' . $data . '\')'; + $result = dbFetchCell($sql); + return $result; } @@ -76,6 +76,7 @@ function dbReleaseLock($data, $timeout = 0) { $sql = 'SELECT RELEASE_LOCK(\'' . $data . '\')'; $result = dbFetchCell($sql); return $result; +} /* From 1379a13c7686cfef66f52aa85625d609cf8b7400 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Wed, 22 Jul 2015 08:09:19 -0400 Subject: [PATCH 075/263] wait for all locks to be free when updating schema --- includes/sql-schema/update.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/sql-schema/update.php b/includes/sql-schema/update.php index 19b043ada..46233e8dd 100644 --- a/includes/sql-schema/update.php +++ b/includes/sql-schema/update.php @@ -34,7 +34,11 @@ if (!isset($debug)) { if (!dbGetLock('schema_update')) { echo "Schema update already in progress. Exiting"; exit(1); -} +} //end if + +do { + sleep(1); +} while (@dbFetchCell('SELECT COUNT(*) FROM `devices` WHERE NOT IS_FREE_LOCK(CONCAT("polling.", device_id)) OR NOT IS_FREE_LOCK(CONCAT("queued.", device_id)) OR NOT IS_FREE_LOCK(CONCAT("discovering.", device_id))') > 0); $insert = 0; From c5fcb87b51b7590195e3e5b27570ace0fc8d8da6 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Wed, 22 Jul 2015 08:31:51 -0400 Subject: [PATCH 076/263] bail if schema is already up to date --- includes/sql-schema/update.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/includes/sql-schema/update.php b/includes/sql-schema/update.php index 46233e8dd..23038e5fc 100644 --- a/includes/sql-schema/update.php +++ b/includes/sql-schema/update.php @@ -32,7 +32,7 @@ if (!isset($debug)) { } if (!dbGetLock('schema_update')) { - echo "Schema update already in progress. Exiting"; + echo "Schema update already in progress. Exiting\n"; exit(1); } //end if @@ -93,6 +93,13 @@ if ($handle = opendir($config['install_dir'].'/sql-schema')) { asort($filelist); +if (explode('.', max($filelist), 2) <= $db_rev) { + if ($debug) { + echo "DB Schema already up to date.\n"; + } + exit(0); +} + foreach ($filelist as $file) { list($filename,$extension) = explode('.', $file, 2); if ($filename > $db_rev) { From e74a6db21650f1e3b08d4f190450ea0a712a1f2f Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Wed, 22 Jul 2015 08:32:30 -0400 Subject: [PATCH 077/263] move lock checks after bail out --- includes/sql-schema/update.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/includes/sql-schema/update.php b/includes/sql-schema/update.php index 23038e5fc..c07909845 100644 --- a/includes/sql-schema/update.php +++ b/includes/sql-schema/update.php @@ -31,15 +31,6 @@ if (!isset($debug)) { } } -if (!dbGetLock('schema_update')) { - echo "Schema update already in progress. Exiting\n"; - exit(1); -} //end if - -do { - sleep(1); -} while (@dbFetchCell('SELECT COUNT(*) FROM `devices` WHERE NOT IS_FREE_LOCK(CONCAT("polling.", device_id)) OR NOT IS_FREE_LOCK(CONCAT("queued.", device_id)) OR NOT IS_FREE_LOCK(CONCAT("discovering.", device_id))') > 0); - $insert = 0; if ($db_rev = @dbFetchCell('SELECT version FROM `dbSchema` ORDER BY version DESC LIMIT 1')) { @@ -100,6 +91,15 @@ if (explode('.', max($filelist), 2) <= $db_rev) { exit(0); } +if (!dbGetLock('schema_update')) { + echo "Schema update already in progress. Exiting\n"; + exit(1); +} //end if + +do { + sleep(1); +} while (@dbFetchCell('SELECT COUNT(*) FROM `devices` WHERE NOT IS_FREE_LOCK(CONCAT("polling.", device_id)) OR NOT IS_FREE_LOCK(CONCAT("queued.", device_id)) OR NOT IS_FREE_LOCK(CONCAT("discovering.", device_id))') > 0); + foreach ($filelist as $file) { list($filename,$extension) = explode('.', $file, 2); if ($filename > $db_rev) { From d9efadb441c243fb39a1dfe9eb26850ce1061013 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Wed, 22 Jul 2015 08:44:55 -0400 Subject: [PATCH 078/263] fix bailout comparison --- includes/sql-schema/update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/sql-schema/update.php b/includes/sql-schema/update.php index c07909845..141139a35 100644 --- a/includes/sql-schema/update.php +++ b/includes/sql-schema/update.php @@ -84,7 +84,7 @@ if ($handle = opendir($config['install_dir'].'/sql-schema')) { asort($filelist); -if (explode('.', max($filelist), 2) <= $db_rev) { +if (explode('.', max($filelist), 2)[0] <= $db_rev) { if ($debug) { echo "DB Schema already up to date.\n"; } From 38af8b4c4c6cf568487342b3469811091466b32b Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Wed, 22 Jul 2015 08:48:33 -0400 Subject: [PATCH 079/263] return instead of exit --- includes/sql-schema/update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/sql-schema/update.php b/includes/sql-schema/update.php index 141139a35..1d0c70804 100644 --- a/includes/sql-schema/update.php +++ b/includes/sql-schema/update.php @@ -88,7 +88,7 @@ if (explode('.', max($filelist), 2)[0] <= $db_rev) { if ($debug) { echo "DB Schema already up to date.\n"; } - exit(0); + return; } if (!dbGetLock('schema_update')) { From 33baea6d6a9edcec35f1e01690aca86405feff46 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Wed, 22 Jul 2015 08:50:35 -0400 Subject: [PATCH 080/263] release schema lock --- includes/sql-schema/update.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/sql-schema/update.php b/includes/sql-schema/update.php index 1d0c70804..154ac007c 100644 --- a/includes/sql-schema/update.php +++ b/includes/sql-schema/update.php @@ -169,3 +169,5 @@ if ($updating) { echo "-- Done\n"; } + +dbReleaseLock('schema_update'); From 6f0969c1516b15c246606d3b16e12bbd5f6ccbf0 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Wed, 22 Jul 2015 09:04:12 -0400 Subject: [PATCH 081/263] typo --- poller-service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poller-service.py b/poller-service.py index 178282026..74e584e64 100755 --- a/poller-service.py +++ b/poller-service.py @@ -238,7 +238,7 @@ while True: log.critical('ERROR: MySQL query error. Is your schema up to date?') sys.exit(2) cursor.fetchall() - log.info('INFO: {0} devices scanned in the last 5 minutes'.format(devices_scanned)) + log.info('INFO: {0} devices scanned in the last minute'.format(devices_scanned)) devices_scanned = 0 next_update = datetime.now() + timedelta(minutes=1) From 507e4baa95daacec409e31077cbea65f5175ccba Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Thu, 23 Jul 2015 14:48:08 -0400 Subject: [PATCH 082/263] simplify poller-service.conf --- poller-service.conf | 9 --------- 1 file changed, 9 deletions(-) diff --git a/poller-service.conf b/poller-service.conf index 36677e7d2..b41af1830 100644 --- a/poller-service.conf +++ b/poller-service.conf @@ -12,15 +12,6 @@ stop on runlevel [016] # Automatically restart process if crashed respawn -# Essentially lets upstart know the process will detach itself to the background -#expect fork - -# # Run before process -# pre-start script -# [ -d /var/run/myservice ] || mkdir -p /var/run/myservice -# echo "Put bash code here" -# end script - chdir /opt/librenms setuid librenms setgid librenms From bba88039338fdd7a22508a9b149164a0d226bc67 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Thu, 23 Jul 2015 14:49:34 -0400 Subject: [PATCH 083/263] symlink instead of copy --- doc/Extensions/Poller-Service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Extensions/Poller-Service.md b/doc/Extensions/Poller-Service.md index 354d58c39..d6efd97a2 100644 --- a/doc/Extensions/Poller-Service.md +++ b/doc/Extensions/Poller-Service.md @@ -21,4 +21,4 @@ $config['poller_service_down_retry'] = 60; Distributed polling is possible, and uses the same configuration options as are described for traditional distributed polling, except that the memcached options are not necessary. The database must be acessable from the distributed pollers, and properly configured. Remote access to the RRD directory must also be configured as described in the Distributed Poller documentation. Memcache is not required. Concurrency is managed using mysql GET_LOCK to ensure that devices are only being polled by one device at at time. The poller service is compatible with poller groups. ## Service Installation -The service is tested on Ubuntu 14.04. An upstart configuration `poller-service.conf` is provided. To install copy this file to `/etc/init/poller-service.conf`. The service will start on boot and can be started manually by running `start poller-service`. The service is configured to run as the user `librenms` and will fail if that user does not exist. +The service is tested on Ubuntu 14.04. An upstart configuration `poller-service.conf` is provided. To install symlink this file to `/etc/init/poller-service.conf`. The service will start on boot and can be started manually by running `start poller-service`. The service is configured to run as the user `librenms` and will fail if that user does not exist. From ef91005f6c9b6a84a425f6612bf3efa33409e269 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Thu, 23 Jul 2015 14:53:37 -0400 Subject: [PATCH 084/263] add LSB script --- poller-service.init | 88 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100755 poller-service.init diff --git a/poller-service.init b/poller-service.init new file mode 100755 index 000000000..ff5b4766c --- /dev/null +++ b/poller-service.init @@ -0,0 +1,88 @@ +### BEGIN INIT INFO +# Provides: poller-service +# Required-Start: networking +# Required-Stop: networking +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: The LibreNMS poller-service daemon +# Description: The LibreNMS poller-service daemon +# This polls devices monitored by LibreNMS +### END INIT INFO + +./lib/lsb/init-functions + +NAME=poller-service + +DAEMON=/opt/librenms/poller-service.py + +PIDFILE=/var/run/poller-service.pid + +test -x $DAEMON || exit 5 + +case $1 in + + start) + # Checked the PID file exists and check the actual status of process + if [ -e $PIDFILE ]; then + status_of_proc -p $PIDFILE $DAEMON "$NAME process" && status="0" || status="$?" + # If the status is SUCCESS then don't need to start again. + if [ $status = "0" ]; then + exit # Exit + fi + fi + # Start the daemon. + log_daemon_msg "Starting the process" "$NAME" + # Start the daemon with the help of start-stop-daemon + # Log the message appropriately + if start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON ; then + log_end_msg 0 + else + log_end_msg 1 + fi + ;; + + stop) + # Stop the daemon. + if [ -e $PIDFILE ]; then + status_of_proc -p $PIDFILE $DAEMON "Stoppping the $NAME process" && status="0" || status="$?" + if [ "$status" = 0 ]; then + start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE + /bin/rm -rf $PIDFILE + fi + else + log_daemon_msg "$NAME process is not running" + log_end_msg 0 + fi + ;; + restart) + # Restart the daemon. + $0 stop && sleep 2 && $0 start + ;; + + status) + # Check the status of the process. + if [ -e $PIDFILE ]; then + status_of_proc -p $PIDFILE $DAEMON "$NAME process" && exit 0 || exit $? + else + log_daemon_msg "$NAME Process is not running" + log_end_msg 0 + fi + ;; + + reload) + # Reload the process. Basically sending some signal to a daemon to reload + # it configurations. + if [ -e $PIDFILE ]; then + start-stop-daemon --stop --signal USR1 --quiet --pidfile $PIDFILE --name $NAME + log_success_msg "$NAME process reloaded successfully" + else + log_failure_msg "$PIDFILE does not exists" + fi + ;; + + *) + # For invalid arguments, print the usage message. + echo "Usage: $0 {start|stop|restart|reload|status}" + exit 2 + ;; +esac From 4c5f7f9dd1ce34ac23849fda751fa976b5719367 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Thu, 23 Jul 2015 14:56:42 -0400 Subject: [PATCH 085/263] add lsb docs --- doc/Extensions/Poller-Service.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/Extensions/Poller-Service.md b/doc/Extensions/Poller-Service.md index d6efd97a2..4d709ccd6 100644 --- a/doc/Extensions/Poller-Service.md +++ b/doc/Extensions/Poller-Service.md @@ -21,4 +21,6 @@ $config['poller_service_down_retry'] = 60; Distributed polling is possible, and uses the same configuration options as are described for traditional distributed polling, except that the memcached options are not necessary. The database must be acessable from the distributed pollers, and properly configured. Remote access to the RRD directory must also be configured as described in the Distributed Poller documentation. Memcache is not required. Concurrency is managed using mysql GET_LOCK to ensure that devices are only being polled by one device at at time. The poller service is compatible with poller groups. ## Service Installation -The service is tested on Ubuntu 14.04. An upstart configuration `poller-service.conf` is provided. To install symlink this file to `/etc/init/poller-service.conf`. The service will start on boot and can be started manually by running `start poller-service`. The service is configured to run as the user `librenms` and will fail if that user does not exist. +An upstart configuration `poller-service.conf` is provided. To install run `ln -s /opt/librenms/poller-service.conf /etc/init/poller-service.conf`. The service will start on boot and can be started manually by running `start poller-service`. The service is configured to run as the user `librenms` and will fail if that user does not exist. + +An LSB init script `poller-service.init` is also provided. To install run `ln -s /opt/librenms/poller-service.init /etc/init.d/poller-service && update-rc.d poller-service defaults`. From 92177414ad0bb477b4470e73fa54f4dbb2c35cea Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Thu, 23 Jul 2015 14:59:17 -0400 Subject: [PATCH 086/263] space --- poller-service.init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poller-service.init b/poller-service.init index ff5b4766c..7e1e5620f 100755 --- a/poller-service.init +++ b/poller-service.init @@ -9,7 +9,7 @@ # This polls devices monitored by LibreNMS ### END INIT INFO -./lib/lsb/init-functions +. /lib/lsb/init-functions NAME=poller-service From 29a6f1b0579555d4badee0a16330bb9891ebfe29 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Thu, 23 Jul 2015 15:03:01 -0400 Subject: [PATCH 087/263] run as librenms and background --- poller-service.init | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/poller-service.init b/poller-service.init index 7e1e5620f..25c4bd253 100755 --- a/poller-service.init +++ b/poller-service.init @@ -15,6 +15,8 @@ NAME=poller-service DAEMON=/opt/librenms/poller-service.py +USER=librenms + PIDFILE=/var/run/poller-service.pid test -x $DAEMON || exit 5 @@ -34,7 +36,7 @@ case $1 in log_daemon_msg "Starting the process" "$NAME" # Start the daemon with the help of start-stop-daemon # Log the message appropriately - if start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON ; then + if start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON --chuid $USER --background; then log_end_msg 0 else log_end_msg 1 @@ -69,17 +71,6 @@ case $1 in fi ;; - reload) - # Reload the process. Basically sending some signal to a daemon to reload - # it configurations. - if [ -e $PIDFILE ]; then - start-stop-daemon --stop --signal USR1 --quiet --pidfile $PIDFILE --name $NAME - log_success_msg "$NAME process reloaded successfully" - else - log_failure_msg "$PIDFILE does not exists" - fi - ;; - *) # For invalid arguments, print the usage message. echo "Usage: $0 {start|stop|restart|reload|status}" From 985ea21f6e2321d68626bfb8a842529f26b25807 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Thu, 23 Jul 2015 15:09:06 -0400 Subject: [PATCH 088/263] make and remove pidfile --- poller-service.init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poller-service.init b/poller-service.init index 25c4bd253..15f2509d5 100755 --- a/poller-service.init +++ b/poller-service.init @@ -36,7 +36,7 @@ case $1 in log_daemon_msg "Starting the process" "$NAME" # Start the daemon with the help of start-stop-daemon # Log the message appropriately - if start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON --chuid $USER --background; then + if start-stop-daemon --start --quiet --oknodo --make-pidfile --pidfile $PIDFILE --exec $DAEMON --chuid $USER --background; then log_end_msg 0 else log_end_msg 1 @@ -48,7 +48,7 @@ case $1 in if [ -e $PIDFILE ]; then status_of_proc -p $PIDFILE $DAEMON "Stoppping the $NAME process" && status="0" || status="$?" if [ "$status" = 0 ]; then - start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE + start-stop-daemon --stop --quiet --oknodo --remove-pidfile --pidfile $PIDFILE /bin/rm -rf $PIDFILE fi else From 2fdea68e493e82ca5e77480a9d526115451d9286 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Thu, 23 Jul 2015 15:10:59 -0400 Subject: [PATCH 089/263] no removepidfile --- poller-service.init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poller-service.init b/poller-service.init index 15f2509d5..6e870a6db 100755 --- a/poller-service.init +++ b/poller-service.init @@ -48,7 +48,7 @@ case $1 in if [ -e $PIDFILE ]; then status_of_proc -p $PIDFILE $DAEMON "Stoppping the $NAME process" && status="0" || status="$?" if [ "$status" = 0 ]; then - start-stop-daemon --stop --quiet --oknodo --remove-pidfile --pidfile $PIDFILE + start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE /bin/rm -rf $PIDFILE fi else From 2caba3ee589c6d5480c2bbc6781c96e9440aca93 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Thu, 23 Jul 2015 15:35:32 -0400 Subject: [PATCH 090/263] add note to reload initctl after linking upstart job --- doc/Extensions/Poller-Service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Extensions/Poller-Service.md b/doc/Extensions/Poller-Service.md index 4d709ccd6..26bf898c1 100644 --- a/doc/Extensions/Poller-Service.md +++ b/doc/Extensions/Poller-Service.md @@ -21,6 +21,6 @@ $config['poller_service_down_retry'] = 60; Distributed polling is possible, and uses the same configuration options as are described for traditional distributed polling, except that the memcached options are not necessary. The database must be acessable from the distributed pollers, and properly configured. Remote access to the RRD directory must also be configured as described in the Distributed Poller documentation. Memcache is not required. Concurrency is managed using mysql GET_LOCK to ensure that devices are only being polled by one device at at time. The poller service is compatible with poller groups. ## Service Installation -An upstart configuration `poller-service.conf` is provided. To install run `ln -s /opt/librenms/poller-service.conf /etc/init/poller-service.conf`. The service will start on boot and can be started manually by running `start poller-service`. The service is configured to run as the user `librenms` and will fail if that user does not exist. +An upstart configuration `poller-service.conf` is provided. To install run `ln -s /opt/librenms/poller-service.conf /etc/init/poller-service.conf`. The service will start on boot and can be started manually by running `start poller-service`. If you recieve an error that the service does not exist, run `initctl reload-configuration`. The service is configured to run as the user `librenms` and will fail if that user does not exist. An LSB init script `poller-service.init` is also provided. To install run `ln -s /opt/librenms/poller-service.init /etc/init.d/poller-service && update-rc.d poller-service defaults`. From a71172969f88ed4d2898e5a5e38722a051fb5003 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Tue, 28 Jul 2015 07:31:46 -0400 Subject: [PATCH 091/263] fix unused code --- includes/dbFacile.mysql.php | 22 ++++++++++++++++------ includes/dbFacile.mysqli.php | 21 +++++++++++++++------ 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/includes/dbFacile.mysql.php b/includes/dbFacile.mysql.php index bac21b008..7b75aa9fb 100644 --- a/includes/dbFacile.mysql.php +++ b/includes/dbFacile.mysql.php @@ -59,10 +59,20 @@ function dbQuery($sql, $parameters=array()) { }//end dbQuery() +/* + * Aquire a lock on a string + * */ +function dbGetLock($data, $timeout = 0) { + $sql = 'SELECT GET_LOCK(\'' . $data . '\',' . $timeout . ')'; + $result = dbFetchCell($sql); + return $result; +} + + /* * Check a lock on a string * */ -function dbCheckLock($data, $timeout = 0) { +function dbCheckLock($data) { $sql = 'SELECT IS_FREE_LOCK(\'' . $data . '\')'; $result = dbFetchCell($sql); return $result; @@ -72,12 +82,12 @@ function dbCheckLock($data, $timeout = 0) { /* * Release a lock on a string * */ -function dbReleaseLock($data, $timeout = 0) { - $sql = 'SELECT RELEASE_LOCK(\'' . $data . '\')'; - $result = dbFetchCell($sql); - return $result; +function dbReleaseLock($data) { + $sql = 'SELECT RELEASE_LOCK(\'' . $data . '\')'; + $result = dbFetchCell($sql); + return $result; } - + /* * Passed an array and a table name, it attempts to insert the data into the table. diff --git a/includes/dbFacile.mysqli.php b/includes/dbFacile.mysqli.php index 158a1dae5..d7016368d 100644 --- a/includes/dbFacile.mysqli.php +++ b/includes/dbFacile.mysqli.php @@ -59,10 +59,20 @@ function dbQuery($sql, $parameters=array()) { }//end dbQuery() +/* + * Aquire a lock on a string + * */ +function dbGetLock($data, $timeout = 0) { + $sql = 'SELECT GET_LOCK(\'' . $data . '\',' . $timeout . ')'; + $result = dbFetchCell($sql); + return $result; +} + + /* * Check a lock on a string * */ -function dbCheckLock($data, $timeout = 0) { +function dbCheckLock($data) { $sql = 'SELECT IS_FREE_LOCK(\'' . $data . '\')'; $result = dbFetchCell($sql); return $result; @@ -72,13 +82,12 @@ function dbCheckLock($data, $timeout = 0) { /* * Release a lock on a string * */ -function dbReleaseLock($data, $timeout = 0) { - $sql = 'SELECT RELEASE_LOCK(\'' . $data . '\')'; - $result = dbFetchCell($sql); - return $result; +function dbReleaseLock($data) { + $sql = 'SELECT RELEASE_LOCK(\'' . $data . '\')'; + $result = dbFetchCell($sql); + return $result; } - /* * Passed an array and a table name, it attempts to insert the data into the table. * Check for boolean false to determine whether insert failed From f28c0cceca229b17fc1177aa8cef5e6618af3513 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Thu, 30 Jul 2015 09:39:08 -0400 Subject: [PATCH 092/263] multi-master mysql docs --- doc/Extensions/Poller-Service.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/Extensions/Poller-Service.md b/doc/Extensions/Poller-Service.md index 26bf898c1..ab5461ca6 100644 --- a/doc/Extensions/Poller-Service.md +++ b/doc/Extensions/Poller-Service.md @@ -20,6 +20,9 @@ $config['poller_service_down_retry'] = 60; ## Distributed Polling Distributed polling is possible, and uses the same configuration options as are described for traditional distributed polling, except that the memcached options are not necessary. The database must be acessable from the distributed pollers, and properly configured. Remote access to the RRD directory must also be configured as described in the Distributed Poller documentation. Memcache is not required. Concurrency is managed using mysql GET_LOCK to ensure that devices are only being polled by one device at at time. The poller service is compatible with poller groups. +## Multi-Master MySQL considerations +Because locks are not replicated in Multi-Master MySQL configurations, if you are using such a configuration, you will need to make sure that all pollers are using the same MySQL server. + ## Service Installation An upstart configuration `poller-service.conf` is provided. To install run `ln -s /opt/librenms/poller-service.conf /etc/init/poller-service.conf`. The service will start on boot and can be started manually by running `start poller-service`. If you recieve an error that the service does not exist, run `initctl reload-configuration`. The service is configured to run as the user `librenms` and will fail if that user does not exist. From 588ea4083eee6d3dbf9f93f4416347f8204ffad2 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Fri, 21 Aug 2015 07:44:05 -0400 Subject: [PATCH 093/263] add license text --- poller-service.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/poller-service.py b/poller-service.py index 74e584e64..d8b48f455 100755 --- a/poller-service.py +++ b/poller-service.py @@ -10,6 +10,17 @@ Date: July 2015 License: BSD 2-Clause + +Copyright (c) 2015, Clint Armstrong +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import json From 29887af3766e1f2133b6c8d5fb9253b77de0b3a7 Mon Sep 17 00:00:00 2001 From: f0o Date: Wed, 26 Aug 2015 08:44:15 +0100 Subject: [PATCH 094/263] Remain PHP Backwards compatibility --- includes/sql-schema/update.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/sql-schema/update.php b/includes/sql-schema/update.php index 154ac007c..00add08f9 100644 --- a/includes/sql-schema/update.php +++ b/includes/sql-schema/update.php @@ -83,8 +83,8 @@ if ($handle = opendir($config['install_dir'].'/sql-schema')) { } asort($filelist); - -if (explode('.', max($filelist), 2)[0] <= $db_rev) { +$tmp = explode('.', max($filelist), 2); +if ($tmp[0] <= $db_rev) { if ($debug) { echo "DB Schema already up to date.\n"; } From f28103173bf2a2885711c5686c4f6f985d98a31d Mon Sep 17 00:00:00 2001 From: f0o Date: Thu, 27 Aug 2015 14:05:47 +0100 Subject: [PATCH 095/263] Only process followups if there are any results --- alerts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alerts.php b/alerts.php index fafc909ac..7a0f7afd4 100755 --- a/alerts.php +++ b/alerts.php @@ -193,7 +193,7 @@ function RunFollowUp() { $state = 4; } - if ($state > 0) { + if ($state > 0 && $n > 0) { $alert['details']['rule'] = $chk; if (dbInsert(array('state' => $state, 'device_id' => $alert['device_id'], 'rule_id' => $alert['rule_id'], 'details' => gzcompress(json_encode($alert['details']), 9)), 'alert_log')) { dbUpdate(array('state' => $state, 'open' => 1, 'alerted' => 1), 'alerts', 'rule_id = ? && device_id = ?', array($alert['rule_id'], $alert['device_id'])); From 867c83e9acdc13b758ed6c97b1ce29898f74cddc Mon Sep 17 00:00:00 2001 From: f0o Date: Thu, 27 Aug 2015 14:28:46 +0100 Subject: [PATCH 096/263] Fix Alert-Test Object. --- alerts.php | 2 +- html/includes/forms/test-transport.inc.php | 37 +++++++++++----------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/alerts.php b/alerts.php index fafc909ac..8cbeae55d 100755 --- a/alerts.php +++ b/alerts.php @@ -326,7 +326,7 @@ function ExtTransports($obj) { foreach ($config['alert']['transports'] as $transport => $opts) { if (($opts === true || !empty($opts)) && $opts != false && file_exists($config['install_dir'].'/includes/alerts/transport.'.$transport.'.php')) { echo $transport.' => '; - eval('$tmp = function($obj,$opts) { global $config; '.file_get_contents($config['install_dir'].'/includes/alerts/transport.'.$transport.'.php').' };'); + eval('$tmp = function($obj,$opts) { global $config; '.file_get_contents($config['install_dir'].'/includes/alerts/transport.'.$transport.'.php').' return false; };'); $tmp = $tmp($obj,$opts); $prefix = array( 0=>"recovery", 1=>$obj['severity']." alert", 2=>"acknowledgment" ); $prefix[3] = &$prefix[0]; diff --git a/html/includes/forms/test-transport.inc.php b/html/includes/forms/test-transport.inc.php index 121961ee0..4919a7ebc 100644 --- a/html/includes/forms/test-transport.inc.php +++ b/html/includes/forms/test-transport.inc.php @@ -18,31 +18,32 @@ if (is_admin() === false) { $transport = mres($_POST['transport']); +require_once $config['install_dir'].'/includes/alerts.inc.php'; +$tmp = array(dbFetchRow('select device_id,hostname from devices order by device_id asc limit 1')); +$tmp['contacts'] = GetContacts($tmp); $obj = array( - 'contacts' => $config['alert']['default_mail'], - 'title' => 'Testing transport from ' . $config['project_name'], - 'msg' => 'This is a test alert', - 'severity' => 'critical', - 'state' => 'critical', - 'hostname' => 'testing', - 'name' => 'Testing rule', + "hostname" => $tmp[0]['hostname'], + "device_id" => $tmp[0]['device_id'], + "title" => "Testing transport from ".$config['project_name'], + "elapsed" => "11s", + "id" => "000", + "faults" => false, + "uid" => "000", + "severity" => "critical", + "rule" => "%macros.device = 1", + "name" => "Test-Rule", + "timestamp" => date("Y-m-d H:i:s"), + "contacts" => $tmp['contacts'], + "state" => "0", + "msg" => "This is a test alert", ); -unset($obj); -$obj['contacts'] = 'test'; -$obj['title'] = 'test'; -$obj['msg'] = 'test'; -$obj['severity'] = 'test'; -$obj['state'] = 'test'; -$obj['hostname'] = 'test'; -$obj['name'] = 'test'; - $status = 'error'; -if (file_exists($config['install_dir']."/includes/alerts/transport.$transport.php")) { +if (file_exists($config['install_dir']."/includes/alerts/transport.".$transport.".php")) { $opts = $config['alert']['transports'][$transport]; if ($opts) { - eval('$tmp = function($obj,$opts) { global $config; '.file_get_contents($config['install_dir'].'/includes/alerts/transport.'.$transport.'.php').' };'); + eval('$tmp = function($obj,$opts) { global $config; '.file_get_contents($config['install_dir'].'/includes/alerts/transport.'.$transport.'.php').' return false; };'); $tmp = $tmp($obj,$opts); if ($tmp) { $status = 'ok'; From d58cdc0bb78ef0bb68cf2d8dde67b0c6203f9331 Mon Sep 17 00:00:00 2001 From: Rosiak Date: Thu, 27 Aug 2015 19:04:01 +0200 Subject: [PATCH 097/263] Basic MacOSX Discovery --- includes/definitions.inc.php | 8 ++++++++ includes/discovery/os/macosx.inc.php | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 includes/discovery/os/macosx.inc.php diff --git a/includes/definitions.inc.php b/includes/definitions.inc.php index 0fc20c740..b818cf266 100644 --- a/includes/definitions.inc.php +++ b/includes/definitions.inc.php @@ -1276,6 +1276,14 @@ $config['os'][$os]['icon'] = 'perle'; $config['os'][$os]['over'][0]['graph'] = 'device_bits'; $config['os'][$os]['over'][0]['text'] = 'Traffic'; +// MACOSX +$os = 'macosx'; +$config['os'][$os]['text'] = 'Apple OSX'; +$config['os'][$os]['type'] = 'server'; +$config['os'][$os]['icon'] = 'generic'; +$config['os'][$os]['over'][0]['graph'] = 'device_bits'; +$config['os'][$os]['over'][0]['text'] = 'Traffic'; + // Graph Types require_once $config['install_dir'].'/includes/load_db_graph_types.inc.php'; diff --git a/includes/discovery/os/macosx.inc.php b/includes/discovery/os/macosx.inc.php new file mode 100644 index 000000000..e2cf9a534 --- /dev/null +++ b/includes/discovery/os/macosx.inc.php @@ -0,0 +1,16 @@ + + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ +if (!$os) { + if (strpos($sysObjectId, '1.3.6.1.4.1.8072.3.2.16') !== false) { + $os = 'macosx'; + } +} From 976dbfd1006dc2ebbbe7cdf0efeee763e473109e Mon Sep 17 00:00:00 2001 From: f0o Date: Thu, 27 Aug 2015 19:00:17 +0100 Subject: [PATCH 098/263] Temporally fixes #1771 A nicer fix would be knowing a full sysDescr.0 from a Zyxel IES DSLAM to be more specific with the matching. --- includes/discovery/os/ies.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/discovery/os/ies.inc.php b/includes/discovery/os/ies.inc.php index 62b2e49a6..1079ba8d8 100644 --- a/includes/discovery/os/ies.inc.php +++ b/includes/discovery/os/ies.inc.php @@ -1,7 +1,7 @@ Date: Thu, 27 Aug 2015 18:19:06 +0000 Subject: [PATCH 099/263] Added response to test transport button --- html/pages/settings/alerting.inc.php | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/html/pages/settings/alerting.inc.php b/html/pages/settings/alerting.inc.php index ef58465db..f6c1bda0a 100644 --- a/html/pages/settings/alerting.inc.php +++ b/html/pages/settings/alerting.inc.php @@ -834,12 +834,33 @@ echo '
$(".toolTip").tooltip(); $("button#test-alert").click(function() { - var transport = $(this).data("transport"); + var $this = $(this); + var transport = $this.data("transport"); $.ajax({ type: 'POST', url: '/ajax_form.php', data: { type: "test-transport", transport: transport }, - dataType: "json" + dataType: "json", + success: function(data){ + if (data.status == 'ok') { + $this.removeClass('btn-primary').addClass('btn-success'); + setTimeout(function(){ + $this.removeClass('btn-success').addClass('btn-primary'); + }, 2000); + } + else { + $this.removeClass('btn-primary').addClass('btn-danger'); + setTimeout(function(){ + $this.removeClass('btn-danger').addClass('btn-primary'); + }, 2000); + } + }, + error: function(){ + $this.removeClass('btn-primary').addClass('btn-danger'); + setTimeout(function(){ + $this.removeClass('btn-danger').addClass('btn-primary'); + }, 2000); + } }); }); From ddf800fb16a5ef1e7c30c02e690d028eae49f0a6 Mon Sep 17 00:00:00 2001 From: laf Date: Thu, 27 Aug 2015 20:29:16 +0000 Subject: [PATCH 100/263] Added docs for device groups and tried to make sure old alerting docs are clear --- doc/Extensions/Device-Groups.md | 30 ++++++++++++++++++++++++++++++ doc/Extensions/Email-Alerting.md | 10 +++++++--- 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 doc/Extensions/Device-Groups.md diff --git a/doc/Extensions/Device-Groups.md b/doc/Extensions/Device-Groups.md new file mode 100644 index 000000000..cc48cdaad --- /dev/null +++ b/doc/Extensions/Device-Groups.md @@ -0,0 +1,30 @@ +# Device Groups + +LibreNMS supports grouping your devices together in much the same way as you can configure alerts. This document will hopefully help you get started. + +### Pattern + +Patterns work in the same was as Entities within the alerting system, the format of the pattern is based on the MySQL structure your data is in such +as __tablename.columnname__. If you are ensure of what the entity is you want then have a browse around inside MySQL using `show tables` and `desc `. + +As a working example and a common question, let's assume you want to group devices by hostname. If you hostname format is dcX.[devicetype].example.com. You would use the pattern +devices.hostname. Select the condition which in this case would Like and then enter dc1.@.example.com. This would then match dc1.sw01.example.com, dc1.rtr01.example.com but not + dc2.sw01.example.com. + +#### Wildcards + +As used in the example above, wildcards are represented by the @ symbol. I.e @.example.com would match any hostnames under example.com. + +A list of common entities is maintained in our [Alerting docs](http://docs.librenms.org/Extensions/Alerting/#entities). + +### Conditions + +Please see our [Alerting docs](http://docs.librenms.org/Extensions/Alerting/#syntax) for explanations. + +### Connection + +If you only want to group based on one pattern then select And. If however you want to build a group based on multiple patterns then you can build a SQL like +query using And / Or. As an example, we want to base our group on the devices hostname AND it's type. Use the pattern as before, devices.hostname, select the condition which in this case would Like and then enter dc1.@.example.com then click And. Now enter devices.type in the pattern, select Equals and enter firewall. This would then match dc1.fw01.example.com but not dc1.sw01.example.com as that is a network type. + +You can now select this group from the Devices -> All Devices link in the navigation at the top. You can also use the group to map alert rules to by creating an alert mapping +Overview -> Alerts -> Rule Mapping. diff --git a/doc/Extensions/Email-Alerting.md b/doc/Extensions/Email-Alerting.md index 67b51a6ba..0cb61dc9d 100644 --- a/doc/Extensions/Email-Alerting.md +++ b/doc/Extensions/Email-Alerting.md @@ -2,11 +2,15 @@ #### Please see [The new alerting docs](http://docs.librenms.org/Extensions/Alerting/#transports-email) -Currently, the email alerts needs to be set up in the config. If you want to enable it, paste this in your config and change it: +> None of these configuration options will work on builds older than the 1st of August 2015. + + +~~Currently, the email alerts needs to be set up in the config. If you want to enable it, paste this in your config and change it:~~ + ```php // Mailer backend Settings -$config['email_backend'] = 'mail'; // Mail backend. Allowed: "mail" (PHP's built-in), "sendmail", "smtp". +~~$config['email_backend'] = 'mail'; // Mail backend. Allowed: "mail" (PHP's built-in), "sendmail", "smtp". $config['email_from'] = NULL; // Mail from. Default: "ProjectName" $config['email_user'] = $config['project_id']; $config['email_sendmail_path'] = '/usr/sbin/sendmail'; // The location of the sendmail program. @@ -23,5 +27,5 @@ $config['alerts']['email']['default'] = 'sendto@somewhere.com'; // Defau $config['alerts']['email']['default_only'] = FALSE; // Only use default recipient $config['alerts']['email']['enable'] = TRUE; // Enable email alerts $config['alerts']['bgp']['whitelist'] = NULL; // Populate as an array() with ASNs to alert on. -$config['alerts']['port']['ifdown'] = FALSE; // Generate alerts for ports that go down +$config['alerts']['port']['ifdown'] = FALSE; // Generate alerts for ports that go down~~ ``` From e7df1285477547307b1b1c96bfdb234c760063b8 Mon Sep 17 00:00:00 2001 From: laf Date: Thu, 27 Aug 2015 20:43:30 +0000 Subject: [PATCH 101/263] Added dnos to this, does not seem worth duplicating the code for another os --- includes/discovery/temperatures/ftos-s-series.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/discovery/temperatures/ftos-s-series.inc.php b/includes/discovery/temperatures/ftos-s-series.inc.php index f1628240f..fc18b4a6a 100644 --- a/includes/discovery/temperatures/ftos-s-series.inc.php +++ b/includes/discovery/temperatures/ftos-s-series.inc.php @@ -3,7 +3,7 @@ // Force10 S-Series // F10-S-SERIES-CHASSIS-MIB::chStackUnitTemp.1 = Gauge32: 47 // F10-S-SERIES-CHASSIS-MIB::chStackUnitModelID.1 = STRING: S25-01-GE-24V -if ($device['os'] == 'ftos' || $device['os_group'] == 'ftos') { +if ($device['os'] == 'ftos' || $device['os_group'] == 'ftos' || $device['os'] == 'dnos') { echo 'FTOS C-Series '; $oids = snmpwalk_cache_oid($device, 'chStackUnitTemp', array(), 'F10-S-SERIES-CHASSIS-MIB', $config['mib_dir'].':'.$config['mib_dir'].'/ftos'); From 2dc98ce2f7aafe59ea4290e905bfdc11830802c5 Mon Sep 17 00:00:00 2001 From: laf Date: Thu, 27 Aug 2015 21:01:31 +0000 Subject: [PATCH 102/263] Added check for zywall using OID --- includes/discovery/os/zywall.inc.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/discovery/os/zywall.inc.php b/includes/discovery/os/zywall.inc.php index 0b3b25056..0a6fc008e 100644 --- a/includes/discovery/os/zywall.inc.php +++ b/includes/discovery/os/zywall.inc.php @@ -4,4 +4,7 @@ if (!$os) { if (strstr($sysDescr, 'ZyWALL')) { $os = 'zywall'; } + if (strstr($sysObjectId, '.1.3.6.1.4.1.890.1.15')) { + $os = 'zywall'; + } } From 5fe78afec6190465a7870af15fa33c658d9f432a Mon Sep 17 00:00:00 2001 From: vitalisator Date: Fri, 28 Aug 2015 08:54:35 +0200 Subject: [PATCH 103/263] add arrows to edges --- includes/defaults.inc.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index 66ca1fcea..ca9da0bc2 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -339,6 +339,9 @@ $config['network_map_vis_options'] = '{ randomSeed:2 }, "edges": { + arrows: { + to: {enabled: true, scaleFactor:0.5}, + }, "smooth": { enabled: false }, From a1f9fe19faf38b395cdb9116fd299bd70a715993 Mon Sep 17 00:00:00 2001 From: f0o Date: Fri, 28 Aug 2015 09:24:08 +0100 Subject: [PATCH 104/263] Added option to display errored ports in device summary --- doc/Support/Configuration.md | 1 + html/includes/common/device-summary-horiz.inc.php | 4 ++++ html/includes/common/device-summary-vert.inc.php | 15 +++++++++++++++ includes/defaults.inc.php | 3 +++ 4 files changed, 23 insertions(+) diff --git a/doc/Support/Configuration.md b/doc/Support/Configuration.md index dfc2fd143..e804239e6 100644 --- a/doc/Support/Configuration.md +++ b/doc/Support/Configuration.md @@ -143,6 +143,7 @@ $config['show_locations'] = 1; # Enable Locations on menu $config['show_locations_dropdown'] = 1; # Enable Locations dropdown on menu $config['show_services'] = 0; # Enable Services on menu $config['int_customers'] = 1; # Enable Customer Port Parsing +$config['summary_errors'] = 0; # Show Errored ports in summary boxes on the dashboard $config['customers_descr'] = 'cust'; // The description to look for in ifDescr. Can be an array as well array('cust','cid'); $config['transit_descr'] = ""; // Add custom transit descriptions (can be an array) $config['peering_descr'] = ""; // Add custom peering descriptions (can be an array) diff --git a/html/includes/common/device-summary-horiz.inc.php b/html/includes/common/device-summary-horiz.inc.php index 439234af4..f8b6b56bd 100644 --- a/html/includes/common/device-summary-horiz.inc.php +++ b/html/includes/common/device-summary-horiz.inc.php @@ -12,6 +12,7 @@ $temp_output = ' Down Ignored Disabled + '.($config['summary_errors'] ? 'Errored' : '').' @@ -22,6 +23,7 @@ $temp_output = ' '.$devices['down'].' '.$devices['ignored'].' '.$devices['disabled'].' + '.($config['summary_errors'] ? '-' : '').' Ports @@ -30,6 +32,7 @@ $temp_output = ' '.$ports['down'].' '.$ports['ignored'].' '.$ports['shutdown'].' + '.($config['summary_errors'] ? ' '.$ports['errored'].'' : '').' '; if ($config['show_services']) { @@ -41,6 +44,7 @@ $temp_output .= ' '.$services['down'].' '.$services['ignored'].' '.$services['disabled'].' + '.($config['summary_errors'] ? '-' : '').' '; } $temp_output .= ' diff --git a/html/includes/common/device-summary-vert.inc.php b/html/includes/common/device-summary-vert.inc.php index e5d5706fe..067677504 100644 --- a/html/includes/common/device-summary-vert.inc.php +++ b/html/includes/common/device-summary-vert.inc.php @@ -83,6 +83,21 @@ if ($config['show_services']) { } +if ($config['summary_errors']) { + $temp_output .= ' + + + Errored + - + '.$ports['errored'].' +'; + if ($config['show_services']) { + $temp_output .= ' + - +'; + } +} + $temp_output .= ' diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index 66ca1fcea..27d715d93 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -783,3 +783,6 @@ $config['gui']['network-map']['style'] = 'new';//old is also va // Navbar variables $config['navbar']['manage_groups']['hide'] = 0; + +// Show errored ports in the summary table on the dashboard +$config['summary_errors'] = 0; From 08368f92f2fdb22256de0d418c9ca59e154babca Mon Sep 17 00:00:00 2001 From: laf Date: Fri, 28 Aug 2015 08:55:46 +0000 Subject: [PATCH 105/263] Moved strikeout to outside code block --- doc/Extensions/Email-Alerting.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/Extensions/Email-Alerting.md b/doc/Extensions/Email-Alerting.md index 0cb61dc9d..fc20362e9 100644 --- a/doc/Extensions/Email-Alerting.md +++ b/doc/Extensions/Email-Alerting.md @@ -8,9 +8,9 @@ ~~Currently, the email alerts needs to be set up in the config. If you want to enable it, paste this in your config and change it:~~ -```php +~~```php // Mailer backend Settings -~~$config['email_backend'] = 'mail'; // Mail backend. Allowed: "mail" (PHP's built-in), "sendmail", "smtp". +$config['email_backend'] = 'mail'; // Mail backend. Allowed: "mail" (PHP's built-in), "sendmail", "smtp". $config['email_from'] = NULL; // Mail from. Default: "ProjectName" $config['email_user'] = $config['project_id']; $config['email_sendmail_path'] = '/usr/sbin/sendmail'; // The location of the sendmail program. @@ -27,5 +27,5 @@ $config['alerts']['email']['default'] = 'sendto@somewhere.com'; // Defau $config['alerts']['email']['default_only'] = FALSE; // Only use default recipient $config['alerts']['email']['enable'] = TRUE; // Enable email alerts $config['alerts']['bgp']['whitelist'] = NULL; // Populate as an array() with ASNs to alert on. -$config['alerts']['port']['ifdown'] = FALSE; // Generate alerts for ports that go down~~ -``` +$config['alerts']['port']['ifdown'] = FALSE; // Generate alerts for ports that go down +```~~ From 813b518abf4ba217524a09b4b5558f1196bc0b96 Mon Sep 17 00:00:00 2001 From: laf Date: Fri, 28 Aug 2015 08:58:06 +0000 Subject: [PATCH 106/263] Renamed file --- .../{ftos-s-series.inc.php => dnos-ftos-s-series.inc.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename includes/discovery/temperatures/{ftos-s-series.inc.php => dnos-ftos-s-series.inc.php} (100%) diff --git a/includes/discovery/temperatures/ftos-s-series.inc.php b/includes/discovery/temperatures/dnos-ftos-s-series.inc.php similarity index 100% rename from includes/discovery/temperatures/ftos-s-series.inc.php rename to includes/discovery/temperatures/dnos-ftos-s-series.inc.php From 950b58ba657f71149720e1051d7ca97efc1259f5 Mon Sep 17 00:00:00 2001 From: laf Date: Fri, 28 Aug 2015 09:02:36 +0000 Subject: [PATCH 107/263] Removed strikethrough --- doc/Extensions/Email-Alerting.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/Extensions/Email-Alerting.md b/doc/Extensions/Email-Alerting.md index fc20362e9..55a2f0a5f 100644 --- a/doc/Extensions/Email-Alerting.md +++ b/doc/Extensions/Email-Alerting.md @@ -7,8 +7,7 @@ ~~Currently, the email alerts needs to be set up in the config. If you want to enable it, paste this in your config and change it:~~ - -~~```php +```php // Mailer backend Settings $config['email_backend'] = 'mail'; // Mail backend. Allowed: "mail" (PHP's built-in), "sendmail", "smtp". $config['email_from'] = NULL; // Mail from. Default: "ProjectName" @@ -28,4 +27,4 @@ $config['alerts']['email']['default_only'] = FALSE; // Only use default recipi $config['alerts']['email']['enable'] = TRUE; // Enable email alerts $config['alerts']['bgp']['whitelist'] = NULL; // Populate as an array() with ASNs to alert on. $config['alerts']['port']['ifdown'] = FALSE; // Generate alerts for ports that go down -```~~ +``` From 1384505d1c51d9abaca3736aa0f5fd0adc592608 Mon Sep 17 00:00:00 2001 From: Richard Lawley Date: Fri, 28 Aug 2015 14:38:57 +0100 Subject: [PATCH 108/263] Fix broken repeated RRA config Since d8693f0 the RRA config section repeats in the file - the second contains MAX instead of the first MIN definition. --- includes/defaults.inc.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index 9776c5991..db087244b 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -191,14 +191,7 @@ $config['snmp']['v3'][0]['cryptopass'] = ''; // Privacy (Encryption) Passphrase $config['snmp']['v3'][0]['cryptoalgo'] = 'AES'; // AES | DES -// RRD Format Settings -// These should not normally be changed -// Though one could conceivably increase or decrease the size of each RRA if one had performance problems -// Or if one had a very fast I/O subsystem with no performance worries. -$config['rrd_rra'] = ' RRA:AVERAGE:0.5:1:2016 RRA:AVERAGE:0.5:6:1440 RRA:AVERAGE:0.5:24:1440 RRA:AVERAGE:0.5:288:1440 '; -$config['rrd_rra'] .= ' RRA:MAX:0.5:1:720 RRA:MIN:0.5:6:1440 RRA:MIN:0.5:24:775 RRA:MIN:0.5:288:797 '; -$config['rrd_rra'] .= ' RRA:MAX:0.5:1:720 RRA:MAX:0.5:6:1440 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797 '; -$config['rrd_rra'] .= ' RRA:LAST:0.5:1:1440 '; + // Autodiscovery Settings $config['autodiscovery']['xdp'] = true; From 408b8dd8551120468e3924d5db5fc7ee4775dc1d Mon Sep 17 00:00:00 2001 From: Louis Rossouw Date: Sat, 29 Aug 2015 02:41:47 +0200 Subject: [PATCH 109/263] Fix to avoid triggering this bug: http://sourceforge.net/p/mysql-python/bugs/325/ We remove miliseconds from datetime. --- poller-service.py | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/poller-service.py b/poller-service.py index d8b48f455..099bf7213 100755 --- a/poller-service.py +++ b/poller-service.py @@ -195,18 +195,24 @@ poller_group = ('and poller_group IN({0}) ' # Add last_polled and last_polled_timetaken so we can sort by the time the last poll started, with the goal # of having each device complete a poll within the given time range. dev_query = ('SELECT device_id, status, ' - 'DATE_ADD( ' - ' DATE_SUB( ' - ' last_polled, ' - ' INTERVAL last_polled_timetaken SECOND ' - ' ), ' - ' INTERVAL {0} SECOND) AS next_poll, ' - 'DATE_ADD( ' - ' DATE_SUB( ' - ' last_discovered, ' - ' INTERVAL last_discovered_timetaken SECOND ' - ' ), ' - ' INTERVAL {1} SECOND) AS next_discovery ' + 'CAST( ' + ' DATE_ADD( ' + ' DATE_SUB( ' + ' last_polled, ' + ' INTERVAL last_polled_timetaken SECOND ' + ' ), ' + ' INTERVAL {0} SECOND) ' + ' AS DATETIME(0) ' + ') AS next_poll, ' + 'CAST( ' + ' DATE_ADD( ' + ' DATE_SUB( ' + ' last_discovered, ' + ' INTERVAL last_discovered_timetaken SECOND ' + ' ), ' + ' INTERVAL {1} SECOND) ' + ' AS DATETIME(0) ' + ') as next_discovery ' 'FROM devices WHERE ' 'disabled = 0 ' 'AND IS_FREE_LOCK(CONCAT("polling.", device_id)) ' From 35c7c6ab1bea037156038eebc77f5ab5b41e62e8 Mon Sep 17 00:00:00 2001 From: Arjit Chaudhary Date: Sat, 29 Aug 2015 18:46:14 +0530 Subject: [PATCH 110/263] Display a message if no Group is found Screenshot: http://i.imgur.com/ac9okNO.png --- html/pages/device-groups.inc.php | 36 +++++++++++++++++++------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/html/pages/device-groups.inc.php b/html/pages/device-groups.inc.php index 891b42c20..e5e6c9918 100644 --- a/html/pages/device-groups.inc.php +++ b/html/pages/device-groups.inc.php @@ -3,23 +3,31 @@ require_once 'includes/modal/new_device_group.inc.php'; require_once 'includes/modal/delete_device_group.inc.php'; $no_refresh = true; - +$group_count_check = array_filter(GetDeviceGroups()); +if(!empty($group_count_check)) { echo '
'; echo '
'; echo ''; echo ''; echo ''; -foreach (GetDeviceGroups() as $group) { - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; -} - + foreach (GetDeviceGroups() as $group) { + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } +} else { //if $group_count_check is empty, aka no group found, then display a message to the user. + echo "
Looks like no groups have been created, let's create one now. Click on Create New Group to create one.

"; + echo "
"; +} echo '
NameDescriptionPatternActions
'.$group['name'].''.$group['desc'].''.$group['pattern'].''; - echo " "; - echo ""; - echo '
'.$group['name'].''.$group['desc'].''.$group['pattern'].''; + echo " "; + echo ""; + echo '
'; -echo " "; + +if(!empty($group_count_check)) { //display create new node group when $group_count_check has a value so that the user can define more groups in the future. +echo "
"; +echo "
"; +} From 55e94573091f039a63854094e4ff749f73122adf Mon Sep 17 00:00:00 2001 From: Arjit Chaudhary Date: Sat, 29 Aug 2015 18:50:57 +0530 Subject: [PATCH 111/263] Minor UI changes Screenshot: http://i.imgur.com/PwmyNNG.png --- html/pages/addhost.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/html/pages/addhost.inc.php b/html/pages/addhost.inc.php index 27bca2a57..2844982d7 100644 --- a/html/pages/addhost.inc.php +++ b/html/pages/addhost.inc.php @@ -221,7 +221,8 @@ if ($config['distributed_poller'] === true) { }//end if ?> - +
+
From 7efbb076957995e7c50399e4b62cbc4eb2c239cd Mon Sep 17 00:00:00 2001 From: Arjit Chaudhary Date: Sat, 29 Aug 2015 19:00:50 +0530 Subject: [PATCH 112/263] Unify UI as in add device.. Screenshot: http://i.imgur.com/TgpwIXR.png --- html/pages/delhost.inc.php | 55 +++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/html/pages/delhost.inc.php b/html/pages/delhost.inc.php index 165ee99e4..79a2e3f05 100644 --- a/html/pages/delhost.inc.php +++ b/html/pages/delhost.inc.php @@ -1,5 +1,3 @@ -

Delete Host

-
+
@@ -46,37 +45,39 @@ else { else { ?> - -
-
- -

It will also remove historical data about this device such as Syslog, Eventlog and Alert log data.

");?> -
-
-
- -
- + ".$data['hostname'].""); + } -".$data['hostname'].""); -} - -?> - -
-
+ ?> + +
+ +
+
+
+
-
- - -
Date: Sat, 29 Aug 2015 21:27:11 +0530 Subject: [PATCH 113/263] Fixed indents and coding style. --- html/pages/device-groups.inc.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/html/pages/device-groups.inc.php b/html/pages/device-groups.inc.php index e5e6c9918..8cc08e020 100644 --- a/html/pages/device-groups.inc.php +++ b/html/pages/device-groups.inc.php @@ -21,13 +21,14 @@ echo ''; echo ''; echo ''; } -} else { //if $group_count_check is empty, aka no group found, then display a message to the user. +} +else { //if $group_count_check is empty, aka no group found, then display a message to the user. echo "
Looks like no groups have been created, let's create one now. Click on Create New Group to create one.

"; echo "
"; } echo '
'; if(!empty($group_count_check)) { //display create new node group when $group_count_check has a value so that the user can define more groups in the future. -echo "
"; -echo "
"; + echo "
"; + echo "
"; } From 419336a7a29d6f89b570c2d07a54f46c6ac9449c Mon Sep 17 00:00:00 2001 From: Arjit Chaudhary Date: Sat, 29 Aug 2015 21:36:19 +0530 Subject: [PATCH 114/263] Add page title for poll-log.inc.php --- html/pages/poll-log.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/html/pages/poll-log.inc.php b/html/pages/poll-log.inc.php index ac912a6f8..ddeca02c8 100644 --- a/html/pages/poll-log.inc.php +++ b/html/pages/poll-log.inc.php @@ -1,5 +1,6 @@ From 9488ef63a904a119aa41ea5051c06d46a5ad590c Mon Sep 17 00:00:00 2001 From: Arjit Chaudhary Date: Sat, 29 Aug 2015 21:44:29 +0530 Subject: [PATCH 115/263] UI changes to preferences.inc.php Screenshot: http://i.imgur.com/QaobUQv.png --- html/pages/preferences.inc.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/html/pages/preferences.inc.php b/html/pages/preferences.inc.php index 91a02e1ce..661a7a8f5 100644 --- a/html/pages/preferences.inc.php +++ b/html/pages/preferences.inc.php @@ -4,7 +4,8 @@ $no_refresh = true; $pagetitle[] = 'Preferences'; -echo '

User Preferences

'; +echo '

User Preferences

'; +echo '
'; if ($_SESSION['userlevel'] == 11) { demo_account(); @@ -30,10 +31,12 @@ else { include 'includes/update-preferences-password.inc.php'; - echo "
"; + if (passwordscanchange($_SESSION['username'])) { echo '

Change Password

'; + echo '
'; + echo "
"; echo $changepass_message; echo "
@@ -57,11 +60,13 @@ else {
+
+
- + "; echo '
'; }//end if @@ -183,9 +188,10 @@ else { }//end if }//end if -echo "
"; -echo "
Device Permissions
"; +echo "

Device Permissions

"; +echo "
"; +echo "
"; if ($_SESSION['userlevel'] == '10') { echo "Global Administrative Access"; } From c69596314aa832eb9c8d5f94687a6a3282f14737 Mon Sep 17 00:00:00 2001 From: Arjit Chaudhary Date: Sat, 29 Aug 2015 22:10:19 +0530 Subject: [PATCH 116/263] Added header to authlog page --- html/pages/authlog.inc.php | 236 ++++++++++++++++++++++++++++++++----- 1 file changed, 207 insertions(+), 29 deletions(-) diff --git a/html/pages/authlog.inc.php b/html/pages/authlog.inc.php index 3cffbbea9..661a7a8f5 100644 --- a/html/pages/authlog.inc.php +++ b/html/pages/authlog.inc.php @@ -1,37 +1,215 @@ = '10') { - echo '
'; +$no_refresh = true; - foreach (dbFetchRows("SELECT *,DATE_FORMAT(datetime, '".$config['dateformat']['mysql']['compact']."') as humandate FROM `authlog` ORDER BY `datetime` DESC LIMIT 0,250") as $entry) { - if ($bg == $list_colour_a) { - $bg = $list_colour_b; - } - else { - $bg = $list_colour_a; - } +$pagetitle[] = 'Preferences'; - echo " - - - - - - '; - }//end foreach +echo '

User Preferences

'; +echo '
'; - $pagetitle[] = 'Authlog'; - - echo '
- ".$entry['datetime'].' - - '.$entry['user'].' - - '.$entry['address'].' - - '.$entry['result'].' -
'; +if ($_SESSION['userlevel'] == 11) { + demo_account(); } else { - include 'includes/error-no-perm.inc.php'; + if ($_POST['action'] == 'changepass') { + if (authenticate($_SESSION['username'], $_POST['old_pass'])) { + if ($_POST['new_pass'] == '' || $_POST['new_pass2'] == '') { + $changepass_message = 'Password must not be blank.'; + } + else if ($_POST['new_pass'] == $_POST['new_pass2']) { + changepassword($_SESSION['username'], $_POST['new_pass']); + $changepass_message = 'Password Changed.'; + } + else { + $changepass_message = "Passwords don't match."; + } + } + else { + $changepass_message = 'Incorrect password'; + } + } + + include 'includes/update-preferences-password.inc.php'; + + + + if (passwordscanchange($_SESSION['username'])) { + echo '

Change Password

'; + echo '
'; + echo "
"; + echo $changepass_message; + echo "
+ +
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+ +
"; + echo '
'; + }//end if + + if ($config['twofactor'] === true) { + if ($_POST['twofactorremove'] == 1) { + include_once $config['install_dir'].'/html/includes/authentication/twofactor.lib.php'; + if (!isset($_POST['twofactor'])) { + echo '
'; + echo ''; + echo twofactor_form(false); + echo '
'; + } + else { + $twofactor = dbFetchRow('SELECT twofactor FROM users WHERE username = ?', array($_SESSION['username'])); + if (empty($twofactor['twofactor'])) { + echo '
Error: How did you even get here?!
'; + } + else { + $twofactor = json_decode($twofactor['twofactor'], true); + } + + if (verify_hotp($twofactor['key'], $_POST['twofactor'], $twofactor['counter'])) { + if (!dbUpdate(array('twofactor' => ''), 'users', 'username = ?', array($_SESSION['username']))) { + echo '
Error while disabling TwoFactor.
'; + } + else { + echo '
TwoFactor Disabled.
'; + } + } + else { + session_destroy(); + echo '
Error: Supplied TwoFactor Token is wrong, you\'ve been logged out.
'; + } + }//end if + } + else { + $twofactor = dbFetchRow('SELECT twofactor FROM users WHERE username = ?', array($_SESSION['username'])); + echo ''; + echo '

Two-Factor Authentication

'; + if (!empty($twofactor['twofactor'])) { + $twofactor = json_decode($twofactor['twofactor'], true); + $twofactor['text'] = "
+ +
+ +
+
"; + if ($twofactor['counter'] !== false) { + $twofactor['uri'] = 'otpauth://hotp/'.$_SESSION['username'].'?issuer=LibreNMS&counter='.$twofactor['counter'].'&secret='.$twofactor['key']; + $twofactor['text'] .= "
+ +
+ +
+
"; + } + else { + $twofactor['uri'] = 'otpauth://totp/'.$_SESSION['username'].'?issuer=LibreNMS&secret='.$twofactor['key']; + } + + echo '
+
+ +
'; + echo '
+
'.$twofactor['text'].'
+ +
'; + echo ''; + echo '
+ + +
'; + } + else { + if (isset($_POST['gentwofactorkey']) && isset($_POST['twofactortype'])) { + include_once $config['install_dir'].'/html/includes/authentication/twofactor.lib.php'; + $chk = dbFetchRow('SELECT twofactor FROM users WHERE username = ?', array($_SESSION['username'])); + if (empty($chk['twofactor'])) { + $twofactor = array('key' => twofactor_genkey()); + if ($_POST['twofactortype'] == 'counter') { + $twofactor['counter'] = 1; + } + else { + $twofactor['counter'] = false; + } + + if (!dbUpdate(array('twofactor' => json_encode($twofactor)), 'users', 'username = ?', array($_SESSION['username']))) { + echo '
Error inserting TwoFactor details. Please try again later and contact Administrator if error persists.
'; + } + else { + echo '
Added TwoFactor credentials. Please reload page.
'; + } + } + else { + echo '
TwoFactor credentials already exists.
'; + } + } + else { + echo '
+ +
+ +
+ +
+
+ +
'; + }//end if + }//end if + echo '
'; + }//end if + }//end if }//end if + + +echo "

Device Permissions

"; +echo "
"; +echo "
"; +if ($_SESSION['userlevel'] == '10') { + echo "Global Administrative Access"; +} + +if ($_SESSION['userlevel'] == '5') { + echo "Global Viewing Access"; +} + +if ($_SESSION['userlevel'] == '1') { + foreach (dbFetchRows('SELECT * FROM `devices_perms` AS P, `devices` AS D WHERE `user_id` = ? AND P.device_id = D.device_id', array($_SESSION['user_id'])) as $perm) { + // FIXME generatedevicelink? + echo "".$perm['hostname'].'
'; + $dev_access = 1; + } + + if (!$dev_access) { + echo 'No access!'; + } +} + +echo '
'; From 1f8c48ac66568a4f5b90d2997a84acd756b8facc Mon Sep 17 00:00:00 2001 From: Arjit Chaudhary Date: Sat, 29 Aug 2015 22:35:13 +0530 Subject: [PATCH 117/263] Fixed :) --- html/pages/authlog.inc.php | 237 +++++-------------------------------- 1 file changed, 30 insertions(+), 207 deletions(-) diff --git a/html/pages/authlog.inc.php b/html/pages/authlog.inc.php index 661a7a8f5..a882e83fd 100644 --- a/html/pages/authlog.inc.php +++ b/html/pages/authlog.inc.php @@ -1,215 +1,38 @@ Authlog"; +echo "
"; +if ($_SESSION['userlevel'] >= '10') { + echo ''; -$no_refresh = true; + foreach (dbFetchRows("SELECT *,DATE_FORMAT(datetime, '".$config['dateformat']['mysql']['compact']."') as humandate FROM `authlog` ORDER BY `datetime` DESC LIMIT 0,250") as $entry) { + if ($bg == $list_colour_a) { + $bg = $list_colour_b; + } + else { + $bg = $list_colour_a; + } -$pagetitle[] = 'Preferences'; + echo " + + + + + + '; + }//end foreach -echo '

User Preferences

'; -echo '
'; + $pagetitle[] = 'Authlog'; -if ($_SESSION['userlevel'] == 11) { - demo_account(); + echo '
+ ".$entry['datetime'].' + + '.$entry['user'].' + + '.$entry['address'].' + + '.$entry['result'].' +
'; } else { - if ($_POST['action'] == 'changepass') { - if (authenticate($_SESSION['username'], $_POST['old_pass'])) { - if ($_POST['new_pass'] == '' || $_POST['new_pass2'] == '') { - $changepass_message = 'Password must not be blank.'; - } - else if ($_POST['new_pass'] == $_POST['new_pass2']) { - changepassword($_SESSION['username'], $_POST['new_pass']); - $changepass_message = 'Password Changed.'; - } - else { - $changepass_message = "Passwords don't match."; - } - } - else { - $changepass_message = 'Incorrect password'; - } - } - - include 'includes/update-preferences-password.inc.php'; - - - - if (passwordscanchange($_SESSION['username'])) { - echo '

Change Password

'; - echo '
'; - echo "
"; - echo $changepass_message; - echo "
- -
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
-
- -
"; - echo '
'; - }//end if - - if ($config['twofactor'] === true) { - if ($_POST['twofactorremove'] == 1) { - include_once $config['install_dir'].'/html/includes/authentication/twofactor.lib.php'; - if (!isset($_POST['twofactor'])) { - echo '
'; - echo ''; - echo twofactor_form(false); - echo '
'; - } - else { - $twofactor = dbFetchRow('SELECT twofactor FROM users WHERE username = ?', array($_SESSION['username'])); - if (empty($twofactor['twofactor'])) { - echo '
Error: How did you even get here?!
'; - } - else { - $twofactor = json_decode($twofactor['twofactor'], true); - } - - if (verify_hotp($twofactor['key'], $_POST['twofactor'], $twofactor['counter'])) { - if (!dbUpdate(array('twofactor' => ''), 'users', 'username = ?', array($_SESSION['username']))) { - echo '
Error while disabling TwoFactor.
'; - } - else { - echo '
TwoFactor Disabled.
'; - } - } - else { - session_destroy(); - echo '
Error: Supplied TwoFactor Token is wrong, you\'ve been logged out.
'; - } - }//end if - } - else { - $twofactor = dbFetchRow('SELECT twofactor FROM users WHERE username = ?', array($_SESSION['username'])); - echo ''; - echo '

Two-Factor Authentication

'; - if (!empty($twofactor['twofactor'])) { - $twofactor = json_decode($twofactor['twofactor'], true); - $twofactor['text'] = "
- -
- -
-
"; - if ($twofactor['counter'] !== false) { - $twofactor['uri'] = 'otpauth://hotp/'.$_SESSION['username'].'?issuer=LibreNMS&counter='.$twofactor['counter'].'&secret='.$twofactor['key']; - $twofactor['text'] .= "
- -
- -
-
"; - } - else { - $twofactor['uri'] = 'otpauth://totp/'.$_SESSION['username'].'?issuer=LibreNMS&secret='.$twofactor['key']; - } - - echo '
-
- -
'; - echo '
-
'.$twofactor['text'].'
- -
'; - echo ''; - echo '
- - -
'; - } - else { - if (isset($_POST['gentwofactorkey']) && isset($_POST['twofactortype'])) { - include_once $config['install_dir'].'/html/includes/authentication/twofactor.lib.php'; - $chk = dbFetchRow('SELECT twofactor FROM users WHERE username = ?', array($_SESSION['username'])); - if (empty($chk['twofactor'])) { - $twofactor = array('key' => twofactor_genkey()); - if ($_POST['twofactortype'] == 'counter') { - $twofactor['counter'] = 1; - } - else { - $twofactor['counter'] = false; - } - - if (!dbUpdate(array('twofactor' => json_encode($twofactor)), 'users', 'username = ?', array($_SESSION['username']))) { - echo '
Error inserting TwoFactor details. Please try again later and contact Administrator if error persists.
'; - } - else { - echo '
Added TwoFactor credentials. Please reload page.
'; - } - } - else { - echo '
TwoFactor credentials already exists.
'; - } - } - else { - echo '
- -
- -
- -
-
- -
'; - }//end if - }//end if - echo '
'; - }//end if - }//end if + include 'includes/error-no-perm.inc.php'; }//end if - - -echo "

Device Permissions

"; -echo "
"; -echo "
"; -if ($_SESSION['userlevel'] == '10') { - echo "Global Administrative Access"; -} - -if ($_SESSION['userlevel'] == '5') { - echo "Global Viewing Access"; -} - -if ($_SESSION['userlevel'] == '1') { - foreach (dbFetchRows('SELECT * FROM `devices_perms` AS P, `devices` AS D WHERE `user_id` = ? AND P.device_id = D.device_id', array($_SESSION['user_id'])) as $perm) { - // FIXME generatedevicelink? - echo "".$perm['hostname'].'
'; - $dev_access = 1; - } - - if (!$dev_access) { - echo 'No access!'; - } -} - -echo '
'; From eb70f3e089455eda8c78b6ba7fade90b0af78f21 Mon Sep 17 00:00:00 2001 From: Arjit Chaudhary Date: Sat, 29 Aug 2015 22:37:27 +0530 Subject: [PATCH 118/263] Added page title --- html/pages/about.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/html/pages/about.inc.php b/html/pages/about.inc.php index 53eee1e3e..8d131d5b5 100644 --- a/html/pages/about.inc.php +++ b/html/pages/about.inc.php @@ -1,4 +1,5 @@ '; if(!empty($group_count_check)) { //display create new node group when $group_count_check has a value so that the user can define more groups in the future. echo "
"; From cba5e03817821f55e21def2db4902b1fdcd2d016 Mon Sep 17 00:00:00 2001 From: Arjit Chaudhary Date: Sat, 29 Aug 2015 22:44:44 +0530 Subject: [PATCH 120/263] Added title and page header --- html/pages/availability-map.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/html/pages/availability-map.inc.php b/html/pages/availability-map.inc.php index d41153b65..b5ede4e14 100644 --- a/html/pages/availability-map.inc.php +++ b/html/pages/availability-map.inc.php @@ -1,4 +1,6 @@ +

Availability Map

+
Date: Sat, 29 Aug 2015 22:52:09 +0530 Subject: [PATCH 121/263] UI changes Screenshot http://i.imgur.com/tObHk8F.png --- html/pages/adduser.inc.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/html/pages/adduser.inc.php b/html/pages/adduser.inc.php index 1ba262150..7f5c21c09 100644 --- a/html/pages/adduser.inc.php +++ b/html/pages/adduser.inc.php @@ -10,6 +10,7 @@ else if ($_SESSION['userlevel'] == 11) { } else { echo '

Add User

'; + echo '
'; $pagetitle[] = 'Add user'; @@ -37,7 +38,6 @@ else { echo '
Please enter a username!
'; }//end if }//end if - echo "
"; echo "
@@ -89,22 +89,25 @@ else { +
+ +
+
+
"; echo "
-
- -
+
"; - echo ""; + echo '
'; } else { From e9ca3d4d702b867a3afab95844f9e3c18fcd903d Mon Sep 17 00:00:00 2001 From: Rosiak Date: Sun, 30 Aug 2015 16:16:18 +0100 Subject: [PATCH 122/263] Docs Correction --- doc/Installation/Installation-(RHEL-CentOS).md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/Installation/Installation-(RHEL-CentOS).md b/doc/Installation/Installation-(RHEL-CentOS).md index 124fbe9f8..101a0d766 100644 --- a/doc/Installation/Installation-(RHEL-CentOS).md +++ b/doc/Installation/Installation-(RHEL-CentOS).md @@ -27,14 +27,13 @@ service mariadb start Now continue with the installation: ```bash -yum install net-snmp mysql-server service snmpd start chkconfig snmpd on mysql_secure_installation mysql -uroot -p ``` -Enter the MySQL root password to enter the MySQL command-line interface. +Enter the MySQL/MariaDB root password to enter the command-line interface. Create database. From ac7d0c9420680c864a434b404d117092dbae963c Mon Sep 17 00:00:00 2001 From: f0o Date: Sun, 30 Aug 2015 16:53:34 +0100 Subject: [PATCH 123/263] Added user defined titles for alert templates --- alerts.php | 36 ++++++++++++--------- html/includes/forms/alert-templates.inc.php | 4 +-- html/includes/modal/alert_template.inc.php | 2 ++ sql-schema/066.sql | 2 ++ 4 files changed, 26 insertions(+), 18 deletions(-) create mode 100644 sql-schema/066.sql diff --git a/alerts.php b/alerts.php index 8cbeae55d..b23f96fa0 100755 --- a/alerts.php +++ b/alerts.php @@ -96,24 +96,14 @@ function IssueAlert($alert) { return true; } - $default_tpl = "%title\r\nSeverity: %severity\r\n{if %state == 0}Time elapsed: %elapsed\r\n{/if}Timestamp: %timestamp\r\nUnique-ID: %uid\r\nRule: {if %name}%name{else}%rule{/if}\r\n{if %faults}Faults:\r\n{foreach %faults} #%key: %value.string\r\n{/foreach}{/if}Alert sent to: {foreach %contacts}%value <%key> {/foreach}"; - // FIXME: Put somewhere else? if ($config['alert']['fixed-contacts'] == false) { $alert['details']['contacts'] = GetContacts($alert['details']['rule']); } $obj = DescribeAlert($alert); if (is_array($obj)) { - $tpl = dbFetchRow('SELECT `template` FROM `alert_templates` JOIN `alert_template_map` ON `alert_template_map`.`alert_templates_id`=`alert_templates`.`id` WHERE `alert_template_map`.`alert_rule_id`=?', array($alert['rule_id'])); - if (isset($tpl['template'])) { - $tpl = $tpl['template']; - } - else { - $tpl = $default_tpl; - } - echo 'Issuing Alert-UID #'.$alert['id'].'/'.$alert['state'].': '; - $msg = FormatAlertTpl($tpl, $obj); + $msg = FormatAlertTpl($obj); $obj['msg'] = $msg; if (!empty($config['alert']['transports'])) { ExtTransports($obj); @@ -349,12 +339,11 @@ function ExtTransports($obj) { /** * Format Alert - * @param string $tpl Template * @param array $obj Alert-Array * @return string */ -function FormatAlertTpl($tpl, $obj) { - $msg = '$ret .= "'.str_replace(array('{else}', '{/if}', '{/foreach}'), array('"; } else { $ret .= "', '"; } $ret .= "', '"; } $ret .= "'), addslashes($tpl)).'";'; +function FormatAlertTpl($obj) { + $msg = '$ret .= "'.str_replace(array('{else}', '{/if}', '{/foreach}'), array('"; } else { $ret .= "', '"; } $ret .= "', '"; } $ret .= "'), addslashes($obj["template"])).'";'; $parsed = $msg; $s = strlen($msg); $x = $pos = -1; @@ -426,11 +415,21 @@ function DescribeAlert($alert) { $obj = array(); $i = 0; $device = dbFetchRow('SELECT hostname FROM devices WHERE device_id = ?', array($alert['device_id'])); + $tpl = dbFetchRow('SELECT `template`,`title`,`title_rec` FROM `alert_templates` JOIN `alert_template_map` ON `alert_template_map`.`alert_templates_id`=`alert_templates`.`id` WHERE `alert_template_map`.`alert_rule_id`=?', array($alert['rule_id'])); + $default_tpl = "%title\r\nSeverity: %severity\r\n{if %state == 0}Time elapsed: %elapsed\r\n{/if}Timestamp: %timestamp\r\nUnique-ID: %uid\r\nRule: {if %name}%name{else}%rule{/if}\r\n{if %faults}Faults:\r\n{foreach %faults} #%key: %value.string\r\n{/foreach}{/if}Alert sent to: {foreach %contacts}%value <%key> {/foreach}"; $obj['hostname'] = $device['hostname']; $obj['device_id'] = $alert['device_id']; $extra = $alert['details']; + if (!isset($tpl['template'])) { + $tpl['template'] = $default_tpl; + } if ($alert['state'] >= 1) { - $obj['title'] = 'Alert for device '.$device['hostname'].' - '.($alert['name'] ? $alert['name'] : $alert['rule']); + if (!empty($tpl['title'])) { + $obj['title'] = $tpl['title']; + } + else { + $obj['title'] = 'Alert for device '.$device['hostname'].' - '.($alert['name'] ? $alert['name'] : $alert['rule']); + } if ($alert['state'] == 2) { $obj['title'] .= ' got acknowledged'; } @@ -458,7 +457,12 @@ function DescribeAlert($alert) { } $extra = json_decode(gzuncompress($id['details']), true); - $obj['title'] = 'Device '.$device['hostname'].' recovered from '.($alert['name'] ? $alert['name'] : $alert['rule']); + if (!empty($tpl['title_rec'])) { + $obj['title'] = $tpl['title_rec']; + } + else { + $obj['title'] = 'Device '.$device['hostname'].' recovered from '.($alert['name'] ? $alert['name'] : $alert['rule']); + } $obj['elapsed'] = TimeFormat(strtotime($alert['time_logged']) - strtotime($id['time_logged'])); $obj['id'] = $id['id']; $obj['faults'] = false; diff --git a/html/includes/forms/alert-templates.inc.php b/html/includes/forms/alert-templates.inc.php index 67182b1f2..74fda1b8c 100644 --- a/html/includes/forms/alert-templates.inc.php +++ b/html/includes/forms/alert-templates.inc.php @@ -52,7 +52,7 @@ if(!empty($name)) { elseif( $_REQUEST['template'] && is_numeric($_REQUEST['template_id']) ) { //Update template-text - if($ret = dbUpdate(array('template' => $_REQUEST['template'], 'name' => $name), "alert_templates", "id = ?", array($_REQUEST['template_id']))) { + if($ret = dbUpdate(array('template' => $_REQUEST['template'], 'name' => $name, 'title' => $_REQUEST['title'], 'title_rec' => $_REQUEST['title_rec']), "alert_templates", "id = ?", array($_REQUEST['template_id']))) { $ok = "Updated template"; } else { @@ -62,7 +62,7 @@ if(!empty($name)) { elseif( $_REQUEST['template'] ) { //Create new template - if(dbInsert(array('template' => $_REQUEST['template'], 'name' => $name), "alert_templates")) { + if(dbInsert(array('template' => $_REQUEST['template'], 'name' => $name, 'title' => $_REQUEST['title'], 'title_rec' => $_REQUEST['title_rec']), "alert_templates")) { $ok = "Alert template has been created."; } else { diff --git a/html/includes/modal/alert_template.inc.php b/html/includes/modal/alert_template.inc.php index 71574ba6f..dceab82cf 100644 --- a/html/includes/modal/alert_template.inc.php +++ b/html/includes/modal/alert_template.inc.php @@ -51,6 +51,8 @@ if(is_admin() === false) {

Give your template a name:

+ Optionally, add custom titles:
+

diff --git a/sql-schema/066.sql b/sql-schema/066.sql new file mode 100644 index 000000000..37b4dc6ed --- /dev/null +++ b/sql-schema/066.sql @@ -0,0 +1,2 @@ +ALTER TABLE `alert_templates` ADD `title` VARCHAR(255) NULL DEFAULT NULL; +ALTER TABLE `alert_templates` ADD `title_rec` VARCHAR(255) NULL DEFAULT NULL; From 9057d48273778159d45cb7fabc5054361886204e Mon Sep 17 00:00:00 2001 From: f0o Date: Sun, 30 Aug 2015 17:07:02 +0100 Subject: [PATCH 124/263] Fix default template assignment --- alerts.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/alerts.php b/alerts.php index b23f96fa0..eb63a8ad5 100755 --- a/alerts.php +++ b/alerts.php @@ -343,7 +343,8 @@ function ExtTransports($obj) { * @return string */ function FormatAlertTpl($obj) { - $msg = '$ret .= "'.str_replace(array('{else}', '{/if}', '{/foreach}'), array('"; } else { $ret .= "', '"; } $ret .= "', '"; } $ret .= "'), addslashes($obj["template"])).'";'; + $tpl = $obj["template"]; + $msg = '$ret .= "'.str_replace(array('{else}', '{/if}', '{/foreach}'), array('"; } else { $ret .= "', '"; } $ret .= "', '"; } $ret .= "'), addslashes($tpl)).'";'; $parsed = $msg; $s = strlen($msg); $x = $pos = -1; @@ -421,7 +422,9 @@ function DescribeAlert($alert) { $obj['device_id'] = $alert['device_id']; $extra = $alert['details']; if (!isset($tpl['template'])) { - $tpl['template'] = $default_tpl; + $obj['template'] = $default_tpl; + } else { + $obj['template'] = $tpl['template']; } if ($alert['state'] >= 1) { if (!empty($tpl['title'])) { From 65e38c69b18087d03231a2897d416791889ef37e Mon Sep 17 00:00:00 2001 From: Rosiak Date: Sun, 30 Aug 2015 17:14:30 +0100 Subject: [PATCH 125/263] Add Varnish Docs - Fix #1808 --- doc/Extensions/Varnish.md | 53 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 doc/Extensions/Varnish.md diff --git a/doc/Extensions/Varnish.md b/doc/Extensions/Varnish.md new file mode 100644 index 000000000..001332007 --- /dev/null +++ b/doc/Extensions/Varnish.md @@ -0,0 +1,53 @@ +# Setting up Varnish + +This document will explain how to setup Varnish for LibreNMS. + +### Varnish installation +This example is based on a fresh LibreNMS install, on a minimimal CentOS installation. +In this example, we'll use the default package available through yum. + +- Install Varnish + +```ssh +yum install varnish +chkconfig varnish on +``` +- Confirm that Varnish has been installed + +```ssh +varnishd -V +varnishd (varnish-2.1.5 SVN ) +``` +- Change the webservers port to 8080, since we'll put Varnish in front(Or whatever you prefer) + +- Point Varnish towards the webserver by editing the default.vcl + +```ssh +vi /etc/varnish/default.vcl + +backend default { + .host = "127.0.0.1"; + .port = "8080"; +} + +``` +- Change the default port Varnish listens on + +```ssh +vi /etc/sysconfig/varnish + +VARNISH_LISTEN_PORT=80 +``` + +- Restart webserver(Apache in this case) and start Varnish afterwards + +```ssh +service httpd restart +service varnish start +``` + +- Browse around the webui to build up the cache, verify that the cache is working afterwards + +```ssh +varnishstat +``` From 68f9812b9d18c63a236f58a50b9d436daa85deb5 Mon Sep 17 00:00:00 2001 From: f0o Date: Sun, 30 Aug 2015 17:27:31 +0100 Subject: [PATCH 126/263] Added JavaScript to modal --- html/includes/modal/alert_template.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/html/includes/modal/alert_template.inc.php b/html/includes/modal/alert_template.inc.php index dceab82cf..bef4957a2 100644 --- a/html/includes/modal/alert_template.inc.php +++ b/html/includes/modal/alert_template.inc.php @@ -125,10 +125,12 @@ $('#create-template').click('', function(e) { var template = $("#template").val(); var template_id = $("#template_id").val(); var name = $("#name").val(); + var title = $("#title").val(); + var title_rec = $("#title_rec").val(); $.ajax({ type: "POST", url: "ajax_form.php", - data: { type: "alert-templates", template: template , name: name, template_id: template_id}, + data: { type: "alert-templates", template: template , name: name, template_id: template_id, title: title, title_rec: title_rec}, dataType: "html", success: function(msg){ if(msg.indexOf("ERROR:") <= -1) { From 937d598564e7a577e328b5b4ed6ab0d9c288329d Mon Sep 17 00:00:00 2001 From: Paul Gear Date: Sun, 30 Aug 2015 17:48:45 +0100 Subject: [PATCH 127/263] Move packages into overview menu --- html/includes/print-menubar.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php index 06b4ffb04..927cba8fe 100644 --- a/html/includes/print-menubar.php +++ b/html/includes/print-menubar.php @@ -65,6 +65,14 @@ if ($_SESSION['userlevel'] >= '10') {
  • Templates
  • +
  • + Packages +
  • + @@ -427,14 +435,6 @@ if ($_SESSION['userlevel'] >= '5' && ($routing_count['bgp']+$routing_count['ospf -
  • - Packages -
  • -
  • Templates
  • -
  • - Packages -
  • - @@ -97,6 +89,15 @@ if (isset($config['graylog']['server']) && isset($config['graylog']['port'])) { ?>
  • Inventory
  • + +
  • + Packages +
  • +
  • IPv4 Search
  • From a833d46d4d5aae6cd1dda89055ff4b91501540d1 Mon Sep 17 00:00:00 2001 From: f0o Date: Sun, 30 Aug 2015 18:02:29 +0100 Subject: [PATCH 129/263] Add placehoders to custom titles --- alerts.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/alerts.php b/alerts.php index eb63a8ad5..3e8bdead8 100755 --- a/alerts.php +++ b/alerts.php @@ -480,6 +480,9 @@ function DescribeAlert($alert) { $obj['timestamp'] = $alert['time_logged']; $obj['contacts'] = $extra['contacts']; $obj['state'] = $alert['state']; + if (strstr($obj['title'],'%')) { + $obj['title'] = RunJail('$ret = "'.populate(addslashes($obj['title'])).'";', $obj); + } return $obj; }//end DescribeAlert() From bea05876344ba4f2e2f632637bfdd9f39581dcfa Mon Sep 17 00:00:00 2001 From: f0o Date: Sun, 30 Aug 2015 18:05:57 +0100 Subject: [PATCH 130/263] Fixed edit-javascript --- html/includes/forms/parse-alert-template.inc.php | 6 ++++-- html/includes/modal/alert_template.inc.php | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/html/includes/forms/parse-alert-template.inc.php b/html/includes/forms/parse-alert-template.inc.php index 31dc3c714..2b8bb2e56 100644 --- a/html/includes/forms/parse-alert-template.inc.php +++ b/html/includes/forms/parse-alert-template.inc.php @@ -21,8 +21,10 @@ $template_id = ($_POST['template_id']); if (is_numeric($template_id) && $template_id > 0) { $template = dbFetchRow('SELECT * FROM `alert_templates` WHERE `id` = ? LIMIT 1', array($template_id)); $output = array( - 'template' => $template['template'], - 'name' => $template['name'], + 'template' => $template['template'], + 'name' => $template['name'], + 'title' => $template['title'], + 'title_rec' => $template['title_rec'], ); echo _json_encode($output); } diff --git a/html/includes/modal/alert_template.inc.php b/html/includes/modal/alert_template.inc.php index bef4957a2..8e96f3032 100644 --- a/html/includes/modal/alert_template.inc.php +++ b/html/includes/modal/alert_template.inc.php @@ -115,6 +115,8 @@ $('#alert-template').on('show.bs.modal', function (event) { success: function(output) { $('#template').val(output['template']); $('#name').val(output['name']); + $('#title').val(output['title']); + $('#title_rec').val(output['title_rec']); } }); } From 3ae4372e6821284a2da25be61741feccdec11eb2 Mon Sep 17 00:00:00 2001 From: laf Date: Sun, 30 Aug 2015 17:33:54 +0000 Subject: [PATCH 131/263] Initial work on port override --- html/includes/table/edit-ports.inc.php | 4 +-- html/pages/device/edit/ports.inc.php | 38 ++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/html/includes/table/edit-ports.inc.php b/html/includes/table/edit-ports.inc.php index d53a436d8..0c73c88b5 100644 --- a/html/includes/table/edit-ports.inc.php +++ b/html/includes/table/edit-ports.inc.php @@ -64,7 +64,7 @@ foreach (dbFetchRows($sql, $param) as $port) { ', 'ignore' => ' ', - 'ifAlias' => $port['ifAlias'] + 'ifAlias' => '' ); }//end foreach @@ -75,4 +75,4 @@ $output = array( 'rows' => $response, 'total' => $total, ); -echo _json_encode($output); \ No newline at end of file +echo _json_encode($output); diff --git a/html/pages/device/edit/ports.inc.php b/html/pages/device/edit/ports.inc.php index 865439595..368747a76 100644 --- a/html/pages/device/edit/ports.inc.php +++ b/html/pages/device/edit/ports.inc.php @@ -1,3 +1,4 @@ +
    n.b For the first time, please click any button twice.
    @@ -20,6 +21,42 @@
    '; } else { From e67f91c48ebdc67a6beb11be80e14fd5e27abe6e Mon Sep 17 00:00:00 2001 From: laf Date: Mon, 31 Aug 2015 21:17:34 +0000 Subject: [PATCH 152/263] Added FortiOS definitions + appliance type --- includes/definitions.inc.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/includes/definitions.inc.php b/includes/definitions.inc.php index 24326b104..5fcdce7b6 100644 --- a/includes/definitions.inc.php +++ b/includes/definitions.inc.php @@ -1284,6 +1284,18 @@ $config['os'][$os]['icon'] = 'generic'; $config['os'][$os]['over'][0]['graph'] = 'device_bits'; $config['os'][$os]['over'][0]['text'] = 'Traffic'; +// Appliances +$os = 'fortios'; +$config['os'][$os]['text'] = 'FortiOS'; +$config['os'][$os]['type'] = 'appliance'; +$config['os'][$os]['icon'] = 'fortios'; +$config['os'][$os]['over'][0]['graph'] = 'device_bits'; +$config['os'][$os]['over'][0]['text'] = 'Traffic'; +$config['os'][$os]['over'][1]['graph'] = 'device_processor'; +$config['os'][$os]['over'][1]['text'] = 'CPU Usage'; +$config['os'][$os]['over'][2]['graph'] = 'device_mempool'; +$config['os'][$os]['over'][2]['text'] = 'Memory Usage'; + // Graph Types require_once $config['install_dir'].'/includes/load_db_graph_types.inc.php'; @@ -1638,6 +1650,11 @@ if (isset($config['enable_printers']) && $config['enable_printers']) { $config['device_types'][$i]['icon'] = 'printer.png'; } +$i++; +$config['device_types'][$i]['text'] = 'Appliance'; +$config['device_types'][$i]['type'] = 'appliance'; +$config['device_types'][$i]['icon'] = 'appliance.png'; + // // No changes below this line # // From 6d39bb4f81c2818fabd28d449bd1bd93e40ad697 Mon Sep 17 00:00:00 2001 From: laf Date: Mon, 31 Aug 2015 21:17:56 +0000 Subject: [PATCH 153/263] Added appliance logo - this is a copy of apps.png --- html/images/icons/appliance.png | Bin 0 -> 555 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 html/images/icons/appliance.png diff --git a/html/images/icons/appliance.png b/html/images/icons/appliance.png new file mode 100644 index 0000000000000000000000000000000000000000..851950db7c285f586d7ee74bcc417f225bdf18c1 GIT binary patch literal 555 zcmV+`0@VG9P)CjNr zUW1fN1d-Gd7r2N>l%796-}n2KALIT2^YO?eu@~9M*vzf-7i;%d+Nwx^J95X|kPDY1 zGh9Mum^%l$6{Q6;tonHam& z&u-m)+9C;(lg!W0^P=Y{J$aeIu9KK&6b^;p+My?$?QijWYk;}0r)e}Am>WqzqNC`2 z&bQ6)?2D%u>Kdo4V?>9yzpnCg;~hszOJrF_;)Rg}bEBg#TjxYM(AWKi=r@UR2yLC= z^Xf3~moMO(#>D=QByLU;NZgGixEo2m zUZ+l-#NFwTM29LuhehJSZEZZ_k>_v$^`U`{uGrzP*mgoQg002ovPDHLkV1oRO19t!b literal 0 HcmV?d00001 From 3c577a271576fcedf81fcb2016062a5c8458d4d5 Mon Sep 17 00:00:00 2001 From: laf Date: Mon, 31 Aug 2015 21:18:19 +0000 Subject: [PATCH 154/263] www.fortinet.com/sites/all/themes/fortinet/images/fortinet_logo.png --- html/images/os/fortios.png | Bin 0 -> 22231 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 html/images/os/fortios.png diff --git a/html/images/os/fortios.png b/html/images/os/fortios.png new file mode 100644 index 0000000000000000000000000000000000000000..3c4252d05423f5bd5be6c13d98d24712d3f1ef87 GIT binary patch literal 22231 zcmeI4cT`hZ)VD89nji=YDoF2y&;y}LkuG4PgCPWnbP~E0k=_)P-Yg(Zx^$@`NN>`+ zG!+4*D&U3jnkik@E6dT9$TbJCvoJJ)?@eJfpp% zojKAP0RXNexo$|YYx{%WMqZwwi*QRpu&*VxuSwp`qN6L8Z>H9WV&!hR_n7z;S3;Jb zma1U%1Jw|@EMZ2beVR90TRYPGkS-^wRGOX2t?HGMf$D*h{ObH_8GzaMd3m|z11iRV z$U1bHK8ou#ZbWbJ;>kpZ{7$XIMdmxs#Gmnv6pS-J0A5-nW(Io(^r_~KyfGGl5 z?kA@7V>mu!0P+UDcohIZ07n^S{2K%(0ysw8bKh~?nE~zM_%Hze6bb2gKoIW3-C%8F za~|FMP58P4PdX`yol|(kg3c_~L@{VQZZ>e+t)E6qG)E`tg;_4hY`a?emCytBxDR!% zyp-~c@qBEfLOIb1)RFsaHY&M^J$n~;`6Vc6-!d+E*%)BN^Z7=E(60hp@z=*~%Xq@F z>xFqv02KIj>QoI5{i+)PmIbT}*;I!a|*mdf?6P zdqkJpP)&SI9B#Y8OKLaV^V;b=&Z!i;7;WC|Xk;sQ=ks{!V2@8)fUlyAuR`Rj8{`+1 z*HWo+&#=OjO!$TzZTAI){}-xhJmDL-c$QN*S)Yh$WdpZs9p+{6*t?mCX$!Vvjij?> zIlFy`Rb&HQgM7E@{AdknAx&fsN@KK;SK$sCh76ExDvp-V8QeV~mMYKL^r=qme9$@PHr1)g7t2vjxz5jR^(r z�=x`}dlY`AO7?b__b`-_`kW1_cDkoZYy&LA>F=ubo`_)`u7!M5z4G?h*hL1cj@? zF8cX%C?~vnrP#-|L|dPo!zR)%f(CBw?Xtx(FiehPwt`>n4nxFgvWNM^vI6^op{EEk zx$viCR!?v&9A`8G?1!bqBIBR8PXhq{LxAv;FGbKDVNM?sOJ6=(UoPF-Qsq7z+x5qY z0_=lu*jZm*A0m#whe!B`BBFtqGf=f0h~BgUgM?F zxJA6Uz<$r}HJDm{Sj+h8@o4#eEzdW{on)nYHY{l?i8U03y74Rp^aE0q@}IbL2U^NN z!@LwS1nP7Jywpjq)UOMWwiB#1%L%ZT(zi8*6bL>$Ruxjr=)t2One31OWRF!OwZ;owFf`@03`#Ror$NEE!+n#-Dd_9{E0>F>5%D>W~Ycn zoIx>2utCIVh=iZSovNg&Xb(TanaKIVDdPFzS6Av$u?zIzNS&0y2uKtpa0}OtW`&vo zk}8@CnKZ9CSu=X;wFUyHR^M`y*Hd4P!Q zk0pzh;vMCa;Nbu-u#_p~U9vSa)|$8^eXU0STRQHwdIi{hx%dVu#mA3pOdq@zcy*rb zs)`bqVU|Lc!I^6V*CMo}pN>@}6pY*ufjbR^mmlPH$H&rhj7n5{fmS?|>wh@UoG zz~yu1`@)xRIA;W@m~dpNtf-7GuXY)xaZjeIW2n%DJhtS&cj`NWOrO6B zX||163cnK37Itppx%rjpr(93**3>0W)=Jk%--a;pJrdGpa&UQ@$U2i2m6qBv(V`=Y zvN5+_R@YV?P85u}ne6UPTEph5)^s|RF>{EP_P^iTji$I=np3&^}?Cj3q zl(yW9IaE0uorFm%6*t@-)m%)UzY6lU=~OI_bN&1>y-rONEMaI{@z^_kKKo;Tua)Fr zQ9jGyl|0RU|3R|Bo&K$fg4!O(zEATd2H9nuqRJu<#^$S%N0pK7mWDS~Z4zuFtWsW3 zIa{P5;BBGTCkHreY;BBO=$9vIEj;r}#-CNcuj$zfAhbF^_O5#+(<5`|lY7Rcg%Ty` z-8`rF&PFQ(i+L*o?<$6?O3Mnn(pEa*ZOvOLLsD)-D`S&8Zx-Jd-}bpZZNb#ll&U1N z4~-KR+h<;4n?`K%bm}O|KbA-2pE4OFUnHOOf`56smfJi^!&1+}pfsaIGl6)KQ3F1E zpEl?0Ae~)YLCU)?1VMk&6$?h!ym2l z>z6AvjwrWqvfdP{sY%cEwXz)HIo$orqk*8%w zE`b*khA#!8Q;pWc{Kl(}B)45h1ppzz6>Qd#C#mcwTX0*T7F+jTG}0NaSoLX5&1uT-4@NX7JP_MyYf`I^TNbcq;Xzy^N-J zn-e?Ez~UZ+)sFZ03uP=E{w3m!g&#m*Z4Cs)||mdh;5>X2%zWmbP@w#h23& zEA8UdD-+)y;iaN7PIS&|Fnmpsx%Mf`zUbZBbgGir-Lnt)RlDdGq0)|~Z)dBnnYqCuG!Sa;e0D-n^y45 zH?DcqSZsM#d49W{%H$O{j5 zftN<7sfsvDLF6s|dtvb;#c)JKZ@s%ODE>odUQ2zaz{@X5Iq_8?9H}nnOlWJXd?Ft{ zrbzAf{Zy`;YWYMr+_gd>*evpDeYW9y^>|jjgrw*fX}g;KmtIk+er_$zNx!NUP27)D zvhx8V(uq86m5wC*K>O~bQ`H8^h9{Zd@sxaVbK0WoeLjkBvYQ^oy*6L-5- zO1$SPhk#_Cij6Wzn$2?}R>I9*)jN-U2LlTHkN0*3*pl>}Fd(uEQ4SRj_syJtmn?Al zc#;Fe*(FJDtV^R`z1EerhP$3^TFKO*cO>o6?DG!OM7s?9r>hy{wpkOER*5Ul{!2m< z`hBY|0qF+Ims=^uIueNEWj4diq(%%9tHFV#njSL9{i)lb6~ly2R;|e$7%F3H`Mir5 zOS+%E-nAc~Tv-!p_ z)AN?YbWy{p{hYwOje*YtJL8s4LZD^ z?(2NT_iEWmD$pbFyp{Cu|PKH+|TN!}aQ8%Grr za?KP^?2O5s=Bc@D6fUIx_B|C#HfDt@re_QN6&Q!_lSidQroZl)J;%#>njuCt#)O)q zm8+FEN63opT<7V=0oCaA<#aFeEi=2RdvmX6@H;hs-65X{WM(zrH&``ej6kOZZ6G zs79qaVMkMk1#f+brA8^!Xw;JK$6-2G`t+pd$;n2vc?7m(%PW#u#v>D6(xbODzm|Nt zOHh!fGdWf5V0D8am*<^D(D88=w2Q9%cD{0GCQA=0Y-*@RW1u|%f2ncAEV?81@}TYe z;nP*}!b?c^3js6B@lpgHIu?`TN-}k^JJ1#FZ#fO=rY%p7rAIVFQq;L5^aNb5r+=7r z+enyJ%gD3MgjZ|#71XFyD89|x*ekkJYU@7{&*6qg(&b@t-rIBAW^$)4xI%Nxq|^Hj z!v~>b#cHVG+7AneA_^beF-Ba+hs5kt_&5}Jqf95br;edtO6V$V zQ;Ia6C&v8Yk9bW#3krF%n#t0taQAWUI~sLrR9&fQ$q*-BSk;X9wh^uzKeIK{7&9-0 zMo?AI3FRbKnOTb%bdu*wQC{qn_MZFsvi0am+jwUk?Igy7cW)_IacIl?+ z=AKu`j^TDhdw-)%{doOM{aOelYKz8%ulD4={A~^2UEe|fF~14Yj36yVZUqfRrB|zs zOKd}I#wx~<&;o9`5yOjG^G`n7RNPs8L^2;zq&n6*+mC;$h`Z`+88r5o9{du@&`P#S zej#F+zM6cG=Gf%%;lb>46=#&?KP8TR`*iOPnbUZOhkKlPSeLs<<-~R(5j|s%WafnkIdjqwX^>Jf$ZH zq2f99QH826ciNKA8l_9+fAy05@)iAY`1RCw8$*61YCdc$tXe$iGF#*w;1 zZfY1uA9Gs-9$L#8D{S5&KIO8pQ#g+pVJJ#AZQ~xd zLY=o8Cj(jGX>>YSYNV|chN@OZ%|Jhc#D zbejmomnoxg*Z6GH$r_=klh@AAP?I`1wGZKcZXB3xd~gqxTBehh{_$2q&Ar>p>=us8 zJ*^>=JFLxCla05Z-N|2YQGde_oA`}lltOs{CHhwDx*;pY?45=vDOTictTrI#1G z=nK3{g;(rh8y4y`Q;{_YtXe2eue3P#A<8=ci z8|dQ(o#^j1oCr1*B4j)c0(r*bG1BAewj1atfDQEZc?s)`afOw@D@y=CA&#SJf(M{E zH!}7-?#}Jw==QX$v&hwi0|1mCc~uv!tDz2s+u88J%)K!Z4dt4~y^FcG1nelrUw3QU|g@XYZbv3jY3{G$?uR&>V9 z;Q3b>!WH>1vIEZ#+4ofVu|krV{DaCnB4B7c z$E$XB*3v(+?AK*8%vH04tYYNUfWeWr2iMZLB*ECCUn~AA9zp?zMo43{A|QS-kdVMt zK|v_L2vkUnhhG57&;MJHA3d>RXkfD642FjNmneVfiyg<#3~BE6pQ8Ng`PUd48c-Em z6dGm=N2n-BV~(8vu!B1tq!K3dkF9TJ2gii}nIKS6A(#li2;3AT&TlFR5)gohfnacP5s*1TKukys zVhTYB2>m(GZ^8aHkftLNQ<-4azx6pd7BkFX;s_YOnW=~n$W&NN3?vK@7Y2zV;0TZ? z#8kxGTvSLz03!J35dRS7Z$l{~QJ8#k`z_Bf+4jBmTtPVewe?SjHS&86v4=UL5C>aR ziuupI`LpQ!tSJYY?^_%SgCA5MY4||`Bg`bhe`)oe z5@CB-`u_;^z1P17LD`w3U0{xg3l^9R`EPskN8G;(u?LU@AJl7WH7+M->1G7MY z?QJb2!M_@RjVbx74$0eD+c|33nIWVx<>sH7|51hc*@f1RUtLHmAW`<#Ft^{uzj=RC zAAG?Iqlx(D^b+Ua|Lh#)`a0TwuT{X_b@8(XS(xb$~7w)B_s znk^D7jj58~CyLelo9f_O82TOM70d}ELRwTrL`XyujNOc_&_cQ*taTNTm~RTyLB$io zjPzZD?f6Hb-oFWdbNnIvkx0Lt+I_DPKUy&-j+k>+@XwRhzm<=lb@qSq!>=RypNxtX z>u3-xAcvbrxDMxo|t^2-o3!u)IgOuz(zH9^pEi50>``7Z#Ai%_Cfg^TF~S z;lcuPxOs%@a6VYxBV1TO4mXc*9nJ^KdxQ%M$l>M@uEY6Yd5>^m0Xf_}!gV+wEbkF6 zEFg!QN4O5>gXKNKg$3kr^9a}Be6YMnxUhg6ZXV$}oDY`w2p1NR!_6aHhx5Vm9^t|Q za=3Yf>u^3;-XmOCKn^#La2?JE%X@?i3&`Q-5w64eV0n*lVF5YZJi>K2A1vXN4T(n9Bv-rI-C!d_Xrmjki*SGagqGG4HRLEx%blr zbCc)t2>}tz4Wf*2<;xlXU=s%bs0aWU#@uRpI~4%D698Zc4gi8Q06-5in5gap0K6_0 zg$q|*M?PNHu%lC?@a*sFD;An486FA{QITybLJ=uP-tviKRU##?&rl#HBEL<#3oz0Z z(1lH%r~}tAyT^$u{#L#rqS|Vu!M%7=X#5(TsH@CL7;%gE!w33Lv~#LV z`aSxuX)ya%3;RozasX8c6JLt`8wNNQMtOL&NZP3bSS%)6Yqo4>n!|7 zz5Qla6Fxs5)h`pGrj|Qe#ue=wBxr8!Aduh@9d-tP>f+1jHp5(Lpy0Yb2r#9}yG{s{ zU#3h1D4Gp(SNC=vuu@Rwjyn@{l3l#9_NBxh0<5RtK3?8}vEa%A56XmCI&Hkxncli? zzsc&vB`_D$+5Ols^?qNkpK(Zk_suo#F-xG^Fh8`U-)ivnT4kr;eg45kAdMbXEv>Ab z%f2KEI1EJZzjaTJt72^5SRA|tO_p}MjLPL6NMBf}_oWxqeZ5`(=nMdjJqLA=dq%Jk zWXS#A!V$O%6+(Y3KkuE;aFs@uvD1MLkI{jgdCYqA6&J3LuTNN{*u1`tEV0T-a3b3z zp-`EALFrv%%2iJaZHjK=LFSI=5dOhDWB+w+)|6Q2EitFr*R?Ay(W-0B4A!vwVUuc+ z@hR++njM`ts|uMMUbuaOixF;|@P&swjx3uTK2LhL=QMO1g#z&kT3JV!l+Q#uW7|Puh_9h4sKW`f&or2%ATYxdXE2b0T4v zQy`+7w7t)b2~lhF9k+!E8ej0wX!yG0!cYT0G~8h28I6Xu~^O7Z+JnbU$%8HQ&iT_?KpFg`b;l!XdV1u~i$fK0ZVXC*Ribu2Se*)>e@#fQk={pGyHn#h7Xq4< z08yn~23HfwGDyaGEjjg88Ylx*h0~hqnE$OB|LBXGkcgr-KIOf$;;1Hd4XMZP<*h>G zNaR-~9mvzVAH80?O4~5_MopVqJ5V$I>b=LDm$g~j)2In9Ogg!*qIdW4cBO!8h%X8@ UaVA>_H;St$UQ)=DyW#u)01aSCO#lD@ literal 0 HcmV?d00001 From 703bdf37174af124e0bbdc66257b390a0dbe7d1d Mon Sep 17 00:00:00 2001 From: laf Date: Mon, 31 Aug 2015 21:18:49 +0000 Subject: [PATCH 155/263] http://en.community.dell.com/techcenter/networking/nms/f/4877/t/19583922 --- mibs/FORTINET-FORTIANALYZER-MIB.mib | 538 ++++++++++++++++++++++++++++ 1 file changed, 538 insertions(+) create mode 100755 mibs/FORTINET-FORTIANALYZER-MIB.mib diff --git a/mibs/FORTINET-FORTIANALYZER-MIB.mib b/mibs/FORTINET-FORTIANALYZER-MIB.mib new file mode 100755 index 000000000..e4681cd51 --- /dev/null +++ b/mibs/FORTINET-FORTIANALYZER-MIB.mib @@ -0,0 +1,538 @@ + +FORTINET-FORTIANALYZER-MIB DEFINITIONS ::= BEGIN + +IMPORTS + FnIndex, fnGenTrapMsg, fnSysSerial, fortinet, fnTrapsPrefix + FROM FORTINET-CORE-MIB + InetPortNumber + FROM INET-ADDRESS-MIB + sysName + FROM SNMPv2-MIB + MODULE-COMPLIANCE, NOTIFICATION-GROUP, OBJECT-GROUP + FROM SNMPv2-CONF + Counter32, Gauge32, Integer32, IpAddress, MODULE-IDENTITY, + NOTIFICATION-TYPE, OBJECT-TYPE + FROM SNMPv2-SMI + DisplayString, TEXTUAL-CONVENTION + FROM SNMPv2-TC; + +fnFortiAnalyzerMib MODULE-IDENTITY + LAST-UPDATED "200909210000Z" + ORGANIZATION + "Fortinet Technologies, Inc." + CONTACT-INFO + " + Technical Support + email: support@fortinet.com + http://www.fortinet.com" + DESCRIPTION + "MIB module for Fortinet FortiAnalyzer devices." + REVISION "200909210000Z" + DESCRIPTION + "Fix syntax errors." + REVISION "200902050000Z" + DESCRIPTION + "Initial version of FORTINET-FORTIANALYZER-MIB." + ::= { fortinet 102 } + +FaSessProto ::= TEXTUAL-CONVENTION + STATUS current + DESCRIPTION + "data type for session protocols" + SYNTAX INTEGER { ip(0), icmp(1), igmp(2), ipip(4), tcp(6), + egp(8), pup(12), udp(17), idp(22), ipv6(41), + rsvp(46), gre(47), esp(50), ah(51), ospf(89), + pim(103), comp(108), raw(255) } + +FaRAIDStatusCode ::= TEXTUAL-CONVENTION + STATUS current + DESCRIPTION + "Enumerated list of RAID status codes." + SYNTAX INTEGER { arrayOK(1), arrayDegraded(2), arrayInoperable(3), + arrayRebuilding(4), arrayRebuildingStarted(5), + arrayRebuildingFinished(6), arrayInitializing(7), + arrayInitializingStarted(8), arrayInitializingFinished(9), + diskOK(10), diskDegraded(11), diskFailEvent(12) } + +FaSysEventCode ::= TEXTUAL-CONVENTION + STATUS current + DESCRIPTION + "Enumerated list of system events." + SYNTAX INTEGER { systemHalt(1), systemReboot(2), + upgradeConfig(3), systemUpgrade(4), logdiskFormat(5) } + +faTraps OBJECT IDENTIFIER + ::= { fnFortiAnalyzerMib 0 } + +faTrapPrefix OBJECT IDENTIFIER + ::= { faTraps 0 } + +faTrapObject OBJECT IDENTIFIER + ::= { faTraps 1 } + +faSystemEvent OBJECT-TYPE + SYNTAX FaSysEventCode + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "Type of system event that triggered notification." + ::= { faTrapObject 1 } + +faRAIDStatus OBJECT-TYPE + SYNTAX FaRAIDStatusCode + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "New RAID state associated with a RAID status change event." + ::= { faTrapObject 2 } + +faRAIDDevIndex OBJECT-TYPE + SYNTAX DisplayString (SIZE(0..32)) + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "Name/index of a RAID device relating to the event." + ::= { faTrapObject 3 } + +faGenAlert OBJECT-TYPE + SYNTAX DisplayString + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Detail of defined event alert sent from FortiAnalyzer" + ::= { faTrapObject 4 } + +faModel OBJECT IDENTIFIER + ::= { fnFortiAnalyzerMib 1 } + +faz100 OBJECT IDENTIFIER + ::= { faModel 1000 } + +faz100A OBJECT IDENTIFIER + ::= { faModel 1001 } + +faz100B OBJECT IDENTIFIER + ::= { faModel 1002 } + +faz100C OBJECT IDENTIFIER + ::= { faModel 1003 } + +faz400 OBJECT IDENTIFIER + ::= { faModel 4000 } + +faz400B OBJECT IDENTIFIER + ::= { faModel 4002 } + +faz800 OBJECT IDENTIFIER + ::= { faModel 8000 } + +faz800B OBJECT IDENTIFIER + ::= { faModel 8002 } + +faz1000B OBJECT IDENTIFIER + ::= { faModel 10002 } + +faz2000 OBJECT IDENTIFIER + ::= { faModel 20000 } + +faz2000A OBJECT IDENTIFIER + ::= { faModel 20001 } + +faz4000 OBJECT IDENTIFIER + ::= { faModel 40000 } + +faz4000A OBJECT IDENTIFIER + ::= { faModel 40001 } + + +faInetProto OBJECT IDENTIFIER + ::= { fnFortiAnalyzerMib 2 } + +faInetProtoInfo OBJECT IDENTIFIER + ::= { faInetProto 1 } + +faInetProtoTables OBJECT IDENTIFIER + ::= { faInetProto 2 } + +faIpSessTable OBJECT-TYPE + SYNTAX SEQUENCE OF FaIpSessEntry + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "Information on the IP sessions active on the device" + ::= { faInetProtoTables 1 } + +faIpSessEntry OBJECT-TYPE + SYNTAX FaIpSessEntry + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "Information on a specific session, including source and destination" + INDEX { faIpSessIndex } + ::= { faIpSessTable 1 } + +FaIpSessEntry ::= SEQUENCE { + faIpSessIndex FnIndex, + faIpSessProto FaSessProto, + faIpSessFromAddr IpAddress, + faIpSessFromPort InetPortNumber, + faIpSessToAddr IpAddress, + faIpSessToPort InetPortNumber, + faIpSessExp Counter32 +} + +faIpSessIndex OBJECT-TYPE + SYNTAX FnIndex + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "An index value that uniquely identifies + an IP session within the faIpSessTable" + ::= { faIpSessEntry 1 } + +faIpSessProto OBJECT-TYPE + SYNTAX FaSessProto + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The protocol the session is using (IP, TCP, UDP, etc.)" + ::= { faIpSessEntry 2 } + +faIpSessFromAddr OBJECT-TYPE + SYNTAX IpAddress + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Source IP address (IPv4 only) of the session" + ::= { faIpSessEntry 3 } + +faIpSessFromPort OBJECT-TYPE + SYNTAX InetPortNumber + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Source port number (UDP and TCP only) of the session" + ::= { faIpSessEntry 4 } + +faIpSessToAddr OBJECT-TYPE + SYNTAX IpAddress + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Destination IP address (IPv4 only) of the session" + ::= { faIpSessEntry 5 } + +faIpSessToPort OBJECT-TYPE + SYNTAX InetPortNumber + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Destination Port number (UDP and TCP only) of the session" + ::= { faIpSessEntry 6 } + +faIpSessExp OBJECT-TYPE + SYNTAX Counter32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Number of seconds remaining before the session expires (if idle)" + ::= { faIpSessEntry 7 } + +fa300Compat OBJECT IDENTIFIER + ::= { fnFortiAnalyzerMib 99 } + +faHwSensors OBJECT IDENTIFIER + ::= { fa300Compat 1 } + +faHwSensorCount OBJECT-TYPE + SYNTAX Integer32 + MAX-ACCESS read-only + STATUS deprecated + DESCRIPTION + "The number of entries in faHwSensorTable" + ::= { faHwSensors 1 } + +faHwSensorTable OBJECT-TYPE + SYNTAX SEQUENCE OF FaHwSensorEntry + MAX-ACCESS not-accessible + STATUS deprecated + DESCRIPTION + "A list of device specific hardware sensors and values. Because different devices have different hardware sensor capabilities, this table may or may not contain any values." + ::= { faHwSensors 2 } + +faHwSensorEntry OBJECT-TYPE + SYNTAX FaHwSensorEntry + MAX-ACCESS not-accessible + STATUS deprecated + DESCRIPTION + "An entry containing the name, value, and alarm status of a given hardware sensor" + INDEX { faHwSensorEntIndex } + ::= { faHwSensorTable 1 } + +FaHwSensorEntry ::= SEQUENCE { + faHwSensorEntIndex FnIndex, + faHwSensorEntName DisplayString, + faHwSensorEntValue DisplayString, + faHwSensorEntAlarmStatus INTEGER +} + +faHwSensorEntIndex OBJECT-TYPE + SYNTAX FnIndex + MAX-ACCESS not-accessible + STATUS deprecated + DESCRIPTION + "A unique identifier within the faHwSensorTable" + ::= { faHwSensorEntry 1 } + +faHwSensorEntName OBJECT-TYPE + SYNTAX DisplayString + MAX-ACCESS read-only + STATUS deprecated + DESCRIPTION + "A string identifying the sensor by name" + ::= { faHwSensorEntry 2 } + +faHwSensorEntValue OBJECT-TYPE + SYNTAX DisplayString + MAX-ACCESS read-only + STATUS deprecated + DESCRIPTION + "A string representation of the value of the sensor. Because sensors can present data in different formats, string representation is most general format. Interpretation of the value (units of measure, for example) is dependent on the individual sensor." + ::= { faHwSensorEntry 3 } + +faHwSensorEntAlarmStatus OBJECT-TYPE + SYNTAX INTEGER { false(0), true(1) } + MAX-ACCESS read-only + STATUS deprecated + DESCRIPTION + "If the sensor has an alarm threshold and has exceeded it, this will indicate its status. Not all sensors have alarms." + ::= { faHwSensorEntry 4 } + + + +fa300System OBJECT IDENTIFIER + ::= { fa300Compat 2 } + +fa300SysSerial OBJECT-TYPE + SYNTAX DisplayString (SIZE(0..32)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Serial number of the device" + ::= { fa300System 1 } + +fa300SysVersion OBJECT-TYPE + SYNTAX DisplayString (SIZE(0..128)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Firmware version of the device" + ::= { fa300System 2 } + +fa300SysCpuUsage OBJECT-TYPE + SYNTAX Gauge32 (0..100) + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Current CPU usage (percentage)" + ::= { fa300System 3 } + +fa300SysMemUsage OBJECT-TYPE + SYNTAX Gauge32 (0..100) + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Current memory utilization (percentage)" + ::= { fa300System 4 } + +fa300SysSesCount OBJECT-TYPE + SYNTAX Gauge32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Number of active sessions on the device" + ::= { fa300System 5 } + +fa300SysDiskCapacity OBJECT-TYPE + SYNTAX Gauge32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Total hard disk capacity (MB), if disk is present" + ::= { fa300System 6 } + +fa300SysDiskUsage OBJECT-TYPE + SYNTAX Gauge32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Current hard disk usage (MB), if disk is present" + ::= { fa300System 7 } + +fa300SysMemCapacity OBJECT-TYPE + SYNTAX Gauge32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Total physical memory (RAM) installed (KB)" + ::= { fa300System 8 } + + + + +faMIBConformance OBJECT IDENTIFIER + ::= { fnFortiAnalyzerMib 100 } + +faTrapSystemEvent NOTIFICATION-TYPE + OBJECTS { fnSysSerial, faSystemEvent } + STATUS current + DESCRIPTION + "A system event occured. The specific type of event is indecated by the faSystemEvent parameter." + ::= { faTrapPrefix 1001 } + +faTrapRAIDStatusChange NOTIFICATION-TYPE + OBJECTS { fnSysSerial, faRAIDStatus, faRAIDDevIndex } + STATUS current + DESCRIPTION + "Trap is sent when there is a change in the status of the RAID array, if present." + ::= { faTrapPrefix 1002 } + +faTrapGenAlert NOTIFICATION-TYPE + OBJECTS { fnSysSerial, fnGenTrapMsg } + STATUS current + DESCRIPTION + "Trap sent when FortiAnalyzer event parameter + exceeds configured limit. Event description + included in trap." + ::= { faTrapPrefix 1003 } + + +faTrapLogRateThreshold NOTIFICATION-TYPE + OBJECTS { fnSysSerial, sysName } + STATUS current + DESCRIPTION + "Indicates that the incoming log rate has exceeded the configured threshold." + ::= { fnTrapsPrefix 1005 } + +faTrapDataRateThreshold NOTIFICATION-TYPE + OBJECTS { fnSysSerial, sysName } + STATUS current + DESCRIPTION + "Indicates that the incoming data rate has exceeded the configured threshold." + ::= { fnTrapsPrefix 1006 } + + + +faSystemComplianceGroup OBJECT-GROUP + OBJECTS { + fa300SysSerial, + fa300SysVersion, + fa300SysCpuUsage, + fa300SysMemUsage, + fa300SysDiskCapacity, + fa300SysDiskUsage, + fa300SysMemCapacity, + fa300SysSesCount, + faSystemEvent + } + STATUS current + DESCRIPTION "System related instrumentation" + ::= { faMIBConformance 1 } + + +faTrapsComplianceGroup NOTIFICATION-GROUP + NOTIFICATIONS { faTrapSystemEvent, faTrapRAIDStatusChange, + faTrapGenAlert, faTrapLogRateThreshold, faTrapDataRateThreshold } + STATUS current + DESCRIPTION + "Event notifications" + ::= { faMIBConformance 2 } + + +faSessionComplianceGroup OBJECT-GROUP + OBJECTS { + faIpSessProto, + faIpSessFromAddr, + faIpSessFromPort, + faIpSessToAddr, + faIpSessToPort, + faIpSessExp + } + STATUS current + DESCRIPTION "Session related instrumentation" + ::= { faMIBConformance 3 } + +faMiscComplianceGroup OBJECT-GROUP + OBJECTS { + faGenAlert + + } + STATUS current + DESCRIPTION "Miscellanious instrumentation" + ::= { faMIBConformance 4 } + +faHwSensorComplianceGroup OBJECT-GROUP + OBJECTS { + faHwSensorCount, + faHwSensorEntName, + faHwSensorEntValue, + faHwSensorEntAlarmStatus + } + STATUS deprecated + DESCRIPTION "Hardware sensor related information" + ::= { faMIBConformance 5 } + +faNotificationObjectsComplianceGroup OBJECT-GROUP + OBJECTS { faSystemEvent, faRAIDStatus, faRAIDDevIndex } + STATUS current + DESCRIPTION + "Object identifiers used in notifications" + ::= { faMIBConformance 6 } + + + + +faMIBCompliance MODULE-COMPLIANCE + STATUS current + DESCRIPTION + "The compliance statement for the application MIB." + + MODULE -- this module + + GROUP faSystemComplianceGroup + DESCRIPTION "System related instrumentation" + + GROUP faSessionComplianceGroup + DESCRIPTION + "Session related instrumentation" + + GROUP faMiscComplianceGroup + DESCRIPTION "Miscellanious instrumentation" + + GROUP faTrapsComplianceGroup + DESCRIPTION + "Traps are optional. Not all models support all traps. Consult product literature to see which traps are supported." + + GROUP faNotificationObjectsComplianceGroup + DESCRIPTION + "Object identifiers used in notifications. Objects are required if their containing trap is implemented." + + ::= { faMIBConformance 100 } + + + +faObsoleteMIBCompliance MODULE-COMPLIANCE + STATUS deprecated + DESCRIPTION + "The compliance statement of deprecated objects for the application MIB, they may still be used by older models." + + MODULE -- this module + + GROUP faHwSensorComplianceGroup + DESCRIPTION + "Traps are optional. Not all models support all traps. Consult product literature to see which traps are supported." + + ::= { faMIBConformance 101 } + + +END -- end of module FORTINET-FORTIANALYZER-MIB. From c708610c9672bf0f8b8e2f0ec605c9ae4e1ccf7f Mon Sep 17 00:00:00 2001 From: laf Date: Mon, 31 Aug 2015 21:19:39 +0000 Subject: [PATCH 156/263] Added basic detection for FortiOS --- includes/discovery/os/fortios.inc.php | 7 +++++++ includes/polling/os/fortios.inc.php | 3 +++ 2 files changed, 10 insertions(+) create mode 100644 includes/discovery/os/fortios.inc.php create mode 100644 includes/polling/os/fortios.inc.php diff --git a/includes/discovery/os/fortios.inc.php b/includes/discovery/os/fortios.inc.php new file mode 100644 index 000000000..bf432ddd7 --- /dev/null +++ b/includes/discovery/os/fortios.inc.php @@ -0,0 +1,7 @@ + Date: Mon, 31 Aug 2015 21:21:36 +0000 Subject: [PATCH 157/263] Updated sysObjectId --- includes/discovery/os/fortios.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/discovery/os/fortios.inc.php b/includes/discovery/os/fortios.inc.php index bf432ddd7..62584f2cb 100644 --- a/includes/discovery/os/fortios.inc.php +++ b/includes/discovery/os/fortios.inc.php @@ -1,7 +1,7 @@ Date: Mon, 31 Aug 2015 21:33:57 +0000 Subject: [PATCH 158/263] Fixed syslog and eventlog tables to be responsive --- html/includes/common/eventlog.inc.php | 23 ++++++++++++----------- html/includes/common/syslog.inc.php | 23 ++++++++++++----------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/html/includes/common/eventlog.inc.php b/html/includes/common/eventlog.inc.php index 7ce1590c0..fcf5e955e 100644 --- a/html/includes/common/eventlog.inc.php +++ b/html/includes/common/eventlog.inc.php @@ -1,17 +1,18 @@ - - - Datetime - Hostname - Type - Message - - - - +
    + + + + + + + + + +
    DatetimeHostnameTypeMessage
    +
    '; + return; + } else { + echo 'Step #'.$limit.' ...'.PHP_EOL; + } + } + if (!empty($line)) { $creation = mysqli_query($database_link, $line); - if (!$creation) { + if (!$creation && ($limit <= 100 || $limit > 391) ) { echo 'WARNING: Cannot execute query ('.$line.'): '.mysqli_error($database_link)."\n"; } } @@ -41,4 +53,9 @@ while (!feof($sql_fh)) { fclose($sql_fh); -require 'includes/sql-schema/update.php'; +if( !isset($_SESSION['stage']) ) { + require 'includes/sql-schema/update.php'; +} else { + $_SESSION['build-ok'] = true; + dbInsert(array('version' => 67), 'dbSchema'); +} diff --git a/build.sql b/build.sql index 9f4526069..39d87c8cf 100644 --- a/build.sql +++ b/build.sql @@ -70,12 +70,9 @@ CREATE TABLE IF NOT EXISTS `frequency` ( `freq_id` int(11) NOT NULL auto_increme CREATE TABLE IF NOT EXISTS `current` ( `current_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL default '0', `current_oid` varchar(64) NOT NULL, `current_index` varchar(8) NOT NULL, `current_type` varchar(32) NOT NULL, `current_descr` varchar(32) NOT NULL default '', `current_precision` int(11) NOT NULL default '1', `current_current` float default NULL, `current_limit` float default NULL, `current_limit_warn` float default NULL, `current_limit_low` float default NULL, PRIMARY KEY (`current_id`), KEY `current_host` (`device_id`)) ENGINE=MyISAM AUTO_INCREMENT=189 DEFAULT CHARSET=latin1; CREATE TABLE IF NOT EXISTS `ucd_diskio` ( `diskio_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `diskio_index` int(11) NOT NULL, `diskio_descr` varchar(32) NOT NULL, PRIMARY KEY (`diskio_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ; CREATE TABLE IF NOT EXISTS `applications` ( `app_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `app_type` varchar(64) NOT NULL, PRIMARY KEY (`app_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; -## 0.10.6 CREATE TABLE IF NOT EXISTS `sensors` ( `sensor_id` int(11) NOT NULL auto_increment, `sensor_class` varchar(64) NOT NULL, `device_id` int(11) NOT NULL default '0', `sensor_oid` varchar(64) NOT NULL, `sensor_index` varchar(8) NOT NULL, `sensor_type` varchar(32) NOT NULL, `sensor_descr` varchar(32) NOT NULL default '', `sensor_precision` int(11) NOT NULL default '1', `sensor_current` float default NULL, `sensor_limit` float default NULL, `sensor_limit_warn` float default NULL, `sensor_limit_low` float default NULL, `sensor_limit_low_warn` float default NULL, PRIMARY KEY (`sensor_id`), KEY `sensor_host` (`device_id`)) ENGINE=MyISAM AUTO_INCREMENT=189 DEFAULT CHARSET=latin1; CREATE TABLE IF NOT EXISTS `ports_adsl` ( `interface_id` int(11) NOT NULL, `port_adsl_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `adslLineCoding` varchar(8) COLLATE utf8_bin NOT NULL, `adslLineType` varchar(16) COLLATE utf8_bin NOT NULL, `adslAtucInvVendorID` varchar(8) COLLATE utf8_bin NOT NULL, `adslAtucInvVersionNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAtucCurrSnrMgn` decimal(5,1) NOT NULL, `adslAtucCurrAtn` decimal(5,1) NOT NULL, `adslAtucCurrOutputPwr` decimal(5,1) NOT NULL, `adslAtucCurrAttainableRate` int(11) NOT NULL, `adslAtucChanCurrTxRate` int(11) NOT NULL, `adslAturInvSerialNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturInvVendorID` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturInvVersionNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturChanCurrTxRate` int(11) NOT NULL, `adslAturCurrSnrMgn` decimal(5,1) NOT NULL, `adslAturCurrAtn` decimal(5,1) NOT NULL, `adslAturCurrOutputPwr` decimal(5,1) NOT NULL, `adslAturCurrAttainableRate` int(11) NOT NULL, UNIQUE KEY `interface_id` (`interface_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -## 0.10.7 CREATE TABLE IF NOT EXISTS `perf_times` ( `type` varchar(8) NOT NULL, `doing` varchar(64) NOT NULL, `start` int(11) NOT NULL, `duration` double(5,2) NOT NULL, `devices` int(11) NOT NULL, KEY `type` (`type`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -## 0.10.7.1 CREATE TABLE IF NOT EXISTS `device_graphs` ( `device_id` int(11) NOT NULL, `graph` varchar(32) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; CREATE TABLE IF NOT EXISTS `graph_types` ( `graph_type` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_subtype` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_section` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_descr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `graph_order` int(11) NOT NULL, KEY `graph_type` (`graph_type`), KEY `graph_subtype` (`graph_subtype`), KEY `graph_section` (`graph_section`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `graph_types` (`graph_type`, `graph_subtype`, `graph_section`, `graph_descr`, `graph_order`) VALUES('device', 'bits', 'netstats', 'Total Traffic', 0),('device', 'hr_users', 'system', 'Users Logged In', 0),('device', 'ucd_load', 'system', 'Load Averages', 0),('device', 'ucd_cpu', 'system', 'Detailed Processor Usage', 0),('device', 'ucd_memory', 'system', 'Detailed Memory Usage', 0),('device', 'netstat_tcp', 'netstats', 'TCP Statistics', 0),('device', 'netstat_icmp_info', 'netstats', 'ICMP Informational Statistics', 0),('device', 'netstat_icmp_stat', 'netstats', 'ICMP Statistics', 0),('device', 'netstat_ip', 'netstats', 'IP Statistics', 0),('device', 'netstat_ip_frag', 'netstats', 'IP Fragmentation Statistics', 0),('device', 'netstat_udp', 'netstats', 'UDP Statistics', 0),('device', 'netstat_snmp', 'netstats', 'SNMP Statistics', 0),('device', 'temperatures', 'system', 'Temperatures', 0),('device', 'mempools', 'system', 'Memory Pool Usage', 0),('device', 'processors', 'system', 'Processor Usage', 0),('device', 'storage', 'system', 'Filesystem Usage', 0),('device', 'hr_processes', 'system', 'Running Processes', 0),('device', 'uptime', 'system', 'System Uptime', 0),('device', 'ipsystemstats_ipv4', 'netstats', 'IPv4 Packet Statistics', 0),('device', 'ipsystemstats_ipv6_frag', 'netstats', 'IPv6 Fragmentation Statistics', 0),('device', 'ipsystemstats_ipv6', 'netstats', 'IPv6 Packet Statistics', 0),('device', 'ipsystemstats_ipv4_frag', 'netstats', 'IPv4 Fragmentation Statistics', 0),('device', 'fortigate_sessions', 'firewall', 'Active Sessions', 0), ('device', 'screenos_sessions', 'firewall', 'Active Sessions', 0), ('device', 'fdb_count', 'system', 'MAC Addresses Learnt', 0),('device', 'cras_sessions', 'firewall', 'Remote Access Sessions', 0); @@ -98,3 +95,448 @@ CREATE TABLE IF NOT EXISTS `slas` ( `sla_id` int(11) NOT NULL auto_increment, CREATE TABLE IF NOT EXISTS `munin_plugins` ( `mplug_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `mplug_type` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `mplug_instance` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_category` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_title` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_info` text CHARACTER SET utf8 COLLATE utf8_bin, `mplug_vlabel` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_args` varchar(512) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_total` binary(1) NOT NULL DEFAULT '0', `mplug_graph` binary(1) NOT NULL DEFAULT '1', PRIMARY KEY (`mplug_id`), UNIQUE KEY `UNIQUE` (`device_id`,`mplug_type`), KEY `device_id` (`device_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin ; CREATE TABLE IF NOT EXISTS `munin_plugins_ds` ( `mplug_id` int(11) NOT NULL, `ds_name` varchar(32) COLLATE utf8_bin NOT NULL, `ds_type` enum('COUNTER','ABSOLUTE','DERIVE','GAUGE') COLLATE utf8_bin NOT NULL DEFAULT 'GAUGE', `ds_label` varchar(64) COLLATE utf8_bin NOT NULL, `ds_cdef` text COLLATE utf8_bin NOT NULL, `ds_draw` varchar(64) COLLATE utf8_bin NOT NULL, `ds_graph` enum('no','yes') COLLATE utf8_bin NOT NULL DEFAULT 'yes', `ds_info` varchar(255) COLLATE utf8_bin NOT NULL, `ds_extinfo` text COLLATE utf8_bin NOT NULL, `ds_max` varchar(32) COLLATE utf8_bin NOT NULL, `ds_min` varchar(32) COLLATE utf8_bin NOT NULL, `ds_negative` varchar(32) COLLATE utf8_bin NOT NULL, `ds_warning` varchar(32) COLLATE utf8_bin NOT NULL, `ds_critical` varchar(32) COLLATE utf8_bin NOT NULL, `ds_colour` varchar(32) COLLATE utf8_bin NOT NULL, `ds_sum` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `ds_stack` text COLLATE utf8_bin NOT NULL, `ds_line` varchar(64) COLLATE utf8_bin NOT NULL, UNIQUE KEY `splug_id` (`mplug_id`,`ds_name`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; CREATE TABLE IF NOT EXISTS `access_points` ( `accesspoint_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `radio_number` tinyint(4) DEFAULT NULL, `type` varchar(16) NOT NULL, `mac_addr` varchar(24) NOT NULL, `deleted` tinyint(1) NOT NULL DEFAULT '0', `channel` tinyint(4) unsigned NOT NULL DEFAULT '0', `txpow` tinyint(4) NOT NULL DEFAULT '0', `radioutil` tinyint(4) NOT NULL DEFAULT '0', `numasoclients` smallint(6) NOT NULL DEFAULT '0', `nummonclients` smallint(6) NOT NULL DEFAULT '0', `numactbssid` tinyint(4) NOT NULL DEFAULT '0', `nummonbssid` tinyint(4) NOT NULL DEFAULT '0', `interference` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`accesspoint_id`), KEY `deleted` (`deleted`), KEY `name` (`name`,`radio_number`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Access Points'; +CREATE TABLE IF NOT EXISTS `alerts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `importance` int(11) NOT NULL DEFAULT '0', `device_id` int(11) NOT NULL, `message` text NOT NULL, `time_logged` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `alerted` smallint(6) NOT NULL DEFAULT '0', KEY `id` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `applications` ( `app_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `app_type` varchar(64) NOT NULL, PRIMARY KEY (`app_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `authlog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `user` text NOT NULL, `address` text NOT NULL, `result` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `bgpPeers` ( `bgpPeer_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `astext` varchar(64) NOT NULL, `bgpPeerIdentifier` text NOT NULL, `bgpPeerRemoteAs` int(11) NOT NULL, `bgpPeerState` text NOT NULL, `bgpPeerAdminStatus` text NOT NULL, `bgpLocalAddr` text NOT NULL, `bgpPeerRemoteAddr` text NOT NULL, `bgpPeerInUpdates` int(11) NOT NULL, `bgpPeerOutUpdates` int(11) NOT NULL, `bgpPeerInTotalMessages` int(11) NOT NULL, `bgpPeerOutTotalMessages` int(11) NOT NULL, `bgpPeerFsmEstablishedTime` int(11) NOT NULL, `bgpPeerInUpdateElapsedTime` int(11) NOT NULL, PRIMARY KEY (`bgpPeer_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `bgpPeers_cbgp` ( `device_id` int(11) NOT NULL, `bgpPeerIdentifier` varchar(64) NOT NULL, `afi` varchar(16) NOT NULL, `safi` varchar(16) NOT NULL, KEY `device_id` (`device_id`,`bgpPeerIdentifier`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `bills` ( `bill_id` int(11) NOT NULL AUTO_INCREMENT, `bill_name` text NOT NULL, `bill_type` text NOT NULL, `bill_cdr` int(11) DEFAULT NULL, `bill_day` int(11) NOT NULL DEFAULT '1', `bill_gb` int(11) DEFAULT NULL, `rate_95th_in` int(11) NOT NULL, `rate_95th_out` int(11) NOT NULL, `rate_95th` int(11) NOT NULL, `dir_95th` varchar(3) NOT NULL, `total_data` int(11) NOT NULL, `total_data_in` int(11) NOT NULL, `total_data_out` int(11) NOT NULL, `rate_average_in` int(11) NOT NULL, `rate_average_out` int(11) NOT NULL, `rate_average` int(11) NOT NULL, `bill_last_calc` datetime NOT NULL, `bill_custid` varchar(64) NOT NULL, `bill_ref` varchar(64) NOT NULL, `bill_notes` varchar(256) NOT NULL, `bill_autoadded` tinyint(1) NOT NULL, UNIQUE KEY `bill_id` (`bill_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; +CREATE TABLE IF NOT EXISTS `bill_data` ( `bill_id` int(11) NOT NULL, `timestamp` datetime NOT NULL, `period` int(11) NOT NULL, `delta` bigint(11) NOT NULL, `in_delta` bigint(11) NOT NULL, `out_delta` bigint(11) NOT NULL, KEY `bill_id` (`bill_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `bill_perms` ( `user_id` int(11) NOT NULL, `bill_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `bill_ports` ( `bill_id` int(11) NOT NULL, `port_id` int(11) NOT NULL, `bill_port_autoadded` tinyint(1) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `cef_switching` ( `cef_switching_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `entPhysicalIndex` int(11) NOT NULL, `afi` varchar(4) COLLATE utf8_unicode_ci NOT NULL, `cef_index` int(11) NOT NULL, `cef_path` varchar(16) COLLATE utf8_unicode_ci NOT NULL, `drop` int(11) NOT NULL, `punt` int(11) NOT NULL, `punt2host` int(11) NOT NULL, `drop_prev` int(11) NOT NULL, `punt_prev` int(11) NOT NULL, `punt2host_prev` int(11) NOT NULL, `updated` int(11) NOT NULL, `updated_prev` int(11) NOT NULL, PRIMARY KEY (`cef_switching_id`), UNIQUE KEY `device_id` (`device_id`,`entPhysicalIndex`,`afi`,`cef_index`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `customers` ( `customer_id` int(11) NOT NULL AUTO_INCREMENT, `username` char(64) NOT NULL, `password` char(32) NOT NULL, `string` char(64) NOT NULL, `level` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`customer_id`), UNIQUE KEY `username` (`username`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `dbSchema` ( `revision` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`revision`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `devices` ( `device_id` int(11) NOT NULL AUTO_INCREMENT, `hostname` varchar(128) CHARACTER SET latin1 NOT NULL, `sysName` varchar(128) CHARACTER SET latin1 DEFAULT NULL, `community` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `snmpver` varchar(4) CHARACTER SET latin1 NOT NULL DEFAULT 'v2c', `port` smallint(5) unsigned NOT NULL DEFAULT '161', `transport` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'udp', `timeout` int(11) DEFAULT NULL, `retries` int(11) DEFAULT NULL, `bgpLocalAs` varchar(16) CHARACTER SET latin1 DEFAULT NULL, `sysDescr` text CHARACTER SET latin1, `sysContact` text CHARACTER SET latin1, `version` text CHARACTER SET latin1, `hardware` text CHARACTER SET latin1, `features` text CHARACTER SET latin1, `location` text COLLATE utf8_unicode_ci, `os` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `status` tinyint(4) NOT NULL DEFAULT '0', `ignore` tinyint(4) NOT NULL DEFAULT '0', `disabled` tinyint(1) NOT NULL DEFAULT '0', `uptime` bigint(20) DEFAULT NULL, `agent_uptime` int(11) NOT NULL, `last_polled` timestamp NULL DEFAULT NULL, `last_polled_timetaken` double(5,2) DEFAULT NULL, `last_discovered_timetaken` double(5,2) DEFAULT NULL, `last_discovered` timestamp NULL DEFAULT NULL, `purpose` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, `type` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `serial` text COLLATE utf8_unicode_ci, PRIMARY KEY (`device_id`), KEY `status` (`status`), KEY `hostname` (`hostname`), KEY `sysName` (`sysName`), KEY `os` (`os`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `devices_attribs` ( `attrib_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `attrib_type` varchar(32) NOT NULL, `attrib_value` text NOT NULL, `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`attrib_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `devices_perms` ( `user_id` int(11) NOT NULL, `device_id` int(11) NOT NULL, `access_level` int(4) NOT NULL DEFAULT '0', KEY `user_id` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `device_graphs` ( `device_id` int(11) NOT NULL, `graph` varchar(32) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `entPhysical` ( `entPhysical_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `entPhysicalIndex` int(11) NOT NULL, `entPhysicalDescr` text NOT NULL, `entPhysicalClass` text NOT NULL, `entPhysicalName` text NOT NULL, `entPhysicalHardwareRev` varchar(64) DEFAULT NULL, `entPhysicalFirmwareRev` varchar(64) DEFAULT NULL, `entPhysicalSoftwareRev` varchar(64) DEFAULT NULL, `entPhysicalAlias` varchar(32) DEFAULT NULL, `entPhysicalAssetID` varchar(32) DEFAULT NULL, `entPhysicalIsFRU` varchar(8) DEFAULT NULL, `entPhysicalModelName` text NOT NULL, `entPhysicalVendorType` text, `entPhysicalSerialNum` text NOT NULL, `entPhysicalContainedIn` int(11) NOT NULL, `entPhysicalParentRelPos` int(11) NOT NULL, `entPhysicalMfgName` text NOT NULL, `ifIndex` int(11) DEFAULT NULL, PRIMARY KEY (`entPhysical_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `eventlog` ( `event_id` int(11) NOT NULL AUTO_INCREMENT, `host` int(11) NOT NULL DEFAULT '0', `datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `message` text CHARACTER SET latin1, `type` varchar(64) CHARACTER SET latin1 DEFAULT NULL, `reference` varchar(64) CHARACTER SET latin1 NOT NULL, PRIMARY KEY (`event_id`), KEY `host` (`host`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `graph_types` ( `graph_type` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_subtype` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_section` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_descr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `graph_order` int(11) NOT NULL, KEY `graph_type` (`graph_type`), KEY `graph_subtype` (`graph_subtype`), KEY `graph_section` (`graph_section`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `graph_types_dead` ( `graph_type` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_subtype` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_section` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_descr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `graph_order` int(11) NOT NULL, KEY `graph_type` (`graph_type`), KEY `graph_subtype` (`graph_subtype`), KEY `graph_section` (`graph_section`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `hrDevice` ( `hrDevice_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `hrDeviceIndex` int(11) NOT NULL, `hrDeviceDescr` text CHARACTER SET latin1 NOT NULL, `hrDeviceType` text CHARACTER SET latin1 NOT NULL, `hrDeviceErrors` int(11) NOT NULL, `hrDeviceStatus` text CHARACTER SET latin1 NOT NULL, `hrProcessorLoad` tinyint(4) DEFAULT NULL, PRIMARY KEY (`hrDevice_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `ipv4_addresses` ( `ipv4_address_id` int(11) NOT NULL AUTO_INCREMENT,`ipv4_address` varchar(32) CHARACTER SET latin1 NOT NULL, `ipv4_prefixlen` int(11) NOT NULL,`ipv4_network_id` varchar(32) CHARACTER SET latin1 NOT NULL, `interface_id` int(11) NOT NULL,PRIMARY KEY (`ipv4_address_id`), KEY `interface_id` (`interface_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `ipv4_mac` ( `interface_id` int(11) NOT NULL, `mac_address` varchar(32) CHARACTER SET latin1 NOT NULL, `ipv4_address` varchar(32) CHARACTER SET latin1 NOT NULL, KEY `interface_id` (`interface_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `ipv4_networks` ( `ipv4_network_id` int(11) NOT NULL AUTO_INCREMENT, `ipv4_network` varchar(64) CHARACTER SET latin1 NOT NULL, PRIMARY KEY (`ipv4_network_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `ipv6_addresses` ( `ipv6_address_id` int(11) NOT NULL AUTO_INCREMENT, `ipv6_address` varchar(128) CHARACTER SET latin1 NOT NULL, `ipv6_compressed` varchar(128) CHARACTER SET latin1 NOT NULL, `ipv6_prefixlen` int(11) NOT NULL, `ipv6_origin` varchar(16) CHARACTER SET latin1 NOT NULL, `ipv6_network_id` varchar(128) CHARACTER SET latin1 NOT NULL, `interface_id` int(11) NOT NULL, PRIMARY KEY (`ipv6_address_id`), KEY `interface_id` (`interface_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `ipv6_networks` ( `ipv6_network_id` int(11) NOT NULL AUTO_INCREMENT, `ipv6_network` varchar(64) CHARACTER SET latin1 NOT NULL, PRIMARY KEY (`ipv6_network_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `juniAtmVp` ( `juniAtmVp_id` int(11) NOT NULL, `interface_id` int(11) NOT NULL, `vp_id` int(11) NOT NULL, `vp_descr` varchar(32) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `links` ( `id` int(11) NOT NULL AUTO_INCREMENT, `local_interface_id` int(11) DEFAULT NULL, `remote_interface_id` int(11) DEFAULT NULL, `active` tinyint(4) NOT NULL DEFAULT '1', `protocol` varchar(11) DEFAULT NULL, `remote_hostname` varchar(128) NOT NULL, `remote_port` varchar(128) NOT NULL, `remote_platform` varchar(128) NOT NULL, `remote_version` varchar(256) NOT NULL, PRIMARY KEY (`id`), KEY `src_if` (`local_interface_id`), KEY `dst_if` (`remote_interface_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `mac_accounting` ( `ma_id` int(11) NOT NULL AUTO_INCREMENT, `interface_id` int(11) NOT NULL, `mac` varchar(32) NOT NULL, `in_oid` varchar(128) NOT NULL, `out_oid` varchar(128) NOT NULL, `bps_out` int(11) NOT NULL, `bps_in` int(11) NOT NULL, `cipMacHCSwitchedBytes_input` bigint(20) DEFAULT NULL, `cipMacHCSwitchedBytes_input_prev` bigint(20) DEFAULT NULL, `cipMacHCSwitchedBytes_input_delta` bigint(20) DEFAULT NULL, `cipMacHCSwitchedBytes_input_rate` int(11) DEFAULT NULL, `cipMacHCSwitchedBytes_output` bigint(20) DEFAULT NULL, `cipMacHCSwitchedBytes_output_prev` bigint(20) DEFAULT NULL, `cipMacHCSwitchedBytes_output_delta` bigint(20) DEFAULT NULL, `cipMacHCSwitchedBytes_output_rate` int(11) DEFAULT NULL, `cipMacHCSwitchedPkts_input` bigint(20) DEFAULT NULL, `cipMacHCSwitchedPkts_input_prev` bigint(20) DEFAULT NULL, `cipMacHCSwitchedPkts_input_delta` bigint(20) DEFAULT NULL, `cipMacHCSwitchedPkts_input_rate` int(11) DEFAULT NULL, `cipMacHCSwitchedPkts_output` bigint(20) DEFAULT NULL, `cipMacHCSwitchedPkts_output_prev` bigint(20) DEFAULT NULL, `cipMacHCSwitchedPkts_output_delta` bigint(20) DEFAULT NULL, `cipMacHCSwitchedPkts_output_rate` int(11) DEFAULT NULL, `poll_time` int(11) DEFAULT NULL, `poll_prev` int(11) DEFAULT NULL, `poll_period` int(11) DEFAULT NULL, PRIMARY KEY (`ma_id`), KEY `interface_id` (`interface_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `mempools` ( `mempool_id` int(11) NOT NULL AUTO_INCREMENT, `mempool_index` varchar(16) CHARACTER SET latin1 NOT NULL, `entPhysicalIndex` int(11) DEFAULT NULL, `hrDeviceIndex` int(11) DEFAULT NULL, `mempool_type` varchar(32) CHARACTER SET latin1 NOT NULL, `mempool_precision` int(11) NOT NULL DEFAULT '1', `mempool_descr` varchar(64) CHARACTER SET latin1 NOT NULL, `device_id` int(11) NOT NULL, `mempool_perc` int(11) NOT NULL, `mempool_used` bigint(16) NOT NULL, `mempool_free` bigint(16) NOT NULL, `mempool_total` bigint(16) NOT NULL, `mempool_largestfree` bigint(16) DEFAULT NULL, `mempool_lowestfree` bigint(16) DEFAULT NULL, PRIMARY KEY (`mempool_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `ospf_areas` ( `device_id` int(11) NOT NULL, `ospfAreaId` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfAuthType` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `ospfImportAsExtern` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `ospfSpfRuns` int(11) NOT NULL, `ospfAreaBdrRtrCount` int(11) NOT NULL, `ospfAsBdrRtrCount` int(11) NOT NULL, `ospfAreaLsaCount` int(11) NOT NULL, `ospfAreaLsaCksumSum` int(11) NOT NULL, `ospfAreaSummary` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `ospfAreaStatus` varchar(64) COLLATE utf8_unicode_ci NOT NULL, UNIQUE KEY `device_area` (`device_id`,`ospfAreaId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `ospf_instances` ( `device_id` int(11) NOT NULL, `ospf_instance_id` int(11) NOT NULL, `ospfRouterId` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfAdminStat` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfVersionNumber` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfAreaBdrRtrStatus` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfASBdrRtrStatus` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfExternLsaCount` int(11) NOT NULL, `ospfExternLsaCksumSum` int(11) NOT NULL, `ospfTOSSupport` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfOriginateNewLsas` int(11) NOT NULL, `ospfRxNewLsas` int(11) NOT NULL, `ospfExtLsdbLimit` int(11) DEFAULT NULL, `ospfMulticastExtensions` int(11) DEFAULT NULL, `ospfExitOverflowInterval` int(11) DEFAULT NULL, `ospfDemandExtensions` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, UNIQUE KEY `device_id` (`device_id`,`ospf_instance_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `ospf_nbrs` ( `device_id` int(11) NOT NULL, `interface_id` int(11) NOT NULL, `ospf_nbr_id` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbrIpAddr` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbrAddressLessIndex` int(11) NOT NULL, `ospfNbrRtrId` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbrOptions` int(11) NOT NULL, `ospfNbrPriority` int(11) NOT NULL, `ospfNbrState` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbrEvents` int(11) NOT NULL, `ospfNbrLsRetransQLen` int(11) NOT NULL, `ospfNbmaNbrStatus` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbmaNbrPermanence` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbrHelloSuppressed` varchar(32) COLLATE utf8_unicode_ci NOT NULL, UNIQUE KEY `device_id` (`device_id`,`ospf_nbr_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `ospf_ports` ( `device_id` int(11) NOT NULL, `interface_id` int(11) NOT NULL, `ospf_port_id` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfIfIpAddress` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfAddressLessIf` int(11) NOT NULL, `ospfIfAreaId` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfIfType` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfAdminStat` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfRtrPriority` int(11) DEFAULT NULL, `ospfIfTransitDelay` int(11) DEFAULT NULL, `ospfIfRetransInterval` int(11) DEFAULT NULL, `ospfIfHelloInterval` int(11) DEFAULT NULL, `ospfIfRtrDeadInterval` int(11) DEFAULT NULL, `ospfIfPollInterval` int(11) DEFAULT NULL, `ospfIfState` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfDesignatedRouter` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfBackupDesignatedRouter` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfEvents` int(11) DEFAULT NULL, `ospfIfAuthKey` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfStatus` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfMulticastForwarding` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfDemand` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfAuthType` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, UNIQUE KEY `device_id` (`device_id`,`ospf_port_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `perf_times` ( `type` varchar(8) CHARACTER SET latin1 NOT NULL, `doing` varchar(64) CHARACTER SET latin1 NOT NULL, `start` int(11) NOT NULL, `duration` double(8,2) NOT NULL, `devices` int(11) NOT NULL, KEY `type` (`type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `ports` ( `interface_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL DEFAULT '0', `port_descr_type` varchar(255) DEFAULT NULL, `port_descr_descr` varchar(255) DEFAULT NULL, `port_descr_circuit` varchar(255) DEFAULT NULL, `port_descr_speed` varchar(32) DEFAULT NULL, `port_descr_notes` varchar(255) DEFAULT NULL, `ifDescr` varchar(255) DEFAULT NULL, `ifName` varchar(64) DEFAULT NULL, `portName` varchar(128) DEFAULT NULL, `ifIndex` int(11) DEFAULT '0', `ifSpeed` bigint(20) DEFAULT NULL, `ifConnectorPresent` varchar(12) DEFAULT NULL, `ifPromiscuousMode` varchar(12) DEFAULT NULL, `ifHighSpeed` int(11) DEFAULT NULL, `ifOperStatus` varchar(16) DEFAULT NULL, `ifAdminStatus` varchar(16) DEFAULT NULL, `ifDuplex` varchar(12) DEFAULT NULL, `ifMtu` int(11) DEFAULT NULL, `ifType` text, `ifAlias` text, `ifPhysAddress` text, `ifHardType` varchar(64) DEFAULT NULL, `ifLastChange` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `ifVlan` varchar(8) NOT NULL DEFAULT '', `ifTrunk` varchar(8) DEFAULT '', `ifVrf` int(11) NOT NULL, `counter_in` int(11) DEFAULT NULL, `counter_out` int(11) DEFAULT NULL, `ignore` tinyint(1) NOT NULL DEFAULT '0', `disabled` tinyint(1) NOT NULL DEFAULT '0', `detailed` tinyint(1) NOT NULL DEFAULT '0', `deleted` tinyint(1) NOT NULL DEFAULT '0', `pagpOperationMode` varchar(32) DEFAULT NULL, `pagpPortState` varchar(16) DEFAULT NULL, `pagpPartnerDeviceId` varchar(48) DEFAULT NULL, `pagpPartnerLearnMethod` varchar(16) DEFAULT NULL, `pagpPartnerIfIndex` int(11) DEFAULT NULL, `pagpPartnerGroupIfIndex` int(11) DEFAULT NULL, `pagpPartnerDeviceName` varchar(128) DEFAULT NULL, `pagpEthcOperationMode` varchar(16) DEFAULT NULL, `pagpDeviceId` varchar(48) DEFAULT NULL, `pagpGroupIfIndex` int(11) DEFAULT NULL, `ifInUcastPkts` bigint(20) DEFAULT NULL, `ifInUcastPkts_prev` bigint(20) DEFAULT NULL, `ifInUcastPkts_delta` bigint(20) DEFAULT NULL, `ifInUcastPkts_rate` int(11) DEFAULT NULL, `ifOutUcastPkts` bigint(20) DEFAULT NULL, `ifOutUcastPkts_prev` bigint(20) DEFAULT NULL, `ifOutUcastPkts_delta` bigint(20) DEFAULT NULL, `ifOutUcastPkts_rate` int(11) DEFAULT NULL, `ifInErrors` bigint(20) DEFAULT NULL, `ifInErrors_prev` bigint(20) DEFAULT NULL, `ifInErrors_delta` bigint(20) DEFAULT NULL, `ifInErrors_rate` int(11) DEFAULT NULL, `ifOutErrors` bigint(20) DEFAULT NULL, `ifOutErrors_prev` bigint(20) DEFAULT NULL, `ifOutErrors_delta` bigint(20) DEFAULT NULL, `ifOutErrors_rate` int(11) DEFAULT NULL, `ifInOctets` bigint(20) DEFAULT NULL, `ifInOctets_prev` bigint(20) DEFAULT NULL, `ifInOctets_delta` bigint(20) DEFAULT NULL, `ifInOctets_rate` int(11) DEFAULT NULL, `ifOutOctets` bigint(20) DEFAULT NULL, `ifOutOctets_prev` bigint(20) DEFAULT NULL, `ifOutOctets_delta` bigint(20) DEFAULT NULL, `ifOutOctets_rate` int(11) DEFAULT NULL, `poll_time` int(11) DEFAULT NULL, `poll_prev` int(11) DEFAULT NULL, `poll_period` int(11) DEFAULT NULL, PRIMARY KEY (`interface_id`), UNIQUE KEY `device_ifIndex` (`device_id`,`ifIndex`), KEY `if_2` (`ifDescr`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `ports_adsl` ( `interface_id` int(11) NOT NULL, `port_adsl_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `adslLineCoding` varchar(8) COLLATE utf8_bin NOT NULL, `adslLineType` varchar(16) COLLATE utf8_bin NOT NULL, `adslAtucInvVendorID` varchar(8) COLLATE utf8_bin NOT NULL, `adslAtucInvVersionNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAtucCurrSnrMgn` decimal(5,1) NOT NULL, `adslAtucCurrAtn` decimal(5,1) NOT NULL, `adslAtucCurrOutputPwr` decimal(5,1) NOT NULL, `adslAtucCurrAttainableRate` int(11) NOT NULL, `adslAtucChanCurrTxRate` int(11) NOT NULL, `adslAturInvSerialNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturInvVendorID` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturInvVersionNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturChanCurrTxRate` int(11) NOT NULL, `adslAturCurrSnrMgn` decimal(5,1) NOT NULL, `adslAturCurrAtn` decimal(5,1) NOT NULL, `adslAturCurrOutputPwr` decimal(5,1) NOT NULL, `adslAturCurrAttainableRate` int(11) NOT NULL, UNIQUE KEY `interface_id` (`interface_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +CREATE TABLE IF NOT EXISTS `ports_perms` ( `user_id` int(11) NOT NULL, `interface_id` int(11) NOT NULL, `access_level` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `ports_stack` ( `device_id` int(11) NOT NULL, `interface_id_high` int(11) NOT NULL, `interface_id_low` int(11) NOT NULL, `ifStackStatus` varchar(32) COLLATE utf8_unicode_ci NOT NULL, UNIQUE KEY `device_id` (`device_id`,`interface_id_high`,`interface_id_low`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `port_in_measurements` ( `port_id` int(11) NOT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `counter` bigint(11) NOT NULL, `delta` bigint(11) NOT NULL, KEY `port_id` (`port_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `port_out_measurements` ( `port_id` int(11) NOT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `counter` bigint(11) NOT NULL, `delta` bigint(11) NOT NULL, KEY `port_id` (`port_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `processors` ( `processor_id` int(11) NOT NULL AUTO_INCREMENT, `entPhysicalIndex` int(11) NOT NULL, `hrDeviceIndex` int(11) DEFAULT NULL, `device_id` int(11) NOT NULL, `processor_oid` varchar(128) CHARACTER SET latin1 NOT NULL, `processor_index` varchar(32) CHARACTER SET latin1 NOT NULL, `processor_type` varchar(16) CHARACTER SET latin1 NOT NULL, `processor_usage` int(11) NOT NULL, `processor_descr` varchar(64) CHARACTER SET latin1 NOT NULL, `processor_precision` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`processor_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `pseudowires` ( `pseudowire_id` int(11) NOT NULL AUTO_INCREMENT, `interface_id` int(11) NOT NULL, `peer_device_id` int(11) NOT NULL, `peer_ldp_id` int(11) NOT NULL, `cpwVcID` int(11) NOT NULL, `cpwOid` int(11) NOT NULL, PRIMARY KEY (`pseudowire_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `sensors` ( `sensor_id` int(11) NOT NULL AUTO_INCREMENT, `sensor_class` varchar(64) CHARACTER SET latin1 NOT NULL, `device_id` int(11) NOT NULL DEFAULT '0', `poller_type` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'snmp', `sensor_oid` varchar(64) CHARACTER SET latin1 NOT NULL, `sensor_index` varchar(10) COLLATE utf8_unicode_ci NOT NULL, `sensor_type` varchar(255) CHARACTER SET latin1 NOT NULL, `sensor_descr` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `sensor_divisor` int(11) NOT NULL DEFAULT '1', `sensor_multiplier` int(11) NOT NULL DEFAULT '1', `sensor_current` float DEFAULT NULL, `sensor_limit` float DEFAULT NULL, `sensor_limit_warn` float DEFAULT NULL, `sensor_limit_low` float DEFAULT NULL, `sensor_limit_low_warn` float DEFAULT NULL, `entPhysicalIndex` varchar(16) CHARACTER SET latin1 DEFAULT NULL, `entPhysicalIndex_measured` varchar(16) CHARACTER SET latin1 DEFAULT NULL, PRIMARY KEY (`sensor_id`), KEY `sensor_host` (`device_id`), KEY `sensor_class` (`sensor_class`), KEY `sensor_type` (`sensor_type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `services` ( `service_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `service_ip` text NOT NULL, `service_type` varchar(16) NOT NULL, `service_desc` text NOT NULL, `service_param` text NOT NULL, `service_ignore` tinyint(1) NOT NULL, `service_status` tinyint(4) NOT NULL DEFAULT '0', `service_checked` int(11) NOT NULL DEFAULT '0', `service_changed` int(11) NOT NULL DEFAULT '0', `service_message` text NOT NULL, `service_disabled` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`service_id`), KEY `service_host` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `storage` ( `storage_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `storage_mib` varchar(16) NOT NULL, `storage_index` int(11) NOT NULL, `storage_type` varchar(32) DEFAULT NULL, `storage_descr` text NOT NULL, `storage_size` bigint(20) NOT NULL, `storage_units` int(11) NOT NULL, `storage_used` bigint(20) NOT NULL, `storage_free` bigint(20) NOT NULL, `storage_perc` text NOT NULL, `storage_perc_warn` int(11) DEFAULT '60', PRIMARY KEY (`storage_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `syslog` ( `device_id` int(11) DEFAULT NULL, `facility` varchar(10) DEFAULT NULL, `priority` varchar(10) DEFAULT NULL, `level` varchar(10) DEFAULT NULL, `tag` varchar(10) DEFAULT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `program` varchar(32) DEFAULT NULL, `msg` text, `seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`seq`), KEY `datetime` (`timestamp`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `toner` ( `toner_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL DEFAULT '0', `toner_index` int(11) NOT NULL, `toner_type` varchar(64) NOT NULL, `toner_oid` varchar(64) NOT NULL, `toner_descr` varchar(32) NOT NULL DEFAULT '', `toner_capacity` int(11) NOT NULL DEFAULT '0', `toner_current` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`toner_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `ucd_diskio` ( `diskio_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `diskio_index` int(11) NOT NULL, `diskio_descr` varchar(32) CHARACTER SET latin1 NOT NULL, PRIMARY KEY (`diskio_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `users` ( `user_id` int(11) NOT NULL AUTO_INCREMENT, `username` char(30) NOT NULL, `password` varchar(34) DEFAULT NULL, `realname` varchar(64) NOT NULL, `email` varchar(64) NOT NULL, `descr` char(30) NOT NULL, `level` tinyint(4) NOT NULL DEFAULT '0', `can_modify_passwd` tinyint(4) NOT NULL DEFAULT '1', PRIMARY KEY (`user_id`), UNIQUE KEY `username` (`username`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `users_prefs` ( `user_id` int(16) NOT NULL, `pref` varchar(32) NOT NULL, `value` varchar(128) NOT NULL, PRIMARY KEY (`user_id`), UNIQUE KEY `user_id.pref` (`user_id`,`pref`), KEY `pref` (`pref`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `vlans` ( `vlan_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) DEFAULT NULL, `vlan_vlan` int(11) DEFAULT NULL, `vlan_domain` text, `vlan_descr` text, PRIMARY KEY (`vlan_id`), KEY `device_id` (`device_id`,`vlan_vlan`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `vminfo` ( `id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `vm_type` varchar(16) NOT NULL DEFAULT 'vmware', `vmwVmVMID` int(11) NOT NULL, `vmwVmDisplayName` varchar(128) NOT NULL, `vmwVmGuestOS` varchar(128) NOT NULL, `vmwVmMemSize` int(11) NOT NULL, `vmwVmCpus` int(11) NOT NULL, `vmwVmState` varchar(128) NOT NULL, PRIMARY KEY (`id`), KEY `device_id` (`device_id`), KEY `vmwVmVMID` (`vmwVmVMID`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `vmware_vminfo` ( `id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `vmwVmVMID` int(11) NOT NULL, `vmwVmDisplayName` varchar(128) NOT NULL, `vmwVmGuestOS` varchar(128) NOT NULL, `vmwVmMemSize` int(11) NOT NULL, `vmwVmCpus` int(11) NOT NULL, `vmwVmState` varchar(128) NOT NULL, PRIMARY KEY (`id`), KEY `device_id` (`device_id`), KEY `vmwVmVMID` (`vmwVmVMID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `vrfs` ( `vrf_id` int(11) NOT NULL AUTO_INCREMENT, `vrf_oid` varchar(256) NOT NULL, `vrf_name` varchar(128) DEFAULT NULL, `mplsVpnVrfRouteDistinguisher` varchar(128) DEFAULT NULL, `mplsVpnVrfDescription` text NOT NULL, `device_id` int(11) NOT NULL, PRIMARY KEY (`vrf_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `bill_history` ( `bill_hist_id` int(11) NOT NULL AUTO_INCREMENT, `bill_id` int(11) NOT NULL, `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `bill_datefrom` datetime NOT NULL, `bill_dateto` datetime NOT NULL, `bill_type` text NOT NULL, `bill_allowed` bigint(20) NOT NULL, `bill_used` bigint(20) NOT NULL, `bill_overuse` bigint(20) NOT NULL, `bill_percent` decimal(10,2) NOT NULL, `rate_95th_in` bigint(20) NOT NULL, `rate_95th_out` bigint(20) NOT NULL, `rate_95th` bigint(20) NOT NULL, `dir_95th` varchar(3) NOT NULL, `rate_average` bigint(20) NOT NULL, `rate_average_in` bigint(20) NOT NULL, `rate_average_out` bigint(20) NOT NULL, `traf_in` bigint(20) NOT NULL, `traf_out` bigint(20) NOT NULL, `traf_total` bigint(20) NOT NULL, `pdf` longblob, PRIMARY KEY (`bill_hist_id`), UNIQUE KEY `unique_index` (`bill_id`,`bill_datefrom`,`bill_dateto`), KEY `bill_id` (`bill_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; +CREATE TABLE IF NOT EXISTS `entPhysical_state` ( `device_id` int(11) NOT NULL, `entPhysicalIndex` varchar(64) NOT NULL, `subindex` varchar(64) DEFAULT NULL, `group` varchar(64) NOT NULL, `key` varchar(64) NOT NULL, `value` varchar(255) NOT NULL, KEY `device_id_index` (`device_id`,`entPhysicalIndex`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `ports_vlans` ( `port_vlan_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `interface_id` int(11) NOT NULL, `vlan` int(11) NOT NULL, `baseport` int(11) NOT NULL, `priority` bigint(32) NOT NULL, `state` varchar(16) NOT NULL, `cost` int(11) NOT NULL, PRIMARY KEY (`port_vlan_id`), UNIQUE KEY `unique` (`device_id`,`interface_id`,`vlan`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; +CREATE TABLE IF NOT EXISTS `netscaler_vservers` ( `vsvr_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `vsvr_name` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `vsvr_ip` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `vsvr_port` int(8) NOT NULL, `vsvr_type` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `vsvr_state` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `vsvr_clients` int(11) NOT NULL, `vsvr_server` int(11) NOT NULL, `vsvr_req_rate` int(11) NOT NULL, `vsvr_bps_in` int(11) NOT NULL, `vsvr_bps_out` int(11) NOT NULL, PRIMARY KEY (`vsvr_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedBytes_input` bigint(20) default NULL; +ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedBytes_input_prev` bigint(20) default NULL; +ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedBytes_input_delta` bigint(20) default NULL; +ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedBytes_input_rate` int(11) default NULL; +ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedBytes_output` bigint(20) default NULL; +ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedBytes_output_prev` bigint(20) default NULL; +ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedBytes_output_delta` bigint(20) default NULL; +ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedBytes_output_rate` int(11) default NULL; +ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedPkts_input` bigint(20) default NULL; +ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedPkts_input_prev` bigint(20) default NULL; +ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedPkts_input_delta` bigint(20) default NULL; +ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedPkts_input_rate` int(11) default NULL; +ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedPkts_output` bigint(20) default NULL; +ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedPkts_output_prev` bigint(20) default NULL; +ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedPkts_output_delta` bigint(20) default NULL; +ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedPkts_output_rate` int(11) default NULL; +ALTER TABLE `mac_accounting` ADD `poll_time` int(11) default NULL; +ALTER TABLE `mac_accounting` ADD `poll_prev` int(11) default NULL; +ALTER TABLE `mac_accounting` ADD `poll_period` int(11) default NULL; +ALTER TABLE `interfaces` ADD `ifInUcastPkts` bigint(20) default NULL; +ALTER TABLE `interfaces` ADD `ifInUcastPkts_prev` bigint(20) default NULL; +ALTER TABLE `interfaces` ADD `ifInUcastPkts_delta` bigint(20) default NULL; +ALTER TABLE `interfaces` ADD `ifInUcastPkts_rate` int(11) default NULL; +ALTER TABLE `interfaces` ADD `ifOutUcastPkts` bigint(20) default NULL; +ALTER TABLE `interfaces` ADD `ifOutUcastPkts_prev` bigint(20) default NULL; +ALTER TABLE `interfaces` ADD `ifOutUcastPkts_delta` bigint(20) default NULL; +ALTER TABLE `interfaces` ADD `ifOutUcastPkts_rate` int(11) default NULL; +ALTER TABLE `interfaces` ADD `ifInErrors` bigint(20) default NULL; +ALTER TABLE `interfaces` ADD `ifInErrors_prev` bigint(20) default NULL; +ALTER TABLE `interfaces` ADD `ifInErrors_delta` bigint(20) default NULL; +ALTER TABLE `interfaces` ADD `ifInErrors_rate` int(11) default NULL; +ALTER TABLE `interfaces` ADD `ifOutErrors` bigint(20) default NULL; +ALTER TABLE `interfaces` ADD `ifOutErrors_prev` bigint(20) default NULL; +ALTER TABLE `interfaces` ADD `ifOutErrors_delta` bigint(20) default NULL; +ALTER TABLE `interfaces` ADD `ifOutErrors_rate` int(11) default NULL; +ALTER TABLE `interfaces` ADD `ifInOctets` bigint(20) default NULL; +ALTER TABLE `interfaces` ADD `ifInOctets_prev` bigint(20) default NULL; +ALTER TABLE `interfaces` ADD `ifInOctets_delta` bigint(20) default NULL; +ALTER TABLE `interfaces` ADD `ifInOctets_rate` int(11) default NULL; +ALTER TABLE `interfaces` ADD `ifOutOctets` bigint(20) default NULL; +ALTER TABLE `interfaces` ADD `ifOutOctets_prev` bigint(20) default NULL; +ALTER TABLE `interfaces` ADD `ifOutOctets_delta` bigint(20) default NULL; +ALTER TABLE `interfaces` ADD `ifOutOctets_rate` int(11) default NULL; +ALTER TABLE `interfaces` ADD `poll_time` int(11) default NULL; +ALTER TABLE `interfaces` ADD `poll_prev` int(11) default NULL; +ALTER TABLE `interfaces` ADD `poll_period` int(11) default NULL; +ALTER TABLE `interfaces` ADD `pagpOperationMode` VARCHAR( 32 ) NULL ; +ALTER TABLE `interfaces` ADD `pagpPortState` VARCHAR( 16 ) NULL ; +ALTER TABLE `interfaces` ADD `pagpPartnerDeviceId` VARCHAR( 48 ) NULL ; +ALTER TABLE `interfaces` ADD `pagpPartnerLearnMethod` VARCHAR( 16 ) NULL ; +ALTER TABLE `interfaces` ADD `pagpPartnerIfIndex` INT NULL ; +ALTER TABLE `interfaces` ADD `pagpPartnerGroupIfIndex` INT NULL ; +ALTER TABLE `interfaces` ADD `pagpPartnerDeviceName` VARCHAR( 128 ) NULL ; +ALTER TABLE `interfaces` ADD `pagpEthcOperationMode` VARCHAR( 16 ) NULL ; +ALTER TABLE `interfaces` ADD `pagpDeviceId` VARCHAR( 48 ) NULL ; +ALTER TABLE `interfaces` ADD `pagpGroupIfIndex` INT NULL ; +ALTER TABLE `interfaces` ADD `ifPromiscuousMode` VARCHAR( 12 ) NULL DEFAULT NULL AFTER `ifSpeed`; +ALTER TABLE `interfaces` ADD `ifConnectorPresent` VARCHAR( 12 ) NULL DEFAULT NULL AFTER `ifSpeed`; +ALTER TABLE `interfaces` ADD `ifName` VARCHAR( 64 ) NULL DEFAULT NULL AFTER `ifDescr`; +ALTER TABLE `interfaces` ADD `portName` VARCHAR( 128 ) NULL DEFAULT NULL AFTER `ifName`; +ALTER TABLE `interfaces` ADD `ifHighSpeed` BIGINT ( 20 ) NULL DEFAULT NULL AFTER `ifSpeed`; +ALTER TABLE `interfaces` DROP `in_rate`; +ALTER TABLE `interfaces` DROP `out_rate`; +ALTER TABLE `interfaces` DROP `in_errors`; +ALTER TABLE `interfaces` DROP `out_errors`; +CREATE TABLE IF NOT EXISTS `cmpMemPool` ( `cmp_id` int(11) NOT NULL auto_increment, `Index` varchar(8) NOT NULL, `cmpName` varchar(32) NOT NULL, `cmpValid` varchar(8) NOT NULL, `device_id` int(11) NOT NULL, `cmpUsed` int(11) NOT NULL, `cmpFree` int(11) NOT NULL, `cmpLargestFree` int(11) NOT NULL, `cmpAlternate` tinyint(4) default NULL, PRIMARY KEY (`cmp_id`), KEY `device_id` (`device_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1; +CREATE TABLE IF NOT EXISTS `hrDevice` ( `hrDevice_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL, `hrDeviceIndex` int(11) NOT NULL, `hrDeviceDescr` text NOT NULL, `hrDeviceType` text NOT NULL, `hrDeviceErrors` int(11) NOT NULL, `hrDeviceStatus` text NOT NULL, `hrProcessorLoad` tinyint(4) default NULL, PRIMARY KEY (`hrDevice_id`), KEY `device_id` (`device_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1; +ALTER TABLE `entPhysical` ADD `entPhysicalHardwareRev` VARCHAR( 16 ) NULL AFTER `entPhysicalName` ,ADD `entPhysicalFirmwareRev` VARCHAR( 16 ) NULL AFTER `entPhysicalHardwareRev` ,ADD `entPhysicalSoftwareRev` VARCHAR( 16 ) NULL AFTER `entPhysicalFirmwareRev` ,ADD `entPhysicalAlias` VARCHAR( 32 ) NULL AFTER `entPhysicalSoftwareRev` ,ADD `entPhysicalAssetID` VARCHAR( 32 ) NULL AFTER `entPhysicalAlias` ,ADD `entPhysicalIsFRU` VARCHAR( 8 ) NULL AFTER `entPhysicalAssetID`; +ALTER TABLE `devices` ADD `last_discovered` timestamp NULL DEFAULT NULL AFTER `last_polled`; +ALTER TABLE `devices` CHANGE `lastchange` `uptime` BIGINT NULL DEFAULT NULL; +ALTER TABLE `storage` ADD `hrStorageType` VARCHAR( 32 ) NULL DEFAULT NULL AFTER `hrStorageIndex`; +ALTER TABLE `devices` MODIFY `type` varchar(8) DEFAULT 'unknown'; +ALTER TABLE `devices` CHANGE `os` `os` VARCHAR( 32 ) NULL DEFAULT NULL; +ALTER TABLE `temperature` ADD `temp_precision` INT(11) NULL DEFAULT '1'; +UPDATE temperature SET temp_precision=10 WHERE temp_tenths=1; +ALTER TABLE `temperature` ADD `temp_index` INT NOT NULL AFTER `temp_host` , ADD `temp_mibtype` VARCHAR( 32 ) NOT NULL AFTER `temp_index`; +ALTER TABLE `temperature` DROP `temp_tenths`; +CREATE TABLE IF NOT EXISTS `dbSchema` ( `revision` int(11) NOT NULL default '0', PRIMARY KEY (`revision`)) ENGINE=MyISAM DEFAULT CHARSET=latin1; +ALTER TABLE `storage` ADD `storage_perc_warn` INT(11) NULL DEFAULT '60'; +CREATE TABLE IF NOT EXISTS `voltage` ( `volt_id` int(11) NOT NULL auto_increment, `volt_host` int(11) NOT NULL default '0', `volt_oid` varchar(64) NOT NULL, `volt_descr` varchar(32) NOT NULL default '', `volt_precision` int(11) NOT NULL default '1', `volt_current` int(11) NOT NULL default '0', `volt_limit` int(11) NOT NULL default '60', PRIMARY KEY (`volt_id`), KEY `volt_host` (`volt_host`)) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE IF NOT EXISTS `fanspeed` ( `fan_id` int(11) NOT NULL auto_increment, `fan_host` int(11) NOT NULL default '0', `fan_oid` varchar(64) NOT NULL, `fan_descr` varchar(32) NOT NULL default '', `fan_precision` int(11) NOT NULL default '1', `fan_current` int(11) NOT NULL default '0', `fan_limit` int(11) NOT NULL default '60', PRIMARY KEY (`fan_id`), KEY `fan_host` (`fan_host`)) ENGINE=InnoDB DEFAULT CHARSET=latin1; +ALTER TABLE `voltage` ADD `volt_limit_low` int(11) NULL DEFAULT NULL AFTER `volt_limit`; +ALTER TABLE `voltage` CHANGE `volt_current` `volt_current` FLOAT(3) NULL DEFAULT NULL; +ALTER TABLE `voltage` CHANGE `volt_limit` `volt_limit` FLOAT(3) NULL DEFAULT NULL; +ALTER TABLE `voltage` CHANGE `volt_limit_low` `volt_limit_low` FLOAT(3) NULL DEFAULT NULL; +ALTER TABLE `fanspeed` ADD `fan_index` INT NOT NULL AFTER `fan_host` , ADD `fan_mibtype` VARCHAR( 32 ) NOT NULL AFTER `fan_index`; +ALTER TABLE `temperature` CHANGE `temp_host` `device_id` INT( 11 ) NOT NULL DEFAULT '0'; +ALTER TABLE `fanspeed` CHANGE `fan_host` `device_id` INT( 11 ) NOT NULL DEFAULT '0'; +ALTER TABLE `voltage` CHANGE `volt_host` `device_id` INT( 11 ) NOT NULL DEFAULT '0'; +CREATE TABLE IF NOT EXISTS `processors` ( `processor_id` int(11) NOT NULL AUTO_INCREMENT, `entPhysicalIndex` int(11) NOT NULL, `device_id` int(11) NOT NULL, `processor_oid` int(11) NOT NULL, `processor_type` int(11) NOT NULL, `processor_usage` int(11) NOT NULL, `processor_description` varchar(64) NOT NULL, PRIMARY KEY (`processor_id`), KEY `cpuCPU_id` (`processor_id`,`device_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; +ALTER TABLE `processors` ADD `hrDeviceIndex` int(11) NULL AFTER `entPhysicalIndex`; +ALTER TABLE `temperature` CHANGE `temp_current` `temp_current` FLOAT( 4 ) NOT NULL DEFAULT '0'; +ALTER TABLE `processors` ADD `processor_index` varchar(32) NOT NULL AFTER `processor_oid`; +ALTER TABLE `processors` CHANGE `processor_description` `processor_descr` varchar(64) NOT NULL; +ALTER TABLE `fanspeed` CHANGE `fan_mibtype` `fan_type` varchar(64) NOT NULL ; +ALTER TABLE `voltage` ADD `volt_index` VARCHAR( 8 ) NOT NULL AFTER `volt_oid`,ADD `volt_type` VARCHAR( 32 ) NOT NULL AFTER `volt_index` ; +ALTER TABLE `processors` ADD `processor_precision` INT( 11 ) NOT NULL DEFAULT '1'; +ALTER TABLE `links` CHANGE `cdp` `vendor` VARCHAR( 11 ) NULL DEFAULT NULL; +ALTER TABLE `links` ADD `remote_hostname` VARCHAR( 128 ) NOT NULL ,ADD `remote_port` VARCHAR( 128 ) NOT NULL ,ADD `remote_platform` VARCHAR( 128 ) NOT NULL ,ADD `remote_version` VARCHAR( 256 ) NOT NULL ; +ALTER TABLE `links` CHANGE `src_if` `local_interface_id` INT( 11 ) NULL DEFAULT NULL ,CHANGE `dst_if` `remote_interface_id` INT( 11 ) NULL DEFAULT NULL ; +ALTER TABLE `links` CHANGE `vendor` `protocol` VARCHAR( 11 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL; +ALTER TABLE `processors` CHANGE `processor_type` `processor_type` varchar(16) NOT NULL; +ALTER TABLE `bgpPeers_cbgp` CHANGE `afi` `afi` VARCHAR( 16 ) NOT NULL , CHANGE `safi` `safi` VARCHAR( 16 ) NOT NULL; +ALTER TABLE `eventlog` ADD `reference` VARCHAR( 64 ) NOT NULL AFTER `type`; +ALTER TABLE `syslog` CHANGE `datetime` `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; +ALTER TABLE `syslog` DROP `host`, DROP `processed`; +RENAME TABLE `interfaces` TO `ports` ; +RENAME TABLE `interfaces_perms` TO `ports_perms` ; +ALTER TABLE `temperature` CHANGE `temp_index` `temp_index` VARCHAR( 32 ) NOT NULL AFTER `device_id` , ADD `temp_type` VARCHAR( 16 ) NOT NULL AFTER `temp_index`; +ALTER TABLE `processors` CHANGE `processor_oid` `processor_oid` VARCHAR( 128 ) NOT NULL; +ALTER TABLE eventlog CHANGE `type` `type` VARCHAR( 64 ) NOT NULL; +ALTER TABLE `services` CHANGE `service_host` `device_id` INT( 11 ) NOT NULL; +CREATE TABLE IF NOT EXISTS `mempools` ( `mempool_id` int(11) NOT NULL AUTO_INCREMENT, `mempool_index` varchar(8) CHARACTER SET latin1 NOT NULL, `entPhysicalIndex` int(11) DEFAULT NULL, `hrDeviceIndex` int(11) DEFAULT NULL, `mempool_type` varchar(32) CHARACTER SET latin1 NOT NULL, `mempool_precision` int(11) NOT NULL DEFAULT '1', `mempool_descr` varchar(32) CHARACTER SET latin1 NOT NULL, `device_id` int(11) NOT NULL, `mempool_used` int(11) NOT NULL, `mempool_free` int(11) NOT NULL, `mempool_total` int(11) NOT NULL, `mempool_largestfree` int(11) DEFAULT NULL, `mempool_lowestfree` int(11) DEFAULT NULL, PRIMARY KEY (`mempool_id`), KEY `device_id` (`device_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin ; +ALTER TABLE `storage` CHANGE `storage_id` `storage_id` INT( 11 ) NOT NULL AUTO_INCREMENT , CHANGE `host_id` `device_id` INT( 11 ) NOT NULL , CHANGE `hrStorageIndex` `storage_index` INT( 11 ) NOT NULL , CHANGE `hrStorageType` `storage_type` VARCHAR( 32 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL , CHANGE `hrStorageDescr` `storage_descr` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL , CHANGE `hrStorageSize` `storage_size` INT( 11 ) NOT NULL , CHANGE `hrStorageAllocationUnits` `storage_units` INT( 11 ) NOT NULL , CHANGE `hrStorageUsed` `storage_used` INT( 11 ) NOT NULL , CHANGE `storage_perc` `storage_perc` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL; +ALTER TABLE `storage` ADD `storage_mib` VARCHAR( 16 ) NOT NULL AFTER `device_id`; +ALTER TABLE `storage` ADD `storage_free` INT NOT NULL AFTER `storage_used`; +ALTER TABLE `storage` CHANGE `storage_size` `storage_size` BIGINT NOT NULL ,CHANGE `storage_used` `storage_used` BIGINT NOT NULL ,CHANGE `storage_free` `storage_free` BIGINT NOT NULL; +ALTER TABLE `mempools` CHANGE `mempool_used` `mempool_used` BIGINT( 20 ) NOT NULL , +CHANGE `mempool_free` `mempool_free` BIGINT( 20 ) NOT NULL ,CHANGE `mempool_total` `mempool_total` BIGINT( 20 ) NOT NULL ,CHANGE `mempool_largestfree` `mempool_largestfree` BIGINT( 20 ) NULL DEFAULT NULL ,CHANGE `mempool_lowestfree` `mempool_lowestfree` BIGINT( 20 ) NULL DEFAULT NULL; +CREATE TABLE IF NOT EXISTS `juniAtmVp` ( `juniAtmVp_id` int(11) NOT NULL AUTO_INCREMENT, `interface_id` int(11) NOT NULL, `vp_id` int(11) NOT NULL, `vp_descr` varchar(32) NOT NULL, PRIMARY KEY (`juniAtmVp_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; +CREATE TABLE IF NOT EXISTS `toner` ( `toner_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL default '0', `toner_index` int(11) NOT NULL, `toner_type` varchar(64) NOT NULL, `toner_oid` varchar(64) NOT NULL, `toner_descr` varchar(32) NOT NULL default '', `toner_capacity` int(11) NOT NULL default '0', `toner_current` int(11) NOT NULL default '0', PRIMARY KEY (`toner_id`), KEY `device_id` (`device_id`)) ENGINE=InnoDB DEFAULT CHARSET=latin1; +ALTER TABLE `mempools` CHANGE `mempool_descr` `mempool_descr` VARCHAR( 64 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL; +ALTER TABLE `processors` CHANGE `processor_descr` `processor_descr` VARCHAR( 64 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL; +DROP TABLE `cempMemPool`; +DROP TABLE `cpmCPU`; +DROP TABLE `cmpMemPool`; +ALTER TABLE `mempools` CHANGE `mempool_used` `mempool_used` BIGINT( 16 ) NOT NULL ,CHANGE `mempool_free` `mempool_free` BIGINT( 16 ) NOT NULL ,CHANGE `mempool_total` `mempool_total` BIGINT( 16 ) NOT NULL ,CHANGE `mempool_largestfree` `mempool_largestfree` BIGINT( 16 ) NULL DEFAULT NULL ,CHANGE `mempool_lowestfree` `mempool_lowestfree` BIGINT( 16 ) NULL DEFAULT NULL ; +ALTER TABLE `ports` ADD `port_descr_type` VARCHAR( 32 ) NULL DEFAULT NULL AFTER `device_id` ,ADD `port_descr_descr` VARCHAR( 64 ) NULL DEFAULT NULL AFTER `port_descr_type` ,ADD `port_descr_circuit` VARCHAR( 64 ) NULL DEFAULT NULL AFTER `port_descr_descr` ,ADD `port_descr_speed` VARCHAR( 32 ) NULL DEFAULT NULL AFTER `port_descr_circuit` ,ADD `port_descr_notes` VARCHAR( 128 ) NULL DEFAULT NULL AFTER `port_descr_speed`; +CREATE TABLE IF NOT EXISTS `frequency` ( `freq_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL default '0', `freq_oid` varchar(64) NOT NULL, `freq_index` varchar(8) NOT NULL, `freq_type` varchar(32) NOT NULL, `freq_descr` varchar(32) NOT NULL default '', `freq_precision` int(11) NOT NULL default '1', `freq_current` float default NULL, `freq_limit` float default NULL, `freq_limit_low` float default NULL, PRIMARY KEY (`freq_id`), KEY `freq_host` (`device_id`)) ENGINE=MyISAM AUTO_INCREMENT=189 DEFAULT CHARSET=latin1; +ALTER TABLE `temperature` CHANGE `temp_index` `temp_index` int(11) NOT NULL; +CREATE TABLE IF NOT EXISTS `current` ( `current_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL default '0', `current_oid` varchar(64) NOT NULL, `current_index` varchar(8) NOT NULL, `current_type` varchar(32) NOT NULL, `current_descr` varchar(32) NOT NULL default '', `current_precision` int(11) NOT NULL default '1', `current_current` float default NULL, `current_limit` float default NULL, `current_limit_warn` float default NULL, `current_limit_low` float default NULL, PRIMARY KEY (`current_id`), KEY `current_host` (`device_id`)) ENGINE=MyISAM AUTO_INCREMENT=189 DEFAULT CHARSET=latin1; +ALTER TABLE `devices` ADD `serial` text default NULL; +ALTER TABLE `temperature` CHANGE `temp_index` `temp_index` VARCHAR(32) NOT NULL; +ALTER TABLE `ports` CHANGE `ifDescr` `ifDescr` VARCHAR(255) NOT NULL; +CREATE TABLE IF NOT EXISTS `ucd_diskio` ( `diskio_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `diskio_index` int(11) NOT NULL, `diskio_descr` varchar(32) NOT NULL, PRIMARY KEY (`diskio_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ; +ALTER TABLE `eventlog` CHANGE `type` `type` VARCHAR( 64 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL; +ALTER TABLE `bills` ADD `bill_custid` VARCHAR( 64 ) NOT NULL ,ADD `bill_ref` VARCHAR( 64 ) NOT NULL ,ADD `bill_notes` VARCHAR( 256 ) NOT NULL; +CREATE TABLE IF NOT EXISTS `applications` ( `app_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `app_type` varchar(64) NOT NULL, PRIMARY KEY (`app_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; +CREATE TABLE IF NOT EXISTS `sensors` ( `sensor_id` int(11) NOT NULL auto_increment, `sensor_class` varchar(64) NOT NULL, `device_id` int(11) NOT NULL default '0', `sensor_oid` varchar(64) NOT NULL, `sensor_index` varchar(8) NOT NULL, `sensor_type` varchar(32) NOT NULL, `sensor_descr` varchar(32) NOT NULL default '', `sensor_precision` int(11) NOT NULL default '1', `sensor_current` float default NULL, `sensor_limit` float default NULL, `sensor_limit_warn` float default NULL, `sensor_limit_low` float default NULL, `sensor_limit_low_warn` float default NULL, PRIMARY KEY (`sensor_id`), KEY `sensor_host` (`device_id`)) ENGINE=MyISAM AUTO_INCREMENT=189 DEFAULT CHARSET=latin1; +ALTER TABLE `devices` CHANGE `type` `type` VARCHAR(20) NOT NULL; +ALTER TABLE `voltage` CHANGE `volt_index` `volt_index` VARCHAR(10) NOT NULL; +ALTER TABLE `frequency` CHANGE `freq_index` `freq_index` VARCHAR(10) NOT NULL; +ALTER TABLE `sensors` CHANGE `sensor_index` `sensor_index` VARCHAR(10) NOT NULL; +DROP TABLE `fanspeed`; +DROP TABLE `temperature`; +DROP TABLE `voltage`; +DROP TABLE `current`; +ALTER TABLE `sensors` ADD `entPhysicalIndex` VARCHAR( 16 ) NULL; +ALTER TABLE `sensors` ADD `entPhysicalIndex_measured` VARCHAR(16) NULL; +ALTER TABLE `processors` DROP INDEX `cpuCPU_id`; +ALTER TABLE `processors` ADD INDEX ( `device_id` ); +ALTER TABLE `ucd_diskio` ADD INDEX ( `device_id` ); +ALTER TABLE `storage` ADD INDEX ( `device_id` ); +ALTER TABLE `mac_accounting` ADD INDEX ( `interface_id` ); +ALTER TABLE `ipv4_addresses` ADD INDEX ( `interface_id` ); +ALTER TABLE `ipv6_addresses` ADD INDEX ( `interface_id` ); +ALTER TABLE `ipv4_mac` ADD INDEX ( `interface_id` ); +CREATE TABLE IF NOT EXISTS `ports_adsl` ( `interface_id` int(11) NOT NULL, `port_adsl_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `adslLineCoding` varchar(8) COLLATE utf8_bin NOT NULL, `adslLineType` varchar(16) COLLATE utf8_bin NOT NULL, `adslAtucInvVendorID` varchar(8) COLLATE utf8_bin NOT NULL, `adslAtucInvVersionNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAtucCurrSnrMgn` decimal(5,1) NOT NULL, `adslAtucCurrAtn` decimal(5,1) NOT NULL, `adslAtucCurrOutputPwr` decimal(5,1) NOT NULL, `adslAtucCurrAttainableRate` int(11) NOT NULL, `adslAtucChanCurrTxRate` int(11) NOT NULL, `adslAturInvSerialNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturInvVendorID` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturInvVersionNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturChanCurrTxRate` int(11) NOT NULL, `adslAturCurrSnrMgn` decimal(5,1) NOT NULL, `adslAturCurrAtn` decimal(5,1) NOT NULL, `adslAturCurrOutputPwr` decimal(5,1) NOT NULL, `adslAturCurrAttainableRate` int(11) NOT NULL, UNIQUE KEY `interface_id` (`interface_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +ALTER TABLE `devices` ADD `last_polled_timetaken` DOUBLE( 5, 2 ) NOT NULL AFTER `last_polled` , ADD `last_discovered_timetaken` DOUBLE( 5, 2 ) NOT NULL AFTER `last_polled_timetaken`; +CREATE TABLE IF NOT EXISTS `perf_times` ( `type` varchar(8) NOT NULL, `doing` varchar(64) NOT NULL, `start` int(11) NOT NULL, `duration` double(5,2) NOT NULL, `devices` int(11) NOT NULL, KEY `type` (`type`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +ALTER TABLE `bills` ADD `bill_autoadded` BOOLEAN NOT NULL DEFAULT '0'; +ALTER TABLE `bill_ports` ADD `bill_port_autoadded` BOOLEAN NOT NULL DEFAULT '0'; +ALTER TABLE `sensors` CHANGE `sensor_precision` `sensor_divisor` INT( 11 ) NOT NULL DEFAULT '1' +ALTER TABLE `sensors` ADD `sensor_multiplier` INT( 11 ) NOT NULL AFTER `sensor_divisor`; +CREATE TABLE IF NOT EXISTS `device_graphs` ( `device_id` int(11) NOT NULL, `graph` varchar(32) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +DROP TABLE IF EXISTS `graph_types`; +CREATE TABLE IF NOT EXISTS `graph_types` ( `graph_type` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_subtype` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_section` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_descr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `graph_order` int(11) NOT NULL, KEY `graph_type` (`graph_type`), KEY `graph_subtype` (`graph_subtype`), KEY `graph_section` (`graph_section`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +INSERT INTO `graph_types` (`graph_type`, `graph_subtype`, `graph_section`, `graph_descr`, `graph_order`) VALUES('device', 'bits', 'netstats', 'Total Traffic', 0),('device', 'hr_users', 'system', 'Users Logged In', 0),('device', 'ucd_load', 'system', 'Load Averages', 0),('device', 'ucd_cpu', 'system', 'Detailed Processor Usage', 0),('device', 'ucd_memory', 'system', 'Detailed Memory Usage', 0),('device', 'netstat_tcp', 'netstats', 'TCP Statistics', 0),('device', 'netstat_icmp_info', 'netstats', 'ICMP Informational Statistics', 0),('device', 'netstat_icmp_stat', 'netstats', 'ICMP Statistics', 0),('device', 'netstat_ip', 'netstats', 'IP Statistics', 0),('device', 'netstat_ip_frag', 'netstats', 'IP Fragmentation Statistics', 0),('device', 'netstat_udp', 'netstats', 'UDP Statistics', 0),('device', 'netstat_snmp', 'netstats', 'SNMP Statistics', 0),('device', 'temperatures', 'system', 'Temperatures', 0),('device', 'mempools', 'system', 'Memory Pool Usage', 0),('device', 'processors', 'system', 'Processor Usage', 0),('device', 'storage', 'system', 'Filesystem Usage', 0),('device', 'hr_processes', 'system', 'Running Processes', 0),('device', 'uptime', 'system', 'System Uptime', ''),('device', 'ipsystemstats_ipv4', 'netstats', 'IPv4 Packet Statistics', 0),('device', 'ipsystemstats_ipv6_frag', 'netstats', 'IPv6 Fragmentation Statistics', 0),('device', 'ipsystemstats_ipv6', 'netstats', 'IPv6 Packet Statistics', 0),('device', 'ipsystemstats_ipv4_frag', 'netstats', 'IPv4 Fragmentation Statistics', 0),('device', 'fortigate_sessions', 'firewall', 'Active Sessions', ''), ('device', 'screenos_sessions', 'firewall', 'Active Sessions', ''), ('device', 'fdb_count', 'system', 'MAC Addresses Learnt', '0'),('device', 'cras_sessions', 'firewall', 'Remote Access Sessions', 0); +DROP TABLE `frequency`; +ALTER TABLE `mempools` CHANGE `mempool_index` `mempool_index` VARCHAR( 16 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL; +ALTER TABLE `vrfs` CHANGE `mplsVpnVrfRouteDistinguisher` `mplsVpnVrfRouteDistinguisher` varchar(26) default NOT NULL; +ALTER TABLE `devices` ADD `timeout` INT NULL DEFAULT NULL AFTER `port`; +ALTER TABLE `devices` ADD `retries` INT NULL DEFAULT NULL AFTER `timeout`; +ALTER TABLE `ports` ADD `disabled` tinyint(1) NOT NULL DEFAULT '0' AFTER `ignore`; +ALTER TABLE `perf_times` CHANGE `duration` `duration` DOUBLE( 8, 2 ) NOT NULL +ALTER TABLE `sensors` ADD `poller_type` VARCHAR(16) NOT NULL DEFAULT 'snmp' AFTER `device_id`; +ALTER TABLE `devices` ADD `transport` VARCHAR(16) NOT NULL DEFAULT 'udp' AFTER `port`; +ALTER TABLE ports MODIFY port_descr_circuit VARCHAR(255); +ALTER TABLE ports MODIFY port_descr_descr VARCHAR(255); +ALTER TABLE ports MODIFY port_descr_notes VARCHAR(255); +ALTER TABLE devices MODIFY community VARCHAR(255); +ALTER TABLE users MODIFY password VARCHAR(34); +ALTER TABLE sensors MODIFY sensor_descr VARCHAR(255); +ALTER TABLE `vrfs` MODIFY `mplsVpnVrfRouteDistinguisher` VARCHAR(128); +ALTER TABLE `vrfs` MODIFY `vrf_name` VARCHAR(128); +ALTER TABLE `ports` MODIFY `ifDescr` VARCHAR(255); +CREATE TABLE IF NOT EXISTS `vminfo` (`id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `vmwVmVMID` int(11) NOT NULL, `vmwVmDisplayName` varchar(128) NOT NULL, `vmwVmGuestOS` varchar(128) NOT NULL, `vmwVmMemSize` int(11) NOT NULL, `vmwVmCpus` int(11) NOT NULL, `vmwVmState` varchar(128) NOT NULL, PRIMARY KEY (`id`), KEY `device_id` (`device_id`), KEY `vmwVmVMID` (`vmwVmVMID`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; +ALTER TABLE `ports` MODIFY `port_descr_type` VARCHAR(255); +RENAME TABLE `vmware_vminfo` TO `vminfo` ; +ALTER TABLE `vminfo` ADD `vm_type` VARCHAR(16) NOT NULL DEFAULT 'vmware' AFTER `device_id`; +CREATE TABLE IF NOT EXISTS `cef_switching` ( `device_id` int(11) NOT NULL, `entPhysicalIndex` int(11) NOT NULL, `afi` varchar(4) COLLATE utf8_unicode_ci NOT NULL, `cef_index` int(11) NOT NULL, `cef_path` varchar(16) COLLATE utf8_unicode_ci NOT NULL, `drop` int(11) NOT NULL, `punt` int(11) NOT NULL, `punt2host` int(11) NOT NULL, `drop_prev` int(11) NOT NULL, `punt_prev` int(11) NOT NULL, `punt2host_prev` int(11) NOT NULL,`updated` INT NOT NULL , `updated_prev` INT NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +ALTER TABLE `mac_accounting` CHANGE `peer_mac` `mac` VARCHAR( 32 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL; +ALTER TABLE `mac_accounting` DROP `peer_ip`, DROP `peer_desc`, DROP `peer_asn`; +UPDATE sensors SET sensor_class='frequency' WHERE sensor_class='freq'; +ALTER TABLE `cef_switching` ADD `cef_switching_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST; +ALTER TABLE `mempools` ADD `mempool_perc` INT NOT NULL AFTER `device_id`; +ALTER TABLE `ports` ADD UNIQUE `device_ifIndex` ( `device_id` , `ifIndex` ); +ALTER TABLE `ports` DROP INDEX `host`; +ALTER TABLE `ports` DROP INDEX `snmpid`; +CREATE TABLE IF NOT EXISTS `ospf_areas` ( `device_id` int(11) NOT NULL, `ospfAreaId` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfAuthType` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `ospfImportAsExtern` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `ospfSpfRuns` int(11) NOT NULL, `ospfAreaBdrRtrCount` int(11) NOT NULL, `ospfAsBdrRtrCount` int(11) NOT NULL, `ospfAreaLsaCount` int(11) NOT NULL, `ospfAreaLsaCksumSum` int(11) NOT NULL, `ospfAreaSummary` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `ospfAreaStatus` varchar(64) COLLATE utf8_unicode_ci NOT NULL, UNIQUE KEY `device_area` (`device_id`,`ospfAreaId`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `ospf_instances` ( `device_id` int(11) NOT NULL, `ospf_instance_id` int(11) NOT NULL, `ospfRouterId` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfAdminStat` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfVersionNumber` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfAreaBdrRtrStatus` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfASBdrRtrStatus` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfExternLsaCount` int(11) NOT NULL, `ospfExternLsaCksumSum` int(11) NOT NULL, `ospfTOSSupport` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfOriginateNewLsas` int(11) NOT NULL, `ospfRxNewLsas` int(11) NOT NULL, `ospfExtLsdbLimit` int(11) DEFAULT NULL, `ospfMulticastExtensions` int(11) DEFAULT NULL, `ospfExitOverflowInterval` int(11) DEFAULT NULL, `ospfDemandExtensions` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, UNIQUE KEY `device_id` (`device_id`,`ospf_instance_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `ospf_ports` ( `device_id` int(11) NOT NULL, `interface_id` int(11) NOT NULL, `ospf_port_id` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfIfIpAddress` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfAddressLessIf` int(11) NOT NULL, `ospfIfAreaId` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfIfType` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfAdminStat` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfRtrPriority` int(11) DEFAULT NULL, `ospfIfTransitDelay` int(11) DEFAULT NULL, `ospfIfRetransInterval` int(11) DEFAULT NULL, `ospfIfHelloInterval` int(11) DEFAULT NULL, `ospfIfRtrDeadInterval` int(11) DEFAULT NULL, `ospfIfPollInterval` int(11) DEFAULT NULL, `ospfIfState` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfDesignatedRouter` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfBackupDesignatedRouter` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfEvents` int(11) DEFAULT NULL, `ospfIfAuthKey` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfStatus` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfMulticastForwarding` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfDemand` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfAuthType` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, UNIQUE KEY `device_id` (`device_id`,`interface_id`,`ospf_port_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `ospf_nbrs` ( `device_id` int(11) NOT NULL, `interface_id` int(11) NOT NULL, `ospf_nbr_id` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbrIpAddr` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbrAddressLessIndex` int(11) NOT NULL, `ospfNbrRtrId` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbrOptions` int(11) NOT NULL, `ospfNbrPriority` int(11) NOT NULL, `ospfNbrState` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbrEvents` int(11) NOT NULL, `ospfNbrLsRetransQLen` int(11) NOT NULL, `ospfNbmaNbrStatus` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbmaNbrPermanence` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbrHelloSuppressed` varchar(32) COLLATE utf8_unicode_ci NOT NULL, UNIQUE KEY `device_id` (`device_id`,`ospf_nbr_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `ports_stack` (`interface_id_high` INT NOT NULL ,`interface_id_low` INT NOT NULL) ENGINE = INNODB; +ALTER TABLE `ports_stack` ADD `device_id` INT NOT NULL; +ALTER TABLE `ports_stack` ADD `ifStackStatus` VARCHAR(32); +ALTER TABLE users ADD can_modify_passwd TINYINT NOT NULL DEFAULT 1; +ALTER TABLE `storage` ADD UNIQUE `index_unique` ( `device_id` , `storage_mib` , `storage_index` ); +ALTER TABLE `bgpPeers_cbgp` ADD `AcceptedPrefixes` INT NOT NULL ,ADD `DeniedPrefixes` INT NOT NULL ,ADD `PrefixAdminLimit` INT NOT NULL ,ADD `PrefixThreshold` INT NOT NULL ,ADD `PrefixClearThreshold` INT NOT NULL ,ADD `AdvertisedPrefixes` INT NOT NULL ,ADD `SuppressedPrefixes` INT NOT NULL ,ADD `WithdrawnPrefixes` INT NOT NULL; +ALTER TABLE `bgpPeers_cbgp` ADD UNIQUE `unique_index` ( `device_id` , `bgpPeerIdentifier` , `afi` , `safi` ); +ALTER TABLE `ports` ADD UNIQUE `device_ifIndex` ( `device_id` , `ifIndex` ); +ALTER TABLE `devices` CHANGE `port` `port` SMALLINT( 5 ) UNSIGNED NOT NULL DEFAULT '161'; +CREATE TABLE IF NOT EXISTS `ipsec_tunnels` ( `tunnel_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `peer_port` int(11) NOT NULL, `peer_addr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `local_addr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `local_port` int(11) NOT NULL, `tunnel_name` varchar(96) COLLATE utf8_unicode_ci NOT NULL, `tunnel_status` varchar(11) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`tunnel_id`), UNIQUE KEY `unique_index` (`device_id`,`peer_addr`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +ALTER TABLE `syslog` ADD INDEX ( `program` ); +ALTER TABLE `devices` ADD `sysObjectID` VARCHAR( 64 ) NULL DEFAULT NULL AFTER `bgpLocalAs`; +ALTER TABLE `ports` CHANGE `ifSpeed` `ifSpeed` BIGINT NULL DEFAULT NULL; +ALTER TABLE `sensors` CHANGE `sensor_oid` `sensor_oid` VARCHAR( 255 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL; +CREATE TABLE IF NOT EXISTS `entPhysical_state` ( `device_id` int(11) NOT NULL, `entPhysicalIndex` varchar(64) NOT NULL, `subindex` varchar(64) DEFAULT NULL, `group` varchar(64) NOT NULL, `key` varchar(64) NOT NULL, `value` varchar(255) NOT NULL, KEY `device_id_index` (`device_id`,`entPhysicalIndex`)) ENGINE=MyISAM DEFAULT CHARSET=latin1; +CREATE TABLE IF NOT EXISTS `ports_vlans` ( `port_vlan_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `interface_id` int(11) NOT NULL, `vlan` int(11) NOT NULL, `baseport` int(11) NOT NULL, `priority` bigint(32) NOT NULL, `state` varchar(16) NOT NULL, `cost` int(11) NOT NULL, PRIMARY KEY (`port_vlan_id`), UNIQUE KEY `unique` (`device_id`,`interface_id`,`vlan`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; +ALTER TABLE `bills` CHANGE `bill_cdr` `bill_cdr` BIGINT( 20 ) NULL DEFAULT NULL; +CREATE TABLE IF NOT EXISTS `loadbalancer_rservers` ( `rserver_id` int(11) NOT NULL AUTO_INCREMENT, `farm_id` varchar(128) CHARACTER SET utf8 NOT NULL, `device_id` int(11) NOT NULL, `StateDescr` varchar(64) CHARACTER SET utf8 NOT NULL, PRIMARY KEY (`rserver_id`)) ENGINE=MyISAM AUTO_INCREMENT=514 DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `loadbalancer_vservers` ( `classmap_id` int(11) NOT NULL, `classmap` varchar(128) NOT NULL, `serverstate` varchar(64) NOT NULL, `device_id` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +ALTER TABLE `sensors` CHANGE `sensor_index` `sensor_index` VARCHAR( 64 ); +CREATE TABLE IF NOT EXISTS `netscaler_vservers` ( `vsvr_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `vsvr_name` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `vsvr_ip` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `vsvr_port` int(8) NOT NULL, `vsvr_type` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `vsvr_state` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `vsvr_clients` int(11) NOT NULL, `vsvr_server` int(11) NOT NULL, `vsvr_req_rate` int(11) NOT NULL, `vsvr_bps_in` int(11) NOT NULL, `vsvr_bps_out` int(11) NOT NULL, PRIMARY KEY (`vsvr_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ; +ALTER TABLE `dbSchema` ADD `version` INT NOT NULL; +ALTER TABLE `dbSchema` DROP `revision`; +ALTER TABLE `bills` CHANGE `bill_gb` `bill_quota` BIGINT( 20 ) NULL DEFAULT NULL; +ALTER TABLE `bills` CHANGE `rate_95th_in` `rate_95th_in` BIGINT( 20 ) NOT NULL; +ALTER TABLE `bills` CHANGE `rate_95th_out` `rate_95th_out` BIGINT( 20 ) NOT NULL; +ALTER TABLE `bills` CHANGE `rate_95th` `rate_95th` BIGINT( 20 ) NOT NULL; +ALTER TABLE `bills` CHANGE `total_data` `total_data` BIGINT( 20 ) NOT NULL; +ALTER TABLE `bills` CHANGE `total_data_in` `total_data_in` BIGINT( 20 ) NOT NULL ; +ALTER TABLE `bills` CHANGE `total_data_out` `total_data_out` BIGINT( 20 ) NOT NULL; +ALTER TABLE `bills` CHANGE `rate_average_in` `rate_average_in` BIGINT( 20 ) NOT NULL; +ALTER TABLE `bills` CHANGE `rate_average_out` `rate_average_out` BIGINT( 20 ) NOT NULL; +ALTER TABLE `bills` CHANGE `rate_average` `rate_average` BIGINT( 20 ) NOT NULL; +ALTER TABLE `eventlog` ADD INDEX `datetime` ( `datetime` ); +CREATE TABLE IF NOT EXISTS `packages` ( `pkg_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL, `name` varchar(64) NOT NULL, `manager` varchar(16) NOT NULL default '1', `status` tinyint(1) NOT NULL, `version` varchar(64) NOT NULL, `build` varchar(64) NOT NULL, `arch` varchar(16) NOT NULL, `size` bigint(20) default NULL, PRIMARY KEY (`pkg_id`), UNIQUE KEY `unique_key` (`device_id`,`name`,`manager`,`arch`,`version`,`build`), KEY `device_id` (`device_id`)) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_bin; +CREATE TABLE IF NOT EXISTS `slas` ( `sla_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL, `sla_nr` int(11) NOT NULL, `owner` varchar(255) NOT NULL, `tag` varchar(255) NOT NULL, `rtt_type` varchar(16) NOT NULL, `status` tinyint(1) NOT NULL, `deleted` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`sla_id`), UNIQUE KEY `unique_key` (`device_id`,`sla_nr`), KEY `device_id` (`device_id`)) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_bin; +ALTER TABLE `devices` ADD COLUMN `icon` VARCHAR(255) DEFAULT NULL +CREATE TABLE IF NOT EXISTS `munin_plugins` ( `mplug_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `mplug_type` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `mplug_instance` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_category` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_title` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_info` text CHARACTER SET utf8 COLLATE utf8_bin, `mplug_vlabel` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_args` varchar(512) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_total` binary(1) NOT NULL DEFAULT '0', `mplug_graph` binary(1) NOT NULL DEFAULT '1', PRIMARY KEY (`mplug_id`), UNIQUE KEY `UNIQUE` (`device_id`,`mplug_type`), KEY `device_id` (`device_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin ; +CREATE TABLE IF NOT EXISTS `munin_plugins_ds` ( `mplug_id` int(11) NOT NULL, `ds_name` varchar(32) COLLATE utf8_bin NOT NULL, `ds_type` enum('COUNTER','ABSOLUTE','DERIVE','GAUGE') COLLATE utf8_bin NOT NULL DEFAULT 'GAUGE', `ds_label` varchar(64) COLLATE utf8_bin NOT NULL, `ds_cdef` text COLLATE utf8_bin NOT NULL, `ds_draw` varchar(64) COLLATE utf8_bin NOT NULL, `ds_graph` enum('no','yes') COLLATE utf8_bin NOT NULL DEFAULT 'yes', `ds_info` varchar(255) COLLATE utf8_bin NOT NULL, `ds_extinfo` text COLLATE utf8_bin NOT NULL, `ds_max` varchar(32) COLLATE utf8_bin NOT NULL, `ds_min` varchar(32) COLLATE utf8_bin NOT NULL, `ds_negative` varchar(32) COLLATE utf8_bin NOT NULL, `ds_warning` varchar(32) COLLATE utf8_bin NOT NULL, `ds_critical` varchar(32) COLLATE utf8_bin NOT NULL, `ds_colour` varchar(32) COLLATE utf8_bin NOT NULL, `ds_sum` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `ds_stack` text COLLATE utf8_bin NOT NULL, `ds_line` varchar(64) COLLATE utf8_bin NOT NULL, UNIQUE KEY `splug_id` (`mplug_id`,`ds_name`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +ALTER TABLE `munin_plugins_ds` CHANGE `ds_cdef` `ds_cdef` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL; +ALTER TABLE `applications` ADD `app_state` TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL; +ALTER TABLE `vlans` ADD `vlan_type` VARCHAR( 16 ) NULL; +ALTER TABLE `vlans` CHANGE `vlan_domain` `vlan_domain` INT NULL DEFAULT NULL; +ALTER TABLE `vlans` CHANGE `vlan_descr` `vlan_name` VARCHAR( 32 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL; +ALTER TABLE `vlans` ADD `vlan_mtu` INT NULL; +ALTER TABLE `applications` ADD `app_status` VARCHAR( 8 ) NOT NULL ; +UPDATE `sensors` SET sensor_limit=sensor_limit/1.3*1.8 WHERE sensor_class="fanspeed" +ALTER TABLE `pseudowires` ADD `device_id` INT NOT NULL AFTER `pseudowire_id`; +TRUNCATE TABLE `pseudowires`; +ALTER TABLE `pseudowires` ADD `pw_type` VARCHAR( 32 ) NOT NULL ,ADD `pw_psntype` VARCHAR( 32 ) NOT NULL ,ADD `pw_local_mtu` INT NOT NULL ,ADD `pw_peer_mtu` INT NOT NULL ,ADD `pw_descr` VARCHAR( 128 ) NOT NULL; +ALTER TABLE `toner` ADD `toner_capacity_oid` VARCHAR( 64 ); +ALTER TABLE `devices` ADD `authlevel` ENUM("noAuthNoPriv", "authNoPriv", "authPriv") NULL DEFAULT NULL AFTER `community`; +ALTER TABLE `devices` ADD `authname` VARCHAR(64) NULL DEFAULT NULL AFTER `authlevel`; +ALTER TABLE `devices` ADD `authpass` VARCHAR(64) NULL DEFAULT NULL AFTER `authname`; +ALTER TABLE `devices` ADD `authalgo` ENUM("MD5", "SHA1") NULL DEFAULT NULL AFTER `authpass`; +ALTER TABLE `devices` ADD `cryptopass` VARCHAR(64) NULL DEFAULT NULL AFTER `authalgo`; +ALTER TABLE `devices` ADD `cryptoalgo` ENUM("AES", "DES") NULL DEFAULT NULL AFTER `cryptopass`; +ALTER TABLE `applications` CHANGE `app_state` `app_state` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT 'UNKNOWN'; +ALTER TABLE `applications` CHANGE `app_type` `app_type` VARCHAR( 64 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL; +ALTER TABLE `devices` CHANGE `authalgo` `authalgo` ENUM( 'MD5', 'SHA' ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL; +ALTER TABLE `ports` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL AUTO_INCREMENT; +ALTER TABLE `storage` ADD `storage_deleted` BOOL NOT NULL DEFAULT '0'; +ALTER TABLE `links` CHANGE `local_interface_id` `local_port_id` INT( 11 ) NULL DEFAULT NULL; +ALTER TABLE `links` CHANGE `remote_interface_id` `remote_port_id` INT( 11 ) NULL DEFAULT NULL; +ALTER TABLE `sensors` ADD `sensor_deleted` BOOL NOT NULL DEFAULT '0' AFTER `sensor_id`; +ALTER TABLE `mempools` ADD `mempool_deleted` BOOL NOT NULL DEFAULT '0'; +ALTER TABLE `ipv4_addresses` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL; +ALTER TABLE `ipv6_addresses` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL; +ALTER TABLE `ipv4_mac` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL; +ALTER TABLE `juniAtmVp` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL; +ALTER TABLE `ospf_nbrs` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL; +ALTER TABLE `mac_accounting` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL; +ALTER TABLE `ospf_ports` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL; +ALTER TABLE `ports_adsl` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL; +ALTER TABLE `ports_perms` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL; +ALTER TABLE `ports_stack` CHANGE `interface_id_high` `port_id_high` INT( 11 ) NOT NULL; +ALTER TABLE `ports_stack` CHANGE `interface_id_low` `port_id_low` INT( 11 ) NOT NULL; +ALTER TABLE `ports_vlans` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL; +ALTER TABLE `pseudowires` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL; +CREATE TABLE IF NOT EXISTS `access_points` ( `accesspoint_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `radio_number` tinyint(4) DEFAULT NULL, `type` varchar(16) NOT NULL, `mac_addr` varchar(24) NOT NULL, `deleted` tinyint(1) NOT NULL DEFAULT '0', `channel` tinyint(4) unsigned NOT NULL DEFAULT '0', `txpow` tinyint(4) NOT NULL DEFAULT '0', `radioutil` tinyint(4) NOT NULL DEFAULT '0', `numasoclients` smallint(6) NOT NULL DEFAULT '0', `nummonclients` smallint(6) NOT NULL DEFAULT '0', `numactbssid` tinyint(4) NOT NULL DEFAULT '0', `nummonbssid` tinyint(4) NOT NULL DEFAULT '0', `interference` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`accesspoint_id`), KEY `deleted` (`deleted`), KEY `name` (`name`,`radio_number`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Access Points';ALTER TABLE `juniAtmVp` ADD INDEX ( `port_id` ); +ALTER TABLE `loadbalancer_vservers` ADD INDEX ( `device_id` ); +ALTER TABLE `users` CHANGE `password` `password` VARCHAR( 60 ); +CREATE TABLE IF NOT EXISTS `session` ( `session_id` int(11) NOT NULL AUTO_INCREMENT, `session_username` varchar(30) NOT NULL, `session_value` varchar(60) NOT NULL, `session_token` varchar(60) NOT NULL, `session_auth` varchar(16) NOT NULL, `session_expiry` int(11) NOT NULL, PRIMARY KEY (`session_id`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; +CREATE TABLE IF NOT EXISTS `plugins` ( `plugin_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `plugin_name` VARCHAR( 60 ) NOT NULL , `plugin_active` INT NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; +ALTER TABLE `sensors` ADD `sensor_alert` TINYINT( 1 ) NOT NULL DEFAULT '1' AFTER `sensor_limit_low_warn` ; +CREATE TABLE IF NOT EXISTS `ciscoASA` ( `ciscoASA_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `oid` varchar(255) NOT NULL, `data` bigint(20) NOT NULL, `high_alert` bigint(20) NOT NULL, `low_alert` bigint(20) NOT NULL, `disabled` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`ciscoASA_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; +INSERT INTO `graph_types` SET `graph_type`='device', `graph_subtype`='asa_conns',`graph_section`='firewall',`graph_descr`='Current connections',`graph_order`='0'; +CREATE TABLE `api_tokens` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `token_hash` varchar(32) NOT NULL, `description` varchar(100) NOT NULL, `disabled` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `token_hash` (`token_hash`)) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; +ALTER TABLE `api_tokens` MODIFY `token_hash` VARCHAR(256); +ALTER TABLE `devices` ADD `last_ping` TIMESTAMP NULL AFTER `last_discovered` , ADD `last_ping_timetaken` DOUBLE( 5, 2 ) NULL AFTER `last_ping` ; +DROP TABLE IF EXISTS `alerts`; +CREATE TABLE IF NOT EXISTS `alerts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `rule_id` int(11) NOT NULL, `state` int(11) NOT NULL, `alerted` int(11) NOT NULL, `open` int(11) NOT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; +DROP TABLE IF EXISTS `alert_log`; +CREATE TABLE IF NOT EXISTS `alert_log` ( `id` int(11) NOT NULL AUTO_INCREMENT, `rule_id` int(11) NOT NULL, `device_id` int(11) NOT NULL, `state` int(11) NOT NULL, `details` longblob NOT NULL, `time_logged` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY `id` (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; +DROP TABLE IF EXISTS `alert_rules`; +CREATE TABLE IF NOT EXISTS `alert_rules` ( `id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `rule` text CHARACTER SET utf8 NOT NULL, `severity` enum('ok','warning','critical') CHARACTER SET utf8 NOT NULL, `extra` varchar(255) CHARACTER SET utf8 NOT NULL, `disabled` tinyint(1) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; +DROP TABLE IF EXISTS `alert_schedule`; +CREATE TABLE IF NOT EXISTS `alert_schedule` ( `id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `start` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `end` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; +DROP TABLE IF EXISTS `alert_templates`; +CREATE TABLE IF NOT EXISTS `alert_templates` ( `id` int(11) NOT NULL AUTO_INCREMENT, `rule_id` varchar(255) NOT NULL DEFAULT ',',`name` varchar(255) NOT NULL, `template` longtext NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; +ALTER TABLE `alert_rules` ADD `name` VARCHAR( 255 ) NOT NULL ; +ALTER TABLE `users` ADD `twofactor` VARCHAR( 255 ) NOT NULL; +CREATE TABLE IF NOT EXISTS `processes` ( `device_id` int(11) NOT NULL, `pid` int(255) NOT NULL, `vsz` int(255) NOT NULL, `rss` int(255) NOT NULL, `cputime` varchar(12) NOT NULL, `user` varchar(50) NOT NULL, `command` varchar(255) NOT NULL, KEY `device_id` (`device_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +ALTER TABLE `devices` CHANGE `agent_uptime` `agent_uptime` INT( 11 ) NOT NULL DEFAULT '0'; +ALTER TABLE `devices` CHANGE `type` `type` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ''; +ALTER TABLE `ports` CHANGE `ifVrf` `ifVrf` INT( 11 ) NOT NULL DEFAULT '0'; +ALTER TABLE `storage` CHANGE `storage_free` `storage_free` BIGINT( 20 ) NOT NULL DEFAULT '0'; +ALTER TABLE `storage` CHANGE `storage_used` `storage_used` BIGINT( 20 ) NOT NULL DEFAULT '0'; +ALTER TABLE `storage` CHANGE `storage_perc` `storage_perc` INT NOT NULL DEFAULT '0'; +ALTER TABLE `processors` CHANGE `entPhysicalIndex` `entPhysicalIndex` INT( 11 ) NOT NULL DEFAULT '0'; +ALTER TABLE `hrDevice` CHANGE `hrDeviceErrors` `hrDeviceErrors` INT( 11 ) NOT NULL DEFAULT '0'; +ALTER TABLE `devices_attribs` ADD INDEX ( `device_id` ); +ALTER TABLE `device_graphs` ADD INDEX ( `device_id` ); +ALTER TABLE `alert_log` ADD INDEX ( `rule_id` ); +ALTER TABLE `alert_log` ADD INDEX ( `device_id` ); +ALTER TABLE `alerts` ADD INDEX ( `rule_id` ); +ALTER TABLE `alerts` ADD INDEX ( `device_id` ); +ALTER TABLE `ciscoASA` ADD INDEX ( `device_id` ); +ALTER TABLE `alert_schedule` ADD INDEX ( `device_id` ); +ALTER TABLE `alert_rules` ADD INDEX ( `device_id` ); +CREATE TABLE `pollers` (`id` int(11) NOT NULL AUTO_INCREMENT, `poller_name` varchar(255) NOT NULL, `last_polled` datetime NOT NULL, `devices` int(11) NOT NULL, `time_taken` double NOT NULL, KEY `id` (`id`)) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +ALTER TABLE `devices` ADD `poller_group` INT(11) NOT NULL DEFAULT '0'; +CREATE TABLE `poller_groups` (`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,`group_name` VARCHAR( 255 ) NOT NULL ,`descr` VARCHAR( 255 ) NOT NULL) ENGINE = INNODB; +ALTER TABLE `links` ADD `local_device_id` INT NOT NULL AFTER `local_port_id` , ADD `remote_device_id` INT NOT NULL AFTER `remote_hostname` ; +ALTER TABLE `links` ADD INDEX ( `local_device_id` , `remote_device_id` ) ; +CREATE TABLE IF NOT EXISTS `device_groups` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL DEFAULT '', `desc` varchar(255) NOT NULL DEFAULT '', `pattern` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`)) ENGINE=InnoDB; +CREATE TABLE IF NOT EXISTS `alert_map` ( `id` int(11) NOT NULL AUTO_INCREMENT, `rule` int(11) NOT NULL DEFAULT '0', `target` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '', PRIMARY KEY (`id`)) ENGINE=InnoDB; +ALTER TABLE `alert_rules` ADD UNIQUE (`name`); +ALTER TABLE `alert_rules` CHANGE `device_id` `device_id` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''; +CREATE TABLE `callback` ( `callback_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `name` CHAR( 64 ) NOT NULL , `value` CHAR( 64 ) NOT NULL ) ENGINE = INNODB; +ALTER TABLE `alert_log` ADD INDEX ( `time_logged` ); +ALTER TABLE `alert_schedule` DROP `device_id`; +ALTER TABLE `alert_schedule` CHANGE `id` `schedule_id` INT( 11 ) NOT NULL AUTO_INCREMENT; +ALTER TABLE `alert_schedule` ADD `title` VARCHAR( 255 ) NOT NULL ,ADD `notes` TEXT NOT NULL ; +CREATE TABLE `librenms`.`alert_schedule_items` (`item_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,`schedule_id` INT NOT NULL ,`target` VARCHAR( 255 ) NOT NULL ,INDEX ( `schedule_id` )) ENGINE = INNODB; +ALTER TABLE device_groups MODIFY COLUMN pattern TEXT; +ALTER TABLE `sensors` ADD `sensor_custom` ENUM( 'No', 'Yes' ) NOT NULL DEFAULT 'No' AFTER `sensor_alert` ; +DROP TABLE IF EXISTS `config`; +CREATE TABLE `config` ( `config_id` int(11) NOT NULL AUTO_INCREMENT, `config_name` varchar(255) NOT NULL, `config_value` varchar(512) NOT NULL, `config_default` varchar(512) NOT NULL, `config_descr` varchar(100) NOT NULL, `config_group` varchar(50) NOT NULL, `config_group_order` int(11) NOT NULL, `config_sub_group` varchar(50) NOT NULL, `config_sub_group_order` int(11) NOT NULL, `config_hidden` enum('0','1') NOT NULL DEFAULT '0', `config_disabled` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`config_id`)) ENGINE=InnoDB AUTO_INCREMENT=720 DEFAULT CHARSET=latin1; +INSERT INTO `config` VALUES (441,'alert.macros.rule.now','NOW()','NOW()','Macro currenttime','alerting',0,'macros',0,'1','0'),(442,'alert.macros.rule.past_5m','DATE_SUB(NOW(),INTERVAL 5 MINUTE)','DATE_SUB(NOW(),INTERVAL 5 MINUTE)','Macro past 5 minutes','alerting',0,'macros',0,'1','0'),(443,'alert.macros.rule.past_10m','DATE_SUB(NOW(),INTERVAL 10 MINUTE)','DATE_SUB(NOW(),INTERVAL 10 MINUTE)','Macro past 10 minutes','alerting',0,'macros',0,'1','0'),(444,'alert.macros.rule.past_15m','DATE_SUB(NOW(),INTERVAL 15 MINUTE)','DATE_SUB(NOW(),INTERVAL 15 MINUTE)','Macro past 15 minutes','alerting',0,'macros',0,'1','0'),(445,'alert.macros.rule.past_30m','DATE_SUB(NOW(),INTERVAL 30 MINUTE)','DATE_SUB(NOW(),INTERVAL 30 MINUTE)','Macro past 30 minutes','alerting',0,'macros',0,'1','0'),(446,'alert.macros.rule.device','(%devices.disabled = 0 && %devices.ignore = 0)','(%devices.disabled = 0 && %devices.ignore = 0)','Devices that aren\'t disabled or ignored','alerting',0,'macros',0,'1','0'),(447,'alert.macros.rule.device_up','(%devices.status = 1 && %macros.device)','(%devices.status = 1 && %macros.device)','Devices that are up','alerting',0,'macros',0,'1','0'),(448,'alert.macros.rule.device_down','(%devices.status = 0 && %macros.device)','(%devices.status = 0 && %macros.device)','Devices that are down','alerting',0,'macros',0,'1','0'),(449,'alert.macros.rule.port','(%ports.deleted = 0 && %ports.ignore = 0 && %ports.disabled = 0)','(%ports.deleted = 0 && %ports.ignore = 0 && %ports.disabled = 0)','Ports that aren\'t disabled, ignored or delete','alerting',0,'macros',0,'1','0'),(450,'alert.macros.rule.port_up','(%ports.ifOperStatus = \"up\" && %ports.ifAdminStatus = \"up\" && %macros.port)','(%ports.ifOperStatus = \"up\" && %ports.ifAdminStatus = \"up\" && %macros.port)','Ports that are up','alerting',0,'macros',0,'1','0'),(451,'alert.admins','true','true','Alert administrators','alerting',0,'general',0,'0','0'),(452,'alert.default_only','true','true','Only alert default mail contact','alerting',0,'general',0,'0','0'),(453,'alert.default_mail','','','The default mail contact','alerting',0,'general',0,'0','0'),(454,'alert.transports.pagerduty','','','Pagerduty transport - put your API key here','alerting',0,'transports',0,'0','0'),(455,'alert.pagerduty.account','','','Pagerduty account name','alerting',0,'transports',0,'0','0'),(456,'alert.pagerduty.service','','','Pagerduty service name','alerting',0,'transports',0,'0','0'),(457,'alert.tolerance_window','5','5','Tolerance window in seconds','alerting',0,'general',0,'0','0'),(458,'email_backend','mail','mail','The backend to use for sending email, can be mail, sendmail or smtp','alerting',0,'general',0,'0','0'),(459,'alert.macros.rule.past_60m','DATE_SUB(NOW(),INTERVAL 60 MINUTE)','DATE_SUB(NOW(),INTERVAL 60 MINUTE)','Macro past 60 minutes','alerting',0,'macros',0,'1','0'),(460,'alert.macros.rule.port_usage_perc','((%ports.ifInOctets_rate*8)/%ports.ifSpeed)*100','((%ports.ifInOctets_rate*8)/%ports.ifSpeed)*100','Ports using more than X perc','alerting',0,'macros',0,'1','0'),(461,'alert.transports.dummy','false','false','Dummy transport','alerting',0,'transports',0,'0','0'),(462,'alert.transports.mail','true','true','Mail alerting transport','alerting',0,'transports',0,'0','0'),(463,'alert.transports.irc','FALSE','false','IRC alerting transport','alerting',0,'transports',0,'0','0'),(464,'alert.globals','true','TRUE','Alert read only administrators','alerting',0,'general',0,'0','0'),(465,'email_from','NULL','NULL','Email address used for sending emails (from)','alerting',0,'general',0,'0','0'),(466,'email_user','LibreNMS','LibreNMS','Name used as part of the from address','alerting',0,'general',0,'0','0'),(467,'email_sendmail_path','/usr/sbin/sendmail','/usr/sbin/sendmail','Location of sendmail if using this option','alerting',0,'general',0,'0','0'),(468,'email_smtp_host','localhost','localhost','SMTP Host for sending email if using this option','alerting',0,'general',0,'0','0'),(469,'email_smtp_port','25','25','SMTP port setting','alerting',0,'general',0,'0','0'),(470,'email_smtp_timeout','10','10','SMTP timeout setting','alerting',0,'general',0,'0','0'),(471,'email_smtp_secure','','','Enable / disable encryption (use tls or ssl)','alerting',0,'general',0,'0','0'),(472,'email_smtp_auth','false','FALSE','Enable / disable smtp authentication','alerting',0,'general',0,'0','0'),(473,'email_smtp_username','NULL','NULL','SMTP Auth username','alerting',0,'general',0,'0','0'),(474,'email_smtp_password','NULL','NULL','SMTP Auth password','alerting',0,'general',0,'0','0'),(475,'alert.macros.rule.port_down','(%ports.ifOperStatus = \"down\" && %ports.ifAdminStatus != \"down\" && %macros.port)','(%ports.ifOperStatus = \"down\" && %ports.ifAdminStatus != \"down\" && %macros.port)','Ports that are down','alerting',0,'macros',0,'1','0'),(486,'alert.syscontact','true','TRUE','Issue alerts to sysContact','alerting',0,'general',0,'0','0'),(487,'alert.fixed-contacts','true','TRUE','If TRUE any changes to sysContact or users emails will not be honoured whilst alert is active','alerting',0,'general',0,'0','0'),(488,'alert.transports.nagios','','','Nagios compatible via FIFO','alerting',0,'transports',0,'0','0'); +ALTER TABLE `munin_plugins` CHANGE `mplug_type` `mplug_type` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL; +ALTER TABLE slas ENGINE=InnoDB; +ALTER TABLE packages ENGINE=InnoDB; +ALTER TABLE munin_plugins_ds ENGINE=InnoDB; +ALTER TABLE munin_plugins ENGINE=InnoDB; +ALTER TABLE loadbalancer_vservers ENGINE=InnoDB; +ALTER TABLE loadbalancer_rservers ENGINE=InnoDB; +ALTER TABLE ipsec_tunnels ENGINE=InnoDB; +CREATE TABLE `alert_template_map` (`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,`alert_templates_id` INT NOT NULL ,`alert_rule_id` INT NOT NULL ,INDEX ( `alert_templates_id` , `alert_rule_id` )) ENGINE = INNODB +ALTER TABLE `graph_types` CHANGE `graph_subtype` `graph_subtype` varchar(64); +ALTER TABLE `device_graphs` CHANGE `graph` `graph` varchar(64); +ALTER TABLE `graph_types` CHANGE `graph_descr` `graph_descr` varchar(255); +ALTER TABLE `graph_types` ADD PRIMARY KEY (`graph_type`, `graph_subtype`, `graph_section`); +insert into config (config_name,config_value,config_default,config_descr,config_group,config_group_order,config_sub_group,config_sub_group_order,config_hidden,config_disabled) values ('alert.macros.rule.sensor','(%sensors.sensor_alert = 1)','(%sensors.sensor_alert = 1)','Sensors of interest','alerting',0,'macros',0,1,0); +CREATE TABLE IF NOT EXISTS `device_perf` ( `id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `timestamp` datetime NOT NULL, `xmt` float NOT NULL, `rcv` float NOT NULL, `loss` float NOT NULL, `min` float NOT NULL, `max` float NOT NULL, `avg` float NOT NULL, KEY `id` (`id`,`device_id`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; +insert into config (config_name,config_value,config_default,config_descr,config_group,config_group_order,config_sub_group,config_sub_group_order,config_hidden,config_disabled) values ('alert.macros.rule.packet_loss_15m','(%macros.past_15m && %device_perf.loss)','(%macros.past_15m && %device_perf.loss)','Packet loss over the last 15 minutes','alerting',0,'macros',0,1,0); +insert into config (config_name,config_value,config_default,config_descr,config_group,config_group_order,config_sub_group,config_sub_group_order,config_hidden,config_disabled) values ('alert.macros.rule.packet_loss_5m','(%macros.past_5m && %device_perf.loss)','(%macros.past_5m && %device_perf.loss)','Packet loss over the last 5 minutes','alerting',0,'macros',0,1,0); +ALTER TABLE `devices` ADD `status_reason` VARCHAR( 50 ) NOT NULL AFTER `status` ; +UPDATE `devices` SET `status_reason`='down' WHERE `status`=0; +ALTER TABLE `ipv4_mac` CHANGE `mac_address` `mac_address` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , CHANGE `ipv4_address` `ipv4_address` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL +ALTER TABLE `ipv4_mac` ADD INDEX ( `port_id`), ADD INDEX (`mac_address` ) +ALTER TABLE `ipv4_mac` DROP INDEX `interface_id`, DROP INDEX `interface_id_2` +CREATE TABLE `locations` ( `id` INT NOT NULL AUTO_INCREMENT ,`location` TEXT NOT NULL ,`lat` FLOAT( 10, 6 ) NOT NULL ,`lng` FLOAT( 10, 6 ) NOT NULL ,`timestamp` DATETIME NOT NULL ,INDEX ( `id` )) ENGINE = INNODB; +ALTER TABLE `devices` ADD `override_sysLocation` bool DEFAULT false; +UPDATE `devices` LEFT JOIN devices_attribs AS sysloc_bool ON(devices.device_id=sysloc_bool.device_id and sysloc_bool.attrib_type = 'override_sysLocation_bool') LEFT JOIN devices_attribs AS sysloc_string ON(devices.device_id=sysloc_string.device_id and sysloc_string.attrib_type = 'override_sysLocation_string') SET `override_sysLocation` = true, `location` = sysloc_string.attrib_value WHERE sysloc_bool.attrib_value = 1; +CREATE TABLE `users_widgets` ( `user_widget_id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `widget_id` int(11) NOT NULL, `col` tinyint(4) NOT NULL, `row` tinyint(4) NOT NULL, `size_x` tinyint(4) NOT NULL, `size_y` tinyint(4) NOT NULL, `title` varchar(255) NOT NULL, `refresh` tinyint(4) NOT NULL DEFAULT '60', PRIMARY KEY (`user_widget_id`), KEY `user_id` (`user_id`,`widget_id`) ) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=latin1; +CREATE TABLE `widgets` ( `widget_id` int(11) NOT NULL AUTO_INCREMENT, `widget_title` varchar(255) NOT NULL, `widget` varchar(255) NOT NULL, `base_dimensions` varchar(10) NOT NULL, PRIMARY KEY (`widget_id`), UNIQUE KEY `widget` (`widget`)) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; +INSERT INTO `widgets` (`widget_id`, `widget_title`, `widget`, `base_dimensions`) VALUES (1, 'Availability map', 'availability-map', '4,3'), (2, 'Device summary horizontal', 'device-summary-horiz', '4,2'), (3, 'Alerts', 'alerts', '8,4'), (4, 'Device summary vertical', 'device-summary-vert', '4,3'), (5, 'World map', 'globe', '3,3'); +INSERT INTO `widgets` (`widget_title`, `widget`, `base_dimensions`) VALUES ('Syslog', 'syslog', '9,3'), ('Eventlog', 'eventlog', '9,5'), ('Global Map', 'worldmap', '8,6'); +ALTER TABLE `device_perf` DROP INDEX `id` , ADD INDEX `id` ( `id` ), ADD INDEX ( `device_id` ); +ALTER TABLE `bgpPeers` MODIFY `bgpPeerRemoteAs` bigint(20) NOT NULL; +INSERT INTO `widgets` (`widget_title`, `widget`, `base_dimensions`) VALUES ('Graylog', 'graylog', '9,7'); +insert into config (config_name,config_value,config_default,config_descr,config_group,config_group_order,config_sub_group,config_sub_group_order,config_hidden,config_disabled) values ('alert.transports.pushbullet','','','Pushbullet access token','alerting',0,'transports',0,'0','0'); +DELETE n1 FROM pollers n1, pollers n2 WHERE n1.last_polled < n2.last_polled and n1.poller_name = n2.poller_name; +ALTER TABLE pollers ADD PRIMARY KEY (poller_name); +ALTER TABLE `devices` ADD `last_poll_attempted` timestamp NULL DEFAULT NULL AFTER `last_polled`; +ALTER TABLE `devices` ADD INDEX `last_polled` (`last_polled`); +ALTER TABLE `devices` ADD INDEX `last_poll_attempted` (`last_poll_attempted`); +ALTER TABLE `alert_templates` ADD `title` VARCHAR(255) NULL DEFAULT NULL; +ALTER TABLE `alert_templates` ADD `title_rec` VARCHAR(255) NULL DEFAULT NULL; +CREATE TABLE `proxmox` ( `id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL DEFAULT '0', `vmid` int(11) NOT NULL, `cluster` varchar(255) NOT NULL, `description` varchar(255) DEFAULT NULL, `last_seen` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `cluster_vm` (`cluster`,`vmid`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE `proxmox_ports` ( `id` int(11) NOT NULL AUTO_INCREMENT, `vm_id` int(11) NOT NULL, `port` varchar(10) NOT NULL, `last_seen` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `vm_port` (`vm_id`,`port`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; +ALTER TABLE `applications` ADD COLUMN `app_instance` varchar(255) NOT NULL; diff --git a/html/install.php b/html/install.php index 73ee6e8ce..127af0b17 100644 --- a/html/install.php +++ b/html/install.php @@ -1,9 +1,16 @@ " . mysqli_connect_error(); } - else { - $sql = "SELECT * FROM users LIMIT 1"; - if(mysqli_query($test_db,$sql)) { - $stage = 3; - $msg = "It appears that the database is already setup so have moved onto stage $stage"; + elseif ($stage != 3) { + if($_SESSION['build-ok'] == true) { + $stage = 3; + $msg = "It appears that the database is already setup so have moved onto stage $stage"; } } + $_SESSION['stage'] = $stage; } elseif($stage == "4") { // Now check we have a username, password and email before adding new user if(empty($add_user) || empty($add_pass) || empty($add_email)) { - $stage = 4; + $stage = 3; $msg = "You haven't entered enough information to add the user account, please check below and re-try"; } } @@ -302,6 +309,7 @@ elseif($stage == "2") {
    Importing MySQL DB - Do not close this page or interrupt the import
    +
     
    +
    diff --git a/includes/sql-schema/update.php b/includes/sql-schema/update.php index 505082615..264f1601b 100644 --- a/includes/sql-schema/update.php +++ b/includes/sql-schema/update.php @@ -147,17 +147,16 @@ foreach ($filelist as $file) { $updating++; $db_rev = $filename; + if ($insert) { + dbInsert(array('version' => $db_rev), 'dbSchema'); + } + else { + dbUpdate(array('version' => $db_rev), 'dbSchema'); + } }//end if }//end foreach if ($updating) { - if ($insert) { - dbInsert(array('version' => $db_rev), 'dbSchema'); - } - else { - dbUpdate(array('version' => $db_rev), 'dbSchema'); - } - echo "-- Done\n"; } From 3f7c37a523f86300066aca2c7982e4bac2a2b446 Mon Sep 17 00:00:00 2001 From: f0o Date: Tue, 1 Sep 2015 22:53:07 +0100 Subject: [PATCH 178/263] revision fix --- build-base.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build-base.php b/build-base.php index dbfe8e3da..c496850d2 100644 --- a/build-base.php +++ b/build-base.php @@ -52,10 +52,8 @@ while (!feof($sql_fh)) { } fclose($sql_fh); +dbInsert(array('version' => 67), 'dbSchema'); -if( !isset($_SESSION['stage']) ) { - require 'includes/sql-schema/update.php'; -} else { +if( isset($_SESSION['stage']) ) { $_SESSION['build-ok'] = true; - dbInsert(array('version' => 67), 'dbSchema'); } From 2fd423f9fc20ac15ef55387f0669736f4587967c Mon Sep 17 00:00:00 2001 From: f0o Date: Tue, 1 Sep 2015 23:31:41 +0100 Subject: [PATCH 179/263] Revert build.sql Make update.php responsive --- build-base.php | 3 +- build.sql | 448 +-------------------------------- html/install.php | 2 +- includes/sql-schema/update.php | 10 + 4 files changed, 16 insertions(+), 447 deletions(-) diff --git a/build-base.php b/build-base.php index c496850d2..507abb266 100644 --- a/build-base.php +++ b/build-base.php @@ -52,7 +52,8 @@ while (!feof($sql_fh)) { } fclose($sql_fh); -dbInsert(array('version' => 67), 'dbSchema'); + +require 'includes/sql-schema/update.php'; if( isset($_SESSION['stage']) ) { $_SESSION['build-ok'] = true; diff --git a/build.sql b/build.sql index 39d87c8cf..9f4526069 100644 --- a/build.sql +++ b/build.sql @@ -70,9 +70,12 @@ CREATE TABLE IF NOT EXISTS `frequency` ( `freq_id` int(11) NOT NULL auto_increme CREATE TABLE IF NOT EXISTS `current` ( `current_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL default '0', `current_oid` varchar(64) NOT NULL, `current_index` varchar(8) NOT NULL, `current_type` varchar(32) NOT NULL, `current_descr` varchar(32) NOT NULL default '', `current_precision` int(11) NOT NULL default '1', `current_current` float default NULL, `current_limit` float default NULL, `current_limit_warn` float default NULL, `current_limit_low` float default NULL, PRIMARY KEY (`current_id`), KEY `current_host` (`device_id`)) ENGINE=MyISAM AUTO_INCREMENT=189 DEFAULT CHARSET=latin1; CREATE TABLE IF NOT EXISTS `ucd_diskio` ( `diskio_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `diskio_index` int(11) NOT NULL, `diskio_descr` varchar(32) NOT NULL, PRIMARY KEY (`diskio_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ; CREATE TABLE IF NOT EXISTS `applications` ( `app_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `app_type` varchar(64) NOT NULL, PRIMARY KEY (`app_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; +## 0.10.6 CREATE TABLE IF NOT EXISTS `sensors` ( `sensor_id` int(11) NOT NULL auto_increment, `sensor_class` varchar(64) NOT NULL, `device_id` int(11) NOT NULL default '0', `sensor_oid` varchar(64) NOT NULL, `sensor_index` varchar(8) NOT NULL, `sensor_type` varchar(32) NOT NULL, `sensor_descr` varchar(32) NOT NULL default '', `sensor_precision` int(11) NOT NULL default '1', `sensor_current` float default NULL, `sensor_limit` float default NULL, `sensor_limit_warn` float default NULL, `sensor_limit_low` float default NULL, `sensor_limit_low_warn` float default NULL, PRIMARY KEY (`sensor_id`), KEY `sensor_host` (`device_id`)) ENGINE=MyISAM AUTO_INCREMENT=189 DEFAULT CHARSET=latin1; CREATE TABLE IF NOT EXISTS `ports_adsl` ( `interface_id` int(11) NOT NULL, `port_adsl_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `adslLineCoding` varchar(8) COLLATE utf8_bin NOT NULL, `adslLineType` varchar(16) COLLATE utf8_bin NOT NULL, `adslAtucInvVendorID` varchar(8) COLLATE utf8_bin NOT NULL, `adslAtucInvVersionNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAtucCurrSnrMgn` decimal(5,1) NOT NULL, `adslAtucCurrAtn` decimal(5,1) NOT NULL, `adslAtucCurrOutputPwr` decimal(5,1) NOT NULL, `adslAtucCurrAttainableRate` int(11) NOT NULL, `adslAtucChanCurrTxRate` int(11) NOT NULL, `adslAturInvSerialNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturInvVendorID` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturInvVersionNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturChanCurrTxRate` int(11) NOT NULL, `adslAturCurrSnrMgn` decimal(5,1) NOT NULL, `adslAturCurrAtn` decimal(5,1) NOT NULL, `adslAturCurrOutputPwr` decimal(5,1) NOT NULL, `adslAturCurrAttainableRate` int(11) NOT NULL, UNIQUE KEY `interface_id` (`interface_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +## 0.10.7 CREATE TABLE IF NOT EXISTS `perf_times` ( `type` varchar(8) NOT NULL, `doing` varchar(64) NOT NULL, `start` int(11) NOT NULL, `duration` double(5,2) NOT NULL, `devices` int(11) NOT NULL, KEY `type` (`type`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +## 0.10.7.1 CREATE TABLE IF NOT EXISTS `device_graphs` ( `device_id` int(11) NOT NULL, `graph` varchar(32) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; CREATE TABLE IF NOT EXISTS `graph_types` ( `graph_type` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_subtype` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_section` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_descr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `graph_order` int(11) NOT NULL, KEY `graph_type` (`graph_type`), KEY `graph_subtype` (`graph_subtype`), KEY `graph_section` (`graph_section`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `graph_types` (`graph_type`, `graph_subtype`, `graph_section`, `graph_descr`, `graph_order`) VALUES('device', 'bits', 'netstats', 'Total Traffic', 0),('device', 'hr_users', 'system', 'Users Logged In', 0),('device', 'ucd_load', 'system', 'Load Averages', 0),('device', 'ucd_cpu', 'system', 'Detailed Processor Usage', 0),('device', 'ucd_memory', 'system', 'Detailed Memory Usage', 0),('device', 'netstat_tcp', 'netstats', 'TCP Statistics', 0),('device', 'netstat_icmp_info', 'netstats', 'ICMP Informational Statistics', 0),('device', 'netstat_icmp_stat', 'netstats', 'ICMP Statistics', 0),('device', 'netstat_ip', 'netstats', 'IP Statistics', 0),('device', 'netstat_ip_frag', 'netstats', 'IP Fragmentation Statistics', 0),('device', 'netstat_udp', 'netstats', 'UDP Statistics', 0),('device', 'netstat_snmp', 'netstats', 'SNMP Statistics', 0),('device', 'temperatures', 'system', 'Temperatures', 0),('device', 'mempools', 'system', 'Memory Pool Usage', 0),('device', 'processors', 'system', 'Processor Usage', 0),('device', 'storage', 'system', 'Filesystem Usage', 0),('device', 'hr_processes', 'system', 'Running Processes', 0),('device', 'uptime', 'system', 'System Uptime', 0),('device', 'ipsystemstats_ipv4', 'netstats', 'IPv4 Packet Statistics', 0),('device', 'ipsystemstats_ipv6_frag', 'netstats', 'IPv6 Fragmentation Statistics', 0),('device', 'ipsystemstats_ipv6', 'netstats', 'IPv6 Packet Statistics', 0),('device', 'ipsystemstats_ipv4_frag', 'netstats', 'IPv4 Fragmentation Statistics', 0),('device', 'fortigate_sessions', 'firewall', 'Active Sessions', 0), ('device', 'screenos_sessions', 'firewall', 'Active Sessions', 0), ('device', 'fdb_count', 'system', 'MAC Addresses Learnt', 0),('device', 'cras_sessions', 'firewall', 'Remote Access Sessions', 0); @@ -95,448 +98,3 @@ CREATE TABLE IF NOT EXISTS `slas` ( `sla_id` int(11) NOT NULL auto_increment, CREATE TABLE IF NOT EXISTS `munin_plugins` ( `mplug_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `mplug_type` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `mplug_instance` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_category` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_title` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_info` text CHARACTER SET utf8 COLLATE utf8_bin, `mplug_vlabel` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_args` varchar(512) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_total` binary(1) NOT NULL DEFAULT '0', `mplug_graph` binary(1) NOT NULL DEFAULT '1', PRIMARY KEY (`mplug_id`), UNIQUE KEY `UNIQUE` (`device_id`,`mplug_type`), KEY `device_id` (`device_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin ; CREATE TABLE IF NOT EXISTS `munin_plugins_ds` ( `mplug_id` int(11) NOT NULL, `ds_name` varchar(32) COLLATE utf8_bin NOT NULL, `ds_type` enum('COUNTER','ABSOLUTE','DERIVE','GAUGE') COLLATE utf8_bin NOT NULL DEFAULT 'GAUGE', `ds_label` varchar(64) COLLATE utf8_bin NOT NULL, `ds_cdef` text COLLATE utf8_bin NOT NULL, `ds_draw` varchar(64) COLLATE utf8_bin NOT NULL, `ds_graph` enum('no','yes') COLLATE utf8_bin NOT NULL DEFAULT 'yes', `ds_info` varchar(255) COLLATE utf8_bin NOT NULL, `ds_extinfo` text COLLATE utf8_bin NOT NULL, `ds_max` varchar(32) COLLATE utf8_bin NOT NULL, `ds_min` varchar(32) COLLATE utf8_bin NOT NULL, `ds_negative` varchar(32) COLLATE utf8_bin NOT NULL, `ds_warning` varchar(32) COLLATE utf8_bin NOT NULL, `ds_critical` varchar(32) COLLATE utf8_bin NOT NULL, `ds_colour` varchar(32) COLLATE utf8_bin NOT NULL, `ds_sum` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `ds_stack` text COLLATE utf8_bin NOT NULL, `ds_line` varchar(64) COLLATE utf8_bin NOT NULL, UNIQUE KEY `splug_id` (`mplug_id`,`ds_name`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; CREATE TABLE IF NOT EXISTS `access_points` ( `accesspoint_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `radio_number` tinyint(4) DEFAULT NULL, `type` varchar(16) NOT NULL, `mac_addr` varchar(24) NOT NULL, `deleted` tinyint(1) NOT NULL DEFAULT '0', `channel` tinyint(4) unsigned NOT NULL DEFAULT '0', `txpow` tinyint(4) NOT NULL DEFAULT '0', `radioutil` tinyint(4) NOT NULL DEFAULT '0', `numasoclients` smallint(6) NOT NULL DEFAULT '0', `nummonclients` smallint(6) NOT NULL DEFAULT '0', `numactbssid` tinyint(4) NOT NULL DEFAULT '0', `nummonbssid` tinyint(4) NOT NULL DEFAULT '0', `interference` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`accesspoint_id`), KEY `deleted` (`deleted`), KEY `name` (`name`,`radio_number`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Access Points'; -CREATE TABLE IF NOT EXISTS `alerts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `importance` int(11) NOT NULL DEFAULT '0', `device_id` int(11) NOT NULL, `message` text NOT NULL, `time_logged` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `alerted` smallint(6) NOT NULL DEFAULT '0', KEY `id` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `applications` ( `app_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `app_type` varchar(64) NOT NULL, PRIMARY KEY (`app_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `authlog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `user` text NOT NULL, `address` text NOT NULL, `result` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `bgpPeers` ( `bgpPeer_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `astext` varchar(64) NOT NULL, `bgpPeerIdentifier` text NOT NULL, `bgpPeerRemoteAs` int(11) NOT NULL, `bgpPeerState` text NOT NULL, `bgpPeerAdminStatus` text NOT NULL, `bgpLocalAddr` text NOT NULL, `bgpPeerRemoteAddr` text NOT NULL, `bgpPeerInUpdates` int(11) NOT NULL, `bgpPeerOutUpdates` int(11) NOT NULL, `bgpPeerInTotalMessages` int(11) NOT NULL, `bgpPeerOutTotalMessages` int(11) NOT NULL, `bgpPeerFsmEstablishedTime` int(11) NOT NULL, `bgpPeerInUpdateElapsedTime` int(11) NOT NULL, PRIMARY KEY (`bgpPeer_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `bgpPeers_cbgp` ( `device_id` int(11) NOT NULL, `bgpPeerIdentifier` varchar(64) NOT NULL, `afi` varchar(16) NOT NULL, `safi` varchar(16) NOT NULL, KEY `device_id` (`device_id`,`bgpPeerIdentifier`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `bills` ( `bill_id` int(11) NOT NULL AUTO_INCREMENT, `bill_name` text NOT NULL, `bill_type` text NOT NULL, `bill_cdr` int(11) DEFAULT NULL, `bill_day` int(11) NOT NULL DEFAULT '1', `bill_gb` int(11) DEFAULT NULL, `rate_95th_in` int(11) NOT NULL, `rate_95th_out` int(11) NOT NULL, `rate_95th` int(11) NOT NULL, `dir_95th` varchar(3) NOT NULL, `total_data` int(11) NOT NULL, `total_data_in` int(11) NOT NULL, `total_data_out` int(11) NOT NULL, `rate_average_in` int(11) NOT NULL, `rate_average_out` int(11) NOT NULL, `rate_average` int(11) NOT NULL, `bill_last_calc` datetime NOT NULL, `bill_custid` varchar(64) NOT NULL, `bill_ref` varchar(64) NOT NULL, `bill_notes` varchar(256) NOT NULL, `bill_autoadded` tinyint(1) NOT NULL, UNIQUE KEY `bill_id` (`bill_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; -CREATE TABLE IF NOT EXISTS `bill_data` ( `bill_id` int(11) NOT NULL, `timestamp` datetime NOT NULL, `period` int(11) NOT NULL, `delta` bigint(11) NOT NULL, `in_delta` bigint(11) NOT NULL, `out_delta` bigint(11) NOT NULL, KEY `bill_id` (`bill_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `bill_perms` ( `user_id` int(11) NOT NULL, `bill_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `bill_ports` ( `bill_id` int(11) NOT NULL, `port_id` int(11) NOT NULL, `bill_port_autoadded` tinyint(1) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `cef_switching` ( `cef_switching_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `entPhysicalIndex` int(11) NOT NULL, `afi` varchar(4) COLLATE utf8_unicode_ci NOT NULL, `cef_index` int(11) NOT NULL, `cef_path` varchar(16) COLLATE utf8_unicode_ci NOT NULL, `drop` int(11) NOT NULL, `punt` int(11) NOT NULL, `punt2host` int(11) NOT NULL, `drop_prev` int(11) NOT NULL, `punt_prev` int(11) NOT NULL, `punt2host_prev` int(11) NOT NULL, `updated` int(11) NOT NULL, `updated_prev` int(11) NOT NULL, PRIMARY KEY (`cef_switching_id`), UNIQUE KEY `device_id` (`device_id`,`entPhysicalIndex`,`afi`,`cef_index`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `customers` ( `customer_id` int(11) NOT NULL AUTO_INCREMENT, `username` char(64) NOT NULL, `password` char(32) NOT NULL, `string` char(64) NOT NULL, `level` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`customer_id`), UNIQUE KEY `username` (`username`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `dbSchema` ( `revision` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`revision`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `devices` ( `device_id` int(11) NOT NULL AUTO_INCREMENT, `hostname` varchar(128) CHARACTER SET latin1 NOT NULL, `sysName` varchar(128) CHARACTER SET latin1 DEFAULT NULL, `community` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `snmpver` varchar(4) CHARACTER SET latin1 NOT NULL DEFAULT 'v2c', `port` smallint(5) unsigned NOT NULL DEFAULT '161', `transport` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'udp', `timeout` int(11) DEFAULT NULL, `retries` int(11) DEFAULT NULL, `bgpLocalAs` varchar(16) CHARACTER SET latin1 DEFAULT NULL, `sysDescr` text CHARACTER SET latin1, `sysContact` text CHARACTER SET latin1, `version` text CHARACTER SET latin1, `hardware` text CHARACTER SET latin1, `features` text CHARACTER SET latin1, `location` text COLLATE utf8_unicode_ci, `os` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `status` tinyint(4) NOT NULL DEFAULT '0', `ignore` tinyint(4) NOT NULL DEFAULT '0', `disabled` tinyint(1) NOT NULL DEFAULT '0', `uptime` bigint(20) DEFAULT NULL, `agent_uptime` int(11) NOT NULL, `last_polled` timestamp NULL DEFAULT NULL, `last_polled_timetaken` double(5,2) DEFAULT NULL, `last_discovered_timetaken` double(5,2) DEFAULT NULL, `last_discovered` timestamp NULL DEFAULT NULL, `purpose` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, `type` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `serial` text COLLATE utf8_unicode_ci, PRIMARY KEY (`device_id`), KEY `status` (`status`), KEY `hostname` (`hostname`), KEY `sysName` (`sysName`), KEY `os` (`os`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `devices_attribs` ( `attrib_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `attrib_type` varchar(32) NOT NULL, `attrib_value` text NOT NULL, `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`attrib_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `devices_perms` ( `user_id` int(11) NOT NULL, `device_id` int(11) NOT NULL, `access_level` int(4) NOT NULL DEFAULT '0', KEY `user_id` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `device_graphs` ( `device_id` int(11) NOT NULL, `graph` varchar(32) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `entPhysical` ( `entPhysical_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `entPhysicalIndex` int(11) NOT NULL, `entPhysicalDescr` text NOT NULL, `entPhysicalClass` text NOT NULL, `entPhysicalName` text NOT NULL, `entPhysicalHardwareRev` varchar(64) DEFAULT NULL, `entPhysicalFirmwareRev` varchar(64) DEFAULT NULL, `entPhysicalSoftwareRev` varchar(64) DEFAULT NULL, `entPhysicalAlias` varchar(32) DEFAULT NULL, `entPhysicalAssetID` varchar(32) DEFAULT NULL, `entPhysicalIsFRU` varchar(8) DEFAULT NULL, `entPhysicalModelName` text NOT NULL, `entPhysicalVendorType` text, `entPhysicalSerialNum` text NOT NULL, `entPhysicalContainedIn` int(11) NOT NULL, `entPhysicalParentRelPos` int(11) NOT NULL, `entPhysicalMfgName` text NOT NULL, `ifIndex` int(11) DEFAULT NULL, PRIMARY KEY (`entPhysical_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `eventlog` ( `event_id` int(11) NOT NULL AUTO_INCREMENT, `host` int(11) NOT NULL DEFAULT '0', `datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `message` text CHARACTER SET latin1, `type` varchar(64) CHARACTER SET latin1 DEFAULT NULL, `reference` varchar(64) CHARACTER SET latin1 NOT NULL, PRIMARY KEY (`event_id`), KEY `host` (`host`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `graph_types` ( `graph_type` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_subtype` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_section` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_descr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `graph_order` int(11) NOT NULL, KEY `graph_type` (`graph_type`), KEY `graph_subtype` (`graph_subtype`), KEY `graph_section` (`graph_section`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `graph_types_dead` ( `graph_type` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_subtype` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_section` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_descr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `graph_order` int(11) NOT NULL, KEY `graph_type` (`graph_type`), KEY `graph_subtype` (`graph_subtype`), KEY `graph_section` (`graph_section`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `hrDevice` ( `hrDevice_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `hrDeviceIndex` int(11) NOT NULL, `hrDeviceDescr` text CHARACTER SET latin1 NOT NULL, `hrDeviceType` text CHARACTER SET latin1 NOT NULL, `hrDeviceErrors` int(11) NOT NULL, `hrDeviceStatus` text CHARACTER SET latin1 NOT NULL, `hrProcessorLoad` tinyint(4) DEFAULT NULL, PRIMARY KEY (`hrDevice_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `ipv4_addresses` ( `ipv4_address_id` int(11) NOT NULL AUTO_INCREMENT,`ipv4_address` varchar(32) CHARACTER SET latin1 NOT NULL, `ipv4_prefixlen` int(11) NOT NULL,`ipv4_network_id` varchar(32) CHARACTER SET latin1 NOT NULL, `interface_id` int(11) NOT NULL,PRIMARY KEY (`ipv4_address_id`), KEY `interface_id` (`interface_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `ipv4_mac` ( `interface_id` int(11) NOT NULL, `mac_address` varchar(32) CHARACTER SET latin1 NOT NULL, `ipv4_address` varchar(32) CHARACTER SET latin1 NOT NULL, KEY `interface_id` (`interface_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `ipv4_networks` ( `ipv4_network_id` int(11) NOT NULL AUTO_INCREMENT, `ipv4_network` varchar(64) CHARACTER SET latin1 NOT NULL, PRIMARY KEY (`ipv4_network_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `ipv6_addresses` ( `ipv6_address_id` int(11) NOT NULL AUTO_INCREMENT, `ipv6_address` varchar(128) CHARACTER SET latin1 NOT NULL, `ipv6_compressed` varchar(128) CHARACTER SET latin1 NOT NULL, `ipv6_prefixlen` int(11) NOT NULL, `ipv6_origin` varchar(16) CHARACTER SET latin1 NOT NULL, `ipv6_network_id` varchar(128) CHARACTER SET latin1 NOT NULL, `interface_id` int(11) NOT NULL, PRIMARY KEY (`ipv6_address_id`), KEY `interface_id` (`interface_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `ipv6_networks` ( `ipv6_network_id` int(11) NOT NULL AUTO_INCREMENT, `ipv6_network` varchar(64) CHARACTER SET latin1 NOT NULL, PRIMARY KEY (`ipv6_network_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `juniAtmVp` ( `juniAtmVp_id` int(11) NOT NULL, `interface_id` int(11) NOT NULL, `vp_id` int(11) NOT NULL, `vp_descr` varchar(32) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `links` ( `id` int(11) NOT NULL AUTO_INCREMENT, `local_interface_id` int(11) DEFAULT NULL, `remote_interface_id` int(11) DEFAULT NULL, `active` tinyint(4) NOT NULL DEFAULT '1', `protocol` varchar(11) DEFAULT NULL, `remote_hostname` varchar(128) NOT NULL, `remote_port` varchar(128) NOT NULL, `remote_platform` varchar(128) NOT NULL, `remote_version` varchar(256) NOT NULL, PRIMARY KEY (`id`), KEY `src_if` (`local_interface_id`), KEY `dst_if` (`remote_interface_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `mac_accounting` ( `ma_id` int(11) NOT NULL AUTO_INCREMENT, `interface_id` int(11) NOT NULL, `mac` varchar(32) NOT NULL, `in_oid` varchar(128) NOT NULL, `out_oid` varchar(128) NOT NULL, `bps_out` int(11) NOT NULL, `bps_in` int(11) NOT NULL, `cipMacHCSwitchedBytes_input` bigint(20) DEFAULT NULL, `cipMacHCSwitchedBytes_input_prev` bigint(20) DEFAULT NULL, `cipMacHCSwitchedBytes_input_delta` bigint(20) DEFAULT NULL, `cipMacHCSwitchedBytes_input_rate` int(11) DEFAULT NULL, `cipMacHCSwitchedBytes_output` bigint(20) DEFAULT NULL, `cipMacHCSwitchedBytes_output_prev` bigint(20) DEFAULT NULL, `cipMacHCSwitchedBytes_output_delta` bigint(20) DEFAULT NULL, `cipMacHCSwitchedBytes_output_rate` int(11) DEFAULT NULL, `cipMacHCSwitchedPkts_input` bigint(20) DEFAULT NULL, `cipMacHCSwitchedPkts_input_prev` bigint(20) DEFAULT NULL, `cipMacHCSwitchedPkts_input_delta` bigint(20) DEFAULT NULL, `cipMacHCSwitchedPkts_input_rate` int(11) DEFAULT NULL, `cipMacHCSwitchedPkts_output` bigint(20) DEFAULT NULL, `cipMacHCSwitchedPkts_output_prev` bigint(20) DEFAULT NULL, `cipMacHCSwitchedPkts_output_delta` bigint(20) DEFAULT NULL, `cipMacHCSwitchedPkts_output_rate` int(11) DEFAULT NULL, `poll_time` int(11) DEFAULT NULL, `poll_prev` int(11) DEFAULT NULL, `poll_period` int(11) DEFAULT NULL, PRIMARY KEY (`ma_id`), KEY `interface_id` (`interface_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `mempools` ( `mempool_id` int(11) NOT NULL AUTO_INCREMENT, `mempool_index` varchar(16) CHARACTER SET latin1 NOT NULL, `entPhysicalIndex` int(11) DEFAULT NULL, `hrDeviceIndex` int(11) DEFAULT NULL, `mempool_type` varchar(32) CHARACTER SET latin1 NOT NULL, `mempool_precision` int(11) NOT NULL DEFAULT '1', `mempool_descr` varchar(64) CHARACTER SET latin1 NOT NULL, `device_id` int(11) NOT NULL, `mempool_perc` int(11) NOT NULL, `mempool_used` bigint(16) NOT NULL, `mempool_free` bigint(16) NOT NULL, `mempool_total` bigint(16) NOT NULL, `mempool_largestfree` bigint(16) DEFAULT NULL, `mempool_lowestfree` bigint(16) DEFAULT NULL, PRIMARY KEY (`mempool_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `ospf_areas` ( `device_id` int(11) NOT NULL, `ospfAreaId` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfAuthType` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `ospfImportAsExtern` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `ospfSpfRuns` int(11) NOT NULL, `ospfAreaBdrRtrCount` int(11) NOT NULL, `ospfAsBdrRtrCount` int(11) NOT NULL, `ospfAreaLsaCount` int(11) NOT NULL, `ospfAreaLsaCksumSum` int(11) NOT NULL, `ospfAreaSummary` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `ospfAreaStatus` varchar(64) COLLATE utf8_unicode_ci NOT NULL, UNIQUE KEY `device_area` (`device_id`,`ospfAreaId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `ospf_instances` ( `device_id` int(11) NOT NULL, `ospf_instance_id` int(11) NOT NULL, `ospfRouterId` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfAdminStat` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfVersionNumber` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfAreaBdrRtrStatus` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfASBdrRtrStatus` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfExternLsaCount` int(11) NOT NULL, `ospfExternLsaCksumSum` int(11) NOT NULL, `ospfTOSSupport` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfOriginateNewLsas` int(11) NOT NULL, `ospfRxNewLsas` int(11) NOT NULL, `ospfExtLsdbLimit` int(11) DEFAULT NULL, `ospfMulticastExtensions` int(11) DEFAULT NULL, `ospfExitOverflowInterval` int(11) DEFAULT NULL, `ospfDemandExtensions` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, UNIQUE KEY `device_id` (`device_id`,`ospf_instance_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `ospf_nbrs` ( `device_id` int(11) NOT NULL, `interface_id` int(11) NOT NULL, `ospf_nbr_id` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbrIpAddr` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbrAddressLessIndex` int(11) NOT NULL, `ospfNbrRtrId` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbrOptions` int(11) NOT NULL, `ospfNbrPriority` int(11) NOT NULL, `ospfNbrState` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbrEvents` int(11) NOT NULL, `ospfNbrLsRetransQLen` int(11) NOT NULL, `ospfNbmaNbrStatus` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbmaNbrPermanence` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbrHelloSuppressed` varchar(32) COLLATE utf8_unicode_ci NOT NULL, UNIQUE KEY `device_id` (`device_id`,`ospf_nbr_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `ospf_ports` ( `device_id` int(11) NOT NULL, `interface_id` int(11) NOT NULL, `ospf_port_id` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfIfIpAddress` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfAddressLessIf` int(11) NOT NULL, `ospfIfAreaId` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfIfType` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfAdminStat` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfRtrPriority` int(11) DEFAULT NULL, `ospfIfTransitDelay` int(11) DEFAULT NULL, `ospfIfRetransInterval` int(11) DEFAULT NULL, `ospfIfHelloInterval` int(11) DEFAULT NULL, `ospfIfRtrDeadInterval` int(11) DEFAULT NULL, `ospfIfPollInterval` int(11) DEFAULT NULL, `ospfIfState` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfDesignatedRouter` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfBackupDesignatedRouter` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfEvents` int(11) DEFAULT NULL, `ospfIfAuthKey` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfStatus` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfMulticastForwarding` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfDemand` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfAuthType` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, UNIQUE KEY `device_id` (`device_id`,`ospf_port_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `perf_times` ( `type` varchar(8) CHARACTER SET latin1 NOT NULL, `doing` varchar(64) CHARACTER SET latin1 NOT NULL, `start` int(11) NOT NULL, `duration` double(8,2) NOT NULL, `devices` int(11) NOT NULL, KEY `type` (`type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `ports` ( `interface_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL DEFAULT '0', `port_descr_type` varchar(255) DEFAULT NULL, `port_descr_descr` varchar(255) DEFAULT NULL, `port_descr_circuit` varchar(255) DEFAULT NULL, `port_descr_speed` varchar(32) DEFAULT NULL, `port_descr_notes` varchar(255) DEFAULT NULL, `ifDescr` varchar(255) DEFAULT NULL, `ifName` varchar(64) DEFAULT NULL, `portName` varchar(128) DEFAULT NULL, `ifIndex` int(11) DEFAULT '0', `ifSpeed` bigint(20) DEFAULT NULL, `ifConnectorPresent` varchar(12) DEFAULT NULL, `ifPromiscuousMode` varchar(12) DEFAULT NULL, `ifHighSpeed` int(11) DEFAULT NULL, `ifOperStatus` varchar(16) DEFAULT NULL, `ifAdminStatus` varchar(16) DEFAULT NULL, `ifDuplex` varchar(12) DEFAULT NULL, `ifMtu` int(11) DEFAULT NULL, `ifType` text, `ifAlias` text, `ifPhysAddress` text, `ifHardType` varchar(64) DEFAULT NULL, `ifLastChange` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `ifVlan` varchar(8) NOT NULL DEFAULT '', `ifTrunk` varchar(8) DEFAULT '', `ifVrf` int(11) NOT NULL, `counter_in` int(11) DEFAULT NULL, `counter_out` int(11) DEFAULT NULL, `ignore` tinyint(1) NOT NULL DEFAULT '0', `disabled` tinyint(1) NOT NULL DEFAULT '0', `detailed` tinyint(1) NOT NULL DEFAULT '0', `deleted` tinyint(1) NOT NULL DEFAULT '0', `pagpOperationMode` varchar(32) DEFAULT NULL, `pagpPortState` varchar(16) DEFAULT NULL, `pagpPartnerDeviceId` varchar(48) DEFAULT NULL, `pagpPartnerLearnMethod` varchar(16) DEFAULT NULL, `pagpPartnerIfIndex` int(11) DEFAULT NULL, `pagpPartnerGroupIfIndex` int(11) DEFAULT NULL, `pagpPartnerDeviceName` varchar(128) DEFAULT NULL, `pagpEthcOperationMode` varchar(16) DEFAULT NULL, `pagpDeviceId` varchar(48) DEFAULT NULL, `pagpGroupIfIndex` int(11) DEFAULT NULL, `ifInUcastPkts` bigint(20) DEFAULT NULL, `ifInUcastPkts_prev` bigint(20) DEFAULT NULL, `ifInUcastPkts_delta` bigint(20) DEFAULT NULL, `ifInUcastPkts_rate` int(11) DEFAULT NULL, `ifOutUcastPkts` bigint(20) DEFAULT NULL, `ifOutUcastPkts_prev` bigint(20) DEFAULT NULL, `ifOutUcastPkts_delta` bigint(20) DEFAULT NULL, `ifOutUcastPkts_rate` int(11) DEFAULT NULL, `ifInErrors` bigint(20) DEFAULT NULL, `ifInErrors_prev` bigint(20) DEFAULT NULL, `ifInErrors_delta` bigint(20) DEFAULT NULL, `ifInErrors_rate` int(11) DEFAULT NULL, `ifOutErrors` bigint(20) DEFAULT NULL, `ifOutErrors_prev` bigint(20) DEFAULT NULL, `ifOutErrors_delta` bigint(20) DEFAULT NULL, `ifOutErrors_rate` int(11) DEFAULT NULL, `ifInOctets` bigint(20) DEFAULT NULL, `ifInOctets_prev` bigint(20) DEFAULT NULL, `ifInOctets_delta` bigint(20) DEFAULT NULL, `ifInOctets_rate` int(11) DEFAULT NULL, `ifOutOctets` bigint(20) DEFAULT NULL, `ifOutOctets_prev` bigint(20) DEFAULT NULL, `ifOutOctets_delta` bigint(20) DEFAULT NULL, `ifOutOctets_rate` int(11) DEFAULT NULL, `poll_time` int(11) DEFAULT NULL, `poll_prev` int(11) DEFAULT NULL, `poll_period` int(11) DEFAULT NULL, PRIMARY KEY (`interface_id`), UNIQUE KEY `device_ifIndex` (`device_id`,`ifIndex`), KEY `if_2` (`ifDescr`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `ports_adsl` ( `interface_id` int(11) NOT NULL, `port_adsl_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `adslLineCoding` varchar(8) COLLATE utf8_bin NOT NULL, `adslLineType` varchar(16) COLLATE utf8_bin NOT NULL, `adslAtucInvVendorID` varchar(8) COLLATE utf8_bin NOT NULL, `adslAtucInvVersionNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAtucCurrSnrMgn` decimal(5,1) NOT NULL, `adslAtucCurrAtn` decimal(5,1) NOT NULL, `adslAtucCurrOutputPwr` decimal(5,1) NOT NULL, `adslAtucCurrAttainableRate` int(11) NOT NULL, `adslAtucChanCurrTxRate` int(11) NOT NULL, `adslAturInvSerialNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturInvVendorID` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturInvVersionNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturChanCurrTxRate` int(11) NOT NULL, `adslAturCurrSnrMgn` decimal(5,1) NOT NULL, `adslAturCurrAtn` decimal(5,1) NOT NULL, `adslAturCurrOutputPwr` decimal(5,1) NOT NULL, `adslAturCurrAttainableRate` int(11) NOT NULL, UNIQUE KEY `interface_id` (`interface_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -CREATE TABLE IF NOT EXISTS `ports_perms` ( `user_id` int(11) NOT NULL, `interface_id` int(11) NOT NULL, `access_level` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `ports_stack` ( `device_id` int(11) NOT NULL, `interface_id_high` int(11) NOT NULL, `interface_id_low` int(11) NOT NULL, `ifStackStatus` varchar(32) COLLATE utf8_unicode_ci NOT NULL, UNIQUE KEY `device_id` (`device_id`,`interface_id_high`,`interface_id_low`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `port_in_measurements` ( `port_id` int(11) NOT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `counter` bigint(11) NOT NULL, `delta` bigint(11) NOT NULL, KEY `port_id` (`port_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `port_out_measurements` ( `port_id` int(11) NOT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `counter` bigint(11) NOT NULL, `delta` bigint(11) NOT NULL, KEY `port_id` (`port_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `processors` ( `processor_id` int(11) NOT NULL AUTO_INCREMENT, `entPhysicalIndex` int(11) NOT NULL, `hrDeviceIndex` int(11) DEFAULT NULL, `device_id` int(11) NOT NULL, `processor_oid` varchar(128) CHARACTER SET latin1 NOT NULL, `processor_index` varchar(32) CHARACTER SET latin1 NOT NULL, `processor_type` varchar(16) CHARACTER SET latin1 NOT NULL, `processor_usage` int(11) NOT NULL, `processor_descr` varchar(64) CHARACTER SET latin1 NOT NULL, `processor_precision` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`processor_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `pseudowires` ( `pseudowire_id` int(11) NOT NULL AUTO_INCREMENT, `interface_id` int(11) NOT NULL, `peer_device_id` int(11) NOT NULL, `peer_ldp_id` int(11) NOT NULL, `cpwVcID` int(11) NOT NULL, `cpwOid` int(11) NOT NULL, PRIMARY KEY (`pseudowire_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `sensors` ( `sensor_id` int(11) NOT NULL AUTO_INCREMENT, `sensor_class` varchar(64) CHARACTER SET latin1 NOT NULL, `device_id` int(11) NOT NULL DEFAULT '0', `poller_type` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'snmp', `sensor_oid` varchar(64) CHARACTER SET latin1 NOT NULL, `sensor_index` varchar(10) COLLATE utf8_unicode_ci NOT NULL, `sensor_type` varchar(255) CHARACTER SET latin1 NOT NULL, `sensor_descr` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `sensor_divisor` int(11) NOT NULL DEFAULT '1', `sensor_multiplier` int(11) NOT NULL DEFAULT '1', `sensor_current` float DEFAULT NULL, `sensor_limit` float DEFAULT NULL, `sensor_limit_warn` float DEFAULT NULL, `sensor_limit_low` float DEFAULT NULL, `sensor_limit_low_warn` float DEFAULT NULL, `entPhysicalIndex` varchar(16) CHARACTER SET latin1 DEFAULT NULL, `entPhysicalIndex_measured` varchar(16) CHARACTER SET latin1 DEFAULT NULL, PRIMARY KEY (`sensor_id`), KEY `sensor_host` (`device_id`), KEY `sensor_class` (`sensor_class`), KEY `sensor_type` (`sensor_type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `services` ( `service_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `service_ip` text NOT NULL, `service_type` varchar(16) NOT NULL, `service_desc` text NOT NULL, `service_param` text NOT NULL, `service_ignore` tinyint(1) NOT NULL, `service_status` tinyint(4) NOT NULL DEFAULT '0', `service_checked` int(11) NOT NULL DEFAULT '0', `service_changed` int(11) NOT NULL DEFAULT '0', `service_message` text NOT NULL, `service_disabled` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`service_id`), KEY `service_host` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `storage` ( `storage_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `storage_mib` varchar(16) NOT NULL, `storage_index` int(11) NOT NULL, `storage_type` varchar(32) DEFAULT NULL, `storage_descr` text NOT NULL, `storage_size` bigint(20) NOT NULL, `storage_units` int(11) NOT NULL, `storage_used` bigint(20) NOT NULL, `storage_free` bigint(20) NOT NULL, `storage_perc` text NOT NULL, `storage_perc_warn` int(11) DEFAULT '60', PRIMARY KEY (`storage_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `syslog` ( `device_id` int(11) DEFAULT NULL, `facility` varchar(10) DEFAULT NULL, `priority` varchar(10) DEFAULT NULL, `level` varchar(10) DEFAULT NULL, `tag` varchar(10) DEFAULT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `program` varchar(32) DEFAULT NULL, `msg` text, `seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`seq`), KEY `datetime` (`timestamp`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `toner` ( `toner_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL DEFAULT '0', `toner_index` int(11) NOT NULL, `toner_type` varchar(64) NOT NULL, `toner_oid` varchar(64) NOT NULL, `toner_descr` varchar(32) NOT NULL DEFAULT '', `toner_capacity` int(11) NOT NULL DEFAULT '0', `toner_current` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`toner_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `ucd_diskio` ( `diskio_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `diskio_index` int(11) NOT NULL, `diskio_descr` varchar(32) CHARACTER SET latin1 NOT NULL, PRIMARY KEY (`diskio_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `users` ( `user_id` int(11) NOT NULL AUTO_INCREMENT, `username` char(30) NOT NULL, `password` varchar(34) DEFAULT NULL, `realname` varchar(64) NOT NULL, `email` varchar(64) NOT NULL, `descr` char(30) NOT NULL, `level` tinyint(4) NOT NULL DEFAULT '0', `can_modify_passwd` tinyint(4) NOT NULL DEFAULT '1', PRIMARY KEY (`user_id`), UNIQUE KEY `username` (`username`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `users_prefs` ( `user_id` int(16) NOT NULL, `pref` varchar(32) NOT NULL, `value` varchar(128) NOT NULL, PRIMARY KEY (`user_id`), UNIQUE KEY `user_id.pref` (`user_id`,`pref`), KEY `pref` (`pref`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `vlans` ( `vlan_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) DEFAULT NULL, `vlan_vlan` int(11) DEFAULT NULL, `vlan_domain` text, `vlan_descr` text, PRIMARY KEY (`vlan_id`), KEY `device_id` (`device_id`,`vlan_vlan`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `vminfo` ( `id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `vm_type` varchar(16) NOT NULL DEFAULT 'vmware', `vmwVmVMID` int(11) NOT NULL, `vmwVmDisplayName` varchar(128) NOT NULL, `vmwVmGuestOS` varchar(128) NOT NULL, `vmwVmMemSize` int(11) NOT NULL, `vmwVmCpus` int(11) NOT NULL, `vmwVmState` varchar(128) NOT NULL, PRIMARY KEY (`id`), KEY `device_id` (`device_id`), KEY `vmwVmVMID` (`vmwVmVMID`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `vmware_vminfo` ( `id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `vmwVmVMID` int(11) NOT NULL, `vmwVmDisplayName` varchar(128) NOT NULL, `vmwVmGuestOS` varchar(128) NOT NULL, `vmwVmMemSize` int(11) NOT NULL, `vmwVmCpus` int(11) NOT NULL, `vmwVmState` varchar(128) NOT NULL, PRIMARY KEY (`id`), KEY `device_id` (`device_id`), KEY `vmwVmVMID` (`vmwVmVMID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `vrfs` ( `vrf_id` int(11) NOT NULL AUTO_INCREMENT, `vrf_oid` varchar(256) NOT NULL, `vrf_name` varchar(128) DEFAULT NULL, `mplsVpnVrfRouteDistinguisher` varchar(128) DEFAULT NULL, `mplsVpnVrfDescription` text NOT NULL, `device_id` int(11) NOT NULL, PRIMARY KEY (`vrf_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `bill_history` ( `bill_hist_id` int(11) NOT NULL AUTO_INCREMENT, `bill_id` int(11) NOT NULL, `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `bill_datefrom` datetime NOT NULL, `bill_dateto` datetime NOT NULL, `bill_type` text NOT NULL, `bill_allowed` bigint(20) NOT NULL, `bill_used` bigint(20) NOT NULL, `bill_overuse` bigint(20) NOT NULL, `bill_percent` decimal(10,2) NOT NULL, `rate_95th_in` bigint(20) NOT NULL, `rate_95th_out` bigint(20) NOT NULL, `rate_95th` bigint(20) NOT NULL, `dir_95th` varchar(3) NOT NULL, `rate_average` bigint(20) NOT NULL, `rate_average_in` bigint(20) NOT NULL, `rate_average_out` bigint(20) NOT NULL, `traf_in` bigint(20) NOT NULL, `traf_out` bigint(20) NOT NULL, `traf_total` bigint(20) NOT NULL, `pdf` longblob, PRIMARY KEY (`bill_hist_id`), UNIQUE KEY `unique_index` (`bill_id`,`bill_datefrom`,`bill_dateto`), KEY `bill_id` (`bill_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; -CREATE TABLE IF NOT EXISTS `entPhysical_state` ( `device_id` int(11) NOT NULL, `entPhysicalIndex` varchar(64) NOT NULL, `subindex` varchar(64) DEFAULT NULL, `group` varchar(64) NOT NULL, `key` varchar(64) NOT NULL, `value` varchar(255) NOT NULL, KEY `device_id_index` (`device_id`,`entPhysicalIndex`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `ports_vlans` ( `port_vlan_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `interface_id` int(11) NOT NULL, `vlan` int(11) NOT NULL, `baseport` int(11) NOT NULL, `priority` bigint(32) NOT NULL, `state` varchar(16) NOT NULL, `cost` int(11) NOT NULL, PRIMARY KEY (`port_vlan_id`), UNIQUE KEY `unique` (`device_id`,`interface_id`,`vlan`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; -CREATE TABLE IF NOT EXISTS `netscaler_vservers` ( `vsvr_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `vsvr_name` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `vsvr_ip` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `vsvr_port` int(8) NOT NULL, `vsvr_type` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `vsvr_state` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `vsvr_clients` int(11) NOT NULL, `vsvr_server` int(11) NOT NULL, `vsvr_req_rate` int(11) NOT NULL, `vsvr_bps_in` int(11) NOT NULL, `vsvr_bps_out` int(11) NOT NULL, PRIMARY KEY (`vsvr_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedBytes_input` bigint(20) default NULL; -ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedBytes_input_prev` bigint(20) default NULL; -ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedBytes_input_delta` bigint(20) default NULL; -ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedBytes_input_rate` int(11) default NULL; -ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedBytes_output` bigint(20) default NULL; -ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedBytes_output_prev` bigint(20) default NULL; -ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedBytes_output_delta` bigint(20) default NULL; -ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedBytes_output_rate` int(11) default NULL; -ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedPkts_input` bigint(20) default NULL; -ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedPkts_input_prev` bigint(20) default NULL; -ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedPkts_input_delta` bigint(20) default NULL; -ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedPkts_input_rate` int(11) default NULL; -ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedPkts_output` bigint(20) default NULL; -ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedPkts_output_prev` bigint(20) default NULL; -ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedPkts_output_delta` bigint(20) default NULL; -ALTER TABLE `mac_accounting` ADD `cipMacHCSwitchedPkts_output_rate` int(11) default NULL; -ALTER TABLE `mac_accounting` ADD `poll_time` int(11) default NULL; -ALTER TABLE `mac_accounting` ADD `poll_prev` int(11) default NULL; -ALTER TABLE `mac_accounting` ADD `poll_period` int(11) default NULL; -ALTER TABLE `interfaces` ADD `ifInUcastPkts` bigint(20) default NULL; -ALTER TABLE `interfaces` ADD `ifInUcastPkts_prev` bigint(20) default NULL; -ALTER TABLE `interfaces` ADD `ifInUcastPkts_delta` bigint(20) default NULL; -ALTER TABLE `interfaces` ADD `ifInUcastPkts_rate` int(11) default NULL; -ALTER TABLE `interfaces` ADD `ifOutUcastPkts` bigint(20) default NULL; -ALTER TABLE `interfaces` ADD `ifOutUcastPkts_prev` bigint(20) default NULL; -ALTER TABLE `interfaces` ADD `ifOutUcastPkts_delta` bigint(20) default NULL; -ALTER TABLE `interfaces` ADD `ifOutUcastPkts_rate` int(11) default NULL; -ALTER TABLE `interfaces` ADD `ifInErrors` bigint(20) default NULL; -ALTER TABLE `interfaces` ADD `ifInErrors_prev` bigint(20) default NULL; -ALTER TABLE `interfaces` ADD `ifInErrors_delta` bigint(20) default NULL; -ALTER TABLE `interfaces` ADD `ifInErrors_rate` int(11) default NULL; -ALTER TABLE `interfaces` ADD `ifOutErrors` bigint(20) default NULL; -ALTER TABLE `interfaces` ADD `ifOutErrors_prev` bigint(20) default NULL; -ALTER TABLE `interfaces` ADD `ifOutErrors_delta` bigint(20) default NULL; -ALTER TABLE `interfaces` ADD `ifOutErrors_rate` int(11) default NULL; -ALTER TABLE `interfaces` ADD `ifInOctets` bigint(20) default NULL; -ALTER TABLE `interfaces` ADD `ifInOctets_prev` bigint(20) default NULL; -ALTER TABLE `interfaces` ADD `ifInOctets_delta` bigint(20) default NULL; -ALTER TABLE `interfaces` ADD `ifInOctets_rate` int(11) default NULL; -ALTER TABLE `interfaces` ADD `ifOutOctets` bigint(20) default NULL; -ALTER TABLE `interfaces` ADD `ifOutOctets_prev` bigint(20) default NULL; -ALTER TABLE `interfaces` ADD `ifOutOctets_delta` bigint(20) default NULL; -ALTER TABLE `interfaces` ADD `ifOutOctets_rate` int(11) default NULL; -ALTER TABLE `interfaces` ADD `poll_time` int(11) default NULL; -ALTER TABLE `interfaces` ADD `poll_prev` int(11) default NULL; -ALTER TABLE `interfaces` ADD `poll_period` int(11) default NULL; -ALTER TABLE `interfaces` ADD `pagpOperationMode` VARCHAR( 32 ) NULL ; -ALTER TABLE `interfaces` ADD `pagpPortState` VARCHAR( 16 ) NULL ; -ALTER TABLE `interfaces` ADD `pagpPartnerDeviceId` VARCHAR( 48 ) NULL ; -ALTER TABLE `interfaces` ADD `pagpPartnerLearnMethod` VARCHAR( 16 ) NULL ; -ALTER TABLE `interfaces` ADD `pagpPartnerIfIndex` INT NULL ; -ALTER TABLE `interfaces` ADD `pagpPartnerGroupIfIndex` INT NULL ; -ALTER TABLE `interfaces` ADD `pagpPartnerDeviceName` VARCHAR( 128 ) NULL ; -ALTER TABLE `interfaces` ADD `pagpEthcOperationMode` VARCHAR( 16 ) NULL ; -ALTER TABLE `interfaces` ADD `pagpDeviceId` VARCHAR( 48 ) NULL ; -ALTER TABLE `interfaces` ADD `pagpGroupIfIndex` INT NULL ; -ALTER TABLE `interfaces` ADD `ifPromiscuousMode` VARCHAR( 12 ) NULL DEFAULT NULL AFTER `ifSpeed`; -ALTER TABLE `interfaces` ADD `ifConnectorPresent` VARCHAR( 12 ) NULL DEFAULT NULL AFTER `ifSpeed`; -ALTER TABLE `interfaces` ADD `ifName` VARCHAR( 64 ) NULL DEFAULT NULL AFTER `ifDescr`; -ALTER TABLE `interfaces` ADD `portName` VARCHAR( 128 ) NULL DEFAULT NULL AFTER `ifName`; -ALTER TABLE `interfaces` ADD `ifHighSpeed` BIGINT ( 20 ) NULL DEFAULT NULL AFTER `ifSpeed`; -ALTER TABLE `interfaces` DROP `in_rate`; -ALTER TABLE `interfaces` DROP `out_rate`; -ALTER TABLE `interfaces` DROP `in_errors`; -ALTER TABLE `interfaces` DROP `out_errors`; -CREATE TABLE IF NOT EXISTS `cmpMemPool` ( `cmp_id` int(11) NOT NULL auto_increment, `Index` varchar(8) NOT NULL, `cmpName` varchar(32) NOT NULL, `cmpValid` varchar(8) NOT NULL, `device_id` int(11) NOT NULL, `cmpUsed` int(11) NOT NULL, `cmpFree` int(11) NOT NULL, `cmpLargestFree` int(11) NOT NULL, `cmpAlternate` tinyint(4) default NULL, PRIMARY KEY (`cmp_id`), KEY `device_id` (`device_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1; -CREATE TABLE IF NOT EXISTS `hrDevice` ( `hrDevice_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL, `hrDeviceIndex` int(11) NOT NULL, `hrDeviceDescr` text NOT NULL, `hrDeviceType` text NOT NULL, `hrDeviceErrors` int(11) NOT NULL, `hrDeviceStatus` text NOT NULL, `hrProcessorLoad` tinyint(4) default NULL, PRIMARY KEY (`hrDevice_id`), KEY `device_id` (`device_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1; -ALTER TABLE `entPhysical` ADD `entPhysicalHardwareRev` VARCHAR( 16 ) NULL AFTER `entPhysicalName` ,ADD `entPhysicalFirmwareRev` VARCHAR( 16 ) NULL AFTER `entPhysicalHardwareRev` ,ADD `entPhysicalSoftwareRev` VARCHAR( 16 ) NULL AFTER `entPhysicalFirmwareRev` ,ADD `entPhysicalAlias` VARCHAR( 32 ) NULL AFTER `entPhysicalSoftwareRev` ,ADD `entPhysicalAssetID` VARCHAR( 32 ) NULL AFTER `entPhysicalAlias` ,ADD `entPhysicalIsFRU` VARCHAR( 8 ) NULL AFTER `entPhysicalAssetID`; -ALTER TABLE `devices` ADD `last_discovered` timestamp NULL DEFAULT NULL AFTER `last_polled`; -ALTER TABLE `devices` CHANGE `lastchange` `uptime` BIGINT NULL DEFAULT NULL; -ALTER TABLE `storage` ADD `hrStorageType` VARCHAR( 32 ) NULL DEFAULT NULL AFTER `hrStorageIndex`; -ALTER TABLE `devices` MODIFY `type` varchar(8) DEFAULT 'unknown'; -ALTER TABLE `devices` CHANGE `os` `os` VARCHAR( 32 ) NULL DEFAULT NULL; -ALTER TABLE `temperature` ADD `temp_precision` INT(11) NULL DEFAULT '1'; -UPDATE temperature SET temp_precision=10 WHERE temp_tenths=1; -ALTER TABLE `temperature` ADD `temp_index` INT NOT NULL AFTER `temp_host` , ADD `temp_mibtype` VARCHAR( 32 ) NOT NULL AFTER `temp_index`; -ALTER TABLE `temperature` DROP `temp_tenths`; -CREATE TABLE IF NOT EXISTS `dbSchema` ( `revision` int(11) NOT NULL default '0', PRIMARY KEY (`revision`)) ENGINE=MyISAM DEFAULT CHARSET=latin1; -ALTER TABLE `storage` ADD `storage_perc_warn` INT(11) NULL DEFAULT '60'; -CREATE TABLE IF NOT EXISTS `voltage` ( `volt_id` int(11) NOT NULL auto_increment, `volt_host` int(11) NOT NULL default '0', `volt_oid` varchar(64) NOT NULL, `volt_descr` varchar(32) NOT NULL default '', `volt_precision` int(11) NOT NULL default '1', `volt_current` int(11) NOT NULL default '0', `volt_limit` int(11) NOT NULL default '60', PRIMARY KEY (`volt_id`), KEY `volt_host` (`volt_host`)) ENGINE=InnoDB DEFAULT CHARSET=latin1; -CREATE TABLE IF NOT EXISTS `fanspeed` ( `fan_id` int(11) NOT NULL auto_increment, `fan_host` int(11) NOT NULL default '0', `fan_oid` varchar(64) NOT NULL, `fan_descr` varchar(32) NOT NULL default '', `fan_precision` int(11) NOT NULL default '1', `fan_current` int(11) NOT NULL default '0', `fan_limit` int(11) NOT NULL default '60', PRIMARY KEY (`fan_id`), KEY `fan_host` (`fan_host`)) ENGINE=InnoDB DEFAULT CHARSET=latin1; -ALTER TABLE `voltage` ADD `volt_limit_low` int(11) NULL DEFAULT NULL AFTER `volt_limit`; -ALTER TABLE `voltage` CHANGE `volt_current` `volt_current` FLOAT(3) NULL DEFAULT NULL; -ALTER TABLE `voltage` CHANGE `volt_limit` `volt_limit` FLOAT(3) NULL DEFAULT NULL; -ALTER TABLE `voltage` CHANGE `volt_limit_low` `volt_limit_low` FLOAT(3) NULL DEFAULT NULL; -ALTER TABLE `fanspeed` ADD `fan_index` INT NOT NULL AFTER `fan_host` , ADD `fan_mibtype` VARCHAR( 32 ) NOT NULL AFTER `fan_index`; -ALTER TABLE `temperature` CHANGE `temp_host` `device_id` INT( 11 ) NOT NULL DEFAULT '0'; -ALTER TABLE `fanspeed` CHANGE `fan_host` `device_id` INT( 11 ) NOT NULL DEFAULT '0'; -ALTER TABLE `voltage` CHANGE `volt_host` `device_id` INT( 11 ) NOT NULL DEFAULT '0'; -CREATE TABLE IF NOT EXISTS `processors` ( `processor_id` int(11) NOT NULL AUTO_INCREMENT, `entPhysicalIndex` int(11) NOT NULL, `device_id` int(11) NOT NULL, `processor_oid` int(11) NOT NULL, `processor_type` int(11) NOT NULL, `processor_usage` int(11) NOT NULL, `processor_description` varchar(64) NOT NULL, PRIMARY KEY (`processor_id`), KEY `cpuCPU_id` (`processor_id`,`device_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -ALTER TABLE `processors` ADD `hrDeviceIndex` int(11) NULL AFTER `entPhysicalIndex`; -ALTER TABLE `temperature` CHANGE `temp_current` `temp_current` FLOAT( 4 ) NOT NULL DEFAULT '0'; -ALTER TABLE `processors` ADD `processor_index` varchar(32) NOT NULL AFTER `processor_oid`; -ALTER TABLE `processors` CHANGE `processor_description` `processor_descr` varchar(64) NOT NULL; -ALTER TABLE `fanspeed` CHANGE `fan_mibtype` `fan_type` varchar(64) NOT NULL ; -ALTER TABLE `voltage` ADD `volt_index` VARCHAR( 8 ) NOT NULL AFTER `volt_oid`,ADD `volt_type` VARCHAR( 32 ) NOT NULL AFTER `volt_index` ; -ALTER TABLE `processors` ADD `processor_precision` INT( 11 ) NOT NULL DEFAULT '1'; -ALTER TABLE `links` CHANGE `cdp` `vendor` VARCHAR( 11 ) NULL DEFAULT NULL; -ALTER TABLE `links` ADD `remote_hostname` VARCHAR( 128 ) NOT NULL ,ADD `remote_port` VARCHAR( 128 ) NOT NULL ,ADD `remote_platform` VARCHAR( 128 ) NOT NULL ,ADD `remote_version` VARCHAR( 256 ) NOT NULL ; -ALTER TABLE `links` CHANGE `src_if` `local_interface_id` INT( 11 ) NULL DEFAULT NULL ,CHANGE `dst_if` `remote_interface_id` INT( 11 ) NULL DEFAULT NULL ; -ALTER TABLE `links` CHANGE `vendor` `protocol` VARCHAR( 11 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL; -ALTER TABLE `processors` CHANGE `processor_type` `processor_type` varchar(16) NOT NULL; -ALTER TABLE `bgpPeers_cbgp` CHANGE `afi` `afi` VARCHAR( 16 ) NOT NULL , CHANGE `safi` `safi` VARCHAR( 16 ) NOT NULL; -ALTER TABLE `eventlog` ADD `reference` VARCHAR( 64 ) NOT NULL AFTER `type`; -ALTER TABLE `syslog` CHANGE `datetime` `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; -ALTER TABLE `syslog` DROP `host`, DROP `processed`; -RENAME TABLE `interfaces` TO `ports` ; -RENAME TABLE `interfaces_perms` TO `ports_perms` ; -ALTER TABLE `temperature` CHANGE `temp_index` `temp_index` VARCHAR( 32 ) NOT NULL AFTER `device_id` , ADD `temp_type` VARCHAR( 16 ) NOT NULL AFTER `temp_index`; -ALTER TABLE `processors` CHANGE `processor_oid` `processor_oid` VARCHAR( 128 ) NOT NULL; -ALTER TABLE eventlog CHANGE `type` `type` VARCHAR( 64 ) NOT NULL; -ALTER TABLE `services` CHANGE `service_host` `device_id` INT( 11 ) NOT NULL; -CREATE TABLE IF NOT EXISTS `mempools` ( `mempool_id` int(11) NOT NULL AUTO_INCREMENT, `mempool_index` varchar(8) CHARACTER SET latin1 NOT NULL, `entPhysicalIndex` int(11) DEFAULT NULL, `hrDeviceIndex` int(11) DEFAULT NULL, `mempool_type` varchar(32) CHARACTER SET latin1 NOT NULL, `mempool_precision` int(11) NOT NULL DEFAULT '1', `mempool_descr` varchar(32) CHARACTER SET latin1 NOT NULL, `device_id` int(11) NOT NULL, `mempool_used` int(11) NOT NULL, `mempool_free` int(11) NOT NULL, `mempool_total` int(11) NOT NULL, `mempool_largestfree` int(11) DEFAULT NULL, `mempool_lowestfree` int(11) DEFAULT NULL, PRIMARY KEY (`mempool_id`), KEY `device_id` (`device_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin ; -ALTER TABLE `storage` CHANGE `storage_id` `storage_id` INT( 11 ) NOT NULL AUTO_INCREMENT , CHANGE `host_id` `device_id` INT( 11 ) NOT NULL , CHANGE `hrStorageIndex` `storage_index` INT( 11 ) NOT NULL , CHANGE `hrStorageType` `storage_type` VARCHAR( 32 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL , CHANGE `hrStorageDescr` `storage_descr` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL , CHANGE `hrStorageSize` `storage_size` INT( 11 ) NOT NULL , CHANGE `hrStorageAllocationUnits` `storage_units` INT( 11 ) NOT NULL , CHANGE `hrStorageUsed` `storage_used` INT( 11 ) NOT NULL , CHANGE `storage_perc` `storage_perc` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL; -ALTER TABLE `storage` ADD `storage_mib` VARCHAR( 16 ) NOT NULL AFTER `device_id`; -ALTER TABLE `storage` ADD `storage_free` INT NOT NULL AFTER `storage_used`; -ALTER TABLE `storage` CHANGE `storage_size` `storage_size` BIGINT NOT NULL ,CHANGE `storage_used` `storage_used` BIGINT NOT NULL ,CHANGE `storage_free` `storage_free` BIGINT NOT NULL; -ALTER TABLE `mempools` CHANGE `mempool_used` `mempool_used` BIGINT( 20 ) NOT NULL , -CHANGE `mempool_free` `mempool_free` BIGINT( 20 ) NOT NULL ,CHANGE `mempool_total` `mempool_total` BIGINT( 20 ) NOT NULL ,CHANGE `mempool_largestfree` `mempool_largestfree` BIGINT( 20 ) NULL DEFAULT NULL ,CHANGE `mempool_lowestfree` `mempool_lowestfree` BIGINT( 20 ) NULL DEFAULT NULL; -CREATE TABLE IF NOT EXISTS `juniAtmVp` ( `juniAtmVp_id` int(11) NOT NULL AUTO_INCREMENT, `interface_id` int(11) NOT NULL, `vp_id` int(11) NOT NULL, `vp_descr` varchar(32) NOT NULL, PRIMARY KEY (`juniAtmVp_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -CREATE TABLE IF NOT EXISTS `toner` ( `toner_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL default '0', `toner_index` int(11) NOT NULL, `toner_type` varchar(64) NOT NULL, `toner_oid` varchar(64) NOT NULL, `toner_descr` varchar(32) NOT NULL default '', `toner_capacity` int(11) NOT NULL default '0', `toner_current` int(11) NOT NULL default '0', PRIMARY KEY (`toner_id`), KEY `device_id` (`device_id`)) ENGINE=InnoDB DEFAULT CHARSET=latin1; -ALTER TABLE `mempools` CHANGE `mempool_descr` `mempool_descr` VARCHAR( 64 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL; -ALTER TABLE `processors` CHANGE `processor_descr` `processor_descr` VARCHAR( 64 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL; -DROP TABLE `cempMemPool`; -DROP TABLE `cpmCPU`; -DROP TABLE `cmpMemPool`; -ALTER TABLE `mempools` CHANGE `mempool_used` `mempool_used` BIGINT( 16 ) NOT NULL ,CHANGE `mempool_free` `mempool_free` BIGINT( 16 ) NOT NULL ,CHANGE `mempool_total` `mempool_total` BIGINT( 16 ) NOT NULL ,CHANGE `mempool_largestfree` `mempool_largestfree` BIGINT( 16 ) NULL DEFAULT NULL ,CHANGE `mempool_lowestfree` `mempool_lowestfree` BIGINT( 16 ) NULL DEFAULT NULL ; -ALTER TABLE `ports` ADD `port_descr_type` VARCHAR( 32 ) NULL DEFAULT NULL AFTER `device_id` ,ADD `port_descr_descr` VARCHAR( 64 ) NULL DEFAULT NULL AFTER `port_descr_type` ,ADD `port_descr_circuit` VARCHAR( 64 ) NULL DEFAULT NULL AFTER `port_descr_descr` ,ADD `port_descr_speed` VARCHAR( 32 ) NULL DEFAULT NULL AFTER `port_descr_circuit` ,ADD `port_descr_notes` VARCHAR( 128 ) NULL DEFAULT NULL AFTER `port_descr_speed`; -CREATE TABLE IF NOT EXISTS `frequency` ( `freq_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL default '0', `freq_oid` varchar(64) NOT NULL, `freq_index` varchar(8) NOT NULL, `freq_type` varchar(32) NOT NULL, `freq_descr` varchar(32) NOT NULL default '', `freq_precision` int(11) NOT NULL default '1', `freq_current` float default NULL, `freq_limit` float default NULL, `freq_limit_low` float default NULL, PRIMARY KEY (`freq_id`), KEY `freq_host` (`device_id`)) ENGINE=MyISAM AUTO_INCREMENT=189 DEFAULT CHARSET=latin1; -ALTER TABLE `temperature` CHANGE `temp_index` `temp_index` int(11) NOT NULL; -CREATE TABLE IF NOT EXISTS `current` ( `current_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL default '0', `current_oid` varchar(64) NOT NULL, `current_index` varchar(8) NOT NULL, `current_type` varchar(32) NOT NULL, `current_descr` varchar(32) NOT NULL default '', `current_precision` int(11) NOT NULL default '1', `current_current` float default NULL, `current_limit` float default NULL, `current_limit_warn` float default NULL, `current_limit_low` float default NULL, PRIMARY KEY (`current_id`), KEY `current_host` (`device_id`)) ENGINE=MyISAM AUTO_INCREMENT=189 DEFAULT CHARSET=latin1; -ALTER TABLE `devices` ADD `serial` text default NULL; -ALTER TABLE `temperature` CHANGE `temp_index` `temp_index` VARCHAR(32) NOT NULL; -ALTER TABLE `ports` CHANGE `ifDescr` `ifDescr` VARCHAR(255) NOT NULL; -CREATE TABLE IF NOT EXISTS `ucd_diskio` ( `diskio_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `diskio_index` int(11) NOT NULL, `diskio_descr` varchar(32) NOT NULL, PRIMARY KEY (`diskio_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ; -ALTER TABLE `eventlog` CHANGE `type` `type` VARCHAR( 64 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL; -ALTER TABLE `bills` ADD `bill_custid` VARCHAR( 64 ) NOT NULL ,ADD `bill_ref` VARCHAR( 64 ) NOT NULL ,ADD `bill_notes` VARCHAR( 256 ) NOT NULL; -CREATE TABLE IF NOT EXISTS `applications` ( `app_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `app_type` varchar(64) NOT NULL, PRIMARY KEY (`app_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; -CREATE TABLE IF NOT EXISTS `sensors` ( `sensor_id` int(11) NOT NULL auto_increment, `sensor_class` varchar(64) NOT NULL, `device_id` int(11) NOT NULL default '0', `sensor_oid` varchar(64) NOT NULL, `sensor_index` varchar(8) NOT NULL, `sensor_type` varchar(32) NOT NULL, `sensor_descr` varchar(32) NOT NULL default '', `sensor_precision` int(11) NOT NULL default '1', `sensor_current` float default NULL, `sensor_limit` float default NULL, `sensor_limit_warn` float default NULL, `sensor_limit_low` float default NULL, `sensor_limit_low_warn` float default NULL, PRIMARY KEY (`sensor_id`), KEY `sensor_host` (`device_id`)) ENGINE=MyISAM AUTO_INCREMENT=189 DEFAULT CHARSET=latin1; -ALTER TABLE `devices` CHANGE `type` `type` VARCHAR(20) NOT NULL; -ALTER TABLE `voltage` CHANGE `volt_index` `volt_index` VARCHAR(10) NOT NULL; -ALTER TABLE `frequency` CHANGE `freq_index` `freq_index` VARCHAR(10) NOT NULL; -ALTER TABLE `sensors` CHANGE `sensor_index` `sensor_index` VARCHAR(10) NOT NULL; -DROP TABLE `fanspeed`; -DROP TABLE `temperature`; -DROP TABLE `voltage`; -DROP TABLE `current`; -ALTER TABLE `sensors` ADD `entPhysicalIndex` VARCHAR( 16 ) NULL; -ALTER TABLE `sensors` ADD `entPhysicalIndex_measured` VARCHAR(16) NULL; -ALTER TABLE `processors` DROP INDEX `cpuCPU_id`; -ALTER TABLE `processors` ADD INDEX ( `device_id` ); -ALTER TABLE `ucd_diskio` ADD INDEX ( `device_id` ); -ALTER TABLE `storage` ADD INDEX ( `device_id` ); -ALTER TABLE `mac_accounting` ADD INDEX ( `interface_id` ); -ALTER TABLE `ipv4_addresses` ADD INDEX ( `interface_id` ); -ALTER TABLE `ipv6_addresses` ADD INDEX ( `interface_id` ); -ALTER TABLE `ipv4_mac` ADD INDEX ( `interface_id` ); -CREATE TABLE IF NOT EXISTS `ports_adsl` ( `interface_id` int(11) NOT NULL, `port_adsl_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `adslLineCoding` varchar(8) COLLATE utf8_bin NOT NULL, `adslLineType` varchar(16) COLLATE utf8_bin NOT NULL, `adslAtucInvVendorID` varchar(8) COLLATE utf8_bin NOT NULL, `adslAtucInvVersionNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAtucCurrSnrMgn` decimal(5,1) NOT NULL, `adslAtucCurrAtn` decimal(5,1) NOT NULL, `adslAtucCurrOutputPwr` decimal(5,1) NOT NULL, `adslAtucCurrAttainableRate` int(11) NOT NULL, `adslAtucChanCurrTxRate` int(11) NOT NULL, `adslAturInvSerialNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturInvVendorID` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturInvVersionNumber` varchar(8) COLLATE utf8_bin NOT NULL, `adslAturChanCurrTxRate` int(11) NOT NULL, `adslAturCurrSnrMgn` decimal(5,1) NOT NULL, `adslAturCurrAtn` decimal(5,1) NOT NULL, `adslAturCurrOutputPwr` decimal(5,1) NOT NULL, `adslAturCurrAttainableRate` int(11) NOT NULL, UNIQUE KEY `interface_id` (`interface_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -ALTER TABLE `devices` ADD `last_polled_timetaken` DOUBLE( 5, 2 ) NOT NULL AFTER `last_polled` , ADD `last_discovered_timetaken` DOUBLE( 5, 2 ) NOT NULL AFTER `last_polled_timetaken`; -CREATE TABLE IF NOT EXISTS `perf_times` ( `type` varchar(8) NOT NULL, `doing` varchar(64) NOT NULL, `start` int(11) NOT NULL, `duration` double(5,2) NOT NULL, `devices` int(11) NOT NULL, KEY `type` (`type`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -ALTER TABLE `bills` ADD `bill_autoadded` BOOLEAN NOT NULL DEFAULT '0'; -ALTER TABLE `bill_ports` ADD `bill_port_autoadded` BOOLEAN NOT NULL DEFAULT '0'; -ALTER TABLE `sensors` CHANGE `sensor_precision` `sensor_divisor` INT( 11 ) NOT NULL DEFAULT '1' -ALTER TABLE `sensors` ADD `sensor_multiplier` INT( 11 ) NOT NULL AFTER `sensor_divisor`; -CREATE TABLE IF NOT EXISTS `device_graphs` ( `device_id` int(11) NOT NULL, `graph` varchar(32) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -DROP TABLE IF EXISTS `graph_types`; -CREATE TABLE IF NOT EXISTS `graph_types` ( `graph_type` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_subtype` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_section` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_descr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `graph_order` int(11) NOT NULL, KEY `graph_type` (`graph_type`), KEY `graph_subtype` (`graph_subtype`), KEY `graph_section` (`graph_section`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -INSERT INTO `graph_types` (`graph_type`, `graph_subtype`, `graph_section`, `graph_descr`, `graph_order`) VALUES('device', 'bits', 'netstats', 'Total Traffic', 0),('device', 'hr_users', 'system', 'Users Logged In', 0),('device', 'ucd_load', 'system', 'Load Averages', 0),('device', 'ucd_cpu', 'system', 'Detailed Processor Usage', 0),('device', 'ucd_memory', 'system', 'Detailed Memory Usage', 0),('device', 'netstat_tcp', 'netstats', 'TCP Statistics', 0),('device', 'netstat_icmp_info', 'netstats', 'ICMP Informational Statistics', 0),('device', 'netstat_icmp_stat', 'netstats', 'ICMP Statistics', 0),('device', 'netstat_ip', 'netstats', 'IP Statistics', 0),('device', 'netstat_ip_frag', 'netstats', 'IP Fragmentation Statistics', 0),('device', 'netstat_udp', 'netstats', 'UDP Statistics', 0),('device', 'netstat_snmp', 'netstats', 'SNMP Statistics', 0),('device', 'temperatures', 'system', 'Temperatures', 0),('device', 'mempools', 'system', 'Memory Pool Usage', 0),('device', 'processors', 'system', 'Processor Usage', 0),('device', 'storage', 'system', 'Filesystem Usage', 0),('device', 'hr_processes', 'system', 'Running Processes', 0),('device', 'uptime', 'system', 'System Uptime', ''),('device', 'ipsystemstats_ipv4', 'netstats', 'IPv4 Packet Statistics', 0),('device', 'ipsystemstats_ipv6_frag', 'netstats', 'IPv6 Fragmentation Statistics', 0),('device', 'ipsystemstats_ipv6', 'netstats', 'IPv6 Packet Statistics', 0),('device', 'ipsystemstats_ipv4_frag', 'netstats', 'IPv4 Fragmentation Statistics', 0),('device', 'fortigate_sessions', 'firewall', 'Active Sessions', ''), ('device', 'screenos_sessions', 'firewall', 'Active Sessions', ''), ('device', 'fdb_count', 'system', 'MAC Addresses Learnt', '0'),('device', 'cras_sessions', 'firewall', 'Remote Access Sessions', 0); -DROP TABLE `frequency`; -ALTER TABLE `mempools` CHANGE `mempool_index` `mempool_index` VARCHAR( 16 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL; -ALTER TABLE `vrfs` CHANGE `mplsVpnVrfRouteDistinguisher` `mplsVpnVrfRouteDistinguisher` varchar(26) default NOT NULL; -ALTER TABLE `devices` ADD `timeout` INT NULL DEFAULT NULL AFTER `port`; -ALTER TABLE `devices` ADD `retries` INT NULL DEFAULT NULL AFTER `timeout`; -ALTER TABLE `ports` ADD `disabled` tinyint(1) NOT NULL DEFAULT '0' AFTER `ignore`; -ALTER TABLE `perf_times` CHANGE `duration` `duration` DOUBLE( 8, 2 ) NOT NULL -ALTER TABLE `sensors` ADD `poller_type` VARCHAR(16) NOT NULL DEFAULT 'snmp' AFTER `device_id`; -ALTER TABLE `devices` ADD `transport` VARCHAR(16) NOT NULL DEFAULT 'udp' AFTER `port`; -ALTER TABLE ports MODIFY port_descr_circuit VARCHAR(255); -ALTER TABLE ports MODIFY port_descr_descr VARCHAR(255); -ALTER TABLE ports MODIFY port_descr_notes VARCHAR(255); -ALTER TABLE devices MODIFY community VARCHAR(255); -ALTER TABLE users MODIFY password VARCHAR(34); -ALTER TABLE sensors MODIFY sensor_descr VARCHAR(255); -ALTER TABLE `vrfs` MODIFY `mplsVpnVrfRouteDistinguisher` VARCHAR(128); -ALTER TABLE `vrfs` MODIFY `vrf_name` VARCHAR(128); -ALTER TABLE `ports` MODIFY `ifDescr` VARCHAR(255); -CREATE TABLE IF NOT EXISTS `vminfo` (`id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `vmwVmVMID` int(11) NOT NULL, `vmwVmDisplayName` varchar(128) NOT NULL, `vmwVmGuestOS` varchar(128) NOT NULL, `vmwVmMemSize` int(11) NOT NULL, `vmwVmCpus` int(11) NOT NULL, `vmwVmState` varchar(128) NOT NULL, PRIMARY KEY (`id`), KEY `device_id` (`device_id`), KEY `vmwVmVMID` (`vmwVmVMID`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; -ALTER TABLE `ports` MODIFY `port_descr_type` VARCHAR(255); -RENAME TABLE `vmware_vminfo` TO `vminfo` ; -ALTER TABLE `vminfo` ADD `vm_type` VARCHAR(16) NOT NULL DEFAULT 'vmware' AFTER `device_id`; -CREATE TABLE IF NOT EXISTS `cef_switching` ( `device_id` int(11) NOT NULL, `entPhysicalIndex` int(11) NOT NULL, `afi` varchar(4) COLLATE utf8_unicode_ci NOT NULL, `cef_index` int(11) NOT NULL, `cef_path` varchar(16) COLLATE utf8_unicode_ci NOT NULL, `drop` int(11) NOT NULL, `punt` int(11) NOT NULL, `punt2host` int(11) NOT NULL, `drop_prev` int(11) NOT NULL, `punt_prev` int(11) NOT NULL, `punt2host_prev` int(11) NOT NULL,`updated` INT NOT NULL , `updated_prev` INT NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -ALTER TABLE `mac_accounting` CHANGE `peer_mac` `mac` VARCHAR( 32 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL; -ALTER TABLE `mac_accounting` DROP `peer_ip`, DROP `peer_desc`, DROP `peer_asn`; -UPDATE sensors SET sensor_class='frequency' WHERE sensor_class='freq'; -ALTER TABLE `cef_switching` ADD `cef_switching_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST; -ALTER TABLE `mempools` ADD `mempool_perc` INT NOT NULL AFTER `device_id`; -ALTER TABLE `ports` ADD UNIQUE `device_ifIndex` ( `device_id` , `ifIndex` ); -ALTER TABLE `ports` DROP INDEX `host`; -ALTER TABLE `ports` DROP INDEX `snmpid`; -CREATE TABLE IF NOT EXISTS `ospf_areas` ( `device_id` int(11) NOT NULL, `ospfAreaId` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfAuthType` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `ospfImportAsExtern` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `ospfSpfRuns` int(11) NOT NULL, `ospfAreaBdrRtrCount` int(11) NOT NULL, `ospfAsBdrRtrCount` int(11) NOT NULL, `ospfAreaLsaCount` int(11) NOT NULL, `ospfAreaLsaCksumSum` int(11) NOT NULL, `ospfAreaSummary` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `ospfAreaStatus` varchar(64) COLLATE utf8_unicode_ci NOT NULL, UNIQUE KEY `device_area` (`device_id`,`ospfAreaId`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `ospf_instances` ( `device_id` int(11) NOT NULL, `ospf_instance_id` int(11) NOT NULL, `ospfRouterId` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfAdminStat` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfVersionNumber` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfAreaBdrRtrStatus` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfASBdrRtrStatus` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfExternLsaCount` int(11) NOT NULL, `ospfExternLsaCksumSum` int(11) NOT NULL, `ospfTOSSupport` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfOriginateNewLsas` int(11) NOT NULL, `ospfRxNewLsas` int(11) NOT NULL, `ospfExtLsdbLimit` int(11) DEFAULT NULL, `ospfMulticastExtensions` int(11) DEFAULT NULL, `ospfExitOverflowInterval` int(11) DEFAULT NULL, `ospfDemandExtensions` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, UNIQUE KEY `device_id` (`device_id`,`ospf_instance_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `ospf_ports` ( `device_id` int(11) NOT NULL, `interface_id` int(11) NOT NULL, `ospf_port_id` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfIfIpAddress` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfAddressLessIf` int(11) NOT NULL, `ospfIfAreaId` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfIfType` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfAdminStat` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfRtrPriority` int(11) DEFAULT NULL, `ospfIfTransitDelay` int(11) DEFAULT NULL, `ospfIfRetransInterval` int(11) DEFAULT NULL, `ospfIfHelloInterval` int(11) DEFAULT NULL, `ospfIfRtrDeadInterval` int(11) DEFAULT NULL, `ospfIfPollInterval` int(11) DEFAULT NULL, `ospfIfState` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfDesignatedRouter` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfBackupDesignatedRouter` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfEvents` int(11) DEFAULT NULL, `ospfIfAuthKey` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfStatus` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfMulticastForwarding` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfDemand` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `ospfIfAuthType` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, UNIQUE KEY `device_id` (`device_id`,`interface_id`,`ospf_port_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `ospf_nbrs` ( `device_id` int(11) NOT NULL, `interface_id` int(11) NOT NULL, `ospf_nbr_id` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbrIpAddr` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbrAddressLessIndex` int(11) NOT NULL, `ospfNbrRtrId` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbrOptions` int(11) NOT NULL, `ospfNbrPriority` int(11) NOT NULL, `ospfNbrState` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbrEvents` int(11) NOT NULL, `ospfNbrLsRetransQLen` int(11) NOT NULL, `ospfNbmaNbrStatus` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbmaNbrPermanence` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `ospfNbrHelloSuppressed` varchar(32) COLLATE utf8_unicode_ci NOT NULL, UNIQUE KEY `device_id` (`device_id`,`ospf_nbr_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE IF NOT EXISTS `ports_stack` (`interface_id_high` INT NOT NULL ,`interface_id_low` INT NOT NULL) ENGINE = INNODB; -ALTER TABLE `ports_stack` ADD `device_id` INT NOT NULL; -ALTER TABLE `ports_stack` ADD `ifStackStatus` VARCHAR(32); -ALTER TABLE users ADD can_modify_passwd TINYINT NOT NULL DEFAULT 1; -ALTER TABLE `storage` ADD UNIQUE `index_unique` ( `device_id` , `storage_mib` , `storage_index` ); -ALTER TABLE `bgpPeers_cbgp` ADD `AcceptedPrefixes` INT NOT NULL ,ADD `DeniedPrefixes` INT NOT NULL ,ADD `PrefixAdminLimit` INT NOT NULL ,ADD `PrefixThreshold` INT NOT NULL ,ADD `PrefixClearThreshold` INT NOT NULL ,ADD `AdvertisedPrefixes` INT NOT NULL ,ADD `SuppressedPrefixes` INT NOT NULL ,ADD `WithdrawnPrefixes` INT NOT NULL; -ALTER TABLE `bgpPeers_cbgp` ADD UNIQUE `unique_index` ( `device_id` , `bgpPeerIdentifier` , `afi` , `safi` ); -ALTER TABLE `ports` ADD UNIQUE `device_ifIndex` ( `device_id` , `ifIndex` ); -ALTER TABLE `devices` CHANGE `port` `port` SMALLINT( 5 ) UNSIGNED NOT NULL DEFAULT '161'; -CREATE TABLE IF NOT EXISTS `ipsec_tunnels` ( `tunnel_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `peer_port` int(11) NOT NULL, `peer_addr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `local_addr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `local_port` int(11) NOT NULL, `tunnel_name` varchar(96) COLLATE utf8_unicode_ci NOT NULL, `tunnel_status` varchar(11) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`tunnel_id`), UNIQUE KEY `unique_index` (`device_id`,`peer_addr`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -ALTER TABLE `syslog` ADD INDEX ( `program` ); -ALTER TABLE `devices` ADD `sysObjectID` VARCHAR( 64 ) NULL DEFAULT NULL AFTER `bgpLocalAs`; -ALTER TABLE `ports` CHANGE `ifSpeed` `ifSpeed` BIGINT NULL DEFAULT NULL; -ALTER TABLE `sensors` CHANGE `sensor_oid` `sensor_oid` VARCHAR( 255 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL; -CREATE TABLE IF NOT EXISTS `entPhysical_state` ( `device_id` int(11) NOT NULL, `entPhysicalIndex` varchar(64) NOT NULL, `subindex` varchar(64) DEFAULT NULL, `group` varchar(64) NOT NULL, `key` varchar(64) NOT NULL, `value` varchar(255) NOT NULL, KEY `device_id_index` (`device_id`,`entPhysicalIndex`)) ENGINE=MyISAM DEFAULT CHARSET=latin1; -CREATE TABLE IF NOT EXISTS `ports_vlans` ( `port_vlan_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `interface_id` int(11) NOT NULL, `vlan` int(11) NOT NULL, `baseport` int(11) NOT NULL, `priority` bigint(32) NOT NULL, `state` varchar(16) NOT NULL, `cost` int(11) NOT NULL, PRIMARY KEY (`port_vlan_id`), UNIQUE KEY `unique` (`device_id`,`interface_id`,`vlan`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; -ALTER TABLE `bills` CHANGE `bill_cdr` `bill_cdr` BIGINT( 20 ) NULL DEFAULT NULL; -CREATE TABLE IF NOT EXISTS `loadbalancer_rservers` ( `rserver_id` int(11) NOT NULL AUTO_INCREMENT, `farm_id` varchar(128) CHARACTER SET utf8 NOT NULL, `device_id` int(11) NOT NULL, `StateDescr` varchar(64) CHARACTER SET utf8 NOT NULL, PRIMARY KEY (`rserver_id`)) ENGINE=MyISAM AUTO_INCREMENT=514 DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `loadbalancer_vservers` ( `classmap_id` int(11) NOT NULL, `classmap` varchar(128) NOT NULL, `serverstate` varchar(64) NOT NULL, `device_id` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -ALTER TABLE `sensors` CHANGE `sensor_index` `sensor_index` VARCHAR( 64 ); -CREATE TABLE IF NOT EXISTS `netscaler_vservers` ( `vsvr_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `vsvr_name` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `vsvr_ip` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `vsvr_port` int(8) NOT NULL, `vsvr_type` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `vsvr_state` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `vsvr_clients` int(11) NOT NULL, `vsvr_server` int(11) NOT NULL, `vsvr_req_rate` int(11) NOT NULL, `vsvr_bps_in` int(11) NOT NULL, `vsvr_bps_out` int(11) NOT NULL, PRIMARY KEY (`vsvr_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ; -ALTER TABLE `dbSchema` ADD `version` INT NOT NULL; -ALTER TABLE `dbSchema` DROP `revision`; -ALTER TABLE `bills` CHANGE `bill_gb` `bill_quota` BIGINT( 20 ) NULL DEFAULT NULL; -ALTER TABLE `bills` CHANGE `rate_95th_in` `rate_95th_in` BIGINT( 20 ) NOT NULL; -ALTER TABLE `bills` CHANGE `rate_95th_out` `rate_95th_out` BIGINT( 20 ) NOT NULL; -ALTER TABLE `bills` CHANGE `rate_95th` `rate_95th` BIGINT( 20 ) NOT NULL; -ALTER TABLE `bills` CHANGE `total_data` `total_data` BIGINT( 20 ) NOT NULL; -ALTER TABLE `bills` CHANGE `total_data_in` `total_data_in` BIGINT( 20 ) NOT NULL ; -ALTER TABLE `bills` CHANGE `total_data_out` `total_data_out` BIGINT( 20 ) NOT NULL; -ALTER TABLE `bills` CHANGE `rate_average_in` `rate_average_in` BIGINT( 20 ) NOT NULL; -ALTER TABLE `bills` CHANGE `rate_average_out` `rate_average_out` BIGINT( 20 ) NOT NULL; -ALTER TABLE `bills` CHANGE `rate_average` `rate_average` BIGINT( 20 ) NOT NULL; -ALTER TABLE `eventlog` ADD INDEX `datetime` ( `datetime` ); -CREATE TABLE IF NOT EXISTS `packages` ( `pkg_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL, `name` varchar(64) NOT NULL, `manager` varchar(16) NOT NULL default '1', `status` tinyint(1) NOT NULL, `version` varchar(64) NOT NULL, `build` varchar(64) NOT NULL, `arch` varchar(16) NOT NULL, `size` bigint(20) default NULL, PRIMARY KEY (`pkg_id`), UNIQUE KEY `unique_key` (`device_id`,`name`,`manager`,`arch`,`version`,`build`), KEY `device_id` (`device_id`)) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_bin; -CREATE TABLE IF NOT EXISTS `slas` ( `sla_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL, `sla_nr` int(11) NOT NULL, `owner` varchar(255) NOT NULL, `tag` varchar(255) NOT NULL, `rtt_type` varchar(16) NOT NULL, `status` tinyint(1) NOT NULL, `deleted` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`sla_id`), UNIQUE KEY `unique_key` (`device_id`,`sla_nr`), KEY `device_id` (`device_id`)) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_bin; -ALTER TABLE `devices` ADD COLUMN `icon` VARCHAR(255) DEFAULT NULL -CREATE TABLE IF NOT EXISTS `munin_plugins` ( `mplug_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `mplug_type` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `mplug_instance` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_category` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_title` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_info` text CHARACTER SET utf8 COLLATE utf8_bin, `mplug_vlabel` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_args` varchar(512) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `mplug_total` binary(1) NOT NULL DEFAULT '0', `mplug_graph` binary(1) NOT NULL DEFAULT '1', PRIMARY KEY (`mplug_id`), UNIQUE KEY `UNIQUE` (`device_id`,`mplug_type`), KEY `device_id` (`device_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin ; -CREATE TABLE IF NOT EXISTS `munin_plugins_ds` ( `mplug_id` int(11) NOT NULL, `ds_name` varchar(32) COLLATE utf8_bin NOT NULL, `ds_type` enum('COUNTER','ABSOLUTE','DERIVE','GAUGE') COLLATE utf8_bin NOT NULL DEFAULT 'GAUGE', `ds_label` varchar(64) COLLATE utf8_bin NOT NULL, `ds_cdef` text COLLATE utf8_bin NOT NULL, `ds_draw` varchar(64) COLLATE utf8_bin NOT NULL, `ds_graph` enum('no','yes') COLLATE utf8_bin NOT NULL DEFAULT 'yes', `ds_info` varchar(255) COLLATE utf8_bin NOT NULL, `ds_extinfo` text COLLATE utf8_bin NOT NULL, `ds_max` varchar(32) COLLATE utf8_bin NOT NULL, `ds_min` varchar(32) COLLATE utf8_bin NOT NULL, `ds_negative` varchar(32) COLLATE utf8_bin NOT NULL, `ds_warning` varchar(32) COLLATE utf8_bin NOT NULL, `ds_critical` varchar(32) COLLATE utf8_bin NOT NULL, `ds_colour` varchar(32) COLLATE utf8_bin NOT NULL, `ds_sum` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `ds_stack` text COLLATE utf8_bin NOT NULL, `ds_line` varchar(64) COLLATE utf8_bin NOT NULL, UNIQUE KEY `splug_id` (`mplug_id`,`ds_name`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -ALTER TABLE `munin_plugins_ds` CHANGE `ds_cdef` `ds_cdef` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL; -ALTER TABLE `applications` ADD `app_state` TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL; -ALTER TABLE `vlans` ADD `vlan_type` VARCHAR( 16 ) NULL; -ALTER TABLE `vlans` CHANGE `vlan_domain` `vlan_domain` INT NULL DEFAULT NULL; -ALTER TABLE `vlans` CHANGE `vlan_descr` `vlan_name` VARCHAR( 32 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL; -ALTER TABLE `vlans` ADD `vlan_mtu` INT NULL; -ALTER TABLE `applications` ADD `app_status` VARCHAR( 8 ) NOT NULL ; -UPDATE `sensors` SET sensor_limit=sensor_limit/1.3*1.8 WHERE sensor_class="fanspeed" -ALTER TABLE `pseudowires` ADD `device_id` INT NOT NULL AFTER `pseudowire_id`; -TRUNCATE TABLE `pseudowires`; -ALTER TABLE `pseudowires` ADD `pw_type` VARCHAR( 32 ) NOT NULL ,ADD `pw_psntype` VARCHAR( 32 ) NOT NULL ,ADD `pw_local_mtu` INT NOT NULL ,ADD `pw_peer_mtu` INT NOT NULL ,ADD `pw_descr` VARCHAR( 128 ) NOT NULL; -ALTER TABLE `toner` ADD `toner_capacity_oid` VARCHAR( 64 ); -ALTER TABLE `devices` ADD `authlevel` ENUM("noAuthNoPriv", "authNoPriv", "authPriv") NULL DEFAULT NULL AFTER `community`; -ALTER TABLE `devices` ADD `authname` VARCHAR(64) NULL DEFAULT NULL AFTER `authlevel`; -ALTER TABLE `devices` ADD `authpass` VARCHAR(64) NULL DEFAULT NULL AFTER `authname`; -ALTER TABLE `devices` ADD `authalgo` ENUM("MD5", "SHA1") NULL DEFAULT NULL AFTER `authpass`; -ALTER TABLE `devices` ADD `cryptopass` VARCHAR(64) NULL DEFAULT NULL AFTER `authalgo`; -ALTER TABLE `devices` ADD `cryptoalgo` ENUM("AES", "DES") NULL DEFAULT NULL AFTER `cryptopass`; -ALTER TABLE `applications` CHANGE `app_state` `app_state` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT 'UNKNOWN'; -ALTER TABLE `applications` CHANGE `app_type` `app_type` VARCHAR( 64 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL; -ALTER TABLE `devices` CHANGE `authalgo` `authalgo` ENUM( 'MD5', 'SHA' ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL; -ALTER TABLE `ports` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL AUTO_INCREMENT; -ALTER TABLE `storage` ADD `storage_deleted` BOOL NOT NULL DEFAULT '0'; -ALTER TABLE `links` CHANGE `local_interface_id` `local_port_id` INT( 11 ) NULL DEFAULT NULL; -ALTER TABLE `links` CHANGE `remote_interface_id` `remote_port_id` INT( 11 ) NULL DEFAULT NULL; -ALTER TABLE `sensors` ADD `sensor_deleted` BOOL NOT NULL DEFAULT '0' AFTER `sensor_id`; -ALTER TABLE `mempools` ADD `mempool_deleted` BOOL NOT NULL DEFAULT '0'; -ALTER TABLE `ipv4_addresses` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL; -ALTER TABLE `ipv6_addresses` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL; -ALTER TABLE `ipv4_mac` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL; -ALTER TABLE `juniAtmVp` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL; -ALTER TABLE `ospf_nbrs` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL; -ALTER TABLE `mac_accounting` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL; -ALTER TABLE `ospf_ports` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL; -ALTER TABLE `ports_adsl` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL; -ALTER TABLE `ports_perms` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL; -ALTER TABLE `ports_stack` CHANGE `interface_id_high` `port_id_high` INT( 11 ) NOT NULL; -ALTER TABLE `ports_stack` CHANGE `interface_id_low` `port_id_low` INT( 11 ) NOT NULL; -ALTER TABLE `ports_vlans` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL; -ALTER TABLE `pseudowires` CHANGE `interface_id` `port_id` INT( 11 ) NOT NULL; -CREATE TABLE IF NOT EXISTS `access_points` ( `accesspoint_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `radio_number` tinyint(4) DEFAULT NULL, `type` varchar(16) NOT NULL, `mac_addr` varchar(24) NOT NULL, `deleted` tinyint(1) NOT NULL DEFAULT '0', `channel` tinyint(4) unsigned NOT NULL DEFAULT '0', `txpow` tinyint(4) NOT NULL DEFAULT '0', `radioutil` tinyint(4) NOT NULL DEFAULT '0', `numasoclients` smallint(6) NOT NULL DEFAULT '0', `nummonclients` smallint(6) NOT NULL DEFAULT '0', `numactbssid` tinyint(4) NOT NULL DEFAULT '0', `nummonbssid` tinyint(4) NOT NULL DEFAULT '0', `interference` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`accesspoint_id`), KEY `deleted` (`deleted`), KEY `name` (`name`,`radio_number`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Access Points';ALTER TABLE `juniAtmVp` ADD INDEX ( `port_id` ); -ALTER TABLE `loadbalancer_vservers` ADD INDEX ( `device_id` ); -ALTER TABLE `users` CHANGE `password` `password` VARCHAR( 60 ); -CREATE TABLE IF NOT EXISTS `session` ( `session_id` int(11) NOT NULL AUTO_INCREMENT, `session_username` varchar(30) NOT NULL, `session_value` varchar(60) NOT NULL, `session_token` varchar(60) NOT NULL, `session_auth` varchar(16) NOT NULL, `session_expiry` int(11) NOT NULL, PRIMARY KEY (`session_id`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -CREATE TABLE IF NOT EXISTS `plugins` ( `plugin_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `plugin_name` VARCHAR( 60 ) NOT NULL , `plugin_active` INT NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -ALTER TABLE `sensors` ADD `sensor_alert` TINYINT( 1 ) NOT NULL DEFAULT '1' AFTER `sensor_limit_low_warn` ; -CREATE TABLE IF NOT EXISTS `ciscoASA` ( `ciscoASA_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `oid` varchar(255) NOT NULL, `data` bigint(20) NOT NULL, `high_alert` bigint(20) NOT NULL, `low_alert` bigint(20) NOT NULL, `disabled` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`ciscoASA_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -INSERT INTO `graph_types` SET `graph_type`='device', `graph_subtype`='asa_conns',`graph_section`='firewall',`graph_descr`='Current connections',`graph_order`='0'; -CREATE TABLE `api_tokens` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `token_hash` varchar(32) NOT NULL, `description` varchar(100) NOT NULL, `disabled` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `token_hash` (`token_hash`)) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; -ALTER TABLE `api_tokens` MODIFY `token_hash` VARCHAR(256); -ALTER TABLE `devices` ADD `last_ping` TIMESTAMP NULL AFTER `last_discovered` , ADD `last_ping_timetaken` DOUBLE( 5, 2 ) NULL AFTER `last_ping` ; -DROP TABLE IF EXISTS `alerts`; -CREATE TABLE IF NOT EXISTS `alerts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `rule_id` int(11) NOT NULL, `state` int(11) NOT NULL, `alerted` int(11) NOT NULL, `open` int(11) NOT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; -DROP TABLE IF EXISTS `alert_log`; -CREATE TABLE IF NOT EXISTS `alert_log` ( `id` int(11) NOT NULL AUTO_INCREMENT, `rule_id` int(11) NOT NULL, `device_id` int(11) NOT NULL, `state` int(11) NOT NULL, `details` longblob NOT NULL, `time_logged` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY `id` (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; -DROP TABLE IF EXISTS `alert_rules`; -CREATE TABLE IF NOT EXISTS `alert_rules` ( `id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `rule` text CHARACTER SET utf8 NOT NULL, `severity` enum('ok','warning','critical') CHARACTER SET utf8 NOT NULL, `extra` varchar(255) CHARACTER SET utf8 NOT NULL, `disabled` tinyint(1) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; -DROP TABLE IF EXISTS `alert_schedule`; -CREATE TABLE IF NOT EXISTS `alert_schedule` ( `id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `start` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `end` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; -DROP TABLE IF EXISTS `alert_templates`; -CREATE TABLE IF NOT EXISTS `alert_templates` ( `id` int(11) NOT NULL AUTO_INCREMENT, `rule_id` varchar(255) NOT NULL DEFAULT ',',`name` varchar(255) NOT NULL, `template` longtext NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; -ALTER TABLE `alert_rules` ADD `name` VARCHAR( 255 ) NOT NULL ; -ALTER TABLE `users` ADD `twofactor` VARCHAR( 255 ) NOT NULL; -CREATE TABLE IF NOT EXISTS `processes` ( `device_id` int(11) NOT NULL, `pid` int(255) NOT NULL, `vsz` int(255) NOT NULL, `rss` int(255) NOT NULL, `cputime` varchar(12) NOT NULL, `user` varchar(50) NOT NULL, `command` varchar(255) NOT NULL, KEY `device_id` (`device_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -ALTER TABLE `devices` CHANGE `agent_uptime` `agent_uptime` INT( 11 ) NOT NULL DEFAULT '0'; -ALTER TABLE `devices` CHANGE `type` `type` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ''; -ALTER TABLE `ports` CHANGE `ifVrf` `ifVrf` INT( 11 ) NOT NULL DEFAULT '0'; -ALTER TABLE `storage` CHANGE `storage_free` `storage_free` BIGINT( 20 ) NOT NULL DEFAULT '0'; -ALTER TABLE `storage` CHANGE `storage_used` `storage_used` BIGINT( 20 ) NOT NULL DEFAULT '0'; -ALTER TABLE `storage` CHANGE `storage_perc` `storage_perc` INT NOT NULL DEFAULT '0'; -ALTER TABLE `processors` CHANGE `entPhysicalIndex` `entPhysicalIndex` INT( 11 ) NOT NULL DEFAULT '0'; -ALTER TABLE `hrDevice` CHANGE `hrDeviceErrors` `hrDeviceErrors` INT( 11 ) NOT NULL DEFAULT '0'; -ALTER TABLE `devices_attribs` ADD INDEX ( `device_id` ); -ALTER TABLE `device_graphs` ADD INDEX ( `device_id` ); -ALTER TABLE `alert_log` ADD INDEX ( `rule_id` ); -ALTER TABLE `alert_log` ADD INDEX ( `device_id` ); -ALTER TABLE `alerts` ADD INDEX ( `rule_id` ); -ALTER TABLE `alerts` ADD INDEX ( `device_id` ); -ALTER TABLE `ciscoASA` ADD INDEX ( `device_id` ); -ALTER TABLE `alert_schedule` ADD INDEX ( `device_id` ); -ALTER TABLE `alert_rules` ADD INDEX ( `device_id` ); -CREATE TABLE `pollers` (`id` int(11) NOT NULL AUTO_INCREMENT, `poller_name` varchar(255) NOT NULL, `last_polled` datetime NOT NULL, `devices` int(11) NOT NULL, `time_taken` double NOT NULL, KEY `id` (`id`)) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -ALTER TABLE `devices` ADD `poller_group` INT(11) NOT NULL DEFAULT '0'; -CREATE TABLE `poller_groups` (`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,`group_name` VARCHAR( 255 ) NOT NULL ,`descr` VARCHAR( 255 ) NOT NULL) ENGINE = INNODB; -ALTER TABLE `links` ADD `local_device_id` INT NOT NULL AFTER `local_port_id` , ADD `remote_device_id` INT NOT NULL AFTER `remote_hostname` ; -ALTER TABLE `links` ADD INDEX ( `local_device_id` , `remote_device_id` ) ; -CREATE TABLE IF NOT EXISTS `device_groups` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL DEFAULT '', `desc` varchar(255) NOT NULL DEFAULT '', `pattern` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`)) ENGINE=InnoDB; -CREATE TABLE IF NOT EXISTS `alert_map` ( `id` int(11) NOT NULL AUTO_INCREMENT, `rule` int(11) NOT NULL DEFAULT '0', `target` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '', PRIMARY KEY (`id`)) ENGINE=InnoDB; -ALTER TABLE `alert_rules` ADD UNIQUE (`name`); -ALTER TABLE `alert_rules` CHANGE `device_id` `device_id` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''; -CREATE TABLE `callback` ( `callback_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `name` CHAR( 64 ) NOT NULL , `value` CHAR( 64 ) NOT NULL ) ENGINE = INNODB; -ALTER TABLE `alert_log` ADD INDEX ( `time_logged` ); -ALTER TABLE `alert_schedule` DROP `device_id`; -ALTER TABLE `alert_schedule` CHANGE `id` `schedule_id` INT( 11 ) NOT NULL AUTO_INCREMENT; -ALTER TABLE `alert_schedule` ADD `title` VARCHAR( 255 ) NOT NULL ,ADD `notes` TEXT NOT NULL ; -CREATE TABLE `librenms`.`alert_schedule_items` (`item_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,`schedule_id` INT NOT NULL ,`target` VARCHAR( 255 ) NOT NULL ,INDEX ( `schedule_id` )) ENGINE = INNODB; -ALTER TABLE device_groups MODIFY COLUMN pattern TEXT; -ALTER TABLE `sensors` ADD `sensor_custom` ENUM( 'No', 'Yes' ) NOT NULL DEFAULT 'No' AFTER `sensor_alert` ; -DROP TABLE IF EXISTS `config`; -CREATE TABLE `config` ( `config_id` int(11) NOT NULL AUTO_INCREMENT, `config_name` varchar(255) NOT NULL, `config_value` varchar(512) NOT NULL, `config_default` varchar(512) NOT NULL, `config_descr` varchar(100) NOT NULL, `config_group` varchar(50) NOT NULL, `config_group_order` int(11) NOT NULL, `config_sub_group` varchar(50) NOT NULL, `config_sub_group_order` int(11) NOT NULL, `config_hidden` enum('0','1') NOT NULL DEFAULT '0', `config_disabled` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`config_id`)) ENGINE=InnoDB AUTO_INCREMENT=720 DEFAULT CHARSET=latin1; -INSERT INTO `config` VALUES (441,'alert.macros.rule.now','NOW()','NOW()','Macro currenttime','alerting',0,'macros',0,'1','0'),(442,'alert.macros.rule.past_5m','DATE_SUB(NOW(),INTERVAL 5 MINUTE)','DATE_SUB(NOW(),INTERVAL 5 MINUTE)','Macro past 5 minutes','alerting',0,'macros',0,'1','0'),(443,'alert.macros.rule.past_10m','DATE_SUB(NOW(),INTERVAL 10 MINUTE)','DATE_SUB(NOW(),INTERVAL 10 MINUTE)','Macro past 10 minutes','alerting',0,'macros',0,'1','0'),(444,'alert.macros.rule.past_15m','DATE_SUB(NOW(),INTERVAL 15 MINUTE)','DATE_SUB(NOW(),INTERVAL 15 MINUTE)','Macro past 15 minutes','alerting',0,'macros',0,'1','0'),(445,'alert.macros.rule.past_30m','DATE_SUB(NOW(),INTERVAL 30 MINUTE)','DATE_SUB(NOW(),INTERVAL 30 MINUTE)','Macro past 30 minutes','alerting',0,'macros',0,'1','0'),(446,'alert.macros.rule.device','(%devices.disabled = 0 && %devices.ignore = 0)','(%devices.disabled = 0 && %devices.ignore = 0)','Devices that aren\'t disabled or ignored','alerting',0,'macros',0,'1','0'),(447,'alert.macros.rule.device_up','(%devices.status = 1 && %macros.device)','(%devices.status = 1 && %macros.device)','Devices that are up','alerting',0,'macros',0,'1','0'),(448,'alert.macros.rule.device_down','(%devices.status = 0 && %macros.device)','(%devices.status = 0 && %macros.device)','Devices that are down','alerting',0,'macros',0,'1','0'),(449,'alert.macros.rule.port','(%ports.deleted = 0 && %ports.ignore = 0 && %ports.disabled = 0)','(%ports.deleted = 0 && %ports.ignore = 0 && %ports.disabled = 0)','Ports that aren\'t disabled, ignored or delete','alerting',0,'macros',0,'1','0'),(450,'alert.macros.rule.port_up','(%ports.ifOperStatus = \"up\" && %ports.ifAdminStatus = \"up\" && %macros.port)','(%ports.ifOperStatus = \"up\" && %ports.ifAdminStatus = \"up\" && %macros.port)','Ports that are up','alerting',0,'macros',0,'1','0'),(451,'alert.admins','true','true','Alert administrators','alerting',0,'general',0,'0','0'),(452,'alert.default_only','true','true','Only alert default mail contact','alerting',0,'general',0,'0','0'),(453,'alert.default_mail','','','The default mail contact','alerting',0,'general',0,'0','0'),(454,'alert.transports.pagerduty','','','Pagerduty transport - put your API key here','alerting',0,'transports',0,'0','0'),(455,'alert.pagerduty.account','','','Pagerduty account name','alerting',0,'transports',0,'0','0'),(456,'alert.pagerduty.service','','','Pagerduty service name','alerting',0,'transports',0,'0','0'),(457,'alert.tolerance_window','5','5','Tolerance window in seconds','alerting',0,'general',0,'0','0'),(458,'email_backend','mail','mail','The backend to use for sending email, can be mail, sendmail or smtp','alerting',0,'general',0,'0','0'),(459,'alert.macros.rule.past_60m','DATE_SUB(NOW(),INTERVAL 60 MINUTE)','DATE_SUB(NOW(),INTERVAL 60 MINUTE)','Macro past 60 minutes','alerting',0,'macros',0,'1','0'),(460,'alert.macros.rule.port_usage_perc','((%ports.ifInOctets_rate*8)/%ports.ifSpeed)*100','((%ports.ifInOctets_rate*8)/%ports.ifSpeed)*100','Ports using more than X perc','alerting',0,'macros',0,'1','0'),(461,'alert.transports.dummy','false','false','Dummy transport','alerting',0,'transports',0,'0','0'),(462,'alert.transports.mail','true','true','Mail alerting transport','alerting',0,'transports',0,'0','0'),(463,'alert.transports.irc','FALSE','false','IRC alerting transport','alerting',0,'transports',0,'0','0'),(464,'alert.globals','true','TRUE','Alert read only administrators','alerting',0,'general',0,'0','0'),(465,'email_from','NULL','NULL','Email address used for sending emails (from)','alerting',0,'general',0,'0','0'),(466,'email_user','LibreNMS','LibreNMS','Name used as part of the from address','alerting',0,'general',0,'0','0'),(467,'email_sendmail_path','/usr/sbin/sendmail','/usr/sbin/sendmail','Location of sendmail if using this option','alerting',0,'general',0,'0','0'),(468,'email_smtp_host','localhost','localhost','SMTP Host for sending email if using this option','alerting',0,'general',0,'0','0'),(469,'email_smtp_port','25','25','SMTP port setting','alerting',0,'general',0,'0','0'),(470,'email_smtp_timeout','10','10','SMTP timeout setting','alerting',0,'general',0,'0','0'),(471,'email_smtp_secure','','','Enable / disable encryption (use tls or ssl)','alerting',0,'general',0,'0','0'),(472,'email_smtp_auth','false','FALSE','Enable / disable smtp authentication','alerting',0,'general',0,'0','0'),(473,'email_smtp_username','NULL','NULL','SMTP Auth username','alerting',0,'general',0,'0','0'),(474,'email_smtp_password','NULL','NULL','SMTP Auth password','alerting',0,'general',0,'0','0'),(475,'alert.macros.rule.port_down','(%ports.ifOperStatus = \"down\" && %ports.ifAdminStatus != \"down\" && %macros.port)','(%ports.ifOperStatus = \"down\" && %ports.ifAdminStatus != \"down\" && %macros.port)','Ports that are down','alerting',0,'macros',0,'1','0'),(486,'alert.syscontact','true','TRUE','Issue alerts to sysContact','alerting',0,'general',0,'0','0'),(487,'alert.fixed-contacts','true','TRUE','If TRUE any changes to sysContact or users emails will not be honoured whilst alert is active','alerting',0,'general',0,'0','0'),(488,'alert.transports.nagios','','','Nagios compatible via FIFO','alerting',0,'transports',0,'0','0'); -ALTER TABLE `munin_plugins` CHANGE `mplug_type` `mplug_type` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL; -ALTER TABLE slas ENGINE=InnoDB; -ALTER TABLE packages ENGINE=InnoDB; -ALTER TABLE munin_plugins_ds ENGINE=InnoDB; -ALTER TABLE munin_plugins ENGINE=InnoDB; -ALTER TABLE loadbalancer_vservers ENGINE=InnoDB; -ALTER TABLE loadbalancer_rservers ENGINE=InnoDB; -ALTER TABLE ipsec_tunnels ENGINE=InnoDB; -CREATE TABLE `alert_template_map` (`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,`alert_templates_id` INT NOT NULL ,`alert_rule_id` INT NOT NULL ,INDEX ( `alert_templates_id` , `alert_rule_id` )) ENGINE = INNODB -ALTER TABLE `graph_types` CHANGE `graph_subtype` `graph_subtype` varchar(64); -ALTER TABLE `device_graphs` CHANGE `graph` `graph` varchar(64); -ALTER TABLE `graph_types` CHANGE `graph_descr` `graph_descr` varchar(255); -ALTER TABLE `graph_types` ADD PRIMARY KEY (`graph_type`, `graph_subtype`, `graph_section`); -insert into config (config_name,config_value,config_default,config_descr,config_group,config_group_order,config_sub_group,config_sub_group_order,config_hidden,config_disabled) values ('alert.macros.rule.sensor','(%sensors.sensor_alert = 1)','(%sensors.sensor_alert = 1)','Sensors of interest','alerting',0,'macros',0,1,0); -CREATE TABLE IF NOT EXISTS `device_perf` ( `id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `timestamp` datetime NOT NULL, `xmt` float NOT NULL, `rcv` float NOT NULL, `loss` float NOT NULL, `min` float NOT NULL, `max` float NOT NULL, `avg` float NOT NULL, KEY `id` (`id`,`device_id`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -insert into config (config_name,config_value,config_default,config_descr,config_group,config_group_order,config_sub_group,config_sub_group_order,config_hidden,config_disabled) values ('alert.macros.rule.packet_loss_15m','(%macros.past_15m && %device_perf.loss)','(%macros.past_15m && %device_perf.loss)','Packet loss over the last 15 minutes','alerting',0,'macros',0,1,0); -insert into config (config_name,config_value,config_default,config_descr,config_group,config_group_order,config_sub_group,config_sub_group_order,config_hidden,config_disabled) values ('alert.macros.rule.packet_loss_5m','(%macros.past_5m && %device_perf.loss)','(%macros.past_5m && %device_perf.loss)','Packet loss over the last 5 minutes','alerting',0,'macros',0,1,0); -ALTER TABLE `devices` ADD `status_reason` VARCHAR( 50 ) NOT NULL AFTER `status` ; -UPDATE `devices` SET `status_reason`='down' WHERE `status`=0; -ALTER TABLE `ipv4_mac` CHANGE `mac_address` `mac_address` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , CHANGE `ipv4_address` `ipv4_address` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL -ALTER TABLE `ipv4_mac` ADD INDEX ( `port_id`), ADD INDEX (`mac_address` ) -ALTER TABLE `ipv4_mac` DROP INDEX `interface_id`, DROP INDEX `interface_id_2` -CREATE TABLE `locations` ( `id` INT NOT NULL AUTO_INCREMENT ,`location` TEXT NOT NULL ,`lat` FLOAT( 10, 6 ) NOT NULL ,`lng` FLOAT( 10, 6 ) NOT NULL ,`timestamp` DATETIME NOT NULL ,INDEX ( `id` )) ENGINE = INNODB; -ALTER TABLE `devices` ADD `override_sysLocation` bool DEFAULT false; -UPDATE `devices` LEFT JOIN devices_attribs AS sysloc_bool ON(devices.device_id=sysloc_bool.device_id and sysloc_bool.attrib_type = 'override_sysLocation_bool') LEFT JOIN devices_attribs AS sysloc_string ON(devices.device_id=sysloc_string.device_id and sysloc_string.attrib_type = 'override_sysLocation_string') SET `override_sysLocation` = true, `location` = sysloc_string.attrib_value WHERE sysloc_bool.attrib_value = 1; -CREATE TABLE `users_widgets` ( `user_widget_id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `widget_id` int(11) NOT NULL, `col` tinyint(4) NOT NULL, `row` tinyint(4) NOT NULL, `size_x` tinyint(4) NOT NULL, `size_y` tinyint(4) NOT NULL, `title` varchar(255) NOT NULL, `refresh` tinyint(4) NOT NULL DEFAULT '60', PRIMARY KEY (`user_widget_id`), KEY `user_id` (`user_id`,`widget_id`) ) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=latin1; -CREATE TABLE `widgets` ( `widget_id` int(11) NOT NULL AUTO_INCREMENT, `widget_title` varchar(255) NOT NULL, `widget` varchar(255) NOT NULL, `base_dimensions` varchar(10) NOT NULL, PRIMARY KEY (`widget_id`), UNIQUE KEY `widget` (`widget`)) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; -INSERT INTO `widgets` (`widget_id`, `widget_title`, `widget`, `base_dimensions`) VALUES (1, 'Availability map', 'availability-map', '4,3'), (2, 'Device summary horizontal', 'device-summary-horiz', '4,2'), (3, 'Alerts', 'alerts', '8,4'), (4, 'Device summary vertical', 'device-summary-vert', '4,3'), (5, 'World map', 'globe', '3,3'); -INSERT INTO `widgets` (`widget_title`, `widget`, `base_dimensions`) VALUES ('Syslog', 'syslog', '9,3'), ('Eventlog', 'eventlog', '9,5'), ('Global Map', 'worldmap', '8,6'); -ALTER TABLE `device_perf` DROP INDEX `id` , ADD INDEX `id` ( `id` ), ADD INDEX ( `device_id` ); -ALTER TABLE `bgpPeers` MODIFY `bgpPeerRemoteAs` bigint(20) NOT NULL; -INSERT INTO `widgets` (`widget_title`, `widget`, `base_dimensions`) VALUES ('Graylog', 'graylog', '9,7'); -insert into config (config_name,config_value,config_default,config_descr,config_group,config_group_order,config_sub_group,config_sub_group_order,config_hidden,config_disabled) values ('alert.transports.pushbullet','','','Pushbullet access token','alerting',0,'transports',0,'0','0'); -DELETE n1 FROM pollers n1, pollers n2 WHERE n1.last_polled < n2.last_polled and n1.poller_name = n2.poller_name; -ALTER TABLE pollers ADD PRIMARY KEY (poller_name); -ALTER TABLE `devices` ADD `last_poll_attempted` timestamp NULL DEFAULT NULL AFTER `last_polled`; -ALTER TABLE `devices` ADD INDEX `last_polled` (`last_polled`); -ALTER TABLE `devices` ADD INDEX `last_poll_attempted` (`last_poll_attempted`); -ALTER TABLE `alert_templates` ADD `title` VARCHAR(255) NULL DEFAULT NULL; -ALTER TABLE `alert_templates` ADD `title_rec` VARCHAR(255) NULL DEFAULT NULL; -CREATE TABLE `proxmox` ( `id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL DEFAULT '0', `vmid` int(11) NOT NULL, `cluster` varchar(255) NOT NULL, `description` varchar(255) DEFAULT NULL, `last_seen` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `cluster_vm` (`cluster`,`vmid`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE `proxmox_ports` ( `id` int(11) NOT NULL AUTO_INCREMENT, `vm_id` int(11) NOT NULL, `port` varchar(10) NOT NULL, `last_seen` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `vm_port` (`vm_id`,`port`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; -ALTER TABLE `applications` ADD COLUMN `app_instance` varchar(255) NOT NULL; diff --git a/html/install.php b/html/install.php index 127af0b17..663c4cf44 100644 --- a/html/install.php +++ b/html/install.php @@ -10,7 +10,6 @@ $stage = $_POST['stage']; // Before we do anything, if we see config.php, redirect back to the homepage. if(file_exists('../config.php') && $stage != "6") { - session_destroy(); header("Location: /"); exit; } @@ -76,6 +75,7 @@ elseif($stage == "4") { } } elseif($stage == "6") { + session_destroy(); // If we get here then let's do some final checks. if(!file_exists("../config.php")) { // config.php file doesn't exist. go back to that stage diff --git a/includes/sql-schema/update.php b/includes/sql-schema/update.php index 264f1601b..841faafcd 100644 --- a/includes/sql-schema/update.php +++ b/includes/sql-schema/update.php @@ -94,6 +94,16 @@ if ($tmp[0] <= $db_rev) { foreach ($filelist as $file) { list($filename,$extension) = explode('.', $file, 2); if ($filename > $db_rev) { + + if (isset($_SESSION['stage']) ) { + $limit++; + if ( abs($limit-$_REQUEST['offset']) > 6) { + $_SESSION['offset'] = $limit; + echo 'Updating, please wait..'.date('r').''; + die(); + } + } + if (!$updating) { echo "-- Updating database schema\n"; } From ca0f9ea2f927adf2fe750e6a3ed05d5303c4ab68 Mon Sep 17 00:00:00 2001 From: f0o Date: Tue, 1 Sep 2015 23:38:10 +0100 Subject: [PATCH 180/263] Avoid useless I/O --- build-base.php | 4 ---- html/install.php | 7 ++++++- includes/sql-schema/update.php | 3 +++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/build-base.php b/build-base.php index 507abb266..29700db22 100644 --- a/build-base.php +++ b/build-base.php @@ -54,7 +54,3 @@ while (!feof($sql_fh)) { fclose($sql_fh); require 'includes/sql-schema/update.php'; - -if( isset($_SESSION['stage']) ) { - $_SESSION['build-ok'] = true; -} diff --git a/html/install.php b/html/install.php index 663c4cf44..8619e7b4a 100644 --- a/html/install.php +++ b/html/install.php @@ -318,7 +318,12 @@ elseif($stage == "2") { $config['db_name']=$dbname; $config['db']['extension']='mysqli'; $sql_file = '../build.sql'; - require '../build-base.php'; + if ($_REQUEST['offset'] =< 100) { + require '../build-base.php'; + } + else { + require '../includes/sql-schema/update.php'; + } ?> diff --git a/includes/sql-schema/update.php b/includes/sql-schema/update.php index 841faafcd..45bf671b2 100644 --- a/includes/sql-schema/update.php +++ b/includes/sql-schema/update.php @@ -168,5 +168,8 @@ foreach ($filelist as $file) { if ($updating) { echo "-- Done\n"; + if( isset($_SESSION['stage']) ) { + $_SESSION['build-ok'] = true; + } } From a2096dad51fa5ef080fdd88349a2fc20f7bcc4b6 Mon Sep 17 00:00:00 2001 From: f0o Date: Tue, 1 Sep 2015 23:38:48 +0100 Subject: [PATCH 181/263] Remove dupe-warning suppressor --- build-base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-base.php b/build-base.php index 29700db22..56860774e 100644 --- a/build-base.php +++ b/build-base.php @@ -45,7 +45,7 @@ while (!feof($sql_fh)) { if (!empty($line)) { $creation = mysqli_query($database_link, $line); - if (!$creation && ($limit <= 100 || $limit > 391) ) { + if (!$creation) { echo 'WARNING: Cannot execute query ('.$line.'): '.mysqli_error($database_link)."\n"; } } From e64d145bf1dfe0cc1bff9bcdef5c28ff9fd932c2 Mon Sep 17 00:00:00 2001 From: f0o Date: Tue, 1 Sep 2015 23:39:48 +0100 Subject: [PATCH 182/263] Gracefully break update --- includes/sql-schema/update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/sql-schema/update.php b/includes/sql-schema/update.php index 45bf671b2..7bbe7fc3b 100644 --- a/includes/sql-schema/update.php +++ b/includes/sql-schema/update.php @@ -100,7 +100,7 @@ foreach ($filelist as $file) { if ( abs($limit-$_REQUEST['offset']) > 6) { $_SESSION['offset'] = $limit; echo 'Updating, please wait..'.date('r').''; - die(); + return; } } From 574e4c52908bb6df66d152c330a545f6cd2f3351 Mon Sep 17 00:00:00 2001 From: f0o Date: Tue, 1 Sep 2015 23:40:43 +0100 Subject: [PATCH 183/263] Typo --- html/install.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/install.php b/html/install.php index 8619e7b4a..b3775d2a8 100644 --- a/html/install.php +++ b/html/install.php @@ -318,7 +318,7 @@ elseif($stage == "2") { $config['db_name']=$dbname; $config['db']['extension']='mysqli'; $sql_file = '../build.sql'; - if ($_REQUEST['offset'] =< 100) { + if ($_REQUEST['offset'] <= 100) { require '../build-base.php'; } else { From 501cf5a6ef15ad92745f47c512744b199cda263c Mon Sep 17 00:00:00 2001 From: f0o Date: Wed, 2 Sep 2015 00:13:14 +0100 Subject: [PATCH 184/263] Present all output+errors at the end --- build-base.php | 2 +- html/install.php | 11 ++++++++--- includes/sql-schema/update.php | 3 ++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/build-base.php b/build-base.php index 56860774e..1abbe7642 100644 --- a/build-base.php +++ b/build-base.php @@ -36,7 +36,7 @@ while (!feof($sql_fh)) { } elseif ( abs($limit-$_REQUEST['offset']) > 6) { $_SESSION['offset'] = $limit; - echo 'Installing, please wait..'.date('r').''; + $GLOBALS['refresh'] = 'Installing, please wait..'.date('r').''; return; } else { echo 'Step #'.$limit.' ...'.PHP_EOL; diff --git a/html/install.php b/html/install.php index b3775d2a8..bec581e35 100644 --- a/html/install.php +++ b/html/install.php @@ -309,7 +309,6 @@ elseif($stage == "2") {
    Importing MySQL DB - Do not close this page or interrupt the import
    -
     ".$_SESSION['out']."
    "; ?> -
    diff --git a/includes/sql-schema/update.php b/includes/sql-schema/update.php index 7bbe7fc3b..837794abf 100644 --- a/includes/sql-schema/update.php +++ b/includes/sql-schema/update.php @@ -91,6 +91,7 @@ if ($tmp[0] <= $db_rev) { return; } +$limit = @$limit?: $_REQUEST['offset']; foreach ($filelist as $file) { list($filename,$extension) = explode('.', $file, 2); if ($filename > $db_rev) { @@ -99,7 +100,7 @@ foreach ($filelist as $file) { $limit++; if ( abs($limit-$_REQUEST['offset']) > 6) { $_SESSION['offset'] = $limit; - echo 'Updating, please wait..'.date('r').''; + $GLOBALS['refresh'] = 'Updating, please wait..'.date('r').''; return; } } From 9ca926b9c6bd2b6a9d85be1ca0270461f2b79c56 Mon Sep 17 00:00:00 2001 From: f0o Date: Wed, 2 Sep 2015 14:30:15 +0100 Subject: [PATCH 185/263] SQLs are performed up to an execution time of 45s, then a page reload is induced to avoid fcgi/cgi/modphp timeouts. --- build-base.php | 2 +- html/install.php | 5 +++-- includes/sql-schema/update.php | 16 ++++++++-------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/build-base.php b/build-base.php index 1abbe7642..c6135a12c 100644 --- a/build-base.php +++ b/build-base.php @@ -34,7 +34,7 @@ while (!feof($sql_fh)) { if (isset($_SESSION['offset']) && $limit < $_REQUEST['offset']) { continue; } - elseif ( abs($limit-$_REQUEST['offset']) > 6) { + elseif ( time()-$_SESSION['last'] > 45 ) { $_SESSION['offset'] = $limit; $GLOBALS['refresh'] = 'Installing, please wait..'.date('r').''; return; diff --git a/html/install.php b/html/install.php index bec581e35..232a44c12 100644 --- a/html/install.php +++ b/html/install.php @@ -317,6 +317,7 @@ elseif($stage == "2") { $config['db_name']=$dbname; $config['db']['extension']='mysqli'; $sql_file = '../build.sql'; + $_SESSION['last'] = time(); ob_end_flush(); ob_start(); if ($_SESSION['offset'] < 100 && $_REQUEST['offset'] < 94) { @@ -325,11 +326,11 @@ elseif($stage == "2") { else { require '../includes/sql-schema/update.php'; } - $_SESSION['out'] .= ob_get_clean().PHP_EOL; + $_SESSION['out'] .= ob_get_clean(); ob_end_clean(); ob_start(); echo $GLOBALS['refresh']; - echo "
    ".$_SESSION['out']."
    "; + echo "
    ".trim($_SESSION['out'])."
    "; ?>
    diff --git a/includes/sql-schema/update.php b/includes/sql-schema/update.php index 837794abf..3f3cab661 100644 --- a/includes/sql-schema/update.php +++ b/includes/sql-schema/update.php @@ -91,19 +91,19 @@ if ($tmp[0] <= $db_rev) { return; } -$limit = @$limit?: $_REQUEST['offset']; +$limit = 150; //magic marker far enough in the future foreach ($filelist as $file) { list($filename,$extension) = explode('.', $file, 2); if ($filename > $db_rev) { - if (isset($_SESSION['stage']) ) { - $limit++; - if ( abs($limit-$_REQUEST['offset']) > 6) { - $_SESSION['offset'] = $limit; - $GLOBALS['refresh'] = 'Updating, please wait..'.date('r').''; - return; + if (isset($_SESSION['stage']) ) { + $limit++; + if ( time()-$_SESSION['last'] > 45 ) { + $_SESSION['offset'] = $limit; + $GLOBALS['refresh'] = 'Updating, please wait..'.date('r').''; + return; + } } - } if (!$updating) { echo "-- Updating database schema\n"; From 38bd3cf763f48c63eeae94c881a7cac09b0a8ba6 Mon Sep 17 00:00:00 2001 From: f0o Date: Thu, 3 Sep 2015 15:15:17 +0100 Subject: [PATCH 186/263] fix a typo --- alerts.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/alerts.php b/alerts.php index 23b282a23..dc8e9949a 100755 --- a/alerts.php +++ b/alerts.php @@ -228,7 +228,7 @@ function RunAlerts() { if (!empty($rextra['count']) && empty($rextra['interval'])) { // This check below is for compat-reasons if (!empty($rextra['delay'])) { - if ((time() - strtotime($alert['time_logged']) + $config['alert']['tolerance-window']) < $rextra['delay'] || (!empty($alert['details']['delay']) && (time() - $alert['details']['delay'] + $config['alert']['tolerance-window']) < $rextra['delay'])) { + if ((time() - strtotime($alert['time_logged']) + $config['alert']['tolerance_window']) < $rextra['delay'] || (!empty($alert['details']['delay']) && (time() - $alert['details']['delay'] + $config['alert']['tolerance_window']) < $rextra['delay'])) { continue; } else { @@ -248,12 +248,12 @@ function RunAlerts() { } else { // This is the new way - if (!empty($rextra['delay']) && (time() - strtotime($alert['time_logged']) + $config['alert']['tolerance-window']) < $rextra['delay']) { + if (!empty($rextra['delay']) && (time() - strtotime($alert['time_logged']) + $config['alert']['tolerance_window']) < $rextra['delay']) { continue; } if (!empty($rextra['interval'])) { - if (!empty($alert['details']['interval']) && (time() - $alert['details']['interval'] + $config['alert']['tolerance-window']) < $rextra['interval']) { + if (!empty($alert['details']['interval']) && (time() - $alert['details']['interval'] + $config['alert']['tolerance_window']) < $rextra['interval']) { continue; } else { From 0a478e7ef9079829d4b86f13fe01b60e9f1ac1eb Mon Sep 17 00:00:00 2001 From: laf Date: Fri, 4 Sep 2015 01:06:16 +0000 Subject: [PATCH 187/263] Added support for Oxidized versioning --- doc/Extensions/Oxidized.md | 40 ++++++++++++++ html/pages/device/showconfig.inc.php | 82 ++++++++++++++++++++++------ 2 files changed, 106 insertions(+), 16 deletions(-) create mode 100644 doc/Extensions/Oxidized.md diff --git a/doc/Extensions/Oxidized.md b/doc/Extensions/Oxidized.md new file mode 100644 index 000000000..5d82dcdf5 --- /dev/null +++ b/doc/Extensions/Oxidized.md @@ -0,0 +1,40 @@ +# Oxidized integration + +You can integrate LibreNMS with [Oxidized](https://github.com/ytti/oxidized-web) in two ways: + +### Config viewing + +This is a straight forward use of Oxidized, it relies on you having a working Oxidized setup which is already taking config snapshots for your devices. +When you have that, you only need the following config to enable the display of device configs within the device page itself: + +```php +$config['oxidized']['enabled'] = TRUE; +$config['oxidized']['url'] = 'http://127.0.0.1:8888'; +``` + +We also support config versioning within Oxidized, this will allow you to see the old configs stored. At present this is waiting on a [PR](https://github.com/ytti/oxidized-web/pull/25) to be merged upstream into Oxidized but you could simply patch your local install in the meantime. + +```php +$config['oxidized']['features']['versioning'] = true; +``` + +### Feeding Oxidized + +Oxidized has support for feeding devices into it via an API call, support for Oxidized has been added to the LibreNMS API. A sample config for Oxidized is provided below. + +You will need to configure default credentials for your devices, LibreNMS doesn't provide login credentials at this time. + +```bash + source: + default: http + debug: false + http: + url: https://librenms/api/v0/oxidized + scheme: https + delimiter: !ruby/regexp /:/ + map: + name: hostname + model: os + headers: + X-Auth-Token: '01582bf94c03104ecb7953dsadsadwed' +``` diff --git a/html/pages/device/showconfig.inc.php b/html/pages/device/showconfig.inc.php index 9efc95d63..ac5672d82 100644 --- a/html/pages/device/showconfig.inc.php +++ b/html/pages/device/showconfig.inc.php @@ -94,26 +94,76 @@ if ($_SESSION['userlevel'] >= '7') { } else if ($config['oxidized']['enabled'] === true && isset($config['oxidized']['url'])) { $node_info = json_decode(file_get_contents($config['oxidized']['url'].'/node/show/'.$device['hostname'].'?format=json'), true); - $text = file_get_contents($config['oxidized']['url'].'/node/fetch/'.$device['hostname']); - if ($text == 'node not found') { - $text = file_get_contents($config['oxidized']['url'].'/node/fetch/'.$device['os'].'/'.$device['hostname']); + if ($config['oxidized']['features']['versioning'] === true && isset($_POST['config'])) { + list($oid,$date,$version) = explode('|',mres($_POST['config'])); + $text = file_get_contents($config['oxidized']['url'].'/node/version/view?node='.$device['hostname'].'&group=&oid='.$oid.'&date='.urlencode($date).'&num='.$version.'&format=text'); + if ($text == 'node not found') { + $text = file_get_contents($config['oxidized']['url'].'/node/version/view?node='.$device['hostname'].'&group='.$device['os'].'&oid='.$oid.'&date='.urlencode($date).'&num='.$version.'&format=text'); + } + } + else { + $text = file_get_contents($config['oxidized']['url'].'/node/fetch/'.$device['hostname']); + if ($text == 'node not found') { + $text = file_get_contents($config['oxidized']['url'].'/node/fetch/'.$device['os'].'/'.$device['hostname']); + } + } + if ($config['oxidized']['features']['versioning'] === true) { + $config_versions = json_decode(file_get_contents($config['oxidized']['url'].'/node/version?node_full='.$device['hostname'].'&format=json'), true); } - if (is_array($node_info)) { + if (is_array($node_info) || is_array($config_versions)) { echo '
    -
    -
    -
    Sync status: '.$node_info['last']['status'].'
    -
      -
    • Node: '.$node_info['name'].'
    • -
    • IP: '.$node_info['ip'].'
    • -
    • Model: '.$node_info['model'].'
    • -
    • Last Sync: '.$node_info['last']['end'].'
    • -
    -
    -
    -
    '; + '; + + if (is_array($node_info)) { + echo ' +
    +
    +
    Sync status: '.$node_info['last']['status'].'
    +
      +
    • Node: '.$node_info['name'].'
    • +
    • IP: '.$node_info['ip'].'
    • +
    • Model: '.$node_info['model'].'
    • +
    • Last Sync: '.$node_info['last']['end'].'
    • +
    +
    +
    + '; + } + + if (is_array($config_versions)) { + echo ' +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + '; + } + + echo '
    '; } else { echo '
    '; From 91a61e285c295a461d882f1214e94a3b996ebeb3 Mon Sep 17 00:00:00 2001 From: laf Date: Fri, 4 Sep 2015 09:07:30 +0000 Subject: [PATCH 188/263] Removed notice that upstream PR is waiting to be merged --- doc/Extensions/Oxidized.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Extensions/Oxidized.md b/doc/Extensions/Oxidized.md index 5d82dcdf5..7fb605571 100644 --- a/doc/Extensions/Oxidized.md +++ b/doc/Extensions/Oxidized.md @@ -12,7 +12,7 @@ $config['oxidized']['enabled'] = TRUE; $config['oxidized']['url'] = 'http://127.0.0.1:8888'; ``` -We also support config versioning within Oxidized, this will allow you to see the old configs stored. At present this is waiting on a [PR](https://github.com/ytti/oxidized-web/pull/25) to be merged upstream into Oxidized but you could simply patch your local install in the meantime. +We also support config versioning within Oxidized, this will allow you to see the old configs stored. ```php $config['oxidized']['features']['versioning'] = true; From 5e213990e01255feb57b72f6c74d50ab71baf593 Mon Sep 17 00:00:00 2001 From: f0o Date: Fri, 4 Sep 2015 21:49:31 +0100 Subject: [PATCH 189/263] Make test-alert an 'alert' instead of 'recovery' --- html/includes/forms/test-transport.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/includes/forms/test-transport.inc.php b/html/includes/forms/test-transport.inc.php index 4919a7ebc..05b4dcfdd 100644 --- a/html/includes/forms/test-transport.inc.php +++ b/html/includes/forms/test-transport.inc.php @@ -34,7 +34,7 @@ $obj = array( "name" => "Test-Rule", "timestamp" => date("Y-m-d H:i:s"), "contacts" => $tmp['contacts'], - "state" => "0", + "state" => "1", "msg" => "This is a test alert", ); From 31bf0b4dbf935e3002a75549f085ddb0f27f021a Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Sat, 5 Sep 2015 15:51:20 +0100 Subject: [PATCH 190/263] remove debug statement --- includes/common.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/includes/common.php b/includes/common.php index 1fc1e648c..bcef46da0 100644 --- a/includes/common.php +++ b/includes/common.php @@ -693,9 +693,7 @@ function get_graph_subtypes($type) { // find the MIB subtypes foreach ($config['graph_types'] as $type => $unused1) { - print_r($type); foreach ($config['graph_types'][$type] as $subtype => $unused2) { - print_r($subtype); if (is_mib_graph($type, $subtype)) { $types[] = $subtype; } From 41cff319410e44db99aa653bb8db2929933de7cd Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Sat, 5 Sep 2015 15:53:43 +0100 Subject: [PATCH 191/263] Allow multiple instances of the same widget --- .../forms/update-dashboard-config.inc.php | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/html/includes/forms/update-dashboard-config.inc.php b/html/includes/forms/update-dashboard-config.inc.php index c2760adb5..fd6dc18a4 100644 --- a/html/includes/forms/update-dashboard-config.inc.php +++ b/html/includes/forms/update-dashboard-config.inc.php @@ -20,22 +20,14 @@ elseif ($sub_type == 'remove-all') { } } elseif ($sub_type == 'add' && is_numeric($widget_id)) { - $dupe_check = dbFetchCEll('SELECT `user_widget_id` FROM `users_widgets` WHERE `user_id`=? AND `widget_id`=?',array($_SESSION['user_id'],$widget_id)); - - if (is_numeric($dupe_check)) { - $message = 'This widget has already been added'; - } - else { - - $widget = dbFetchRow('SELECT * FROM `widgets` WHERE `widget_id`=?', array($widget_id)); - if (is_array($widget)) { - list($x,$y) = explode(',',$widget['base_dimensions']); - $item_id = dbInsert(array('user_id'=>$_SESSION['user_id'],'widget_id'=>$widget_id, 'col'=>1,'row'=>1,'refresh'=>60,'title'=>$widget['widget_title'],'size_x'=>$x,'size_y'=>$y),'users_widgets'); - if (is_numeric($item_id)) { - $extra = array('widget_id'=>$item_id,'title'=>$widget['widget_title'],'widget'=>$widget['widget'],'size_x'=>$x,'size_y'=>$y); - $status = 'ok'; - $message = ''; - } + $widget = dbFetchRow('SELECT * FROM `widgets` WHERE `widget_id`=?', array($widget_id)); + if (is_array($widget)) { + list($x,$y) = explode(',',$widget['base_dimensions']); + $item_id = dbInsert(array('user_id'=>$_SESSION['user_id'],'widget_id'=>$widget_id, 'col'=>1,'row'=>1,'refresh'=>60,'title'=>$widget['widget_title'],'size_x'=>$x,'size_y'=>$y),'users_widgets'); + if (is_numeric($item_id)) { + $extra = array('widget_id'=>$item_id,'title'=>$widget['widget_title'],'widget'=>$widget['widget'],'size_x'=>$x,'size_y'=>$y); + $status = 'ok'; + $message = ''; } } } From 7acc1d266a6e5fc013fad4cea085338d8bafaf25 Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Sat, 5 Sep 2015 16:15:11 +0100 Subject: [PATCH 192/263] Added per-widget settings --- html/ajax_dash.php | 7 ++- html/includes/forms/widget-settings.inc.php | 52 +++++++++++++++++++++ html/pages/front/tiles.php | 46 +++++++++++++++--- sql-schema/068.sql | 1 + 4 files changed, 97 insertions(+), 9 deletions(-) create mode 100644 html/includes/forms/widget-settings.inc.php create mode 100644 sql-schema/068.sql diff --git a/html/ajax_dash.php b/html/ajax_dash.php index 3b4c56e46..a26e46e5a 100644 --- a/html/ajax_dash.php +++ b/html/ajax_dash.php @@ -33,8 +33,11 @@ if ($type == 'placeholder') { } elseif (is_file('includes/common/'.$type.'.inc.php')) { - $results_limit = 10; - $no_form = true; + $results_limit = 10; + $no_form = true; + $widget_id = mres($_POST['id']); + $widget_settings = json_decode(dbFetchCell('select settings from users_widgets where user_widget_id = ?',array($widget_id)),true); + $widget_dimensions = dbfetchRow('select size_x,size_y from users_widgets where user_widget_id = ?',array($widget_id)); include 'includes/common/'.$type.'.inc.php'; $output = implode('', $common_output); $status = 'ok'; diff --git a/html/includes/forms/widget-settings.inc.php b/html/includes/forms/widget-settings.inc.php new file mode 100644 index 000000000..2ce0cde63 --- /dev/null +++ b/html/includes/forms/widget-settings.inc.php @@ -0,0 +1,52 @@ + + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ + +/** + * Store per-widget settings + * @author Daniel Preussker + * @copyright 2015 Daniel Preussker, QuxLabs UG + * @license GPL + * @package LibreNMS + * @subpackage Widgets + */ + +$status = 'error'; +$message = 'unknown error'; +$widget_id = (int) $_REQUEST['id']; + +if ($widget_id < 1) { + $status = 'error'; + $message = 'ERROR: malformed widget ID.'; +} +else { + $widget_settings = $_REQUEST['settings']; + if (!is_array($widget_settings)) { + $widget_settings = array(); + } + if (dbUpdate(array('settings'=>json_encode($widget_settings)),'users_widgets','user_widget_id=?',array($widget_id))) { + $status = 'ok'; + $message = 'Updated'; + } + else { + $status = 'error'; + $message = 'ERROR: Could not update'; + } +} + +die(json_encode(array( + 'status' => $status, + 'message' => $message +))); +?> diff --git a/html/pages/front/tiles.php b/html/pages/front/tiles.php index ddaf61af4..063b4bba6 100644 --- a/html/pages/front/tiles.php +++ b/html/pages/front/tiles.php @@ -18,7 +18,7 @@ $no_refresh = true; -foreach (dbFetchRows('SELECT * FROM `users_widgets` LEFT JOIN `widgets` ON `widgets`.`widget_id`=`users_widgets`.`widget_id` WHERE `user_id`=?',array($_SESSION['user_id'])) as $items) { +foreach (dbFetchRows('SELECT user_widget_id,users_widgets.widget_id,title,widget,col,row,size_x,size_y,refresh FROM `users_widgets` LEFT JOIN `widgets` ON `widgets`.`widget_id`=`users_widgets`.`widget_id` WHERE `user_id`=?',array($_SESSION['user_id'])) as $items) { $data[] = $items; } @@ -121,7 +121,7 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg gridster.remove_all_widgets(); $.each(serialization, function() { gridster.add_widget( - '
  • '+ + '
  • '+ '\var timeout'+this.user_widget_id+' = grab_data('+this.user_widget_id+','+this.refresh+',\''+this.widget+'\');\<\/script\>'+ '
    '+this.title+'
    '+ '
    '+this.widget+'
    '+ @@ -166,7 +166,7 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg var size_x = data.extra.size_x; var size_y = data.extra.size_y; gridster.add_widget( - '
  • '+ + '
  • '+ '\var timeout'+widget_id+' = grab_data('+widget_id+',60,\''+widget+'\');\<\/script\>'+ '
    '+title+'
    '+ '
    '+widget+'
    '+ @@ -209,12 +209,40 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg }); - function grab_data(id,refresh,data_type) { - new_refresh = refresh * 1000; + function widget_settings(data) { + var widget_settings = {}; + var widget_id = 0; + datas = $(data).serializeArray(); + for( var field in datas ) { + widget_settings[datas[field].name] = datas[field].value; + } +console.log(widget_settings); + $('.gridster').find('div[id^=widget_body_]').each(function() { + if(this.contains(data)) { + widget_id = $(this).parent().attr('id'); + widget_type = $(this).parent().data('type'); + } + }); + if( widget_id > 0 && widget_settings != {} ) { + $.ajax({ + type: 'POST', + url: 'ajax_form.php', + data: {type: 'widget-settings', id: widget_id, settings: widget_settings}, + dataType: "json", + success: function (data) { + if( data.status == "ok" ) { + widget_reload(widget_id,widget_type); + } + } + }); + } + } + + function widget_reload(id,data_type) { $.ajax({ type: 'POST', url: 'ajax_dash.php', - data: {type: data_type}, + data: {type: data_type, id: id}, dataType: "json", success: function (data) { if (data.status == 'ok') { @@ -228,7 +256,11 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg $("#widget_body_"+id).html('
    Problem with backend
    '); } }); - + } + + function grab_data(id,refresh,data_type) { + new_refresh = refresh * 1000; + widget_reload(id,data_type); setTimeout(function() { grab_data(id,refresh,data_type); }, diff --git a/sql-schema/068.sql b/sql-schema/068.sql new file mode 100644 index 000000000..39784b418 --- /dev/null +++ b/sql-schema/068.sql @@ -0,0 +1 @@ +alter table users_widgets add column `settings` text not null; From 63ed6e25aab2176ff1602355401fefe129ee49b9 Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Sat, 5 Sep 2015 16:15:56 +0100 Subject: [PATCH 193/263] Added generic graph widget (non-responsive sizing) --- html/includes/common/generic-graph.inc.php | 114 +++++++++++++++++++++ sql-schema/068.sql | 1 + 2 files changed, 115 insertions(+) create mode 100644 html/includes/common/generic-graph.inc.php diff --git a/html/includes/common/generic-graph.inc.php b/html/includes/common/generic-graph.inc.php new file mode 100644 index 000000000..b6e5773ee --- /dev/null +++ b/html/includes/common/generic-graph.inc.php @@ -0,0 +1,114 @@ + + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ + +/** + * Generic Graph Widget + * @author Daniel Preussker + * @copyright 2015 Daniel Preussker, QuxLabs UG + * @license GPL + * @package LibreNMS + * @subpackage Widgets + */ + +if( empty($widget_settings) ) { + $common_output[] = ' +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + +
    +'; +} +else { + $widget_settings['device_id'] = dbFetchCell('select device_id from devices where hostname = ?',array($widget_settings['graph_device'])); + $common_output[] = "
    ".$widget_settings['graph_device']." / ".$widget_settings['graph_type']."
    "; + $common_output[] = generate_minigraph_image(array('device_id'=>(int) $widget_settings['device_id']), $config['time']['day'], $config['time']['now'], $widget_settings['graph_type'], $widget_settings['graph_legend'] == 1 ? 'yes' : 'no', $widget_settings['graph_width'], $widget_settings['graph_height'], '&', $widget_settings['graph_type']); +} +?> + diff --git a/sql-schema/068.sql b/sql-schema/068.sql index 39784b418..d0bbda576 100644 --- a/sql-schema/068.sql +++ b/sql-schema/068.sql @@ -1 +1,2 @@ alter table users_widgets add column `settings` text not null; +insert into widgets values(null,'Graph','generic-graph','6,2'); From f081706ab1258e5df068fcd75001064ce128b91c Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Sun, 6 Sep 2015 10:59:44 +0100 Subject: [PATCH 194/263] Added option to allow absolute dimensions on graphs --- html/includes/functions.inc.php | 4 ++-- html/includes/graphs/common.inc.php | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index 7b7ea62ca..b4ab63c70 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -181,8 +181,8 @@ function get_percentage_colours($percentage) { }//end get_percentage_colours() -function generate_minigraph_image($device, $start, $end, $type, $legend='no', $width=275, $height=100, $sep='&', $class='minigraph-image') { - return ''; +function generate_minigraph_image($device, $start, $end, $type, $legend='no', $width=275, $height=100, $sep='&', $class='minigraph-image',$absolute_size=0) { + return ''; }//end generate_minigraph_image() diff --git a/html/includes/graphs/common.inc.php b/html/includes/graphs/common.inc.php index 9dbc97b80..ba77fb3f6 100644 --- a/html/includes/graphs/common.inc.php +++ b/html/includes/graphs/common.inc.php @@ -103,3 +103,7 @@ else { } $rrd_options .= ' --font-render-mode normal'; + +if (isset($_GET['absolute']) && $_GET['absolute'] == "1") { + $rrd_options .= ' --full-size-mode'; +} From 9951c98e70bbb8c394864cbcce4169482fe00e48 Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Sun, 6 Sep 2015 13:18:54 +0100 Subject: [PATCH 195/263] Added edit-page Added responsive resizing support for graph widget --- html/ajax_dash.php | 11 +- html/includes/common/generic-graph.inc.php | 81 ++++---- .../forms/update-dashboard-config.inc.php | 2 +- html/pages/front/tiles.php | 183 ++++++++++-------- 4 files changed, 153 insertions(+), 124 deletions(-) diff --git a/html/ajax_dash.php b/html/ajax_dash.php index a26e46e5a..ec88e68ec 100644 --- a/html/ajax_dash.php +++ b/html/ajax_dash.php @@ -30,23 +30,30 @@ $type = mres($_POST['type']); if ($type == 'placeholder') { $output = 'Please add a Widget to get started'; $status = 'ok'; + $title = 'Placeholder'; } elseif (is_file('includes/common/'.$type.'.inc.php')) { $results_limit = 10; $no_form = true; + $title = ucfirst($type); + $unique_id = str_replace(array("-","."),"_",uniqid($type,true)); $widget_id = mres($_POST['id']); $widget_settings = json_decode(dbFetchCell('select settings from users_widgets where user_widget_id = ?',array($widget_id)),true); - $widget_dimensions = dbfetchRow('select size_x,size_y from users_widgets where user_widget_id = ?',array($widget_id)); + $widget_dimensions = $_POST['dimensions']; + if( !empty($_POST['settings']) ) { + define('show_settings',true); + } include 'includes/common/'.$type.'.inc.php'; $output = implode('', $common_output); $status = 'ok'; - + $title = $widget_settings['title'] ?: $title; } $response = array( 'status' => $status, 'html' => $output, + 'title' => $title, ); echo _json_encode($response); diff --git a/html/includes/common/generic-graph.inc.php b/html/includes/common/generic-graph.inc.php index b6e5773ee..9d79fff22 100644 --- a/html/includes/common/generic-graph.inc.php +++ b/html/includes/common/generic-graph.inc.php @@ -22,13 +22,13 @@ * @subpackage Widgets */ -if( empty($widget_settings) ) { +if( defined('show_settings') || empty($widget_settings) ) { $common_output[] = '
    - +
    @@ -37,10 +37,10 @@ if( empty($widget_settings) ) { Legend + Legend
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    + +'; } else { $widget_settings['device_id'] = dbFetchCell('select device_id from devices where hostname = ?',array($widget_settings['graph_device'])); - $common_output[] = "
    ".$widget_settings['graph_device']." / ".$widget_settings['graph_type']."
    "; - $common_output[] = generate_minigraph_image(array('device_id'=>(int) $widget_settings['device_id']), $config['time']['day'], $config['time']['now'], $widget_settings['graph_type'], $widget_settings['graph_legend'] == 1 ? 'yes' : 'no', $widget_settings['graph_width'], $widget_settings['graph_height'], '&', $widget_settings['graph_type']); + $widget_settings['title'] = $widget_settings['graph_device']." / ".$widget_settings['graph_type']; + $common_output[] = generate_minigraph_image( + array('device_id'=>(int) $widget_settings['device_id']), + $config['time']['day'], + $config['time']['now'], + $widget_settings['graph_type'], + $widget_settings['graph_legend'] == 1 ? 'yes' : 'no', + $widget_dimensions['x'], + $widget_dimensions['y'], + '&', + 'minigraph-image', + 1 + ); } ?> diff --git a/html/includes/forms/update-dashboard-config.inc.php b/html/includes/forms/update-dashboard-config.inc.php index fd6dc18a4..de278fd91 100644 --- a/html/includes/forms/update-dashboard-config.inc.php +++ b/html/includes/forms/update-dashboard-config.inc.php @@ -25,7 +25,7 @@ elseif ($sub_type == 'add' && is_numeric($widget_id)) { list($x,$y) = explode(',',$widget['base_dimensions']); $item_id = dbInsert(array('user_id'=>$_SESSION['user_id'],'widget_id'=>$widget_id, 'col'=>1,'row'=>1,'refresh'=>60,'title'=>$widget['widget_title'],'size_x'=>$x,'size_y'=>$y),'users_widgets'); if (is_numeric($item_id)) { - $extra = array('widget_id'=>$item_id,'title'=>$widget['widget_title'],'widget'=>$widget['widget'],'size_x'=>$x,'size_y'=>$y); + $extra = array('user_widget_id'=>$item_id,'widget_id'=>$item_id,'title'=>$widget['widget_title'],'widget'=>$widget['widget'],'refresh'=>60,'size_x'=>$x,'size_y'=>$y); $status = 'ok'; $message = ''; } diff --git a/html/pages/front/tiles.php b/html/pages/front/tiles.php index 063b4bba6..5c6effb1e 100644 --- a/html/pages/front/tiles.php +++ b/html/pages/front/tiles.php @@ -103,31 +103,25 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg }, resize: { enabled: true, - stop: function(e, ui, $widget) { + stop: function(e, ui, widget) { updatePos(gridster); + widget_reload(widget.attr('id'),widget.data('type')); } }, - serialize_params: function($w, wgd) { - return { - id: $($w).attr('id'), - col: wgd.col, - row: wgd.row, - size_x: wgd.size_x, - size_y: wgd.size_y + serialize_params: function(w, wgd) { + return { + id: $(w).attr('id'), + col: wgd.col, + row: wgd.row, + size_x: wgd.size_x, + size_y: wgd.size_y }; } }).data('gridster'); gridster.remove_all_widgets(); $.each(serialization, function() { - gridster.add_widget( - '
  • '+ - '\var timeout'+this.user_widget_id+' = grab_data('+this.user_widget_id+','+this.refresh+',\''+this.widget+'\');\<\/script\>'+ - '
    '+this.title+'
    '+ - '
    '+this.widget+'
    '+ - '
  • ', - parseInt(this.size_x), parseInt(this.size_y), parseInt(this.col), parseInt(this.row) - ); + widget_dom(this); }); $(document).on('click','#clear_widgets', function() { @@ -160,19 +154,7 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg dataType: "json", success: function (data) { if (data.status == 'ok') { - var widget_id = data.extra.widget_id; - var title = data.extra.title; - var widget = data.extra.widget; - var size_x = data.extra.size_x; - var size_y = data.extra.size_y; - gridster.add_widget( - '
  • '+ - '\var timeout'+widget_id+' = grab_data('+widget_id+',60,\''+widget+'\');\<\/script\>'+ - '
    '+title+'
    '+ - '
    '+widget+'
    '+ - '
  • ', - parseInt(size_x), parseInt(size_y) - ); + widget_dom(data.extra); updatePos(gridster); } else { @@ -207,65 +189,96 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg }); }); + $(document).on("click",".edit-widget",function() { + obj = $(this).parent().parent(); + if( obj.data('settings') == 1 ) { + obj.data('settings','0'); + } else { + obj.data('settings','1'); + } + widget_reload(obj.attr('id'),obj.data('type')); + }); + }); - function widget_settings(data) { - var widget_settings = {}; - var widget_id = 0; - datas = $(data).serializeArray(); - for( var field in datas ) { - widget_settings[datas[field].name] = datas[field].value; - } -console.log(widget_settings); - $('.gridster').find('div[id^=widget_body_]').each(function() { - if(this.contains(data)) { - widget_id = $(this).parent().attr('id'); - widget_type = $(this).parent().data('type'); - } - }); - if( widget_id > 0 && widget_settings != {} ) { - $.ajax({ - type: 'POST', - url: 'ajax_form.php', - data: {type: 'widget-settings', id: widget_id, settings: widget_settings}, - dataType: "json", - success: function (data) { - if( data.status == "ok" ) { - widget_reload(widget_id,widget_type); - } - } - }); - } - } + function widget_dom(data) { + dom = '
  • '+ + '
    '+data.title+''+ + ''+ + ''+ + '
    '+ + '
    '+data.widget+'
    '+ + '\var timeout'+data.user_widget_id+' = grab_data('+data.user_widget_id+','+data.refresh+',\''+data.widget+'\');\<\/script\>'+ + '
  • '; + if (data.hasOwnProperty('col') && data.hasOwnProperty('row')) { + gridster.add_widget(dom, parseInt(data.size_x), parseInt(data.size_y), parseInt(data.col), parseInt(data.row)); + } else { + gridster.add_widget(dom, parseInt(data.size_x), parseInt(data.size_y)); + } + } - function widget_reload(id,data_type) { - $.ajax({ - type: 'POST', - url: 'ajax_dash.php', - data: {type: data_type, id: id}, - dataType: "json", - success: function (data) { - if (data.status == 'ok') { - $("#widget_body_"+id).html(data.html); - } - else { - $("#widget_body_"+id).html('
    ' + data.message + '
    '); - } - }, - error: function () { - $("#widget_body_"+id).html('
    Problem with backend
    '); - } - }); - } + function widget_settings(data) { + var widget_settings = {}; + var widget_id = 0; + datas = $(data).serializeArray(); + for( var field in datas ) { + widget_settings[datas[field].name] = datas[field].value; + } + $('.gridster').find('div[id^=widget_body_]').each(function() { + if(this.contains(data)) { + widget_id = $(this).parent().attr('id'); + widget_type = $(this).parent().data('type'); + $(this).parent().data('settings','0'); + } + }); + if( widget_id > 0 && widget_settings != {} ) { + $.ajax({ + type: 'POST', + url: 'ajax_form.php', + data: {type: 'widget-settings', id: widget_id, settings: widget_settings}, + dataType: "json", + success: function (data) { + if( data.status == "ok" ) { + widget_reload(widget_id,widget_type); + } + } + }); + } + } - function grab_data(id,refresh,data_type) { - new_refresh = refresh * 1000; - widget_reload(id,data_type); - setTimeout(function() { - grab_data(id,refresh,data_type); - }, - new_refresh); - } -$('#new-widget').popover(); + function widget_reload(id,data_type) { + if( $("#widget_body_"+id).parent().data('settings') == 1 ) { + settings = 1; + } else { + settings = 0; + } + $.ajax({ + type: 'POST', + url: 'ajax_dash.php', + data: {type: data_type, id: id, dimensions: {x:$("#widget_body_"+id).innerWidth()-50, y:$("#widget_body_"+id).innerHeight()-50}, settings:settings}, + dataType: "json", + success: function (data) { + if (data.status == 'ok') { + $("#widget_title_"+id).html(data.title); + $("#widget_body_"+id).html(data.html); + } + else { + $("#widget_body_"+id).html('
    ' + data.message + '
    '); + } + }, + error: function () { + $("#widget_body_"+id).html('
    Problem with backend
    '); + } + }); + } + function grab_data(id,refresh,data_type) { + new_refresh = refresh * 1000; + widget_reload(id,data_type); + setTimeout(function() { + grab_data(id,refresh,data_type); + }, + new_refresh); + } + $('#new-widget').popover(); From b741e479a446258d02dcf258e55fe369bfa616da Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Sun, 6 Sep 2015 13:37:48 +0100 Subject: [PATCH 196/263] Allow drag on title-text --- html/pages/front/tiles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/pages/front/tiles.php b/html/pages/front/tiles.php index 5c6effb1e..e679f5079 100644 --- a/html/pages/front/tiles.php +++ b/html/pages/front/tiles.php @@ -96,7 +96,7 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg widget_margins: [5, 5], avoid_overlapped_widgets: true, draggable: { - handle: 'header', + handle: 'header, span', stop: function(e, ui, $widget) { updatePos(gridster); }, From 64f1f3a6365eb2930a91aee19e826a5b68d6d5ed Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Sun, 6 Sep 2015 14:28:55 +0100 Subject: [PATCH 197/263] scrut fixes --- html/includes/common/generic-graph.inc.php | 1 - html/includes/forms/widget-settings.inc.php | 1 - 2 files changed, 2 deletions(-) diff --git a/html/includes/common/generic-graph.inc.php b/html/includes/common/generic-graph.inc.php index 9d79fff22..3ac02ab69 100644 --- a/html/includes/common/generic-graph.inc.php +++ b/html/includes/common/generic-graph.inc.php @@ -119,5 +119,4 @@ else { 1 ); } -?> diff --git a/html/includes/forms/widget-settings.inc.php b/html/includes/forms/widget-settings.inc.php index 2ce0cde63..1926d3491 100644 --- a/html/includes/forms/widget-settings.inc.php +++ b/html/includes/forms/widget-settings.inc.php @@ -49,4 +49,3 @@ die(json_encode(array( 'status' => $status, 'message' => $message ))); -?> From 8182abe5f1ba96cc8984dea8af70c78033346b53 Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Sat, 5 Sep 2015 20:06:29 +0200 Subject: [PATCH 198/263] Update Changelog --- doc/General/Changelog.md | 67 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/doc/General/Changelog.md b/doc/General/Changelog.md index 25eb1421a..f6fe9ab3c 100644 --- a/doc/General/Changelog.md +++ b/doc/General/Changelog.md @@ -1,3 +1,34 @@ +### September + +#### Bug fixes + - Alerting: + - Process followups if there are changes (PR1817) + - Typo in alert_window setting (PR1841) + - Issue alert-trigger as test object (PR1850) + - General: + - Remove 'sh' from cronjob (PR1818) + - Remove MySQL Locks (PR1822,PR1826,PR1829,PR1836) + +#### Improvements + - WebUI: + - Ability to edit ifAlias (PR1811) + - Honour Mouseout/Mouseleave on map widget (PR1814) + - Make syslog/eventlog responsive (PR1816) + - Reformat Proxmox UI (PR1825,PR1827) + - Misc Changes (PR1828,PR1830) + - Added support for Oxidized versioning (PR1842) + - Added graph widget + settings for widgets (PR1835) + - Added detection for: + - FortiOS (PR1815) + - Discovery / Poller: + - Added Proxmox support (PR1789) + - Documentation: + - Add varnish docs (PR1809) + - General: + - Make installer more responsive (PR1832) + - Update fping millisec option to 200 default (PR1833) + - Reduced cleanup of device_perf (PR1837) + ### August 2015 #### Bug fixes @@ -8,6 +39,9 @@ - Fixed Web installer due to code tidying update (PR1644) - Updated gridster variable names to make unique (PR1646) - Fixed issues with displaying devices with ' in location (PR1655) + - Fixes updating snmpv3 details in webui (PR1727) + - Check for user perms before listing neighbour ports (PR1749) + - Fixed Test-Transport button (PR1772) - DB: - Added proper indexes on device_perf table (PR1621) - Fixed multiple mysql strict issues (PR1638, PR1659) @@ -17,8 +51,18 @@ - Fixed discovery-arp not running since code formatting update (PR1671) - Correct the DSM upgrade OID (PR1696) - Fix MySQL agent host variable usage (PR1710) + - Pass snmp-auth parameters enclosed by single-quotes (PR1730) + - Revert change which skips over down ports (PR1742) + - Stop PoE polling for each port (PR1747) + - Use ifHighSpeed if ifSpeed equals 0 (PR1750) + - Keep PHP Backwards compatibility (PR1766) + - False identification of Zyxel as Cisco (PR1776) + - Fix MySQL statement in poller-service.py (PR1794) + - Fix upstart script for poller-service.py (PR1812) - General: - Fixed path to defaults.inc.php in config.php.default (PR1673) + - Strip '::ffff:' from syslog input (PR1734) + - Fix RRA (PR1791) #### Improvements - WebUI Updates: @@ -32,29 +76,50 @@ - Added support for running under sub-directory (PR1667) - Updated vis.js to latest version (PR1708) - Added border on availability map (PR1713) + - Make new dashboard the default (PR1719) + - Rearrange about page (PR1735,PR1743) + - Center/Cleanup graphs (PR1736) + - Added Hover-Effect on devices table (PR1738) + - Show Test-Transport result (PR1777) + - Add arrows to the network map (PR1787) + - Add errored ports to summary widget (PR1788) + - Show message if no Device-Groups exist (PR1796) + - Misc UI fixes (Titles, Headers, ...) (PR1797,PR1798,PR1800,PR1801,PR1802,PR1803,PR1804,PR1805) + - Move packages to overview dropdown (PR1810) - API Updates: - Improvided billing support in API (PR1599) + - Extended support for list devices to support mac/ipv4 and ipv6 filtering (PR1744) - Added detection for: - Perle Media convertors (PR1607) + - Mac OSX 10 (PR1774) - Improved detection for: - Windows devices (PR1639) - - Zywall CPU, Version and Memory (PR1660) + - Zywall CPU, Version and Memory (PR1660,PR1784) - Added LLDP support for PBN devices (PR1705) + - Netgear GS110TP (PR1751) - Additional Sensors: - Added Compressor state for PCOWEB (PR1600) - Added dbm support for IOS-XR (PR1661) + - Added temperature support for DNOS (PR1782) - Discovery / Poller: - Updated autodiscovery function to log new type (PR1623) + - Improve application polling (PR1724) + - Improve debug output (PR1756) - DB: - Added MySQLi support (PR1647) - Documentation: - Added docs on MySQL strict mode (PR1635) - Updated billing docs to use librenms user in cron (PR1676) - Updated LDAP docs to indicate php-ldap module needs installing (PR1716) + - Typo/Spellchecks (PR1731,PR1806) + - Improved Alerting and Device-Groups (PR1781) - Alerting: - Reformatted eventlog message to show state for alerts (PR1685) + - Add basic Pushbullet transport (PR1721) + - Allow custom titles (PR1807) - General: - Added more debugging and checks to discovery-protocols (PR1590) + - Cleanup debug statements (PR1725,PR1737) ### July 2015 From e0e4f97747729ec0b533efb683121894944fab6e Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Sun, 6 Sep 2015 16:13:08 +0000 Subject: [PATCH 199/263] Fixed typo in changelog --- doc/General/Changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/General/Changelog.md b/doc/General/Changelog.md index f6fe9ab3c..86c04213e 100644 --- a/doc/General/Changelog.md +++ b/doc/General/Changelog.md @@ -1,4 +1,4 @@ -### September +### September 2015 #### Bug fixes - Alerting: From e8188c6143f9ee2689be59a302d2043b39419a84 Mon Sep 17 00:00:00 2001 From: Sergiusz Paprzycki Date: Sun, 6 Sep 2015 23:08:14 +0100 Subject: [PATCH 200/263] I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md. --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 95833993b..610f95b21 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -50,6 +50,7 @@ Contributors to LibreNMS: - Mark Schouten (tuxis-ie) - Todd Eddy (vrillusions) - Arjit Chaudhary (arjit.c@gmail.com) (arjitc) +- Sergiusz Paprzycki (spaprzycki) [1]: http://observium.org/ "Observium web site" From 130d1c452a2bd36b31560a5e74e6ed1646daa866 Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Mon, 7 Sep 2015 19:29:30 +0100 Subject: [PATCH 201/263] Added application and munin search operations --- html/ajax_search.php | 108 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 99 insertions(+), 9 deletions(-) diff --git a/html/ajax_search.php b/html/ajax_search.php index 791513972..e42655ee9 100644 --- a/html/ajax_search.php +++ b/html/ajax_search.php @@ -96,23 +96,22 @@ if (isset($_REQUEST['search'])) { }//end if $json = json_encode($device); - print_r($json); - exit; + die($json); } else if ($_REQUEST['type'] == 'ports') { // Search ports if (is_admin() === true || is_read() === true) { - $results = dbFetchRows("SELECT `ports`.*,`devices`.* FROM `ports` LEFT JOIN `devices` ON `ports`.`device_id` = `devices`.`device_id` WHERE `ifAlias` LIKE '%".$search."%' OR `ifDescr` LIKE '%".$search."%' ORDER BY ifDescr LIMIT 8"); + $results = dbFetchRows("SELECT `ports`.*,`devices`.* FROM `ports` LEFT JOIN `devices` ON `ports`.`device_id` = `devices`.`device_id` WHERE `ifAlias` LIKE '%".$search."%' OR `ifDescr` LIKE '%".$search."%' OR `ifName` LIKE '%".$search."%' ORDER BY ifDescr LIMIT 8"); } else { - $results = dbFetchRows("SELECT DISTINCT(`I`.`port_id`), `I`.*, `D`.`hostname` FROM `ports` AS `I`, `devices` AS `D`, `devices_perms` AS `P`, `ports_perms` AS `PP` WHERE ((`P`.`user_id` = ? AND `P`.`device_id` = `D`.`device_id`) OR (`PP`.`user_id` = ? AND `PP`.`port_id` = `I`.`port_id` AND `I`.`device_id` = `D`.`device_id`)) AND `D`.`device_id` = `I`.`device_id` AND (`ifAlias` LIKE '%".$search."%' OR `ifDescr` LIKE '%".$search."%') ORDER BY ifDescr LIMIT 8", array($_SESSION['user_id'], $_SESSION['user_id'])); + $results = dbFetchRows("SELECT DISTINCT(`I`.`port_id`), `I`.*, `D`.`hostname` FROM `ports` AS `I`, `devices` AS `D`, `devices_perms` AS `P`, `ports_perms` AS `PP` WHERE ((`P`.`user_id` = ? AND `P`.`device_id` = `D`.`device_id`) OR (`PP`.`user_id` = ? AND `PP`.`port_id` = `I`.`port_id` AND `I`.`device_id` = `D`.`device_id`)) AND `D`.`device_id` = `I`.`device_id` AND (`ifAlias` LIKE '%".$search."%' OR `ifDescr` LIKE '%".$search."%' OR `ifName` LIKE '%".$search."%') ORDER BY ifDescr LIMIT 8", array($_SESSION['user_id'], $_SESSION['user_id'])); } if (count($results)) { $found = 1; foreach ($results as $result) { - $name = $result['ifDescr']; + $name = $result['ifDescr'] == $result['ifAlias'] ? $result['ifName'] : $result['ifDescr']; $description = $result['ifAlias']; if ($result['deleted'] == 0 && ($result['ignore'] == 0 || $result['ignore'] == 0) && ($result['ifInErrors_delta'] > 0 || $result['ifOutErrors_delta'] > 0)) { @@ -143,13 +142,13 @@ if (isset($_REQUEST['search'])) { 'description' => $description, 'colours' => $highlight_colour, 'hostname' => $result['hostname'], + 'port_id' => $result['port_id'], ); }//end foreach }//end if $json = json_encode($ports); - print_r($json); - exit; + die($json); } else if ($_REQUEST['type'] == 'bgp') { // Search bgp peers @@ -204,8 +203,99 @@ if (isset($_REQUEST['search'])) { }//end if $json = json_encode($bgp); - print_r($json); - exit; + die($json); + } + else if ($_REQUEST['type'] == 'applications') { + // Device search + if (is_admin() === true || is_read() === true) { + $results = dbFetchRows("SELECT * FROM `applications` INNER JOIN `devices` ON devices.device_id = applications.device_id WHERE `app_type` LIKE '%".$search."%' OR `hostname` LIKE '%".$search."%' ORDER BY hostname LIMIT 8"); + } + else { + $results = dbFetchRows("SELECT * FROM `applications` INNER JOIN `devices` AS `D` ON `D`.`device_id` = `applications`.`device_id` INNER JOIN `devices_perms` AS `P` ON `P`.`device_id` = `D`.`device_id` WHERE `P`.`user_id` = ? AND (`app_type` LIKE '%".$search."%' OR `hostname` LIKE '%".$search."%') ORDER BY hostname LIMIT 8", array($_SESSION['user_id'])); + } + + if (count($results)) { + $found = 1; + $devices = count($results); + + foreach ($results as $result) { + $name = $result['app_type']; + if ($result['disabled'] == 1) { + $highlight_colour = '#808080'; + } + else if ($result['ignored'] == 1 && $result['disabled'] == 0) { + $highlight_colour = '#000000'; + } + else if ($result['status'] == 0 && $result['ignore'] == 0 && $result['disabled'] == 0) { + $highlight_colour = '#ff0000'; + } + else if ($result['status'] == 1 && $result['ignore'] == 0 && $result['disabled'] == 0) { + $highlight_colour = '#008000'; + } + + $device[] = array( + 'name' => $name, + 'hostname' => $result['hostname'], + 'app_id' => $result['app_id'], + 'device_id' => $result['device_id'], + 'colours' => $highlight_colour, + 'device_image' => getImageSrc($result), + 'device_hardware' => $result['hardware'], + 'device_os' => $config['os'][$result['os']]['text'], + 'version' => $result['version'], + 'location' => $result['location'], + ); + }//end foreach + }//end if + + $json = json_encode($device); + die($json); + } + else if ($_REQUEST['type'] == 'munin') { + // Device search + if (is_admin() === true || is_read() === true) { + $results = dbFetchRows("SELECT * FROM `munin_plugins` INNER JOIN `devices` ON devices.device_id = munin_plugins.device_id WHERE `mplug_type` LIKE '%".$search."%' OR `mplug_title` LIKE '%".$search."%' OR `hostname` LIKE '%".$search."%' ORDER BY hostname LIMIT 8"); + } + else { + $results = dbFetchRows("SELECT * FROM `munin_plugins` INNER JOIN `devices` AS `D` ON `D`.`device_id` = `munin_plugins`.`device_id` INNER JOIN `devices_perms` AS `P` ON `P`.`device_id` = `D`.`device_id` WHERE `P`.`user_id` = ? AND (`mplug_type` LIKE '%".$search."%' OR `mplug_title` LIKE '%".$search."%' OR `hostname` LIKE '%".$search."%') ORDER BY hostname LIMIT 8", array($_SESSION['user_id'])); + } + + if (count($results)) { + $found = 1; + $devices = count($results); + + foreach ($results as $result) { + $name = $result['mplug_title']; + if ($result['disabled'] == 1) { + $highlight_colour = '#808080'; + } + else if ($result['ignored'] == 1 && $result['disabled'] == 0) { + $highlight_colour = '#000000'; + } + else if ($result['status'] == 0 && $result['ignore'] == 0 && $result['disabled'] == 0) { + $highlight_colour = '#ff0000'; + } + else if ($result['status'] == 1 && $result['ignore'] == 0 && $result['disabled'] == 0) { + $highlight_colour = '#008000'; + } + + $device[] = array( + 'name' => $name, + 'hostname' => $result['hostname'], + 'device_id' => $result['device_id'], + 'colours' => $highlight_colour, + 'device_image' => getImageSrc($result), + 'device_hardware' => $result['hardware'], + 'device_os' => $config['os'][$result['os']]['text'], + 'version' => $result['version'], + 'location' => $result['location'], + 'plugin' => $result['mplug_type'], + ); + }//end foreach + }//end if + + $json = json_encode($device); + die($json); }//end if }//end if }//end if From e8f7f3b6f83918060672402189de50000e6eb098 Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Mon, 7 Sep 2015 19:30:22 +0100 Subject: [PATCH 202/263] Add reload lock if widget is in settings mode --- html/pages/front/tiles.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/html/pages/front/tiles.php b/html/pages/front/tiles.php index e679f5079..9c7c5c933 100644 --- a/html/pages/front/tiles.php +++ b/html/pages/front/tiles.php @@ -202,7 +202,7 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg }); function widget_dom(data) { - dom = '
  • '+ + dom = '
  • '+ '
    '+data.title+''+ ''+ ''+ @@ -273,8 +273,10 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg } function grab_data(id,refresh,data_type) { + if( $("#widget_body_"+id).parent().data('settings') == 0 ) { + widget_reload(id,data_type); + } new_refresh = refresh * 1000; - widget_reload(id,data_type); setTimeout(function() { grab_data(id,refresh,data_type); }, From e67ccd9463f08394f41678c8d70b448edd41ccdd Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Mon, 7 Sep 2015 19:30:37 +0100 Subject: [PATCH 203/263] Added multiple graph type support for the graph widget --- html/includes/common/generic-graph.inc.php | 288 ++++++++++++++++++--- 1 file changed, 246 insertions(+), 42 deletions(-) diff --git a/html/includes/common/generic-graph.inc.php b/html/includes/common/generic-graph.inc.php index 3ac02ab69..4e75b16ca 100644 --- a/html/includes/common/generic-graph.inc.php +++ b/html/includes/common/generic-graph.inc.php @@ -26,35 +26,107 @@ if( defined('show_settings') || empty($widget_settings) ) { $common_output[] = '
    - -
    - +
    +
    -
    -
    -
    -
    -
    - +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    -'; } else { - $widget_settings['device_id'] = dbFetchCell('select device_id from devices where hostname = ?',array($widget_settings['graph_device'])); - $widget_settings['title'] = $widget_settings['graph_device']." / ".$widget_settings['graph_type']; - $common_output[] = generate_minigraph_image( - array('device_id'=>(int) $widget_settings['device_id']), - $config['time']['day'], - $config['time']['now'], - $widget_settings['graph_type'], - $widget_settings['graph_legend'] == 1 ? 'yes' : 'no', - $widget_dimensions['x'], - $widget_dimensions['y'], - '&', - 'minigraph-image', - 1 - ); + $widget_settings['title'] = ""; + $type = array_shift(explode('_',$widget_settings['graph_type'],2)); + $widget_settings['graph_'.$type] = json_decode($widget_settings['graph_'.$type],true); + if ($type == 'device') { + $widget_settings['title'] = $widget_settings['graph_device']['name']." / ".$widget_settings['graph_type']; + $param = 'device='.$widget_settings['graph_device']['device_id']; + } + elseif ($type == 'application') { + $param = 'id='.$widget_settings['graph_'.$type]['app_id']; + } + elseif ($type == 'munin') { + $param = 'device='.$widget_settings['graph_'.$type]['device_id'].'&plugin='.$widget_settings['graph_'.$type]['name']; + } + else { + $param = 'id='.$widget_settings['graph_'.$type][$type.'_id']; + } + if (empty($widget_settings['title'])) { + $widget_settings['title'] = $widget_settings['graph_'.$type]['hostname']." / ".$widget_settings['graph_'.$type]['name']." / ".$widget_settings['graph_type']; + } + $common_output[] = ''; } - From a4d27d3eba3e26bdf34ab9e4f640b5689f046c18 Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Mon, 7 Sep 2015 19:52:22 +0100 Subject: [PATCH 204/263] scrut fixes --- html/includes/common/generic-graph.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/html/includes/common/generic-graph.inc.php b/html/includes/common/generic-graph.inc.php index 4e75b16ca..81776efe1 100644 --- a/html/includes/common/generic-graph.inc.php +++ b/html/includes/common/generic-graph.inc.php @@ -41,7 +41,8 @@ if( defined('show_settings') || empty($widget_settings) ) { foreach (get_graph_subtypes($type) as $avail_type) { $display_type = is_mib_graph($type, $avail_type) ? $avail_type : nicecase($avail_type); if( strstr($display_type,'_') ) { - $sub = array_shift(explode('_',$display_type,2)); + $sub = explode('_',$display_type,2); + $sub = array_shift($sub); if( $sub != $old ) { $old = $sub; $common_output[] = ''; @@ -304,7 +305,8 @@ $(function() { } else { $widget_settings['title'] = ""; - $type = array_shift(explode('_',$widget_settings['graph_type'],2)); + $type = explode('_',$widget_settings['graph_type'],2); + $type = array_shift($type); $widget_settings['graph_'.$type] = json_decode($widget_settings['graph_'.$type],true); if ($type == 'device') { $widget_settings['title'] = $widget_settings['graph_device']['name']." / ".$widget_settings['graph_type']; From 29c55eb41568e6de2f231d07fa0eac0280600a2f Mon Sep 17 00:00:00 2001 From: Sergiusz Paprzycki Date: Sun, 6 Sep 2015 22:40:08 +0100 Subject: [PATCH 205/263] Leaflet module now checks device permissions --- html/includes/common/worldmap.inc.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/html/includes/common/worldmap.inc.php b/html/includes/common/worldmap.inc.php index f6ba921a4..03a3b9603 100644 --- a/html/includes/common/worldmap.inc.php +++ b/html/includes/common/worldmap.inc.php @@ -51,7 +51,26 @@ var greenMarker = L.AwesomeMarkers.icon({ }); '; -foreach (dbFetchRows("SELECT `device_id`,`hostname`,`os`,`status`,`lat`,`lng` FROM `devices` LEFT JOIN `locations` ON `devices`.`location`=`locations`.`location` WHERE `disabled`=0 AND `ignore`=0 AND `lat` != '' AND `lng` != '' ORDER BY `status` ASC, `hostname`") as $map_devices) { +// Checking user permissions +if (is_admin() || is_read()) { +// Admin or global read-only - show all devices + $sql = "SELECT `device_id`,`hostname`,`os`,`status`,`lat`,`lng` FROM `devices` + LEFT JOIN `locations` ON `devices`.`location`=`locations`.`location` + WHERE `disabled`=0 AND `ignore`=0 AND `lat` != '' AND `lng` != '' + ORDER BY `status` ASC, `hostname`"; +} +else { +// Normal user - grab devices that user has permissions to + $sql = "SELECT `devices`.`device_id` as `device_id`,`hostname`,`os`,`status`,`lat`,`lng` + FROM `devices_perms`, `devices` + LEFT JOIN `locations` ON `devices`.`location`=`locations`.`location` + WHERE `disabled`=0 AND `ignore`=0 AND `lat` != '' AND `lng` != '' + AND `devices`.`device_id` = `devices_perms`.`device_id` + AND `devices_perms`.`user_id` = '".$_SESSION['user_id']."' + ORDER BY `status` ASC, `hostname`"; +} +// Slightly modified foreach - grabbing SQL query string from above +foreach (dbFetchRows($sql) as $map_devices) { $icon = 'greenMarker'; if ($map_devices['status'] == 0) { $icon = 'redMarker'; From d568830df35518974c4bdef61767c66f3f822f67 Mon Sep 17 00:00:00 2001 From: Sergiusz Paprzycki Date: Sun, 6 Sep 2015 23:14:52 +0100 Subject: [PATCH 206/263] Leaflet map permissions check #1855 --- html/includes/common/worldmap.inc.php | 1 - 1 file changed, 1 deletion(-) diff --git a/html/includes/common/worldmap.inc.php b/html/includes/common/worldmap.inc.php index 03a3b9603..7feae55a5 100644 --- a/html/includes/common/worldmap.inc.php +++ b/html/includes/common/worldmap.inc.php @@ -69,7 +69,6 @@ else { AND `devices_perms`.`user_id` = '".$_SESSION['user_id']."' ORDER BY `status` ASC, `hostname`"; } -// Slightly modified foreach - grabbing SQL query string from above foreach (dbFetchRows($sql) as $map_devices) { $icon = 'greenMarker'; if ($map_devices['status'] == 0) { From a54dcd76ab764b5389fba8434e0d04ebab5ae146 Mon Sep 17 00:00:00 2001 From: Sergiusz Paprzycki Date: Mon, 7 Sep 2015 15:45:27 +0100 Subject: [PATCH 207/263] Leaflet map permissions check #1855; SQL/query modified as requested --- html/includes/common/worldmap.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html/includes/common/worldmap.inc.php b/html/includes/common/worldmap.inc.php index 7feae55a5..dea7224e7 100644 --- a/html/includes/common/worldmap.inc.php +++ b/html/includes/common/worldmap.inc.php @@ -66,10 +66,10 @@ else { LEFT JOIN `locations` ON `devices`.`location`=`locations`.`location` WHERE `disabled`=0 AND `ignore`=0 AND `lat` != '' AND `lng` != '' AND `devices`.`device_id` = `devices_perms`.`device_id` - AND `devices_perms`.`user_id` = '".$_SESSION['user_id']."' + AND `devices_perms`.`user_id` = ? ORDER BY `status` ASC, `hostname`"; } -foreach (dbFetchRows($sql) as $map_devices) { +foreach (dbFetchRows($sql, array($_SESSION['user_id'])) as $map_devices) { $icon = 'greenMarker'; if ($map_devices['status'] == 0) { $icon = 'redMarker'; From 2ce10cf6dfeee820b5c8c2e274a9a84ece883ef7 Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Wed, 9 Sep 2015 20:06:10 +0100 Subject: [PATCH 208/263] Add multiple dashboard support --- html/includes/forms/add-dashboard.inc.php | 41 +++++ html/includes/forms/delete-dashboard.inc.php | 45 ++++++ html/includes/forms/edit-dashboard.inc.php | 44 ++++++ .../forms/update-dashboard-config.inc.php | 9 +- html/pages/front/tiles.php | 142 ++++++++++++++++-- sql-schema/069.sql | 2 + 6 files changed, 264 insertions(+), 19 deletions(-) create mode 100644 html/includes/forms/add-dashboard.inc.php create mode 100644 html/includes/forms/delete-dashboard.inc.php create mode 100644 html/includes/forms/edit-dashboard.inc.php create mode 100644 sql-schema/069.sql diff --git a/html/includes/forms/add-dashboard.inc.php b/html/includes/forms/add-dashboard.inc.php new file mode 100644 index 000000000..e34993a6e --- /dev/null +++ b/html/includes/forms/add-dashboard.inc.php @@ -0,0 +1,41 @@ + + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ + +/** + * Create Dashboards + * @author Daniel Preussker + * @copyright 2015 Daniel Preussker, QuxLabs UG + * @license GPL + * @package LibreNMS + * @subpackage Dashboards + */ + +$status = 'error'; +$message = 'unknown error'; +if (isset($_REQUEST['dashboard_name']) && ($dash_id = dbInsert(array('dashboard_name'=>$_REQUEST['dashboard_name'],'user_id'=>$_SESSION['user_id']),'dashboards'))) { + $status = 'ok'; + $message = 'Created'; +} +else { + $status = 'error'; + $message = 'ERROR: Could not create'; +} + +die(json_encode(array( + 'status' => $status, + 'message' => $message, + 'dashboard_id' => $dash_id +))); + diff --git a/html/includes/forms/delete-dashboard.inc.php b/html/includes/forms/delete-dashboard.inc.php new file mode 100644 index 000000000..2874dec6e --- /dev/null +++ b/html/includes/forms/delete-dashboard.inc.php @@ -0,0 +1,45 @@ + + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ + +/** + * Delete Dashboards + * @author Daniel Preussker + * @copyright 2015 Daniel Preussker, QuxLabs UG + * @license GPL + * @package LibreNMS + * @subpackage Dashboards + */ + +$status = 'error'; +$message = 'unknown error'; +if (isset($_REQUEST['dashboard_id'])) { + dbDelete('users_widgets','user_id = ? && dashboard_id = ?',array($_SESSION['user_id'],$_REQUEST['dashboard_id'])); + if (dbDelete('dashboards','user_id = ? && dashboard_id = ?',array($_SESSION['user_id'],$_REQUEST['dashboard_id']))) { + $status = 'ok'; + $message = 'Deleted dashboard'; + } + else { + $message = 'ERROR: Could not delete dashboard '.$_REQUEST['dashboard_id']; + } +} +else { + $message = 'ERROR: Not enough params'; +} + +die(json_encode(array( + 'status' => $status, + 'message' => $message, +))); + diff --git a/html/includes/forms/edit-dashboard.inc.php b/html/includes/forms/edit-dashboard.inc.php new file mode 100644 index 000000000..7e87af0a1 --- /dev/null +++ b/html/includes/forms/edit-dashboard.inc.php @@ -0,0 +1,44 @@ + + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ + +/** + * Edit Dashboards + * @author Daniel Preussker + * @copyright 2015 Daniel Preussker, QuxLabs UG + * @license GPL + * @package LibreNMS + * @subpackage Dashboards + */ + +$status = 'error'; +$message = 'unknown error'; +if (isset($_REQUEST['dashboard_id']) && isset($_REQUEST['dashboard_name'])) { + if(dbUpdate(array('dashboard_name'=>$_REQUEST['dashboard_name']),'dashboards','user_id = ? && dashboard_id = ?',array($_SESSION['user_id'],$_REQUEST['dashboard_id']))) { + $status = 'ok'; + $message = 'Updated dashboard'; + } + else { + $message = 'ERROR: Could not update dashboard '.$_REQUEST['dashboard_id']; + } +} +else { + $message = 'ERROR: Not enough params'; +} + +die(json_encode(array( + 'status' => $status, + 'message' => $message, +))); + diff --git a/html/includes/forms/update-dashboard-config.inc.php b/html/includes/forms/update-dashboard-config.inc.php index de278fd91..35168905f 100644 --- a/html/includes/forms/update-dashboard-config.inc.php +++ b/html/includes/forms/update-dashboard-config.inc.php @@ -6,15 +6,16 @@ $message = 'Error updating user dashboard config'; $data = json_decode($_POST['data'],true); $sub_type = mres($_POST['sub_type']); $widget_id = mres($_POST['widget_id']); +$dasboard_id = mres($_POST['dashboard_id']); if ($sub_type == 'remove' && is_numeric($widget_id)) { - if ($widget_id == 0 || dbDelete('users_widgets','`user_id`=? AND `user_widget_id`=?', array($_SESSION['user_id'],$widget_id))) { + if ($widget_id == 0 || dbDelete('users_widgets','`user_id`=? AND `user_widget_id`=? AND `dashboard_id`=?', array($_SESSION['user_id'],$widget_id,$dasboard_id))) { $status = 'ok'; $message = ''; } } elseif ($sub_type == 'remove-all') { - if (dbDelete('users_widgets','`user_id`=?', array($_SESSION['user_id']))) { + if (dbDelete('users_widgets','`user_id`=? AND `dashboard_id`=?', array($_SESSION['user_id'],$dasboard_id))) { $status = 'ok'; $message = ''; } @@ -23,7 +24,7 @@ elseif ($sub_type == 'add' && is_numeric($widget_id)) { $widget = dbFetchRow('SELECT * FROM `widgets` WHERE `widget_id`=?', array($widget_id)); if (is_array($widget)) { list($x,$y) = explode(',',$widget['base_dimensions']); - $item_id = dbInsert(array('user_id'=>$_SESSION['user_id'],'widget_id'=>$widget_id, 'col'=>1,'row'=>1,'refresh'=>60,'title'=>$widget['widget_title'],'size_x'=>$x,'size_y'=>$y),'users_widgets'); + $item_id = dbInsert(array('user_id'=>$_SESSION['user_id'],'widget_id'=>$widget_id, 'col'=>1,'row'=>1,'refresh'=>60,'title'=>$widget['widget_title'],'size_x'=>$x,'size_y'=>$y,'settings'=>'','dashboard_id'=>$dasboard_id),'users_widgets'); if (is_numeric($item_id)) { $extra = array('user_widget_id'=>$item_id,'widget_id'=>$item_id,'title'=>$widget['widget_title'],'widget'=>$widget['widget'],'refresh'=>60,'size_x'=>$x,'size_y'=>$y); $status = 'ok'; @@ -38,7 +39,7 @@ else { foreach ($data as $line) { if (is_array($line)) { $update = array('col'=>$line['col'],'row'=>$line['row'],'size_x'=>$line['size_x'],'size_y'=>$line['size_y']); - dbUpdate($update, 'users_widgets', '`user_widget_id`=?', array($line['id'])); + dbUpdate($update, 'users_widgets', '`user_widget_id`=? AND `user_id`=? AND `dashboard_id`=?', array($line['id'],$_SESSION['user_id'],$dasboard_id)); } } } diff --git a/html/pages/front/tiles.php b/html/pages/front/tiles.php index 9c7c5c933..f5999d1c6 100644 --- a/html/pages/front/tiles.php +++ b/html/pages/front/tiles.php @@ -17,34 +17,94 @@ */ $no_refresh = true; - -foreach (dbFetchRows('SELECT user_widget_id,users_widgets.widget_id,title,widget,col,row,size_x,size_y,refresh FROM `users_widgets` LEFT JOIN `widgets` ON `widgets`.`widget_id`=`users_widgets`.`widget_id` WHERE `user_id`=?',array($_SESSION['user_id'])) as $items) { - $data[] = $items; +if (dbFetchCell('SELECT dashboard_id FROM dashboards WHERE user_id=?',array($_SESSION['user_id'])) == 0) { + $vars['dashboard'] = dbInsert(array('dashboard_name'=>'Default','user_id'=>$_SESSION['user_id']),'dashboards'); } - -if (!is_array($data)) { - $data[] = array('user_widget_id'=>'0','widget_id'=>1,'title'=>'Add a widget','widget'=>'placeholder','col'=>1,'row'=>1,'size_x'=>2,'size_y'=>2,'refresh'=>60); +if (empty($vars['dashboard'])) { + $vars['dashboard'] = dbFetchRow('select dashboard_id,dashboard_name from dashboards where user_id = ? order by dashboard_id limit 1',array($_SESSION['user_id'])); +} else { + $vars['dashboard'] = dbFetchRow('select dashboard_id,dashboard_name from dashboards where user_id = ? && dashboard_id = ? order by dashboard_id limit 1',array($_SESSION['user_id'],$vars['dashboard'])); +} +$data = array(); +foreach (dbFetchRows('SELECT user_widget_id,users_widgets.widget_id,title,widget,col,row,size_x,size_y,refresh FROM `users_widgets` LEFT JOIN `widgets` ON `widgets`.`widget_id`=`users_widgets`.`widget_id` WHERE `user_id`=? AND `dashboard_id`=?',array($_SESSION['user_id'],$vars['dashboard']['dashboard_id'])) as $items) { + $data[] = $items; } $data = serialize(json_encode($data)); $dash_config = unserialize(stripslashes($data)); +$dashboards = dbFetchRows("SELECT * FROM `dashboards` WHERE `user_id` = ?",array($_SESSION['user_id'])); + ?>
    - Widgets - - + Dashboards +'.$dash['dashboard_name'].''; + if ($dash[dashboard_id] == $vars['dashboard']['dashboard_id']) { + echo ''; + } +} +?> +
    -
    + +
    + +
    +
    +
    +
    +
    + + New Dashboard + + + + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    + + Dashboard Name + + + + + + +
    +
    +
    +
    +
    + '. $widgets['widget_title'] .' '; + echo ''. $widgets['widget_title'] .' '; } ?> +
    +
    @@ -75,7 +135,7 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg $.ajax({ type: 'POST', url: 'ajax_form.php', - data: {type: "update-dashboard-config", data: s}, + data: {type: "update-dashboard-config", data: s, dashboard_id: }, dataType: "json", success: function (data) { if (data.status == 'ok') { @@ -129,7 +189,7 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg $.ajax({ type: 'POST', url: 'ajax_form.php', - data: {type: "update-dashboard-config", sub_type: 'remove-all'}, + data: {type: "update-dashboard-config", sub_type: 'remove-all', dashboard_id: }, dataType: "json", success: function (data) { if (data.status == 'ok') { @@ -150,7 +210,7 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg $.ajax({ type: 'POST', url: 'ajax_form.php', - data: {type: "update-dashboard-config", sub_type: 'add', widget_id: widget_id}, + data: {type: "update-dashboard-config", sub_type: 'add', widget_id: widget_id, dashboard_id: }, dataType: "json", success: function (data) { if (data.status == 'ok') { @@ -172,7 +232,7 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg $.ajax({ type: 'POST', url: 'ajax_form.php', - data: {type: "update-dashboard-config", sub_type: 'remove', widget_id: widget_id}, + data: {type: "update-dashboard-config", sub_type: 'remove', widget_id: widget_id, dashboard_id: }, dataType: "json", success: function (data) { if (data.status == 'ok') { @@ -201,6 +261,58 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg }); + function dashboard_delete(data) { + $.ajax({ + type: 'POST', + url: 'ajax_form.php', + data: {type: 'delete-dashboard', dashboard_id: $(data).data('dashboard')}, + dataType: "json", + success: function (data) { + if( data.status == "ok" ) { + window.location.href="/overview"; + } + } + }); + } + + function dashboard_edit(data) { + datas = $(data).serializeArray(); + data = []; + for( var field in datas ) { + data[datas[field].name] = datas[field].value; + } + $.ajax({ + type: 'POST', + url: 'ajax_form.php', + data: {type: 'edit-dashboard', dashboard_name: data['dashboard_name'], dashboard_id: }, + dataType: "json", + success: function (data) { + if( data.status == "ok" ) { + window.location.href="/overview/dashboard="; + } + } + }); + } + + function dashboard_add(data) { + datas = $(data).serializeArray(); + data = []; + for( var field in datas ) { + data[datas[field].name] = datas[field].value; + } + $.ajax({ + type: 'POST', + url: 'ajax_form.php', + data: {type: 'add-dashboard', dashboard_name: data['dashboard_name']}, + dataType: "json", + success: function (data) { + if( data.status == "ok" ) { + window.location.href="/overview/dashboard="+data.dashboard_id; + } + } + }); + } + function widget_dom(data) { dom = '
  • '+ '
    '+data.title+''+ diff --git a/sql-schema/069.sql b/sql-schema/069.sql new file mode 100644 index 000000000..739c558dd --- /dev/null +++ b/sql-schema/069.sql @@ -0,0 +1,2 @@ +CREATE TABLE `dashboards` ( `dashboard_id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL DEFAULT '0', `dashboard_name` varchar(255) NOT NULL, PRIMARY KEY (`dashboard_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; +ALTER TABLE `users_widgets` ADD COLUMN `dashboard_id` int(11) NOT NULL; From 4c3b4fb5fa2333ae789f47be8caf98a59564fa95 Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Wed, 9 Sep 2015 20:19:13 +0100 Subject: [PATCH 209/263] Add transition from old dashboard to new dashboard --- html/pages/front/tiles.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/html/pages/front/tiles.php b/html/pages/front/tiles.php index f5999d1c6..23fd808b4 100644 --- a/html/pages/front/tiles.php +++ b/html/pages/front/tiles.php @@ -19,6 +19,9 @@ $no_refresh = true; if (dbFetchCell('SELECT dashboard_id FROM dashboards WHERE user_id=?',array($_SESSION['user_id'])) == 0) { $vars['dashboard'] = dbInsert(array('dashboard_name'=>'Default','user_id'=>$_SESSION['user_id']),'dashboards'); + if (dbFetchCell('select 1 from users_widgets where user_id = ? && dashboard_id = ?',array($_SESSION['user_id'],0)) == 1) { + dbUpdate(array('dashboard_id'=>$vars['dashboard']),'users_widgets','user_id = ? && dashboard_id = ?',array($_SESSION['user_id'],0)); + } } if (empty($vars['dashboard'])) { $vars['dashboard'] = dbFetchRow('select dashboard_id,dashboard_name from dashboards where user_id = ? order by dashboard_id limit 1',array($_SESSION['user_id'])); @@ -29,12 +32,12 @@ $data = array(); foreach (dbFetchRows('SELECT user_widget_id,users_widgets.widget_id,title,widget,col,row,size_x,size_y,refresh FROM `users_widgets` LEFT JOIN `widgets` ON `widgets`.`widget_id`=`users_widgets`.`widget_id` WHERE `user_id`=? AND `dashboard_id`=?',array($_SESSION['user_id'],$vars['dashboard']['dashboard_id'])) as $items) { $data[] = $items; } - -$data = serialize(json_encode($data)); +if (empty($data)) { + $data[] = array('user_widget_id'=>'0','widget_id'=>1,'title'=>'Add a widget','widget'=>'placeholder','col'=>1,'row'=>1,'size_x'=>2,'size_y'=>2,'refresh'=>60); +} +$data = serialize(json_encode($data)); $dash_config = unserialize(stripslashes($data)); - -$dashboards = dbFetchRows("SELECT * FROM `dashboards` WHERE `user_id` = ?",array($_SESSION['user_id'])); - +$dashboards = dbFetchRows("SELECT * FROM `dashboards` WHERE `user_id` = ?",array($_SESSION['user_id'])); ?>
    From 1b5b5f1bc77896147f202492e00318ac31b15d56 Mon Sep 17 00:00:00 2001 From: Sergiusz Paprzycki Date: Thu, 10 Sep 2015 15:26:19 +0100 Subject: [PATCH 210/263] Settings page for Worldmap widget --- html/includes/common/worldmap.inc.php | 137 ++++++++++++++++++-------- 1 file changed, 94 insertions(+), 43 deletions(-) diff --git a/html/includes/common/worldmap.inc.php b/html/includes/common/worldmap.inc.php index dea7224e7..493bd0ab1 100644 --- a/html/includes/common/worldmap.inc.php +++ b/html/includes/common/worldmap.inc.php @@ -23,19 +23,72 @@ */ if ($config['map']['engine'] == 'leaflet') { - -$temp_output = ' + if ((defined('show_settings') || empty($widget_settings)) && $config['front_page'] == "pages/front/tiles.php") { + $temp_output = ' +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    +
    + '; + } + else { + $temp_output = '
    '; - -} else { + } +} +else { $temp_output = 'Mapael engine not supported here'; } From ac282552f5da212d67dcbc3189b4b59ec76b8664 Mon Sep 17 00:00:00 2001 From: Sergiusz Paprzycki Date: Thu, 10 Sep 2015 16:05:22 +0100 Subject: [PATCH 211/263] Clean up of Global/World map mix-up in DB --- sql-schema/070.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql-schema/070.sql diff --git a/sql-schema/070.sql b/sql-schema/070.sql new file mode 100644 index 000000000..2503e7f74 --- /dev/null +++ b/sql-schema/070.sql @@ -0,0 +1,4 @@ +UPDATE widgets SET widget_title = 'World map' WHERE widget = 'worldmap'; +UPDATE widgets SET widget_title = 'Globe map' WHERE widget = 'globe'; +UPDATE users_widgets SET title = 'World Map' WHERE widget_id = (SELECT widget_id FROM widgets WHERE widget = 'worldmap'); +UPDATE users_widgets SET title = 'Globe Map' WHERE widget_id = (SELECT widget_id FROM widgets WHERE widget = 'globe'); From ac6e56fa5618f86bf839e4288f3d041d5fbb7445 Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Thu, 10 Sep 2015 17:14:36 +0100 Subject: [PATCH 212/263] changed settings icon --- html/pages/front/tiles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/pages/front/tiles.php b/html/pages/front/tiles.php index 23fd808b4..a4d8674ca 100644 --- a/html/pages/front/tiles.php +++ b/html/pages/front/tiles.php @@ -46,7 +46,7 @@ $dashboards = dbFetchRows("SELECT * FROM `dashboards` WHERE `user_id` = ?",arra foreach ($dashboards as $dash) { echo ' '.$dash['dashboard_name'].''; if ($dash[dashboard_id] == $vars['dashboard']['dashboard_id']) { - echo ''; + echo ''; } } ?> From 4b6e17b817afa4819e8d8837bc7d8f2ebee4d2a5 Mon Sep 17 00:00:00 2001 From: Arjit Chaudhary Date: Fri, 11 Sep 2015 01:57:03 +0530 Subject: [PATCH 213/263] Small UI fixes Screenshot 1: http://i.imgur.com/Cj1PMkp.png Screenshot 2: http://i.imgur.com/GsAqJuU.png --- html/pages/delhost.inc.php | 55 +++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/html/pages/delhost.inc.php b/html/pages/delhost.inc.php index 79a2e3f05..d72f47048 100644 --- a/html/pages/delhost.inc.php +++ b/html/pages/delhost.inc.php @@ -25,17 +25,18 @@ else { print_error("Are you sure you want to delete device " . $device['hostname'] . "?"); ?>
    - -
    -
    -
    - - - - +
    + +
    + +
    + + + +
    -
    - + + It will also remove historical data about this device such as Syslog, Eventlog and Alert log data.

    -
    -
    - -
    - + ".$data['hostname'].""); + } - ?> - -
    - -
    -
    -
    -
    + ?> + +
    +
  • +
    + +
    +
    @@ -131,7 +132,7 @@ foreach (array('Private','Shared (Read)','Shared') as $k=>$v) { ?> - +
    @@ -139,32 +140,53 @@ foreach (array('Private','Shared (Read)','Shared') as $k=>$v) {
    + + +
    + Add Widgets +
    + + +
    +
    + +
    - +
    +
    +
    +
    + +
    +
    +
    +
    - @@ -338,8 +360,12 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg dataType: "json", success: function (data) { if( data.status == "ok" ) { + $("#message").html('
    ' + data.message + '
    '); window.location.href="/overview"; } + else { + $("#message").html('
    ' + data.message + '
    '); + } } }); } @@ -357,8 +383,12 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg dataType: "json", success: function (data) { if( data.status == "ok" ) { + $("#message").html('
    ' + data.message + '
    '); window.location.href="/overview/dashboard="; } + else { + $("#message").html('
    ' + data.message + '
    '); + } } }); } @@ -376,8 +406,12 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg dataType: "json", success: function (data) { if( data.status == "ok" ) { + $("#message").html('
    ' + data.message + '
    '); window.location.href="/overview/dashboard="+data.dashboard_id; } + else { + $("#message").html('
    ' + data.message + '
    '); + } } }); } @@ -422,6 +456,9 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg if( data.status == "ok" ) { widget_reload(widget_id,widget_type); } + else { + $("#message").html('
    ' + data.message + '
    '); + } } }); } From 8859130949974b4de883e4e5f4214ef45c8300ed Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Fri, 11 Sep 2015 21:17:49 +0100 Subject: [PATCH 220/263] Fix `base_url` with tailing slash --- html/pages/front/tiles.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/html/pages/front/tiles.php b/html/pages/front/tiles.php index 6297b0a24..79c0e377e 100644 --- a/html/pages/front/tiles.php +++ b/html/pages/front/tiles.php @@ -65,7 +65,7 @@ $nodash = 0; if (sizeof($dashboards) > 0 || $vars['dashboard']['user_id'] != $_SESSION['user_id']) { foreach ($dashboards as $dash) { if ($dash['dashboard_id'] != $vars['dashboard']['dashboard_id']) { - echo '
  • '.$dash['dashboard_name'].'
  • '; + echo '
  • '.$dash['dashboard_name'].'
  • '; $nodash = 1; } } @@ -79,7 +79,7 @@ if (!empty($shared_dashboards)) { echo ' '; foreach ($shared_dashboards as $dash) { if ($dash['dashboard_id'] != $vars['dashboard']['dashboard_id']) { - echo '
  •    '.$dash['username'].':'.$dash['dashboard_name'].($dash['access'] == 1 ? ' (Read)' : '').'
  • '; + echo '
  •    '.$dash['username'].':'.$dash['dashboard_name'].($dash['access'] == 1 ? ' (Read)' : '').'
  • '; } } } @@ -361,7 +361,7 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg success: function (data) { if( data.status == "ok" ) { $("#message").html('
    ' + data.message + '
    '); - window.location.href="/overview"; + window.location.href="/overview"; } else { $("#message").html('
    ' + data.message + '
    '); @@ -384,7 +384,7 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg success: function (data) { if( data.status == "ok" ) { $("#message").html('
    ' + data.message + '
    '); - window.location.href="/overview/dashboard="; + window.location.href="/overview/dashboard="; } else { $("#message").html('
    ' + data.message + '
    '); @@ -407,7 +407,7 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg success: function (data) { if( data.status == "ok" ) { $("#message").html('
    ' + data.message + '
    '); - window.location.href="/overview/dashboard="+data.dashboard_id; + window.location.href="/overview/dashboard="+data.dashboard_id; } else { $("#message").html('
    ' + data.message + '
    '); From baa209ff055c184ed42db9f5a7f4a77e9bf70b7b Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Sat, 12 Sep 2015 09:51:58 +0100 Subject: [PATCH 221/263] Fixed width of dashboard-dropdown --- html/pages/front/tiles.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/html/pages/front/tiles.php b/html/pages/front/tiles.php index 79c0e377e..a3669f559 100644 --- a/html/pages/front/tiles.php +++ b/html/pages/front/tiles.php @@ -51,9 +51,9 @@ $dashboards = dbFetchRows("SELECT * FROM `dashboards` WHERE `user_id` = ? && `d
    - +
    - @@ -121,7 +121,7 @@ if (!empty($shared_dashboards)) {
    - Dashboard Name + Dashboard Name -
    -
    - - -
    - - +
    +
    +
    + + +
    +
    + + +
    + +
    +

    + +
    +
    +
    +
    +
    - -
    -
    - -
    -
    -'error','message'=>$auth_message,'title'=>'Login error'); -} -?> - -
    -
    '.$config['login_message'].'
    -
    - '); -} -?> - - - - - From b26aef9e8f876f299daebba6725283ccbd6d6469 Mon Sep 17 00:00:00 2001 From: RobsanInc Date: Sat, 12 Sep 2015 17:47:31 -0400 Subject: [PATCH 228/263] Added CentOS 7 installation, tweaked formatting --- doc/Extensions/RRDCached.md | 71 +++++++++++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 3 deletions(-) diff --git a/doc/Extensions/RRDCached.md b/doc/Extensions/RRDCached.md index 27a157c5d..bbd025429 100644 --- a/doc/Extensions/RRDCached.md +++ b/doc/Extensions/RRDCached.md @@ -2,8 +2,8 @@ This document will explain how to setup RRDCached for LibreNMS. -### RRDCached installation -This example is based on a fresh LibreNMS install, on a minimimal CentOS installation. +### RRDCached installation CentOS 6 +This example is based on a fresh LibreNMS install, on a minimimal CentOS 6 installation. In this example, we'll use the Repoforge repository. ```ssh @@ -33,7 +33,72 @@ chkconfig rrdcached on service rrdcached start ``` -Edit config.php to include: +- Edit /opt/librenms/config.php to include: ```ssh $config['rrdcached'] = "unix:/var/run/rrdcached/rrdcached.sock"; ``` +### RRDCached installation CentOS 7 +This example is based on a fresh LibreNMS install, on a minimimal CentOS 7.x installation. +We'll use the epel-release and setup a RRDCached as a service. +It is recommended that you monitor your LibreNMS server with LibreNMS so you can view the disk I/O usage delta. +See [Installation (RHEL CentOS)][1] for localhost monitoring. + +- Install the EPEL and update the repos and RRDtool. +```ssh +yum install epel-release +yum update +yum update rrdtool +``` + +- Create the needed directories, set ownership and permissions. +```ssh +mkdir /var/run/rrdcached +chown librenms:librenms /var/run/rrdcached +chmod 755 /var/run/rrdcached +``` + +- Create an rrdcache service for easy daemon management. +```ssh +touch /etc/systemd/system/rrdcache.service +``` +- Edit rrdcache.service and paste the example config: +```ssh +[Unit] +Description=RRDtool Cache +After=network.service + +[Service] +Type=forking +PIDFile=/run/rrdcached.pid +ExecStart=/usr/bin/rrdcached -w 1800 -z 1800 -f 3600 -s librenms -j /var/tmp -l unix:/var/run/rrdcached/rrdcached.sock -t 4 -F -b /opt/librenms/rrd/ +RRDC_USER=librenms + +[Install] +WantedBy=default.target +``` + +- Restart the systemctl daemon so it can recognize the newly created rrdcache.service. Enable the rrdcache.service on boot, and start the service. +```ssh +systemctl daemon-reload +systemctl enable rrdcache.service +systemctl start rrdcache.service +``` + +- Edit /opt/librenms/config.php to include: +```ssh +$config['rrdcached'] = "unix:/var/run/rrdcached/rrdcached.sock"; +``` + +- Restart Apache +```ssh +systemctl restart httpd +``` + +Check to see if the graphs are being drawn in LibreNMS. This might take a few minutes. +After at least one poll cycle (5 mins), check the LibreNMS disk I/O performance delta. +Disk I/O can be found under the menu Devices>All Devices>[localhost hostname]>Health>Disk I/O +Depending on many factors, you should see the Ops/sec drop by ~30-40%. + + +[1]: http://librenms.readthedocs.org/Installation/Installation-(RHEL-CentOS)/#add-localhost +"Add localhost to LibreNMS" From 4453bebef607a95cec562d4530749bfacfc40373 Mon Sep 17 00:00:00 2001 From: Juho Vanhanen Date: Sun, 13 Sep 2015 12:28:53 +0300 Subject: [PATCH 229/263] I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md. --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 610f95b21..035e8383e 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -51,6 +51,7 @@ Contributors to LibreNMS: - Todd Eddy (vrillusions) - Arjit Chaudhary (arjit.c@gmail.com) (arjitc) - Sergiusz Paprzycki (spaprzycki) +- Juho Vanhanen (juhovan) [1]: http://observium.org/ "Observium web site" From 8fd40f463fce1a13041c96d8c63265ab8f974270 Mon Sep 17 00:00:00 2001 From: Arjit Chaudhary Date: Sun, 13 Sep 2015 21:35:59 +0530 Subject: [PATCH 230/263] Various UI changes Screenshots: 1. http://i.imgur.com/smjSuvc.png 2. http://i.imgur.com/0JFyKgE.png --- html/pages/api-access.inc.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/html/pages/api-access.inc.php b/html/pages/api-access.inc.php index 3124aad6e..5bad919ee 100644 --- a/html/pages/api-access.inc.php +++ b/html/pages/api-access.inc.php @@ -79,7 +79,7 @@ foreach (dbFetchRows("SELECT user_id,username FROM `users` WHERE `level` >= '10' -
    - +
    +
    + +
    +

    -
    - \ No newline at end of file +
    +
    + +
    +
    From 27dc720892ac08525450cc6a480b41250a24ab44 Mon Sep 17 00:00:00 2001 From: Arjit Chaudhary Date: Wed, 16 Sep 2015 18:38:09 +0530 Subject: [PATCH 248/263] Match button style (ie, with + fontawesome icon) --- html/includes/print-alert-rules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/includes/print-alert-rules.php b/html/includes/print-alert-rules.php index 670a57815..27e15ad36 100644 --- a/html/includes/print-alert-rules.php +++ b/html/includes/print-alert-rules.php @@ -107,7 +107,7 @@ echo '
    echo ''; if ($_SESSION['userlevel'] >= '10') { - echo ''; + echo ''; } echo ' From 99e819d3bbd71e42ae1ceba4cdd228fc43ac5156 Mon Sep 17 00:00:00 2001 From: Arjit Chaudhary Date: Wed, 16 Sep 2015 19:03:46 +0530 Subject: [PATCH 249/263] Add fa-check to Save and move out of table --- html/pages/device/edit/apps.inc.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/html/pages/device/edit/apps.inc.php b/html/pages/device/edit/apps.inc.php index 044952ab1..0bed0731c 100644 --- a/html/pages/device/edit/apps.inc.php +++ b/html/pages/device/edit/apps.inc.php @@ -58,10 +58,11 @@ if (count($apps_enabled)) { } } -echo " +echo "
    +
    - +
    @@ -89,12 +90,13 @@ foreach ($applications as $app) { $row++; } -echo ' - - - '; echo '
    Enable Application
    - - -
    '; +echo '
    +
    + +
    +
    +'; echo '
    '; +echo '
    '; +echo '
    '; From 9fcee7a0401388707fff8dd70dc15ee897c1985e Mon Sep 17 00:00:00 2001 From: Arjit Chaudhary Date: Wed, 16 Sep 2015 19:04:29 +0530 Subject: [PATCH 250/263] Added back table-condensed --- html/pages/device/edit/apps.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/pages/device/edit/apps.inc.php b/html/pages/device/edit/apps.inc.php index 0bed0731c..9ed743de7 100644 --- a/html/pages/device/edit/apps.inc.php +++ b/html/pages/device/edit/apps.inc.php @@ -62,7 +62,7 @@ echo "
    - +
    From 4393039f6e29968705877cb66b59aef705ea609c Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Wed, 16 Sep 2015 14:05:36 +0000 Subject: [PATCH 251/263] Fix typo in URL --- doc/General/Contributing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/General/Contributing.md b/doc/General/Contributing.md index 8561f3f29..c1d49bc22 100644 --- a/doc/General/Contributing.md +++ b/doc/General/Contributing.md @@ -170,7 +170,7 @@ project. Proposed workflow for submitting pull requests ---------------------------------------------- -Please see the new [Using Git](http://doc.librenms.org/Developing/Using-Git/) document which gives you step-by-step +Please see the new [Using Git](http://docs.librenms.org/Developing/Using-Git/) document which gives you step-by-step instructions on using git to submit a pull request. [1]: http://www.gnu.org/licenses/license-list.html From fe537618b1fd8376e56e0fefc521c9f5c7379b69 Mon Sep 17 00:00:00 2001 From: Rosiak Date: Wed, 16 Sep 2015 18:17:04 +0200 Subject: [PATCH 252/263] Minor Fixes --- html/pages/api-access.inc.php | 2 +- includes/definitions.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/html/pages/api-access.inc.php b/html/pages/api-access.inc.php index 5bad919ee..a57cc935b 100644 --- a/html/pages/api-access.inc.php +++ b/html/pages/api-access.inc.php @@ -135,7 +135,7 @@ foreach (dbFetchRows('SELECT `AT`.*,`U`.`username` FROM `api_tokens` AS AT JOIN - + '; } diff --git a/includes/definitions.inc.php b/includes/definitions.inc.php index 5fcdce7b6..618f871b3 100644 --- a/includes/definitions.inc.php +++ b/includes/definitions.inc.php @@ -1278,7 +1278,7 @@ $config['os'][$os]['over'][0]['text'] = 'Traffic'; // MACOSX $os = 'macosx'; -$config['os'][$os]['text'] = 'Apple OSX'; +$config['os'][$os]['text'] = 'Apple OS X'; $config['os'][$os]['type'] = 'server'; $config['os'][$os]['icon'] = 'generic'; $config['os'][$os]['over'][0]['graph'] = 'device_bits'; From 606963cc18df69aed5fabbf4448daa418bcd67aa Mon Sep 17 00:00:00 2001 From: Tom Ferguson Date: Thu, 17 Sep 2015 06:43:55 -0400 Subject: [PATCH 253/263] Added MIBs for Avaya IP Office --- mibs/avaya/AV-SME-PLATFORM-MIB.mib | 334 +++ mibs/avaya/AV-SME-PLATFORM-PROD-MIB.mib | 288 +++ mibs/avaya/AVAYAGEN-MIB.mib | 104 + mibs/avaya/IPO-MIB.mib | 2499 +++++++++++++++++++++++ mibs/avaya/IPO-PHONES-MIB.mib | 691 +++++++ mibs/avaya/IPO-PROD-MIB.mib | 1202 +++++++++++ 6 files changed, 5118 insertions(+) create mode 100644 mibs/avaya/AV-SME-PLATFORM-MIB.mib create mode 100644 mibs/avaya/AV-SME-PLATFORM-PROD-MIB.mib create mode 100644 mibs/avaya/AVAYAGEN-MIB.mib create mode 100644 mibs/avaya/IPO-MIB.mib create mode 100644 mibs/avaya/IPO-PHONES-MIB.mib create mode 100644 mibs/avaya/IPO-PROD-MIB.mib diff --git a/mibs/avaya/AV-SME-PLATFORM-MIB.mib b/mibs/avaya/AV-SME-PLATFORM-MIB.mib new file mode 100644 index 000000000..16bb78e3e --- /dev/null +++ b/mibs/avaya/AV-SME-PLATFORM-MIB.mib @@ -0,0 +1,334 @@ +--======================================================== +-- +-- MIB : SME Platform Avaya Inc. +-- +-- Version : 0.03.00 11 January 2013 +-- +--======================================================== +-- +-- Copyright (c) 2013 Avaya Inc. +-- All Rights Reserved. +-- +--======================================================== +AV-SME-PLATFORM-MIB DEFINITIONS ::= BEGIN + +IMPORTS + MODULE-IDENTITY, OBJECT-TYPE, + NOTIFICATION-TYPE + FROM SNMPv2-SMI + DateAndTime + FROM SNMPv2-TC + MODULE-COMPLIANCE, OBJECT-GROUP, + NOTIFICATION-GROUP + FROM SNMPv2-CONF + SnmpAdminString + FROM SNMP-FRAMEWORK-MIB + sysDescr + FROM SNMPv2-MIB + ItuPerceivedSeverity + FROM ITU-ALARM-TC-MIB + ifIndex + FROM IF-MIB + mibs + FROM AVAYAGEN-MIB +; + +avSMEPlatformMIB MODULE-IDENTITY + LAST-UPDATED "201301111405Z" -- 11 January 2013 + ORGANIZATION "Avaya Inc." + CONTACT-INFO + "Avaya Customer Services + Postal: Avaya, Inc. + 211 Mt Airy Rd. + Basking Ridge, NJ 07920 + USA + Tel: +1 908 953 6000 + + WWW: http://www.avaya.com" + DESCRIPTION + "Avaya IP Office MIBs OID tree. + + This MIB module defines the root items for MIBs for + use with Avaya SME Embedded Platform." + + + REVISION "201301111405Z" -- 11 January 2013 + DESCRIPTION + "Rev 0.03.00 + Added the WebManagement application value for smepGTEventAppIdentity." + REVISION "201007061347Z" -- 06 July 2010 + DESCRIPTION + "Rev 0.02.00 + Corrected base OID to one properly allocated in Avaya tree." + REVISION "201007021437Z" -- 02 July 2010 + DESCRIPTION + "Rev 0.01.00 + The first rough draft of this MIB module." + ::= { mibs 48 } + +-- sub-tree for SME Embedded Platform wide objects and events +-- irrespective of function +smepGeneric OBJECT IDENTIFIER ::= { avSMEPlatformMIB 1 } + +-- sub-tree for SME Embedded Platform functional MIBs +smepGenMibs OBJECT IDENTIFIER ::= { smepGeneric 1 } + +-- sub-tree for SME EMbedded Platform wide traps/notifications +smepGenTraps OBJECT IDENTIFIER ::= { smepGeneric 2 } + +-- sub-tree for SME Embedded Platform wide conformance information +smepGenConformance OBJECT IDENTIFIER ::= { smepGeneric 3 } + +--******************************************************************** +-- SME Embedded Platform wide traps/notifications +--******************************************************************** + +smepGTEvents OBJECT IDENTIFIER ::= { smepGenTraps 0 } +smepGTObjects OBJECT IDENTIFIER ::= { smepGenTraps 1 } + +-- +-- trap objects +-- + +smepGTEventStdSeverity OBJECT-TYPE + SYNTAX ItuPerceivedSeverity + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "Severity of the event that has occurred. + + The event severity depends upon the type of + entity/notification that the operational state change event + relates to. The severity values that are normally used are + detailed below: + + The enterprise versions of standard SNMP traps all have a + severity of major (4). + + GenAppEvents: + Severity depends on event condition + crash - severity is critical (3)" + ::= { smepGTObjects 1 } + +smepGTEventDateTime OBJECT-TYPE + SYNTAX DateAndTime + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "Date and time of the occurence of the event." + ::= { smepGTObjects 2 } + +smepGTEventDevID OBJECT-TYPE + SYNTAX SnmpAdminString (SIZE (10)) + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "A unique textual identifier of the alarming device." + ::= { smepGTObjects 3 } + +smepGTEventAppEntity OBJECT-TYPE + SYNTAX INTEGER { + voiceMailPro(1), + onex(2), + ipOffice(3), + jade(4), + webmanagement(5) + } + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "The SME Embedded Platform application to which a + notification/trap relates." + ::= { smepGTObjects 4 } + +smepGTEventAppEvent OBJECT-TYPE + SYNTAX INTEGER { + crash(1) -- severity: Critical + } + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "SME Embedded Platform application event states. The + associated event severity of the notification/trap the object + is carried in varies depending upon the event condition. The + appropriate severity is detailed against event enumeration." + ::= { smepGTObjects 5 } + +-- +-- traps +-- + +smepGenColdStartEvent NOTIFICATION-TYPE + OBJECTS { + smepGTEventStdSeverity, + smepGTEventDateTime, + smepGTEventDevID, + sysDescr + } + STATUS current + DESCRIPTION + "Enterprise version of standard coldstart trap featuring + device identification information. A coldStart trap + signifies that the sending protocol entity is reinitializing + itself such that the agent's configuration or the protocol + entity implementation may be altered." + ::= { smepGTEvents 1 } + +smepGenWarmStartEvent NOTIFICATION-TYPE + OBJECTS { + smepGTEventStdSeverity, + smepGTEventDateTime, + smepGTEventDevID, + sysDescr + } + STATUS current + DESCRIPTION + "Enterprise version of standard warmstart trap featuring + device identification information. A warmStart trap + signifies that the sending protocol entity is reinitializing + that neither the agent configuration nor the protocol entity + implementation is altered." + ::= { smepGTEvents 2 } + +smepGenLinkDownEvent NOTIFICATION-TYPE + OBJECTS { + smepGTEventStdSeverity, + smepGTEventDateTime, + smepGTEventDevID, + sysDescr, + ifIndex + } + STATUS current + DESCRIPTION + "Enterprise version of standard linkDown trap featuring device + identification information. A linkDown trap signifies that + the sending protocol entity recognizes a failure in one of + the communication links represented in the agent's + configuration." + ::= { smepGTEvents 3 } + +smepGenLinkUpEvent NOTIFICATION-TYPE + OBJECTS { + smepGTEventStdSeverity, + smepGTEventDateTime, + smepGTEventDevID, + sysDescr, + ifIndex + } + STATUS current + DESCRIPTION + "Enterprise version of standard linkUp trap featuring device + identification information. A linkUp trap signifies that the + sending protocol entity recognizes that one of the + communication links represented in the agent's configuration + has come up." + ::= { smepGTEvents 4 } + +smepGenAuthFailureEvent NOTIFICATION-TYPE + OBJECTS { + smepGTEventStdSeverity, + smepGTEventDateTime, + smepGTEventDevID, + sysDescr + } + STATUS current + DESCRIPTION + "Enterprise version of standard authenticationFailure trap + featuring device identification information. An + authenticationFailure trap signifies that the sending + protocol entity is the addressee of a protocol message that + is not properly authenticated. While implementations of the + SNMP must be capable of generating this trap, they must also + be capable of suppressing the emission of such traps via an + implementation- specific mechanism." + ::= { smepGTEvents 5 } + +smepGenAppEvent NOTIFICATION-TYPE + OBJECTS { + smepGTEventStdSeverity, + smepGTEventDateTime, + smepGTEventDevID, + sysDescr, + smepGTEventAppEntity, + smepGTEventAppEvent + } + STATUS current + DESCRIPTION + "A smepGenAppEvent notification is generated whenever a + application entity of the SME Embedded Platform experiences an + event. It signifies that the SNMP entity, acting as a proxy + for the application, has detected an event on the application + entity. + + The event severity varies dependent upon the event condition." + ::= { smepGTEvents 6 } + + +--******************************************************************** +-- SME Embedded Platform wide compliance +--******************************************************************** + +smepGenCompliances OBJECT IDENTIFIER ::= { smepGenConformance 1 } +smepGenGroups OBJECT IDENTIFIER ::= { smepGenConformance 2 } + +-- +-- compliance statements +-- + +smepGenCompliance MODULE-COMPLIANCE + STATUS deprecated + DESCRIPTION + "The compliance statement for SME Embedded Platform agents + which implement this MIB." + MODULE -- this module + MANDATORY-GROUPS { + smepGenNotificationObjectsGroup, + smepGenEntGenNotificationsGroup, + smepGenAppNotificationsGroup + } + ::= { smepGenCompliances 1 } + +-- +-- MIB groupings +-- + +smepGenNotificationObjectsGroup OBJECT-GROUP + OBJECTS { + smepGTEventStdSeverity, + smepGTEventDevID, + smepGTEventDateTime, + smepGTEventAppEntity, + smepGTEventAppEvent + } + STATUS current + DESCRIPTION + "Objects that are contained in SME Embedded Platform wide + notifications." + ::= { smepGenGroups 1 } + +smepGenEntGenNotificationsGroup NOTIFICATION-GROUP + NOTIFICATIONS { + smepGenColdStartEvent, + smepGenWarmStartEvent, + smepGenLinkDownEvent, + smepGenLinkUpEvent, + smepGenAuthFailureEvent + } + STATUS current + DESCRIPTION + "SME Embedded Platform Enterpise versions of the generic traps + as defined RFC1215 that provide more identification of the entity + concerned." + ::= { smepGenGroups 2 } + +smepGenAppNotificationsGroup NOTIFICATION-GROUP + NOTIFICATIONS { + smepGenAppEvent + } + STATUS current + DESCRIPTION + "The service notifications which indicate specific changes in + the state of Applications on the SME Embedded Platform." + ::= { smepGenGroups 3 } + +END diff --git a/mibs/avaya/AV-SME-PLATFORM-PROD-MIB.mib b/mibs/avaya/AV-SME-PLATFORM-PROD-MIB.mib new file mode 100644 index 000000000..08c053723 --- /dev/null +++ b/mibs/avaya/AV-SME-PLATFORM-PROD-MIB.mib @@ -0,0 +1,288 @@ +--======================================================== +-- +-- MIB : AV-SME-PLATFORM-PROD Avaya Inc. +-- +-- Version : 0.14.00 30 May 2014 +-- +--======================================================== +-- +-- Copyright (c) 2010 - 2012 Avaya Inc. +-- All Rights Reserved. +-- +--======================================================== +AV-SME-PLATFORM-PROD-MIB DEFINITIONS ::= BEGIN + +IMPORTS + MODULE-IDENTITY, OBJECT-IDENTITY + FROM SNMPv2-SMI + products + FROM AVAYAGEN-MIB; + +avSMEPlatformProdMIB MODULE-IDENTITY + LAST-UPDATED "201405301200Z" -- 30 May 2014 + ORGANIZATION "Avaya Inc." + CONTACT-INFO + "Avaya Customer Services + Postal: Avaya, Inc. + 211 Mt Airy Rd. + Basking Ridge, NJ 07920 + USA + Tel: +1 908 953 6000 + + WWW: http://www.avaya.com" + DESCRIPTION + "Avaya IP Office Products OID tree. + + This MIB module defines the product/sysObjectID values for + use with Avaya IP Office family of telephone switches." + + REVISION "201405301200Z" -- 30 May 2014 + DESCRIPTION + "Rev 0.14.00 + Added configuration 11, 12, 13 for IP Office Server Edition Primary, + IP Office Server Edition Secondary and + IP Office Server Edition Expansion System (L) Select Mode" + REVISION "201404031200Z" -- 03 April 2014 + DESCRIPTION + "Rev 0.13.00 + Updated service vendor values + Added Contact Recorder service" + REVISION "201301231600Z" -- 23 January 2013 + DESCRIPTION + "Rev 0.12.00 + Updated branding for configuration 1 and 10" + REVISION "201211291200Z" -- 29 November 2012 + DESCRIPTION + "Rev 0.11.00 + Updated branding for configuration 1. + Added configuration 10." + REVISION "201205101235Z" -- 10 May 2012 + DESCRIPTION + "Rev 0.10.00 + Updated branding for configurations 7, 8 and 9." + REVISION "201204091025Z" -- 09 Apr 2012 + DESCRIPTION + "Rev 0.09.00 + Updated branding for configurations 7, 8 and 9." + REVISION "201203051005Z" -- 05 Mar 2012 + DESCRIPTION + "Rev 0.08.00 + Updated configurations 7, 8 and 9." + REVISION "201112161330Z" -- 16 Dec 2011 + DESCRIPTION + "Rev 0.07.01 + Updated configuration 6." + REVISION "201112141535Z" -- 14 Dec 2011 + DESCRIPTION + "Rev 0.07.00 + Added configuration 9, updated configurations 7 and 8." + REVISION "201112071410Z" -- 07 Dec 2011 + DESCRIPTION + "Rev 0.06.00 + Added configurations 7 and 8." + REVISION "201105031330Z" -- 03 May 2011 + DESCRIPTION + "Rev 0.05.00 + Added configuration 6." + REVISION "201103300922Z" -- 30 March 2011 + DESCRIPTION + "Rev 0.04.00 + Added configuration 4 and 5." + REVISION "201007071350Z" -- 07 July 2010 + DESCRIPTION + "Rev 0.03.00 + Simplified the structure." + REVISION "201007061345Z" -- 06 July 2010 + DESCRIPTION + "Rev 0.02.00 + Corrected base OID to one properly allocated in Avaya tree." + REVISION "201007021506Z" -- 02 July 2010 + DESCRIPTION + "Rev 0.01.00 + The first rough draft of this MIB module." + ::= { products 48 } + +-- Product Groups + +smepProdVariants OBJECT IDENTIFIER ::= { avSMEPlatformProdMIB 1 } +smepProdServices OBJECT IDENTIFIER ::= { avSMEPlatformProdMIB 2 } +smepProdPorts OBJECT IDENTIFIER ::= { avSMEPlatformProdMIB 3 } +smepProdDongleModules OBJECT IDENTIFIER ::= { avSMEPlatformProdMIB 4 } + +-- Configuration 1 + +smepCfg1 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Configuration 1 + of the SME Embedded Platform. + Configuration 1 = IP Office Application Server on Linux PC" + ::= { smepProdVariants 1 } + +-- Configuration 2 + +smepCfg2 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Configuration 2 + of the SME Embedded Platform. + Configuration 2 = IP Office on PC." + ::= { smepProdVariants 2 } + +-- Configuration 3 + +smepCfg3 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Configuration 3 + of the SME Embedded Platform. + Configuration 3 = IP Office on HP ProCurve" + ::= { smepProdVariants 3 } + +-- Configuration 4 + +smepCfg4 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Configuration 4 + of the SME Embedded Platform. + Configuration 4 = IP Office on Dell" + ::= { smepProdVariants 4 } + +-- Configuration 5 + +smepCfg5 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Configuration 5 + of the SME Embedded Platform. + Configuration 5 = Branch installations" + ::= { smepProdVariants 5 } + +-- Configuration 6 + +smepCfg6 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Configuration 6 + of the SME Embedded Platform. + Configuration 6 = Standalone Voice Mail" + ::= { smepProdVariants 6 } + +-- Configuration 7 + +smepCfg7 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Configuration 7 + of the SME Embedded Platform. + Configuration 7 = IP Office Server Edition Primary" + ::= { smepProdVariants 7 } + +-- Configuration 8 + +smepCfg8 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Configuration 8 + of the SME Embedded Platform. + Configuration 8 = IP Office Server Edition Secondary" + ::= { smepProdVariants 8 } + +-- Configuration 9 + +smepCfg9 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Configuration 9 + of the SME Embedded Platform. + Configuration 9 = IP Office Server Edition Expansion System (L)" + ::= { smepProdVariants 9 } + +-- Configuration 10 + +smepCfg10 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Configuration 10 + of the SME Embedded Platform. + Configuration 10 = IP Office Application Server on UCM" + ::= { smepProdVariants 10 } + +-- Configuration 11 + +smepCfg11 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Configuration 11 + of the SME Embedded Platform. + Configuration 11 = IP Office Server Edition Primary Select Mode" + ::= { smepProdVariants 11 } + +-- Configuration 12 + +smepCfg12 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Configuration 12 + of the SME Embedded Platform. + Configuration 12 = IP Office Server Edition Secondary Select Mode" + ::= { smepProdVariants 12 } + +-- Configuration 13 + +smepCfg13 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Configuration 13 + of the SME Embedded Platform. + Configuration 13 = IP Office Server Edition Expansion System (L) Select Mode" + ::= { smepProdVariants 13 } + +-- Application Services Groups + +smepProdServiceOneXPortal OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya one-X Portal service + resident on Avaya IP Office on Linux server." + ::= { smepProdServices 1 } + +smepProdServiceVoicemailPro OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya Voicemail Pro service + resident on Avaya IP Office on Linux server." + ::= { smepProdServices 2 } + +smepProdServiceContactRecorder OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya Contact Recorder service + resident on Avaya IP Office on Linux server." + ::= { smepProdServices 3 } + + +-- Ports + +smepProdPortLAN OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office LAN + (10BASE-T/100BASE-TX) Ports" + ::= { smepProdPorts 1 } + + +-- Dongle + +smepProdGenericDongle OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office License + Dongle - A single representation for three dongle types, + Parallel, Serial and USB. The Parallel and USB ones not truly + connected directly to the IP Office but the managing PC." + ::= { smepProdDongleModules 1 } + + +END diff --git a/mibs/avaya/AVAYAGEN-MIB.mib b/mibs/avaya/AVAYAGEN-MIB.mib new file mode 100644 index 000000000..7e013629b --- /dev/null +++ b/mibs/avaya/AVAYAGEN-MIB.mib @@ -0,0 +1,104 @@ +--======================================================== +-- +-- MIB : AvayaGen Avaya Inc. +-- +-- Version : 1.4.0 27 January 2004 +-- ======================================================== +--- This AVAYA SNMP Management Information Base Specification (Specification) +-- embodies AVAYA confidential and Proprietary intellectual property. +-- AVAYA retains all Title and ownership in the Specification, including any +-- revisions. +-- +-- It is AVAYA's intent to encourage the widespread use of this Specification +-- in connection with the management of AVAYA products. AVAYA grants vendors, +-- end-users, and other interested parties a non-exclusive license to use this +-- Specification in connection with the management of AVAYA products. +-- +-- This Specification is supplied "as is," and AVAYA makes no warranty, either +-- express or implied, as to the use, operation, condition, or performance of +-- the Specification. +--======================================================== +AVAYAGEN-MIB DEFINITIONS ::= BEGIN + IMPORTS + enterprises,MODULE-IDENTITY + FROM SNMPv2-SMI; +avaya MODULE-IDENTITY +LAST-UPDATED "0401270900Z" -- 27 January 2004 +ORGANIZATION "Avaya Inc." +CONTACT-INFO + "Avaya Customer Services + Postal: Avaya, Inc. + 211 Mt Airy Rd. + Basking Ridge, NJ 07920 + USA + Tel: +1 908 953 6000 + WWW: http://www.avaya.com + " +DESCRIPTION + "Avaya top-level OID tree. + This MIB module deals defines the Avaya enterprise-specific tree. + Development organizations within Avaya who wish to register MIBs + under the Avaya enterprise OID, should: + a. Contact the maintainer of this module, and get an organization OID and + group OID. + b. Import the definition of their Organization OID from this MIB. + " +REVISION "0401270900Z" -- 27 January 2004 +DESCRIPTION + "Rev 1.4.0 - Meir Deutsch. + adds avGatewayProducts under avayaProducts. + adds avGatewayMibs under avayaMibs. + " +REVISION "0208150900Z" -- 15 August 2002 +DESCRIPTION + "Rev 1.3.0 - Itai Zilbershterin. + adds avayaSystemStats under lsg. + " +REVISION "0207280900Z" -- 28 July 2002 +DESCRIPTION + "Rev 1.2.0 - Itai Zilbershterin. + adds avayaEISTopology under lsg. + " +REVISION "0108091700Z" -- 09 August 2001 +DESCRIPTION + "Rev 1.1.0 - Itai Zilbershterin. + adds products OID to those defined. + " +REVISION "0106211155Z" -- 21 June 2001 +DESCRIPTION + "Rev 1.0.0 - Itai Zilbershterin. + Fixed the mibs placement error. Avaya Mibs + reside under avaya.2 and not avaya.1. + The MIB branch is called avayaMibs." + +REVISION "0010151045Z" -- 15 Oct. 2000 +DESCRIPTION + "Rev 0.9.0 - Itai Zilbershterin. + The initial version of this MIB module. + + The following Organizational top-level groups are defined: + lsg - Mibs of the LAN System Group (Concord & Israel)." +REVISION "0010151305Z" -- 15 Oct. 2000 +DESCRIPTION + "Rev 0.9.1 - Itai Zilbershterin. + Dates in Revisions changed from 'yyyymmddhhmm' to 'yymmddhhmm', to support + older development environments." +::= { enterprises 6889 } +-- **************************** +-- **************************** +-- Product OIDs +products OBJECT IDENTIFIER ::= { avaya 1 } +-- MIBs +mibs OBJECT IDENTIFIER ::= { avaya 2 } +-- Gateway +avGatewayProducts OBJECT IDENTIFIER ::= { products 6 } +avGatewayMibs OBJECT IDENTIFIER ::= { mibs 6 } +-- ********************************** +-- LAN System Group's +-- ********************************** +lsg OBJECT IDENTIFIER ::= { mibs 1 } +-- Sub branches which are NOT MIB modules (MIB modules directly under lsg +-- will define their OID in relation to lsg) +avayaEISTopology OBJECT IDENTIFIER ::= {lsg 10 } +avayaSystemStats OBJECT IDENTIFIER ::= {lsg 11 } +END diff --git a/mibs/avaya/IPO-MIB.mib b/mibs/avaya/IPO-MIB.mib new file mode 100644 index 000000000..c81143844 --- /dev/null +++ b/mibs/avaya/IPO-MIB.mib @@ -0,0 +1,2499 @@ +--======================================================== +-- +-- MIB : IPO Avaya Inc. +-- +-- Version : 2.00.25 04 July 2014 +-- +--======================================================== +-- +-- Copyright (c) 2003 - 2014 Avaya Inc. +-- All Rights Reserved. +-- +--======================================================== +IPO-MIB DEFINITIONS ::= BEGIN + +IMPORTS + MODULE-IDENTITY, OBJECT-TYPE, + NOTIFICATION-TYPE, Unsigned32, Integer32, + IpAddress + FROM SNMPv2-SMI + DateAndTime + FROM SNMPv2-TC + MODULE-COMPLIANCE, OBJECT-GROUP, + NOTIFICATION-GROUP + FROM SNMPv2-CONF + SnmpAdminString + FROM SNMP-FRAMEWORK-MIB + sysDescr + FROM SNMPv2-MIB + ItuPerceivedSeverity + FROM ITU-ALARM-TC-MIB + ifIndex + FROM IF-MIB + mibs + FROM AVAYAGEN-MIB +; + +ipoMIB MODULE-IDENTITY + LAST-UPDATED "201407040000Z" -- 04 July 2014 + ORGANIZATION "Avaya Inc." + CONTACT-INFO + "Avaya Customer Services + Postal: Avaya, Inc. + 211 Mt Airy Rd. + Basking Ridge, NJ 07920 + USA + Tel: +1 908 953 6000 + + WWW: http://www.avaya.com" + DESCRIPTION + "Avaya IP Office MIBs OID tree. + + This MIB module defines the root items for MIBs for + use with Avaya IP Office family of telephone switches." + REVISION "201407040000Z" -- 04 July 2014 + DESCRIPTION + "Rev 2.00.25 + Added new value serviceAMServerNotAvailable" + REVISION "201406250000Z" -- 25 June 2014 + DESCRIPTION + "Rev 2.00.24 + Added new value serviceCCRNotSupported" + REVISION "201406250000Z" -- 25 June 2014 + DESCRIPTION + "Rev 2.00.23 + Added new value serviceNonSelectAlarm" + REVISION "201406160000Z" -- 16 June 2014 + DESCRIPTION + "Rev 2.00.22 + Added new values serviceGeneralAlarm and serviceSystemInfo" + REVISION "201406040000Z" -- 04 June 2014 + DESCRIPTION + "Rev 2.00.21 + Added new value serviceIPDECTSystemError " + REVISION "201405230000Z" -- 23 May 2014 + DESCRIPTION + "Rev 2.00.20 + Added new value monitorLogStamped " + REVISION "201405080000Z" -- 08 May 2014 + DESCRIPTION + "Rev 2.00.19 + Added new values trunkSIPDNSInvalidConfig and trunkSIPDNSTransportError " + REVISION "201401060000Z" -- 06 January 2014 + DESCRIPTION + "Rev 2.00.18 + Added oneXPortal values for ipoGTEventAppEntity" + REVISION "201310080000Z" -- 08 October 2013 + DESCRIPTION + "Rev 2.00.17 + Added new values serviceSystemHardDriveAlarm and serviceAdditionalHardDriveAlarm " + REVISION "201308060000Z" -- 06 August 2013 + DESCRIPTION + "Rev 2.00.16 + Added new values of serviceACCSAlarm for + ipoGTEventReason object" + REVISION "201304241900Z" -- 24 April 2013 + DESCRIPTION + "Rev 2.00.15 + Added new values for ipoGTEventReason object + serviceCpuAlarm, serviceCpuIOAlarm, serviceMemoryAlarm" + REVISION "201304241518Z" -- 24 April 2013 + DESCRIPTION + "Rev 2.00.14 + Added new value of serviceLocalBackup for + ipoGTEventReason object" + REVISION "201211171511Z" -- 17 November 2012 + DESCRIPTION + "Rev 2.00.13 + Added new notification: ipoGenEmergencyCallSvcEvent + Added new value of serviceEmergencyCall to the ipoGTEventReason object." + REVISION "201202281300Z" -- 28 February 2012 + DESCRIPTION + "Rev 2.00.12 + Added new values for ipoGTEventReason object from + servicePortRangeExhausted to serviceWebservicesUWSError." + REVISION "201111012200Z" -- 1 November 2011 + DESCRIPTION + "Rev 2.00.11 + Added new values for ipoGTEventReason object from + servicePlannedMaintenance to serviceSslVpnServerReportedError." + REVISION "201109271130Z" -- 27 September 2011 + DESCRIPTION + "Rev 2.00.10 + Added new value of testAlarm for ipoGTEventReason object." + REVISION "201103151517Z" -- 15 March 2011 + DESCRIPTION + "Rev 2.00.09 + Added new value of securityError for + ipoGTEventReason object" + REVISION "201010131417Z" -- 13 October 2010 + DESCRIPTION + "Rev 2.00.08 + Added new value of serviceLicenseFileInvalid for + ipoGTEventReason object" + REVISION "201007121345Z" -- 12 July 2010 + DESCRIPTION + "Rev 2.00.07 + Introduced new notifications, see ipoGenSvcMiscNotificationsGroup + and new objects, see ipoGenSvcMiscNotificationObjectsGroup" + REVISION "200910190735Z" -- 19 October 2009 + DESCRIPTION + "Rev 2.00.06 + System Running Backup, Invalid Memory Card, No Licence Key Dongle + Notifications added. Corrections to MIB syntax for System + Shutdown Notification." + REVISION "200910091347Z" -- 09 October 2009 + DESCRIPTION + "Rev 2.00.05 + System shutdown Notification added." + REVISION "200909110950Z" -- 11 September 2009 + DESCRIPTION + "Rev 2.00.04 + QOS Monitoring Notification added." + REVISION "200909071620Z" -- 07 September 2009 + DESCRIPTION + "Rev 2.00.03 + smallBusinessContactCenter(3) value for + ipoGTEventAppEntity changed to customerCallReporter." + REVISION "200804281640Z" -- 28 April 2008 + DESCRIPTION + "Rev 2.00.02 + Added smallBusinessContactCenter(3) value to + ipoGTEventAppEntity." + REVISION "200804181450Z" -- 18 April 2008 + DESCRIPTION + "Rev 2.00.01 + Added traps related to Universal PRI licensing." + REVISION "200606290000Z" -- 29 June 2006 + DESCRIPTION + "Rev 2.00.00 + Traps/notifications revised to provide more information about + the entity and device concerned." + REVISION "200410060000Z" -- 06 October 2004 + DESCRIPTION + "Rev 1.00.08 + Corrected description of event severities for physical + entities." + REVISION "200408270000Z" -- 27 August 2004 + DESCRIPTION + "Rev 1.00.07 + Corrected mandatory groups after addition of SOG event + related objects and notifications." + REVISION "200408060000Z" -- 06 August 2004 + DESCRIPTION + "Rev 1.00.06 + Added SOG event related object and notifications." + REVISION "200407100000Z" -- 10 July 2004 + DESCRIPTION + "Rev 1.00.05 + Added application event related object and notifications. + Corrected description of ipoGenLKSCommsOperationalEvent." + REVISION "200405280000Z" -- 28 May 2004 + DESCRIPTION + "Rev 1.00.04 + Revised usage description for ipoGTEventSeverity." + REVISION "200403030000Z" -- 03 March 2004 + DESCRIPTION + "Rev 1.00.03 + Revised for external publication." + REVISION "200312150000Z" -- 15 December 2003 + DESCRIPTION + "Rev 1.00.02 + Added loopback object and notification." + REVISION "200311110000Z" -- 11 November 2003 + DESCRIPTION + "Rev 1.00.01 + Corrected ipoGTEventEntity MAX-ACCESS." + REVISION "200310100000Z" -- 10 October 2003 + DESCRIPTION + "Rev 1.00.00 + The first published version of this MIB module." + ::= { mibs 2 } + +-- sub-tree for IP Office wide objects and events irrespective of function +ipoGeneric OBJECT IDENTIFIER ::= { ipoMIB 1 } + +-- sub-tree for IP Office functional MIBs +ipoGenMibs OBJECT IDENTIFIER ::= { ipoGeneric 1 } + +-- sub-tree for IP Office wide traps/notifications +ipoGenTraps OBJECT IDENTIFIER ::= { ipoGeneric 2 } + +-- sub-tree for IP Office wide conformance information +ipoGenConformance OBJECT IDENTIFIER ::= { ipoGeneric 3 } + +--******************************************************************** +-- IP Office wide traps/notifications +--******************************************************************** + +ipoGTEvents OBJECT IDENTIFIER ::= { ipoGenTraps 0 } +ipoGTObjects OBJECT IDENTIFIER ::= { ipoGenTraps 1 } + +-- +-- trap objects +-- + +ipoGTEventSeverity OBJECT-TYPE + SYNTAX INTEGER { + critical(1), + major(2), + minor(3) + } + MAX-ACCESS accessible-for-notify + STATUS deprecated + DESCRIPTION + "Severity of the event that has occurred. + + The event severity depends upon the type of + entity/notification that the operational state change event + relates to: + + GenEntityEvents: + + Type of physical Severity + entity + container critical + module major + port major + + Known transient errors for entities have a severity of minor. + + LKSCommsEvents: + Severity is major + + GenLoopbackEvent: + Severity is major + + GenAppEvents: + Severity depends on sub-event + Failure/Operational - severity is major + Event - severity depends on event condition + + ipoGenSogEvents: + Severity depends on sub-event + HostFailure - severity is Major + ModeChange: + - Mode survivable: severity is Major + - Mode subTending: severity is Minor + + PhoneChangeEvents: + Severity is minor + + **NOTE: This object is deprecated and replaced by + ipoGTEventStdSeverity." + ::= { ipoGTObjects 1 } + +ipoGTEventDateTime OBJECT-TYPE + SYNTAX DateAndTime + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "Date and time of the occurence of the event." + ::= { ipoGTObjects 2 } + +ipoGTEventEntity OBJECT-TYPE + SYNTAX Unsigned32 + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "A reference, by entPhysicalIndex value, to the + EntPhysicalEntry representing the physical entity that an + event is associated with in an entity MIB instantiation within + the IP Office agent." + ::= { ipoGTObjects 3 } + +ipoGTEventLoopbackStatus OBJECT-TYPE + SYNTAX Integer32 (1..127) + MAX-ACCESS accessible-for-notify + STATUS deprecated + DESCRIPTION + "This variable represents the current state of the + loopback on the DS1 interface. It contains + information about loopbacks established by a + manager and remotely from the far end. + + The ipoGTEventLoopbackStatus is a bit map represented as + a sum, therefore is can represent multiple + loopbacks simultaneously. + + The various bit positions are: + 1 noLoopback + 2 nearEndPayloadLoopback + 4 nearEndLineLoopback + 8 nearEndOtherLoopback + 16 nearEndInwardLoopback + 32 farEndPayloadLoopback + 64 farEndLineLoopback" + ::= { ipoGTObjects 4 } + +ipoGTEventAppEntity OBJECT-TYPE + SYNTAX INTEGER { + voiceMail(1), + deltaServer(2), + customerCallReporter(3), + oneXPortal(4) + } + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "The IP Office application to which a notification/trap + relates." + ::= { ipoGTObjects 5 } + +ipoGTEventAppEvent OBJECT-TYPE + SYNTAX INTEGER { + storageFull(1), -- severity: Critical + storageNearlyFull(2), -- severity: Major + storageOkay(3), -- severity: Minor + backupCommunicationError(4), -- severity: Major + backupFileError(5), -- severity: Major + httpFailure(6), -- severity: Major + httpSslAcceptFailure(7), -- severity: Major + httpSslConnection(8), -- severity: Major + httpSslFailure(9), -- severity: Major + httpSslPortFailure(10), -- severity: Major + ignoringRequest(11), -- severity: Major + imapInitializationFailed(12), -- severity: Major + imapInvalidMsgNr(13), -- severity: Major + imapMailboxNotExist(14), -- severity: Major + imapMessageInvalid(15), -- severity: Major + imapMessageNotExist(16), -- severity: Major + imapMessageNrNotExist(17), -- severity: Major + imapMissingConnection(18), -- severity: Major + imapMissingSettings(19), -- severity: Major + imapNoLicence(20), -- severity: Major + imapNotConfigured(21), -- severity: Major + imapShiftConnection(22), -- severity: Major + mapiInitializationFailed(23), -- severity: Major + mapiMissingSettings(24), -- severity: Major + mapiConnectionFailed(25), -- severity: Major + mapiShiftConnection(26), -- severity: Major + licence(27), -- severity: Major + licenceDistributed(28), -- severity: Major + licenceExpired(29), -- severity: Major + licenceSOG(30), -- severity: Major + loginFailure(31), -- severity: Major + loginFailureInvalidMailbox(32), -- severity: Major + mailboxNotFound(33), -- severity: Major + makeLiveFileAccess(34), -- severity: Major + makeLiveMissingFile(35), -- severity: Major + offlineMakeLive(36), -- severity: Major + onexError(37), -- severity: Major + pbxConnectionLost(38), -- severity: Major + pbxIncompatibility(39), -- severity: Major + smgrSettingsError(40), -- severity: Major + smtpConnectionFailed(41), -- severity: Major + smtpConnectionTimeout(42), -- severity: Major + smtpError(43), -- severity: Major + smtpSecureConnectionFailed(44), -- severity: Major + smtpUnexpectedData(45), -- severity: Major + smtpUnsuportedData(46), -- severity: Major + socketAbortingError(47), -- severity: Major + socketBindError(48), -- severity: Major +socketClientDisconnectedError(49), -- severity: Major + socketConnectionError(50), -- severity: Major + socketNoresponseError(51), -- severity: Major + socketOptionError(52), -- severity: Major + socketReceiveError(53), -- severity: Major + socketRecvFailedError(54), -- severity: Major + socketSendFailedError(55), -- severity: Major + socketSelectError(56), -- severity: Major + socketTimedOutError(57), -- severity: Major + switchedToPrimary(58), -- severity: Major + switchedToSecondary(59), -- severity: Major + tcpAcceptError(60), -- severity: Major + tcpListenError(61), -- severity: Major + tcpSelectError(62), -- severity: Major + tcpError(63), -- severity: Major + testTimeExpired(64), -- severity: Major + tftpConnectionError(65), -- severity: Major + tftpMonitoringError(66), -- severity: Major + tftpReadingError(67), -- severity: Major + tftpReceivingError(68), -- severity: Major + tftpWrittingError(69), -- severity: Major + tooManyClients(70), -- severity: Major + updateEerror(71), -- severity: Major + updateSuccess(72), -- severity: Major + vmScript(73) -- severity: Major + } + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "IP Office application event states. The associated event + severity of the notification/trap the object is carried in + varies depending upon the event condition. The appropriate + severity is detailed against event enumeration." + ::= { ipoGTObjects 6 } + +ipoGTEventHostAddress OBJECT-TYPE + SYNTAX IpAddress + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "Address of an IP Office Small Office Gateway Subtending Host." + ::= { ipoGTObjects 7 } + +ipoGTEventSOGMode OBJECT-TYPE + SYNTAX INTEGER { + survivable(1), -- severity: Major + subTending(2) -- severity: Minor + } + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "IP Office Small Office Gateway operating modes. + survivable(1) indicates the control unit has no current host, + either through confguration error or communication failure. + subTending(2) indicates normal operation to a valid Sub- + tending Host." + ::= { ipoGTObjects 8 } + +ipoGTEventStdSeverity OBJECT-TYPE + SYNTAX ItuPerceivedSeverity + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "Severity of the event that has occurred. + + The event severity depends upon the type of + entity/notification that the operational state change event + relates to. The severity values that are normally used are + detailed below: + + The enterprise versions of standard SNMP traps all have a + severity of major (4). + + Operational events which notify the transition back to an + operational state from a failure state have a severity of + cleared (1). + + + GenEntityEvents: + Operational - severity is cleared (1) + + Failure event severity levels + Type of physical Severity for failure + entity + container critical (3) + module major (4) + port major (4) + + Error + Known transient errors for entities have a severity of + warning (6). + + Change - severity is major (4) + + LKSCommsSvcEvents: + Operational - severity is cleared (1) + Failure - severity is major (4) + + GenLoopbackSvcEvent: + Severity is major (4) + + GenAppSvcEvents: + Severity depends on sub-event + Operational - severity is cleared (1) + Failure - severity is major (4) + Event - severity depends on event condition + For voicemail storage conditions the severity is as + follows: + storageOkay - severity is cleared (1) + storageNearlyFull - severity is warning (6) + (Only warning severity as it could be transitory.) + storageFull - severity is critical (3) + + GenSogSvcEvents: + Severity depends on sub-event + HostFailure - severity is Major (4) + ModeChange: + - Mode survivable: severity is Major (4) + - Mode subTending: severity is Minor (5) + + GenUPriLicSvcEvents: + Severity depends on sub-event + ChansReduced - severity is Major (4) + CallRejected - severity is Minor (5) + + GenQoSMonSvcEvent: + QoSWarning - severity is Warning (6) + + PhoneChangeSvcEvents: + Severity is minor (5) + + ipoGenSystemRunningBackupEvent: + Severity is cleared (1) + Severity is critical (3) + + ipoGenInvalidMemoryCardEvent: + Severity is cleared (1) + Severity is Major (4) + + ipoGenNoLicenceKeyDongleEvent: + Severity is cleared (1) + Severity is warning (6) + Severity is critical (3) + + ipoGenMemoryCardCapacityEvent: + Severity depends on sub-event + storageOkay - severity is cleared (1) + storageNearlyFull - severity is warning (6) + storageFull - severity is critical (3)" + ::= { ipoGTObjects 9 } + +ipoGTEventDevID OBJECT-TYPE + SYNTAX SnmpAdminString (SIZE (10)) + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "A unique textual identifier of the alarming device." + ::= { ipoGTObjects 10 } + +ipoGTEventEntityName OBJECT-TYPE + SYNTAX SnmpAdminString (SIZE (0..64)) + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "The textual name of the alarming physical entity. The + contents of this object is made of concatenated + entPhysicalName values that fully identify the object with the + overall IP Office entity. Examples values are: + + Controller, Trunk Slot B, Trunk Module, T1 PRI 2 + = T1 PRI Port 2, on a dual T1 Trunk Module, in Trunk Slot B, + on the IP Office Controller Unit + + Controller, VCM Slot 1, VCM 1 + = VCM Card, in VCM Slot 1, on the IP Office Controller Unit + + Controller, EXP 1, DS EXP 16, DS 12 + = DS Phone Port 12, on a DS16 Expansion Module, attached to + Expansion Port 1, on the IP Office Controller Unit" + ::= { ipoGTObjects 11 } + +ipoGTEventLoopbackStatusBits OBJECT-TYPE + SYNTAX BITS { + noLoopback(0), + nearEndPayloadLoopback(1), + nearEndLineLoopback(2), + nearEndOtherLoopback(3), + nearEndInwardLoopback(4), + farEndPayloadLoopback(5), + farEndLineLoopback(6) + } + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "This variable represents the current state of the loopback on + the DS1 interface. It contains information about loopbacks + established by a manager and remotely from the far end. + + The ipoGTEventLoopbackStatus is a bit map therefore is can + represent multiple loopbacks simultaneously." + ::= { ipoGTObjects 12 } + +ipoGTEventQoSMonJitter OBJECT-TYPE + SYNTAX Unsigned32 + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "IP Office QoS monitoring Received Jitter time in milliseconds." + ::= { ipoGTObjects 13 } + +ipoGTEventQoSMonRndTrip OBJECT-TYPE + SYNTAX Unsigned32 + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "IP Office QoS monitoring Round Trip Delay time in milliseconds." + ::= { ipoGTObjects 14 } + +ipoGTEventQoSMonPktLoss OBJECT-TYPE + SYNTAX Unsigned32 + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "IP Office QoS monitoring Received Packet Loss." + ::= { ipoGTObjects 15 } + +ipoGTEventQoSMonCallId OBJECT-TYPE + SYNTAX Unsigned32 + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "IP Office QoS monitoring Call Identifier." + ::= { ipoGTObjects 16 } + +ipoGTEventQoSMonDevType OBJECT-TYPE + SYNTAX INTEGER { + line(1), + extn(2) + } + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "IP Office QoS monitoring Device Type." + ::= { ipoGTObjects 17 } + +ipoGTEventQoSMonDevId OBJECT-TYPE + SYNTAX Unsigned32 + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "IP Office QoS monitoring Device Identifier." + ::= { ipoGTObjects 18 } + +ipoGTEventQoSMonExtnNo OBJECT-TYPE + SYNTAX Unsigned32 + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "IP Office QoS monitoring Extension Number." + ::= { ipoGTObjects 19 } + +ipoGTEventSystemShutdownSource OBJECT-TYPE + SYNTAX SnmpAdminString (SIZE (0..255)) + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "This variable represents the source from where the system + shutdown was performed. + + Possible values are: + + DTE-Port + - if the system shutdown is performed using the DTE, + AUX-Button + - if the system shutdown is performed using the AUX + button (available only for IP500v2), + Phone + - if the system shutdown is performed from a phone, + Manager + - if the system shutdown is performed from Manager, + SSA + - if the system shutdown is performed from SSA." + ::= { ipoGTObjects 20 } + +ipoGTEventSystemShutdownTimeout OBJECT-TYPE + SYNTAX Unsigned32 + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "This variable represents the period of time the system will be in + the shutdown state for. Possible values are in the 5 to 1440 minutes + range, 0 meaning infinite." + ::= { ipoGTObjects 21 } + +ipoGTEventMemoryCardSlotId OBJECT-TYPE + SYNTAX INTEGER { + compactFlash(1), + systemSD(2), + optionalSD(3) + } + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "This variable indicates a memory card physical position identifier. + System(2) and Optional(3) are valid for the IP500 V2. CF(1) valid + for the IP500." + ::= { ipoGTObjects 22 } + +ipoGTEventNoValidKeyReason OBJECT-TYPE + SYNTAX INTEGER { + noReason(1), + notPresent(2), + noRegisterAccess(3), + invalidRegisters(4), + invalidWatermark(5), + invalidClusterSize(6), + invalidVolume(7), + invalidHeaderFiles(8), + nonSpecificError(9) + } + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "This variable indicates the reason no valid licence feature key is + assumed. This is also the order of importance and check precedence. + noReason(1) - cleared condition + notPresent(2) - license feature key no present + noRegisterAccess(3) - license feature key present, but no access + invalidRegisters(4) - invalid register values + invalidWatermark(5) - watermark invalid or not present + invalidClusterSize(6) - filesystem not as expected" + ::= { ipoGTObjects 23 } + +ipoGTEventReason OBJECT-TYPE + SYNTAX INTEGER { + configurationAgentNotTargeted(1), + configurationSCNDialPlanConflict(2), + configurationNoIncomingCallRoute(3), + configurationHWTypeFailure(4), + serviceFeatureLicenseMissing(5), + serviceAllLicensesInUse(6), + serviceClockSourceChanged(7), + serviceLogonFailed(8), + serviceNoFreeChannelsAvail(9), + serviceHoldMusicFileFailure(10), + serviceAllResourcesInUse(11), + serviceAlarm(12), + serviceNetworkInterconnectFailure(13), + trunkSeizeFailure(14), + trunkIncomingCallOutgoingTrunk(15), + trunkCLINotDelivered(16), + trunkDDIIncomplete(17), + trunkLOS(18), + trunkOOS(19), + trunkRedAlarm(20), + trunkBlueAlarm(21), + trunkYellowAlarm(22), + trunkIPConnectFail(23), + trunkSCNInvalidConnection(24), + linkDeviceChanged(25), + linkLDAPServerCommFailure(26), + linkResourceDown(27), + linkSMTPServerCommFailure(28), + linkVMProConnFailure(29), + serviceTimeServerAlarm(30), + serviceLicenseFileInvalid(31), + serviceLicenseError(32), + securityError(33), + codecError(34), + scepNoRespError(35), + configAppsProcAlarm(36), + serviceAppsProcAlarm(37), + serviceLicenseServerError(38), + testAlarm(39), + servicePlannedMaintenance(40), + serviceNetworkDisconnection(41), + serviceFailedTlsNegotiation(42), + serviceFailedTlsRenegotiation(43), + serviceLackOfResources(44), + serviceInternalError(45), + serviceTooManyMissedHeartbeats(46), + serviceFailedDnsResolution(47), + serviceDuplicateIpAddress(48), + serviceAuthenticationFailure(49), + serviceSslVpnStackProtocolError(50), + serviceSslVpnServerReportedError(51), + servicePortRangeExhausted(52), + serviceWebservicesUWSError(53), + trunkNoFreeVoIPChannel(54), + serviceEmergencyCall(55), + serviceLocationCongestion(56), + serviceCpuAlarm(57), + serviceCpuIOAlarm(58), + serviceMemoryAlarm(59), + serviceLocalBackup(60), + trunkSMConnectAsSIP(61), + trunkSIPConnectAsSM(62), + serviceSipRxPacketSizeError(63), + serviceACCSAlarm(64), + serviceSystemHardDriveAlarm(65), + serviceAdditionalHardDriveAlarm(66), + linkDialerConnFailure(67), + trunkSIPDNSInvalidConfig(68), + trunkSIPDNSTransportError(69), + monitorLogStamped(70), + trunkSCNInvalidSubOperMode(71), + serviceIPDECTSystemError(72), + serviceIPOCCAlarm(73), + serviceGeneralAlarm(74), + serviceSystemInfo(75), + serviceNonSelectAlarm(76), + serviceCCRNotSupported(77), + serviceAMServerNotAvailable(78), + trunkMediaSecuritySettingsIncompatible(79) + } + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "This variable indicates what event took place within Configuration, Service, Trunk + or Link category alarm" + ::= { ipoGTObjects 24 } + +ipoGTEventData OBJECT-TYPE + SYNTAX SnmpAdminString (SIZE (0..255)) + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "This variable contains opaque data that can be used to provide additional information + when the ipoGTEventReason value is not sufficient." + ::= { ipoGTObjects 25 } + +ipoGTEventAlarmDescription OBJECT-TYPE + SYNTAX SnmpAdminString (SIZE (0..255)) + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "This variable describes the alarm" + ::= { ipoGTObjects 26 } + +ipoGTEventAlarmRemedialAction OBJECT-TYPE + SYNTAX SnmpAdminString (SIZE (0..255)) + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "This variable describes the remedial action of the alarm" + ::= { ipoGTObjects 27 } + + + +-- +-- traps +-- + +ipoGenEntityFailureEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventSeverity, + ipoGTEventDateTime, + ipoGTEventEntity + } + STATUS deprecated + DESCRIPTION + "A ipoGenEntityFailureEvent notification is generated whenever a + physical entity on the IP Office fails in its operation. It + signifies that the SNMP entity, acting in an agent role, has + detected that the state of a physical entity of the system has + transitioned from the operational to the failed state + + **NOTE: This notification is deprecated and replaced by + ipoGenEntityFailureSvcEvent" + ::= { ipoGTEvents 1 } + +ipoGenEntityOperationalEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventSeverity, + ipoGTEventDateTime, + ipoGTEventEntity + } + STATUS deprecated + DESCRIPTION + "A ipoGenEntityOperationalEvent notification is generated whenever + a physical entity on the IP Office becomes operational again + after having failed. It signifies that the SNMP entity, acting + in an agent role, has detected that the state of a physical + entity of the system has transitioned from the failed to the + operational state + + **NOTE: This notification is deprecated and replaced by + ipoGenEntityOperationalSvcEvent." + ::= { ipoGTEvents 2 } + +ipoGenEntityErrorEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventSeverity, + ipoGTEventDateTime, + ipoGTEventEntity + } + STATUS deprecated + DESCRIPTION + "A ipoGenEntityErrorEvent notification is generated whenever a + physical entity on the IP Office experiences a temporary + error. It signifies that the SNMP entity, acting in an agent + role, has detected a transitory error on a physical entity of + the system. + + **NOTE: This notification is deprecated and replaced by + ipoGenEntityErrorSvcEvent." + ::= { ipoGTEvents 3 } + +ipoGenEntityChangeEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventSeverity, + ipoGTEventDateTime, + ipoGTEventEntity + } + STATUS deprecated + DESCRIPTION + "A ipoGenEntityChangeEvent notification is generated whenever + a physical entity on the IP Office experiences a change itself + or with other entities associated with it. It signifies that + the SNMP entity, acting in an agent role, has detected a non + error/failure change for a physical entity on the system. + + **NOTE: This notification is deprecated and replaced by + ipoGenEntityChangeSvcEvent." + ::= { ipoGTEvents 4 } + +ipoGenLKSCommsFailureEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventSeverity, + ipoGTEventDateTime + } + STATUS deprecated + DESCRIPTION + "A ipoGenLKSCommsFailureEvent notification is generated + whenever communication with a Licence Key Server fails. It + signifies that the SNMP entity, acting in an agent role, has + detected that the state of the communications between the + Licence Key Server has transitioned from the operational to + the failed state. + + **NOTE: This notification is deprecated and replaced by + ipoGenLKSCommsFailureSvcEvent." + ::= { ipoGTEvents 5 } + +ipoGenLKSCommsOperationalEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventSeverity, + ipoGTEventDateTime + } + STATUS deprecated + DESCRIPTION + "A ipoGenLKSCommsOperationalEvent notification is generated + whenever communication with a Licence Key Server becomes + operational again after having failed. It signifies that the + SNMP entity, acting in an agent role, has detected that the + state of the communications between the Licence Key Server has + transitioned from the failed to the operational state. + + **NOTE: This notification is deprecated and replaced by + ipoGenLKSCommsOperationalSvcEvent." + ::= { ipoGTEvents 6 } + +ipoGenLKSCommsErrorEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventSeverity, + ipoGTEventDateTime + } + STATUS deprecated + DESCRIPTION + "A ipoGenLKSCommsErrorEvent notification is generated whenever + a IP Office experiences a temporary error with License Key + Server communication. It signifies that the SNMP entity, + acting in an agent role, has detected a transitory error with + the communication between the License Key Server and Client + on the system. + + **NOTE: This notification is deprecated and replaced by + ipoGenLKSCommsErrorSvcEvent." + ::= { ipoGTEvents 7 } + +ipoGenLKSCommsChangeEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventSeverity, + ipoGTEventDateTime + } + STATUS deprecated + DESCRIPTION + "A ipoGenLKSCommsChangeEvent notification is generated + whenever a IP Office experiences a change a non error change + License Key Server communication operation. It signifies that + the SNMP entity, acting in an agent role, has detected a non + error/failure change with the License Key Server and Client + operation on the system. + + **NOTE: This notification is deprecated and replaced by + ipoGenLKSCommsChangeSvcEvent." + ::= { ipoGTEvents 8 } + +ipoGenLoopbackEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventSeverity, + ipoGTEventDateTime, + ipoGTEventEntity, + ipoGTEventLoopbackStatus + } + STATUS deprecated + DESCRIPTION + "A ipoGenLoopbackEvent notification is generated whenever a IP + Office T1 (DS1) interface operating as a CSU actions a loopback + status change. + + **NOTE: This notification is deprecated and replaced by + ipoGenLoopbackSvcEvent." + ::= { ipoGTEvents 9 } + +ipoGenAppFailureEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventSeverity, + ipoGTEventDateTime, + ipoGTEventAppEntity + } + STATUS deprecated + DESCRIPTION + "A ipoGenAppFailureEvent notification is generated whenever + communication between a IP Office switch and a IP Office + application fails. It signifies that the SNMP entity, acting + in an agent role, has detected that the state of the + communications between the IP Office switch and a IP Office + application has transitioned from the operational to the + failed state. The IP Office application between which + communication has been lost is identified by the value of + ipoGTEventAppEntity. + + **NOTE: This notification is deprecated and replaced by + ipoGenAppFailureSvcEvent." + ::= { ipoGTEvents 10 } + +ipoGenAppOperationalEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventSeverity, + ipoGTEventDateTime, + ipoGTEventAppEntity + } + STATUS deprecated + DESCRIPTION + "A ipoGenAppOperationalEvent notification is generated + whenever communication between a IP Office switch and a IP + Office application becomes operational again after having + failed. It signifies that the SNMP entity, acting in an agent + role, has detected that the state of the communications + between the IP Office switch and a IP Office application has + transitioned from the failed to the operational state. The IP + Office application between which communication has been lost + is identified by the value of ipoGTEventAppEntity. + + **NOTE: This notification is deprecated and replaced by + ipoGenAppOperationalSvcEvent." + ::= { ipoGTEvents 11 } + +ipoGenAppEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventSeverity, + ipoGTEventDateTime, + ipoGTEventAppEntity, + ipoGTEventAppEvent + } + STATUS deprecated + DESCRIPTION + "A ipoGenAppEvent notification is generated whenever a + application entity of the IP Office system experiences an event. + It signifies that the SNMP entity, acting as a proxy for + the application, has detected an event on the application + entity of the overall IP Office system. + The event severity varies dependent upon the event condition. + + **NOTE: This notification is deprecated and replaced by + ipoGenAppSvcEvent." + ::= { ipoGTEvents 12 } + +ipoGenSogHostFailureEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventSeverity, + ipoGTEventDateTime, + ipoGTEventHostAddress + } + STATUS deprecated + DESCRIPTION + "An ipoGenSogFailureEvent notification is generated whenever a + previously valid Sub-tending host fails during Small Office + Gateway operation. + The ipAddress field indicates the address of the failed host. + The event severity will always indicate Major. + + **NOTE: This notification is deprecated and replaced by + ipoGenSogHostFailureSvcEvent." + ::= { ipoGTEvents 13 } + +ipoGenSogModeChangeEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventSeverity, + ipoGTEventDateTime, + ipoGTEventSOGMode + } + STATUS deprecated + DESCRIPTION + "An ipoGenSogModeChangeEvent notification is generated whenever + the Small Office Gateway operating mode changes. This also + includes entry to the initial mode. + The ipoGTEventSOGMode field indicates the new operating mode. + The event severity will be major(2) for a ipoGTEventSOGMode value + of survivable(1), and minor(3) for a ipoGTEventSOGMode value of + subTending(2). + + **NOTE: This notification is deprecated and replaced by + ipoGenSogModeChangeSvcEvent." + ::= { ipoGTEvents 14 } + +ipoGenColdStartSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr + } + STATUS current + DESCRIPTION + "Enterprise version of standard coldstart trap featuring + device identification information. A coldStart trap + signifies that the sending protocol entity is reinitializing + itself such that the agent's configuration or the protocol + entity implementation may be altered." + ::= { ipoGTEvents 15 } + +ipoGenWarmStartSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr + } + STATUS current + DESCRIPTION + "Enterprise version of standard warmstart trap featuring + device identification information. A warmStart trap + signifies that the sending protocol entity is reinitializing + that neither the agent configuration nor the protocol entity + implementation is altered." + ::= { ipoGTEvents 16 } + +ipoGenLinkDownSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ifIndex + } + STATUS current + DESCRIPTION + "Enterprise version of standard linkDown trap featuring device + identification information. A linkDown trap signifies that + the sending protocol entity recognizes a failure in one of + the communication links represented in the agent's + configuration." + ::= { ipoGTEvents 17 } + +ipoGenLinkUpSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ifIndex + } + STATUS current + DESCRIPTION + "Enterprise version of standard linkUp trap featuring device + identification information. A linkUp trap signifies that the + sending protocol entity recognizes that one of the + communication links represented in the agent's configuration + has come up." + ::= { ipoGTEvents 18 } + +ipoGenAuthFailureSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr + } + STATUS current + DESCRIPTION + "Enterprise version of standard authenticationFailure trap + featuring device identification information. An + authenticationFailure trap signifies that the sending + protocol entity is the addressee of a protocol message that + is not properly authenticated. While implementations of the + SNMP must be capable of generating this trap, they must also + be capable of suppressing the emission of such traps via an + implementation- specific mechanism." + ::= { ipoGTEvents 19 } + +ipoGenEntityFailureSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventEntity, + ipoGTEventEntityName + } + STATUS current + DESCRIPTION + "A ipoGenEntityFailureSvcEvent notification is generated + whenever a physical entity on the IP Office fails in its + operation. It signifies that the SNMP entity, acting in an + agent role, has detected that the state of a physical entity + of the system has transitioned from the operational to the + failed state" + ::= { ipoGTEvents 20 } + +ipoGenEntityOperationalSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventEntity, + ipoGTEventEntityName + } + STATUS current + DESCRIPTION + "A ipoGenEntityOperationalSvcEvent notification is generated + whenever a physical entity on the IP Office becomes + operational again after having failed. It signifies that the + SNMP entity, acting in an agent role, has detected that the + state of a physical entity of the system has transitioned from + the failed to the operational state" + ::= { ipoGTEvents 21 } + +ipoGenEntityErrorSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventEntity, + ipoGTEventEntityName + } + STATUS current + DESCRIPTION + "A ipoGenEntityErrorSvcEvent notification is generated + whenever a physical entity on the IP Office experiences a + temporary error. It signifies that the SNMP entity, acting in + an agent role, has detected a transitory error on a physical + entity of the system." + ::= { ipoGTEvents 22 } + +ipoGenEntityChangeSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventEntity, + ipoGTEventEntityName + } + STATUS current + DESCRIPTION + "A ipoGenEntityChangeSvcEvent notification is generated + whenever a physical entity on the IP Office experiences a + change itself or with other entities associated with it. It + signifies that the SNMP entity, acting in an agent role, has + detected a non error/failure change for a physical entity on + the system." + ::= { ipoGTEvents 23 } + +ipoGenLKSCommsFailureSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr + } + STATUS current + DESCRIPTION + "A ipoGenLKSCommsFailureSvcEvent notification is generated + whenever communication with a Licence Key Server fails. It + signifies that the SNMP entity, acting in an agent role, has + detected that the state of the communications between the + Licence Key Server has transitioned from the operational to + the failed state." + ::= { ipoGTEvents 24 } + +ipoGenLKSCommsOperationalSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr + } + STATUS current + DESCRIPTION + "A ipoGenLKSCommsOperationalSvcEvent notification is generated + whenever communication with a Licence Key Server becomes + operational again after having failed. It signifies that the + SNMP entity, acting in an agent role, has detected that the + state of the communications between the Licence Key Server has + transitioned from the failed to the operational state." + ::= { ipoGTEvents 25 } + +ipoGenLKSCommsErrorSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr + } + STATUS current + DESCRIPTION + "A ipoGenLKSCommsErrorSvcEvent notification is generated + whenever a IP Office experiences a temporary error with + License Key Server communication. It signifies that the SNMP + entity, acting in an agent role, has detected a transitory + error with the communication between the License Key Server + and Client on the system." + ::= { ipoGTEvents 26 } + +ipoGenLKSCommsChangeSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr + } + STATUS current + DESCRIPTION + "A ipoGenLKSCommsChangeSvcEvent notification is generated + whenever a IP Office experiences a change a non error change + License Key Server communication operation. It signifies that + the SNMP entity, acting in an agent role, has detected a non + error/failure change with the License Key Server and Client + operation on the system." + ::= { ipoGTEvents 27 } + +ipoGenLoopbackSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventEntity, + ipoGTEventEntityName, + ipoGTEventLoopbackStatusBits + } + STATUS current + DESCRIPTION + "A ipoGenLoopbackSvcEvent notification is generated whenever a + IP Office T1 (DS1) interface operating as a CSU actions a + loopback status change." + ::= { ipoGTEvents 28 } + +ipoGenAppFailureSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventAppEntity + } + STATUS current + DESCRIPTION + "A ipoGenAppFailureSvcEvent notification is generated whenever + communication between a IP Office switch and a IP Office + application fails. It signifies that the SNMP entity, acting + in an agent role, has detected that the state of the + communications between the IP Office switch and a IP Office + application has transitioned from the operational to the + failed state. The IP Office application between which + communication has been lost is identified by the value of + ipoGTEventAppEntity." + ::= { ipoGTEvents 29 } + +ipoGenAppOperationalSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventAppEntity + } + STATUS current + DESCRIPTION + "A ipoGenAppOperationalSvcEvent notification is generated + whenever communication between a IP Office switch and a IP + Office application becomes operational again after having + failed. It signifies that the SNMP entity, acting in an agent + role, has detected that the state of the communications + between the IP Office switch and a IP Office application has + transitioned from the failed to the operational state. The IP + Office application between which communication has been lost + is identified by the value of ipoGTEventAppEntity." + ::= { ipoGTEvents 30 } + +ipoGenAppSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventAppEntity, + ipoGTEventAppEvent, + ipoGTEventAlarmDescription + } + STATUS current + DESCRIPTION + "A ipoGenAppSvcEvent notification is generated whenever a + application entity of the IP Office system experiences an + event. It signifies that the SNMP entity, acting as a proxy + for the application, has detected an event on the application + entity of the overall IP Office system. + + The event severity varies dependent upon the event condition." + ::= { ipoGTEvents 31 } + +ipoGenSogHostFailureSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventHostAddress + } + STATUS current + DESCRIPTION + "An ipoGenSogFailureSvcEvent notification is generated + whenever a previously valid Sub-tending host fails during + Small Office Gateway operation. + + The ipAddress field indicates the address of the failed host. + The event severity will always indicate major(4)." + ::= { ipoGTEvents 32 } + +ipoGenSogModeChangeSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventSOGMode + } + STATUS current + DESCRIPTION + "An ipoGenSogModeChangeSvcEvent notification is generated + whenever the Small Office Gateway operating mode changes. This + also includes entry to the initial mode. + + The ipoGTEventSOGMode field indicates the new operating mode. + The event severity will be major(4) for a ipoGTEventSOGMode + value of survivable(1), and minor(5) for a ipoGTEventSOGMode + value of subTending(2)." + ::= { ipoGTEvents 33 } + +ipoGenUPriLicChansReducedSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr + } + STATUS current + DESCRIPTION + "A ipoGenUPriLicChansReducedSvcEvent notification is generated + whenever the number of Universal PRI Licensed channels has + been reduced. It signifies that the SNMP entity, acting in an + agent role, has detected a reduction in the licensed channels + on a Univeral PRI trunk." + ::= { ipoGTEvents 34 } + +ipoGenUPriLicCallRejectedSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr + } + STATUS current + DESCRIPTION + "A ipoGenUPriLicCallRejectedSvcEvent notification is generated + whenever a call on a Universal PRI is rejected due to a + licensed channel not being available. It signifies that the + SNMP entity, acting in an agent role, has detected a licensed + channel not available in order to make a call on a Univeral + PRI trunk." + ::= { ipoGTEvents 35 } + +ipoGenQoSMonSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventQoSMonJitter, + ipoGTEventQoSMonRndTrip, + ipoGTEventQoSMonPktLoss, + ipoGTEventQoSMonCallId, + ipoGTEventQoSMonDevType, + ipoGTEventQoSMonDevId, + ipoGTEventQoSMonExtnNo + } + STATUS current + DESCRIPTION + "A ipoGenQoSMonSvcEvent notification is generated when one of + the monitored QoS parameters (e.g. round trip delay, jitter, + packet loss, etc) exceeds its pre-selected threshold during + the duration of the call. It signifies that the SNMP entity, + acting in an agent role, has detected a state that one of the + monitored QoS parameters for the call exceeded its + pre-selected threshold. + + The ipoGTEventQOSMonExtnNo value is only valid when the device + monitored is an extension rather than a line." + ::= { ipoGTEvents 36 } + +ipoGenSystemShutdownSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventSystemShutdownSource, + ipoGTEventSystemShutdownTimeout + } + STATUS current + DESCRIPTION + "An ipoGenSystemShutdownSvcEvent notification is generated when a + system shutdown is performed. It signifies that the + SNMP entity has detected a system shutdown." + ::= { ipoGTEvents 37 } + +ipoGenSystemRunningBackupEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr + } + STATUS current + DESCRIPTION + "An ipoGenSystemRunningBackup notification is generated when a + system is running partially or wholly from alternate/backup + software and/or configuration data. + In the case of an IP500 V2, it indicates that the current boot location + is not the System SD card slot, \system\primary." + ::= { ipoGTEvents 38 } + +ipoGenInvalidMemoryCardEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventMemoryCardSlotId + } + STATUS current + DESCRIPTION + "An ipoGenInvalidMemoryCard notification is generated when a memory + card is detected present but cannot be used due to failure in the + filesystem or card type checks. + The checks are carried out on startup and whenever a memory card is + inserted." + ::= { ipoGTEvents 39 } + +ipoGenNoLicenceKeyDongleEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventNoValidKeyReason + } + STATUS current + DESCRIPTION + "A ipoGenNoLicenceKeyDongle notification is generated if a system + either does not detect presence, or fails to validate a Licence Feature + Key Dongle. + In the case of an IP500 V2, it indicates that either the System SD card + is not present, or that one of the validation checks has failed. Note + that removing the System SD card will cause this event immediately, + however the licences will remain valid for approximately 2 hours. + + ipoGTEventStdSeverity will indicate the events state: + Severity is cleared(1): license dongle OK + Severity is warning(6): license dongle not OK, in grace period + Severity is critical(3): license dongle not OK, grace period expired + + The first check to fail is contained within ipoGTEventNoKeyReason." + ::= { ipoGTEvents 40 } + +ipoGenMemoryCardCapacityEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventMemoryCardSlotId, + ipoGTEventAppEvent + } + STATUS current + DESCRIPTION + "A ipoGenMemoryCardCapacityEvent notification is generated if a memory + card passes one of the preset capacity thresholds. + In the case of an IP500 V2, the thresholds shall be + storageFull(1) - greater than 99% of nominal capacity + storageNearlyFull(2) - greater than 90% of nominal capacity + storageOkay(3) - less than 90% of nominal capacity." + ::= { ipoGTEvents 41 } + + + +ipoGenConfigFailureSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventReason, + ipoGTEventData, + ipoGTEventAlarmDescription, + ipoGTEventAlarmRemedialAction + } + STATUS current + DESCRIPTION + "A ipoGenConfigFailureSvcEvent notification is generated + whenever a configuration component fails in its operation. It signifies + that the SNMP entity,acting in an agent role,has detected that + the state of a configuration component has transitioned from the + operational to the failed state. + + This notification event is associated with a configuration + system status category alarm. Details about the alarm are + provided in the included object variables." + ::= { ipoGTEvents 42} + +ipoGenConfigOperationalSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventReason, + ipoGTEventData + } + STATUS current + DESCRIPTION + "A ipoGenConfigOperationalSvcEvent notification is generated + whenever a configuration component becomes operational again + after having failed.It signifies that the SNMP entity,acting in an + agent role,has detected that the state of a configuration component + of thesystem has transitioned from the failed to the operational state. + + This notification event is associated with a configuration + system status category alarm. Details about the alarm are + provided in the included object variables." + ::= { ipoGTEvents 43} + +ipoGenConfigErrorSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventReason, + ipoGTEventData, + ipoGTEventAlarmDescription, + ipoGTEventAlarmRemedialAction + } + STATUS current + DESCRIPTION + "A ipoGenConfigErrorSvcEvent notification is generated + whenever a configuration component experiences a + temporary error.It signifies that the SNMP entity, acting + in an agent role,has detected a transitory error on a + configuration component of the system. + + This notification event is associated with a configuration + system status category alarm. Details about the alarm are + provided in the included object variables." + ::= { ipoGTEvents 44} + +ipoGenConfigChangeSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventReason, + ipoGTEventData, + ipoGTEventAlarmDescription, + ipoGTEventAlarmRemedialAction + } + STATUS current + DESCRIPTION + "A ipoGenConfigChangeSvcEvent notification is generated + whenever a configuration component experiences a change + or a non error change event.It signifies that the SNMP entity, acting + in an agent role,has detected a non error/failure change on a + configuration component of the system. + + This notification event is associated with a configuration + system status category alarm. Details about the alarm are + provided in the included object variables." + ::= { ipoGTEvents 45} + + +ipoGenServiceFailureSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventReason, + ipoGTEventData, + ipoGTEventAlarmDescription, + ipoGTEventAlarmRemedialAction + } + STATUS current + DESCRIPTION + "A ipoGenServiceFailureSvcEvent notification is generated + whenever a Service component fails in its operation. It signifies + that the SNMP entity,acting in an agent role,has detected that + the state of a Service component has transitioned from the + operational to the failed state. + + This notification event is associated with a service + system status category alarm. Details about the alarm are + provided in the included object variables." + ::= { ipoGTEvents 46} + +ipoGenServiceOperationalSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventReason, + ipoGTEventData + } + STATUS current + DESCRIPTION + "A ipoGenServiceOperationalSvcEvent notificationis generated + whenever a service component becomes operational again + after having failed.It signifiest hat the SNMP entity, acting in an + agent role, has detected that the state of a service component + of the system has transitioned from the failed to the operational state. + + This notification event is associated with a service + system status category alarm. Details about the alarm are + provided in the included object variables." + ::= { ipoGTEvents 47} + +ipoGenServiceErrorSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventReason, + ipoGTEventData, + ipoGTEventAlarmDescription, + ipoGTEventAlarmRemedialAction + } + STATUS current + DESCRIPTION + "A ipoGenServiceErrorSvcEvent notification is generated + whenever a service component experiences a + temporary error. It signifiest hat the SNMP entity, acting + in an agent role,has detected a transitory error on a + service component of the system. + + This notification event is associated with a service + system status category alarm. Details about the alarm are + provided in the included object variables." + ::= { ipoGTEvents 48} + +ipoGenServiceChangeSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventReason, + ipoGTEventData, + ipoGTEventAlarmDescription, + ipoGTEventAlarmRemedialAction + } + STATUS current + DESCRIPTION + "A ipoGenServiceChangeSvcEvent notification is generated + whenever a service component experiences a change + or a non error change event. It signifies that the SNMP entity, acting + in an agent role,has detected a non error/failure change on a + service component of the system. + + This notification event is associated with a service + system status category alarm. Details about the alarm are + provided in the included object variables." + ::= { ipoGTEvents 49} + +ipoGenTrunkFailureSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventReason, + ipoGTEventData, + ipoGTEventAlarmDescription, + ipoGTEventAlarmRemedialAction + } + STATUS current + DESCRIPTION + "A ipoGenTrunkFailureSvcEvent notification is generated + whenever a trunk component fails in its operation. It signifies + that the SNMP entity,acting in an agent role,has detected that + the state of a Trunk component has transitioned from the + operational to the failed state. + + This notification event is associated with a trunk + system status category alarm. Details about the alarm are + provided in the included object variables." + ::= { ipoGTEvents 50} + +ipoGenTrunkOperationalSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventReason, + ipoGTEventData + } + STATUS current + DESCRIPTION + "A ipoGenTrunkOperationalSvcEvent notificationis generated + whenever a trunk component becomes operational again + after having failed. It signifies that the SNMP entity, acting in an + agent role,has detected that the state of a trunk component + of the system has transitioned from the failed to the operational state. + + This notification event is associated with a trunk + system status category alarm. Details about the alarm are + provided in the included object variables." + ::= { ipoGTEvents 51} + +ipoGenTrunkErrorSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventReason, + ipoGTEventData, + ipoGTEventAlarmDescription, + ipoGTEventAlarmRemedialAction + } + STATUS current + DESCRIPTION + "A ipoGenTrunkErrorSvcEvent notification is generated + whenever a trunk component experiences a + temporary error. It signifies that the SNMP entity, acting + in an agent role, has detected a transitory error on a + trunk component of the system. + + This notification event is associated with a trunk + system status category alarm. Details about the alarm are + provided in the included object variables." + ::= { ipoGTEvents 52} + +ipoGenTrunkChangeSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventReason, + ipoGTEventData, + ipoGTEventAlarmDescription, + ipoGTEventAlarmRemedialAction + } + STATUS current + DESCRIPTION + "A ipoGenTrunkChangeSvcEvent notification is generated + whenever a trunk component experiences a change + or a non error change event. It signifies that the SNMP entity, acting + in an agent role, has detected a non error/failure change on a + trunk component of the system. + + This notification event is associated with a trunk + system status category alarm. Details about the alarm are + provided in the included object variables." + ::= { ipoGTEvents 53} + +ipoGenLinkFailureSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventReason, + ipoGTEventData, + ipoGTEventAlarmDescription, + ipoGTEventAlarmRemedialAction + } + STATUS current + DESCRIPTION + "A ipoGenLinkFailureSvcEvent notification is generated + whenever a Link component fails in its operation. It signifies + that the SNMP entity,acting in an agent role,has detected that + the state of a Link component has transitioned from the + operational to the failed state. + + This notification event is associated with a link + system status category alarm. Details about the alarm are + provided in the included object variables." + ::= { ipoGTEvents 54} + +ipoGenLinkOperationalSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventReason, + ipoGTEventData + } + STATUS current + DESCRIPTION + "A ipoGenLinkOperationalSvcEvent notification is generated + whenever a link component becomes operational again + after having failed. It signifies that the SNMP entity, acting in an + agent role, hasdetected that the state of a link component + of the system has transitioned from the failed to the operational state. + + This notification event is associated with a link + system status category alarm. Details about the alarm are + provided in the included object variables." + ::= { ipoGTEvents 55} + +ipoGenLinkErrorSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventReason, + ipoGTEventData, + ipoGTEventAlarmDescription, + ipoGTEventAlarmRemedialAction + } + STATUS current + DESCRIPTION + "A ipoGenLinkErrorSvcEvent notification is generated + whenever a link component experiences a + temporary error. It signifies that the SNMP entity, acting + in an agent role,has detected a transitory error on a + link component of thesystem. + + This notification event is associated with a link + system status category alarm. Details about the alarm are + provided in the included object variables." + ::= { ipoGTEvents 56} + +ipoGenLinkChangeSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventReason, + ipoGTEventData, + ipoGTEventAlarmDescription, + ipoGTEventAlarmRemedialAction + } + STATUS current + DESCRIPTION + "A ipoGenLinkChangeSvcEvent notification is generated + whenever a link component experiences a change + or a non error change event. It signifies that the SNMP entity, acting + in an agent role,has detected a non error/failure change on a + link component of the system. + + This notification event is associated with a link + system status category alarm. Details about the alarm are + provided in the included object variables." + ::= { ipoGTEvents 57} + + ipoGenEmergencyCallSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoGTEventReason, + ipoGTEventData, + ipoGTEventAlarmDescription, + ipoGTEventAlarmRemedialAction + } + STATUS current + DESCRIPTION + "A ipoGenEmergencyCallSvcEvent notification is generated + whenever an emergency call is made, regardless whether successfully or not. + It signifies that the SNMP entity, acting + in an agent role, has detected an emergency call attempt on the system. + + This notification event is associated with a service + system status category alarm. Details about the alarm are + provided in the included object variables." + ::= { ipoGTEvents 58} + + +--******************************************************************** +-- IP Office wide compliance +--******************************************************************** + +ipoGenCompliances OBJECT IDENTIFIER ::= { ipoGenConformance 1 } +ipoGenGroups OBJECT IDENTIFIER ::= { ipoGenConformance 2 } + +-- +-- compliance statements +-- + +ipoGenCompliance MODULE-COMPLIANCE + STATUS deprecated + DESCRIPTION + "The compliance statement for IP Office agents which implement + up to and including version 1.00.05 of this MIB." + MODULE -- this module + MANDATORY-GROUPS { + ipoGenNotificationObjectsGroup, + ipoGenNotificationsGroup + } + ::= { ipoGenCompliances 1 } + +ipoGen2Compliance MODULE-COMPLIANCE + STATUS deprecated + DESCRIPTION + "The compliance statement for IP Office agents which implement + version 1.00.06 and later versions of this MIB." + MODULE -- this module + MANDATORY-GROUPS { + ipoGenNotificationObjectsGroup, + ipoGenNotificationsGroup + } + GROUP ipoGenSOGNotificationObjectsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + SOG devices." + GROUP ipoGenSOGNotificationsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + SOG devices." + ::= { ipoGenCompliances 2 } + +ipoGen3Compliance MODULE-COMPLIANCE + STATUS deprecated + DESCRIPTION + "The compliance statement for IP Office agents which implement + version 1.01.01 and later versions of this MIB." + MODULE -- this module + MANDATORY-GROUPS { + ipoGenv2NotificationObjectsGroup, + ipoGenEntGenNotificationsGroup, + ipoGenSvcNotificationsGroup + } + GROUP ipoGenSOGNotificationObjectsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + SOG devices." + GROUP ipoGenSvcSOGNotificationsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + SOG devices." + ::= { ipoGenCompliances 3 } + +ipoGen4Compliance MODULE-COMPLIANCE + STATUS deprecated + DESCRIPTION + "The compliance statement for IP Office agents which implement + version 2.00.01 and later versions of this MIB." + MODULE -- this module + MANDATORY-GROUPS { + ipoGenv2NotificationObjectsGroup, + ipoGenEntGenNotificationsGroup, + ipoGenSvcNotificationsGroup + } + GROUP ipoGenSOGNotificationObjectsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + SOG devices." + GROUP ipoGenSvcSOGNotificationsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + SOG devices." + GROUP ipoGenUPriLicSvcNotificationsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + systems that support the Universal PRI trunk module such as + the IP500." + ::= { ipoGenCompliances 4 } + +ipoGen5Compliance MODULE-COMPLIANCE + STATUS deprecated + DESCRIPTION + "The compliance statement for IP Office agents which implement + version 2.00.04 and later versions of this MIB." + MODULE -- this module + MANDATORY-GROUPS { + ipoGenv2NotificationObjectsGroup, + ipoGenEntGenNotificationsGroup, + ipoGenSvcNotificationsGroup + } + GROUP ipoGenSOGNotificationObjectsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + SOG devices." + GROUP ipoGenSvcSOGNotificationsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + SOG devices." + GROUP ipoGenUPriLicSvcNotificationsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + systems that support the Universal PRI trunk module such as + the IP500." + GROUP ipoGenQosMonNotificationObjectsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + systems that support the QoS monitoring such as the IP500." + GROUP ipoGenSvcQoSMonNotificationsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + systems that support the QoS monitoring such as the IP500." + ::= { ipoGenCompliances 5 } + +ipoGen6Compliance MODULE-COMPLIANCE + STATUS deprecated + DESCRIPTION + "The compliance statement for IP Office agents which implement + version 2.00.03 and later versions of this MIB." + MODULE -- this module + MANDATORY-GROUPS { + ipoGenv2NotificationObjectsGroup, + ipoGenEntGenNotificationsGroup, + ipoGenSvcNotificationsGroup + } + GROUP ipoGenSOGNotificationObjectsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + SOG devices." + GROUP ipoGenSvcSOGNotificationsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + SOG devices." + GROUP ipoGenUPriLicSvcNotificationsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + systems that support the Universal PRI trunk module such as + the IP500." + GROUP ipoGenSvcQoSMonNotificationsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + systems that support the QoS monitoring such as the IP500." + GROUP ipoGenSvcSystemShutdownNotificationsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + systems that support the system shutdown such as the IP406v2, + IP412, IP500 and IP500v2." + GROUP ipoGenSvcSystemShutdownObjectGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + systems that support the system shutdown such as the IP406v2, + IP412, IP500 and IP500v2." + GROUP ipoGenSDcardNotificationsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + systems that support an SD Card for primary operation" + GROUP ipoGenSDcardNotificationObjectsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + systems that support an SD Card for primary operation" + ::= { ipoGenCompliances 6 } + +ipoGen7Compliance MODULE-COMPLIANCE + STATUS current + DESCRIPTION + "The compliance statement for IP Office agents which implement + version 2.00.07 and later versions of this MIB." + MODULE -- this module + MANDATORY-GROUPS { + ipoGenv2NotificationObjectsGroup, + ipoGenEntGenNotificationsGroup, + ipoGenSvcNotificationsGroup, + ipoGenSvcMiscNotificationsGroup, + ipoGenSvcMiscNotificationObjectsGroup + } + GROUP ipoGenSOGNotificationObjectsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + SOG devices." + GROUP ipoGenSvcSOGNotificationsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + SOG devices." + GROUP ipoGenUPriLicSvcNotificationsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + systems that support the Universal PRI trunk module such as + the IP500." + GROUP ipoGenSvcQoSMonNotificationsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + systems that support the QoS monitoring such as the IP500." + GROUP ipoGenSvcSystemShutdownNotificationsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + systems that support the system shutdown such as the IP406v2, + IP412, IP500 and IP500v2." + GROUP ipoGenSvcSystemShutdownObjectGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + systems that support the system shutdown such as the IP406v2, + IP412, IP500 and IP500v2." + GROUP ipoGenSDcardNotificationsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + systems that support an SD Card for primary operation" + GROUP ipoGenSDcardNotificationObjectsGroup + DESCRIPTION + "Implementation of this group is only mandatory for IP Office + systems that support an SD Card for primary operation" + ::= { ipoGenCompliances 7 } + +-- +-- MIB groupings +-- + +ipoGenNotificationObjectsGroup OBJECT-GROUP + OBJECTS { + ipoGTEventSeverity, + ipoGTEventDateTime, + ipoGTEventEntity, + ipoGTEventLoopbackStatus, + ipoGTEventAppEntity, + ipoGTEventAppEvent + } + STATUS deprecated + DESCRIPTION + "Objects that are contained in IP Office wide notifications. + + **NOTE: This group is deprecated and replaced by + ipoGenv2NotificationObjectsGroup." + ::= { ipoGenGroups 1 } + +ipoGenNotificationsGroup NOTIFICATION-GROUP + NOTIFICATIONS { + ipoGenEntityFailureEvent, + ipoGenEntityOperationalEvent, + ipoGenEntityErrorEvent, + ipoGenEntityChangeEvent, + ipoGenLKSCommsFailureEvent, + ipoGenLKSCommsOperationalEvent, + ipoGenLKSCommsErrorEvent, + ipoGenLKSCommsChangeEvent, + ipoGenLoopbackEvent, + ipoGenAppOperationalEvent, + ipoGenAppFailureEvent, + ipoGenAppEvent + } + STATUS deprecated + DESCRIPTION + "The notifications which indicate specific changes in the + state of the IP Office system. + + **NOTE: This group is deprecated and replaced by + ipoGenSvcNotificationsGroup." + ::= { ipoGenGroups 2 } + +ipoGenSOGNotificationObjectsGroup OBJECT-GROUP + OBJECTS { + ipoGTEventHostAddress, + ipoGTEventSOGMode + } + STATUS current + DESCRIPTION + "Objects that are contained in IP Office SOG notifications." + ::= { ipoGenGroups 3 } + +ipoGenSOGNotificationsGroup NOTIFICATION-GROUP + NOTIFICATIONS { + ipoGenSogHostFailureEvent, + ipoGenSogModeChangeEvent + } + STATUS deprecated + DESCRIPTION + "The notifications which indicate specific changes in the + state of the IP Office SOG system. + + **NOTE: This group is deprecated and replaced by + ipoGenSvcNotificationsGroup." + ::= { ipoGenGroups 4 } + +ipoGenv2NotificationObjectsGroup OBJECT-GROUP + OBJECTS { + ipoGTEventDateTime, + ipoGTEventEntity, + ipoGTEventAppEntity, + ipoGTEventAppEvent, + ipoGTEventStdSeverity, + ipoGTEventDevID, + ipoGTEventEntityName, + ipoGTEventLoopbackStatusBits + } + STATUS current + DESCRIPTION + "Objects that are contained in IP Office wide notifications." + ::= { ipoGenGroups 5 } + +ipoGenEntGenNotificationsGroup NOTIFICATION-GROUP + NOTIFICATIONS { + ipoGenColdStartSvcEvent, + ipoGenWarmStartSvcEvent, + ipoGenLinkDownSvcEvent, + ipoGenLinkUpSvcEvent, + ipoGenAuthFailureSvcEvent + } + STATUS current + DESCRIPTION + "IP Office Enterpise versions of the generic traps as defined + RFC1215 that provide more identification of the entity + concerned." + ::= { ipoGenGroups 6 } + +ipoGenSvcNotificationsGroup NOTIFICATION-GROUP + NOTIFICATIONS { + ipoGenEntityFailureSvcEvent, + ipoGenEntityOperationalSvcEvent, + ipoGenEntityErrorSvcEvent, + ipoGenEntityChangeSvcEvent, + ipoGenLKSCommsFailureSvcEvent, + ipoGenLKSCommsOperationalSvcEvent, + ipoGenLKSCommsErrorSvcEvent, + ipoGenLKSCommsChangeSvcEvent, + ipoGenLoopbackSvcEvent, + ipoGenAppOperationalSvcEvent, + ipoGenAppFailureSvcEvent, + ipoGenAppSvcEvent + } + STATUS current + DESCRIPTION + "The service notifications which indicate specific changes in + the state of the IP Office system." + ::= { ipoGenGroups 7 } + +ipoGenSvcSOGNotificationsGroup NOTIFICATION-GROUP + NOTIFICATIONS { + ipoGenSogHostFailureSvcEvent, + ipoGenSogModeChangeSvcEvent + } + STATUS current + DESCRIPTION + "The service notifications which indicate specific changes in + the state of the IP Office SOG system." + ::= { ipoGenGroups 8 } + +ipoGenUPriLicSvcNotificationsGroup NOTIFICATION-GROUP + NOTIFICATIONS { + ipoGenUPriLicChansReducedSvcEvent, + ipoGenUPriLicCallRejectedSvcEvent + } + STATUS current + DESCRIPTION + "The service notifications which indicate specific changes + related to the state licensing and Universal PRI trunks on the + IP Office system." + ::= { ipoGenGroups 9 } + +ipoGenQosMonNotificationObjectsGroup OBJECT-GROUP + OBJECTS { + ipoGTEventQoSMonJitter, + ipoGTEventQoSMonRndTrip, + ipoGTEventQoSMonPktLoss, + ipoGTEventQoSMonCallId, + ipoGTEventQoSMonDevType, + ipoGTEventQoSMonDevId, + ipoGTEventQoSMonExtnNo + } + STATUS current + DESCRIPTION + "Additional objects that are contained in IP Office QOS + Monitoring notifications." + ::= { ipoGenGroups 10 } + +ipoGenSvcQoSMonNotificationsGroup NOTIFICATION-GROUP + NOTIFICATIONS { + ipoGenQoSMonSvcEvent + } + STATUS current + DESCRIPTION + "The service notifications which indicate specific changes + related to the value of QoS parameters for a call on a physical + entity on the IP Office system." + ::= { ipoGenGroups 11 } + +ipoGenSvcSystemShutdownObjectGroup OBJECT-GROUP + OBJECTS { + ipoGTEventSystemShutdownSource, + ipoGTEventSystemShutdownTimeout + } + STATUS current + DESCRIPTION + "Additional objects that are contained in the system shutdown + notification" + ::= { ipoGenGroups 12 } + +ipoGenSvcSystemShutdownNotificationsGroup NOTIFICATION-GROUP + NOTIFICATIONS { + ipoGenSystemShutdownSvcEvent + } + STATUS current + DESCRIPTION + "The service notifications which indicate specific changes + related to the system shutdown performed on the IP Office system." + ::= { ipoGenGroups 13 } + + +ipoGenSDcardNotificationObjectsGroup OBJECT-GROUP + OBJECTS { + ipoGTEventMemoryCardSlotId, + ipoGTEventNoValidKeyReason + } + STATUS current + DESCRIPTION + "Additional objects that are contained in IP Office SD card + notifications." + ::= { ipoGenGroups 14 } + +ipoGenSDcardNotificationsGroup NOTIFICATION-GROUP + NOTIFICATIONS { + ipoGenAppOperationalSvcEvent, + ipoGenAppFailureSvcEvent, + ipoGenAppSvcEvent, + ipoGenSystemRunningBackupEvent, + ipoGenInvalidMemoryCardEvent, + ipoGenNoLicenceKeyDongleEvent, + ipoGenMemoryCardCapacityEvent + } + STATUS current + DESCRIPTION + "The notifications associated with IP Office SD card usage." + ::= { ipoGenGroups 15 } + +ipoGenSvcMiscNotificationObjectsGroup OBJECT-GROUP + OBJECTS { + ipoGTEventReason, + ipoGTEventData, + ipoGTEventAlarmDescription, + ipoGTEventAlarmRemedialAction + } + STATUS current + DESCRIPTION + "Additional objects that are contained in IP Office + notifications to provide additional information to + end user" + ::= { ipoGenGroups 16 } + +ipoGenSvcMiscNotificationsGroup NOTIFICATION-GROUP + NOTIFICATIONS { + ipoGenConfigFailureSvcEvent, + ipoGenConfigOperationalSvcEvent, + ipoGenConfigErrorSvcEvent, + ipoGenConfigChangeSvcEvent, + ipoGenServiceFailureSvcEvent, + ipoGenServiceOperationalSvcEvent, + ipoGenServiceErrorSvcEvent, + ipoGenServiceChangeSvcEvent, + ipoGenTrunkFailureSvcEvent, + ipoGenTrunkOperationalSvcEvent, + ipoGenTrunkErrorSvcEvent, + ipoGenTrunkChangeSvcEvent, + ipoGenLinkFailureSvcEvent, + ipoGenLinkOperationalSvcEvent, + ipoGenLinkErrorSvcEvent, + ipoGenLinkChangeSvcEvent, + ipoGenEmergencyCallSvcEvent + } + STATUS current + DESCRIPTION + "The notifications indicating change in status + related to four areas: Configuration, Sevice, + Trunk and Link" + ::= { ipoGenGroups 17 } + + + + +END diff --git a/mibs/avaya/IPO-PHONES-MIB.mib b/mibs/avaya/IPO-PHONES-MIB.mib new file mode 100644 index 000000000..e21706bb5 --- /dev/null +++ b/mibs/avaya/IPO-PHONES-MIB.mib @@ -0,0 +1,691 @@ +--======================================================== +-- +-- MIB : IPO-PHONES Avaya Inc. +-- +-- Version : 2.00.06 9 February 2011 +-- +--======================================================== +-- +-- Copyright (c) 2003 - 2011 Avaya Inc. +-- All Rights Reserved. +-- +--======================================================== +IPO-PHONES-MIB DEFINITIONS ::= BEGIN + +IMPORTS + MODULE-IDENTITY, OBJECT-TYPE, + NOTIFICATION-TYPE, Integer32, Unsigned32, IpAddress + FROM SNMPv2-SMI + TEXTUAL-CONVENTION, DisplayString, PhysAddress + FROM SNMPv2-TC + MODULE-COMPLIANCE, OBJECT-GROUP, + NOTIFICATION-GROUP + FROM SNMPv2-CONF + sysDescr + FROM SNMPv2-MIB + IndexInteger + FROM DIFFSERV-MIB + ipoGenMibs, ipoGTEventDateTime, ipoGTEventSeverity, + ipoGTEventStdSeverity, ipoGTEventDevID, ipoGTEventEntityName + FROM IPO-MIB + ; + +ipoPhonesMIB MODULE-IDENTITY + LAST-UPDATED "201102091521Z" -- 9 February 2011 + ORGANIZATION "Avaya Inc." + CONTACT-INFO + "Avaya Customer Services + Postal: Avaya, Inc. + 211 Mt Airy Rd. + Basking Ridge, NJ 07920 + USA + Tel: +1 908 953 6000 + + WWW: http://www.avaya.com" + DESCRIPTION + "Avaya IP Office Phones MIB + + The MIB module for representing the phones present on a Avaya + IP Office stack." + + + REVISION "201102091521Z" -- 9 February 2011 + DESCRIPTION + "Rev 2.00.06 + PhoneType: adding more original Nortel phone sets." + REVISION "200902181309Z" -- 18 February 2009 + DESCRIPTION + "Rev 2.00.05 + PhoneType enumerations for a number of SIP phones, + the 1400 phones and PhoneManager IP SoftPhone added." + REVISION "200806121506Z" -- 12 June 2008 + DESCRIPTION + "Rev 2.00.04 + PhoneType enumerations for the 1700 phones added." + REVISION "200804171630Z" -- 17 April 2008 + DESCRIPTION + "Rev 2.00.03 + Added descriptions for new PhoneType enumerations + and corrected versioning." + REVISION "200703281209Z" -- 28 March 2007 + DESCRIPTION + "Rev 2.00.02 + Added the port number, module number, ip address, + and physical address, to the ipoPhonesTable" + REVISION "200702241209Z" -- 24 February 2007 + DESCRIPTION + "Rev 2.00.01 + Added descriptions for new PhoneType enumerations + and corrected versioning." + REVISION "200606290000Z" -- 29 June 2006 + DESCRIPTION + "Rev 2.00.00 + Traps/notifications revised to provide more information about + the entity and device concerned." + REVISION "200601310000Z" -- 31 January 2006 + DESCRIPTION + "Rev 1.00.08 + Corrected enumeration for 5621 IP phones." + REVISION "200511220000Z" -- 22 November 2005 + DESCRIPTION + "Rev 1.00.07 + Revised for 5621 IP phones." + REVISION "200507211050Z" -- 21 July 2005 + DESCRIPTION + "Rev 1.00.06 + Revised for 4621 IP phones." + REVISION "200507211030Z" -- 21 July 2005 + DESCRIPTION + "Rev 1.00.05 + Revised for 5601 and 5602 Phones" + REVISION "200503040000Z" -- 4 March 2005 + DESCRIPTION + "Rev 1.00.04 + Revised for IP Soft Phones" + REVISION "200501060000Z" -- 6 January 2005 + DESCRIPTION + "Rev 1.00.03 + Revised for 5610/5620 IP phones." + REVISION "200412200000Z" -- 20 December 2004 + DESCRIPTION + "Rev 1.00.02 + Revised for additional phone support." + REVISION "200403030000Z" -- 3 March 2004 + DESCRIPTION + "Rev 1.00.01 + Revised for external publication." + REVISION "200310100000Z" -- 10 October 2003 + DESCRIPTION + "Rev 1.0.0 + The first published version of this MIB module." + ::= { ipoGenMibs 1 } + +ipoPhonesMibNotifications OBJECT IDENTIFIER ::= { ipoPhonesMIB 0 } +ipoPhonesMibObjects OBJECT IDENTIFIER ::= { ipoPhonesMIB 1 } +ipoPhonesConformance OBJECT IDENTIFIER ::= { ipoPhonesMIB 2 } + +--******************************************************************** +-- IPOPhone Textual Conventions +--******************************************************************** + +PhoneType ::= TEXTUAL-CONVENTION + STATUS current + DESCRIPTION + "This data type is used as the syntax of the ipoPhoneType + object in the ipoPhonesTable." + SYNTAX INTEGER { + noPhone(1), -- no phone actually connected + genericPhone(2), -- for phone found that we can handle in + -- some way but exact type not recognised + -- may or may not be needed + potPhone(3), -- Generic Analogue/POT Phone + dtPhone(4), -- Generic DT Phone + a4406Dplus(5), -- Avaya 4406D+ DCP Phone + a4412Dplus(6), -- Avaya 4412D+ DCP Phone + a4424Dplus(7), -- Avaya 4424D+ DCP Phone + a4424LDplus(8), -- Avaya 4424LD+ DCP Phone + a9040TransTalk(9), -- Avaya 9040 TransTalk + a6408Dplus(10), -- Avaya 6408D+ DCP Phone + a6416Dplus(11), -- Avaya 6416D+ DCP Phone + a6424Dplus(12), -- Avaya 6424D+ DCP Phone + a4606ip(13), -- Avaya 4606 IP Phone + a4612ip(14), -- Avaya 4612 IP Phone + a4624ip(15), -- Avaya 4624 IP Phone + a4620ip(16), -- Avaya 4620 IP Phone + a4602ip(17), -- Avaya 4602 IP Phone + a2420(18), -- Avaya 2420 DCP Phone + a2010dt(19), -- Avaya 2010 DT Phone + a2020dt(20), -- Avaya 2020 DT Phone + a2030dt(21), -- Avaya 2030 DT Phone + a2050dt(22), -- Avaya 2050 DT Phone + act5(23), -- Avaya CT5 Phone + att3(24), -- Avaya TT3 Phone + att5(25), -- Avaya TT5 Phone + a5420(26), -- Avaya 5420 DCP Phone + a5410(27), -- Avaya 5410 DCP Phone + a4601ip(28), -- Avaya 4601 IP Phone + a4610ip(29), -- Avaya 4610 IP Phone + ablf(30), -- Avaya BLF Phone + a2402(31), -- Avaya 2402 DCP Phone + a2410(32), -- Avaya 2410 DCP Phone + a5610ip(33), -- Avaya 5610 IP Phone + a5620ip(34), -- Avaya 5620 IP Phone + softIPPhone(35), -- Avaya IP Soft Phone + a5601ip(36), -- Avaya 5601 IP Phone + a5602ip(37), -- Avaya 5602 IP Phone + a4621ip(38), -- Avaya 4621 IP Phone + a5621ip(39), -- Avaya 5621 IP Phone + a4625ip(40), -- Avaya 4625 IP Phone + a5402(41), -- Avaya 5402 DCP Phone + h323Phone(42), -- Generic H.323 Phone + sipPhone(43), -- Generic SIP Phone + t3Compact(44), -- Avaya T3 Compact Phone + t3Classic(45), -- Avaya T3 Classic Phone + t3Comfort(46), -- Avaya T3 Comfort Phone + t3Phone(47), -- Avaya T3 Generic Phone + t3compactIP(48), -- Avaya T3 Compact IP Phone + t3classicIP(49), -- Avaya T3 Classic IP Phone + t3comfortIP(50), -- Avaya T3 Comfort IP Phone + avayaSip(51), -- Avaya Generic SIP Phone + admmPhone(52), -- Avaya Generic ADMM (IP DECT) Phone + a9620ip(53), -- Avaya 9620 IP Phone + a9630ip(54), -- Avaya 9630 IP Phone + telecommuter(55), -- Telecommuting homeworker + mobiletwin(56), -- Mobile one-X phone + a9640ip(57), -- Avaya 9640 IP Phone + a9650ip(58), -- Avaya 9650 IP Phone + a9610ip(59), -- Avaya 9610 IP Phone + a1603ip(60), -- Avaya 1603 IP Phone + a1608ip(61), -- Avaya 1608 IP Phone + a1616ip(62), -- Avaya 1616 IP Phone + a1703ip(63), -- Avaya 1703 IP Phone + a1708ip(64), -- Avaya 1708 IP Phone + a1716ip(65), -- Avaya 1716 IP Phone + s60Sip(66), -- S60 SIP + sp320Sip(67), -- SP320 SIP + sp601Sip(68), -- SP601 SIP + a10ataSip(69), -- A10ATA SIP + pmataSip(70), -- Patton M-ATA SIP + ip22Sip(71), -- Innovaphone IP22 SIP + ip24Sip(72), -- Innovaphone IP24 SIP + gxp2000Sip(73), -- Grandstream GXP2000 SIP + gxp2020Sip(74), -- Grandstream GXP2000 SIP + eyebeamSip(75), -- CounterPath eyeBeam SIP + a1403(76), -- Avaya 1403 Phone + a1408(77), -- Avaya 1408 Phone + a1416(78), -- Avaya 1416 Phone + a1450(79), -- Avaya 1450 Phone + ip28Sip(80), + phoneManagerIP(81), -- Phone Manager IP + a1503(82), -- Avaya 1503 Phone + a1508(83), -- Avaya 1508 Phone + a1516(84), -- Avaya 1516 Phone + a1550(85), -- Avaya 1550 Phone + a1603Lip(86), -- Avaya 1603L IP Phone + a1608Lip(87), -- Avaya 1608L IP Phone + a1616Lip(88), -- Avaya 1616L IP Phone + softPhoneSip(89), -- SIP SoftPhone + etr34d(90), -- ETR-34D + etr18d(91), -- ETR-18D + etr6d(92), -- ETR-6D + etr34(93), -- ETR-34 + etr18(94), -- ETR-18 + etr6(95), -- ETR-6 + etrpots(96), -- ETR Pots + doorphone1(97), -- Door phone 1 + doorphone2(98), -- Door phone 2 + bstT7316e(99), -- BST 7316E + a9620Sip(100), -- Avaya 9620L/C SIP Phone + a9630Sip(101), -- Avaya 9630G SIP Phone + a9640Sip(102), -- Avaya 9640/G SIP Phone + a9650Sip(103), -- Avaya 9650/C SIP Phone + a96xxSip(104), -- Avaya 96xx SIP Phone + a1603Sip(105), -- Avaya 1603 Blaze SIP Phone + a9404(106), -- Avaya 9404 Phone + a9408(107), -- Avaya 9408 Phone + a9504(108), -- Avaya 9504 Phone + a9508(109), -- Avaya 9508 Phone + a9608ip(110), -- Avaya 9608 IP Phone + a9611ip(111), -- Avaya 9611 IP Phone + a9621ip(112), -- Avaya 9621 IP Phone + a9641ip(113), -- Avaya 9641 IP Phone + a3720Admm(114), -- Avaya 3720 ADMM (IP DECT) Phone + a3725Admm(115), -- Avaya 3725 ADMM (IP DECT) Phone + a1010Sip(116), -- Avaya 1010 SIP Video Phone + a1040Sip(117), -- Avaya 1040 SIP Video Phone + a1120ESip(118), -- Avaya 1120E SIP Phone + a1140ESip(119), -- Avaya 1140E SIP Phone + a1220Sip(120), -- Avaya 1220 SIP Phone + a1230Sip(121), -- Avaya 1230 SIP Phone + a1692Sip(122), -- Avaya 1692 SIP Phone + pvvxSip(123), -- Polycom VVX SIP + gxv3140Sip(124), -- Grandstream GXV3140 SIP + a3740Admm(125), -- Avaya 3740 ADMM (IP DECT) Phone + a3749Admm(126), -- Avaya 3749 ADMM (IP DECT) Phone + bstT7316(127), -- Original Nortel T7316 BST Phone + bstT7208(128), -- Original Nortel T7208 BST Phone + bstM7208(129), -- Original Nortel M7208 BST Phone + bstM7310(130), -- Original Nortel M7310 BST Phone + bstM7310blf(131), -- Original Nortel M7310 BST Phone with BLF Module + bstM7324(132), -- Original Nortel M7324 BST Phone with BLF Module + bstM7100(133), -- Original Nortel M7100 BST Phone with BLF Module + bstT7100(134), -- Original Nortel T7100 BST Phone with BLF Module + bstT7000(135), -- Original Nortel T7000 BST Phone with BLF Module + bstDectA(136), -- Original Nortel Dect handset model a + bstDectB(137), -- Original Nortel Dect handset model b + bstDectC(138), -- Original Nortel Dect handset model c + bstDoorphone(139), -- Original Nortel Doorphone + bstT7406(140), -- Original Nortel T7406 cordless phone + bstT7406E(141), -- Original Nortel T7406E cordless phone + bstM7310N(142), -- Original Nortel M7310N stimulus phone + bstAcu(143), -- Original Nortel Audio Conferencing Unit + bstM7100N(144), -- Original Nortel M7100N stimulus phone + bstM7324N (145), -- Original Nortel M7324N stimulus phone + bstM7208N(146), -- Original Nortel M7208N stimulus phone + aB179Sip(147), -- Avaya B179 Sip Phone (Konftel 300IP) + bstAta(148), -- Bst ATA + aA175Sip(149), -- Avaya A175 Sip Phone + aOneXSip(150), -- Avaya oneX Sip Phone + aFlareSip(151), -- Avaya Flare Sip Phone + aD100(152), -- Avaya D100 Sip Phone + aRadvisionXT1000(153), -- Avaya RadvisionXT1000 Sip Phone + aRadvisionXT1200(154), -- Avaya RadvisionXT1200 Sip Phone + aRadvisionXT4000(155), -- Avaya RadvisionXT4000 Sip Phone + aRadvisionXT4200(156), -- Avaya RadvisionXT4200 Sip Phone + aRadvisionXT5000(157), -- Avaya RadvisionXT5000 Sip Phone + aRadvisionXTPiccolo(158),-- Avaya RadvisionXTPiccolo Sip Phone + aRadvisionScopiaMCU(159),-- Avaya RadvisionScopiaMCU Sip Phone + aRadvisionScopiaVC240(160),-- Avaya RadvisionScopiaVC240 Sip Phone + aOneXSipMobile(161), -- Avaya OneX Sip Mobile Phone + aACCSServer(162), -- Avaya Contact Center ACCS + aCIEServer(163), -- Avaya Contact Center CIE + aE129SIP(164), -- Avaya E129 SIP phone (Grandstream OEM) + aE159SIP(165), -- Avaya E159 SIP phone (Invoxia OEM) + aE169SIP(166), -- Avaya E169 SIP phone (Invoxia OEM) + aOneXMsiSIP(167), -- Avaya Microsoft Lync SIP plugin + aRadvisionXT240(168), -- Avaya Radvision XT240 Scopia SIP phone + aWebRTCSIP(169), -- Avaya WebRTC Client + softPhoneSipMac(170) -- SIP Mac SoftPhone + } + +--******************************************************************** +-- IPOPhone Objects +--******************************************************************** + +-- MIB contains a single group + +ipoPhones OBJECT IDENTIFIER ::= { ipoPhonesMibObjects 1 } + +ipoPhonesNumber OBJECT-TYPE + SYNTAX Integer32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The number of phone interfaces (regardless of their current + state) present on this system." + ::= { ipoPhones 1 } + +-- the Phones table + +-- The Phones table contains information on the phones connected to a +-- IP Office stack entity. + +ipoPhonesTable OBJECT-TYPE + SYNTAX SEQUENCE OF IpoPhonesEntry + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "A list of phone entries. The number of entries is given by + the value of ipoPhonesNumber." + ::= { ipoPhones 2 } + +ipoPhonesEntry OBJECT-TYPE + SYNTAX IpoPhonesEntry + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "An entry containing management information applicable to a + particular IP Office phone." + INDEX { ipoPhonesIndex } + ::= { ipoPhonesTable 1 } + +IpoPhonesEntry ::= + SEQUENCE { + ipoPhonesIndex IndexInteger, + ipoPhonesExtID Integer32, + ipoPhonesExtNumber Integer32, + ipoPhonesUserShort DisplayString, + ipoPhonesUserLong DisplayString, + ipoPhonesType PhoneType, + ipoPhonesPort Unsigned32, + ipoPhonesPortNumber Unsigned32, + ipoPhonesModuleNumber Unsigned32, + ipoPhonesIPAddress IpAddress, + ipoPhonesPhysAddress PhysAddress + } + +ipoPhonesIndex OBJECT-TYPE + SYNTAX IndexInteger + MAX-ACCESS read-only -- for SMIv1 compatability rather than not-accessible + STATUS current + DESCRIPTION + "A unique value, greater than zero, for each phone. It is + recommended that values are assigned contiguously starting + from 1. The value for each phone sub-layer must remain + constant at least from one re-initialization of the entity's + network management system to the next re- initialization." + ::= { ipoPhonesEntry 1 } + +ipoPhonesExtID OBJECT-TYPE + SYNTAX Integer32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The numerical logical extension entity identifier assigned to + the phone on the IP Office entity." + ::= { ipoPhonesEntry 2 } + +ipoPhonesExtNumber OBJECT-TYPE + SYNTAX Integer32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The number that should be dialed to reach this phone on the + IP Office entity." + ::= { ipoPhonesEntry 3 } + +ipoPhonesUserShort OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..15)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The short form of the name of the user of this phone which is + used in caller display. This is quite often the forename of + the user." + ::= { ipoPhonesEntry 4 } + +ipoPhonesUserLong OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..31)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The long form of the name of the user of this phone. This is + normally the full name (forename and surname) of the user." + ::= { ipoPhonesEntry 5 } + +ipoPhonesType OBJECT-TYPE + SYNTAX PhoneType + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The type of phone that is connected to this IP Office logical + phone extension." + ::= { ipoPhonesEntry 6 } + +ipoPhonesPort OBJECT-TYPE + SYNTAX Unsigned32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "A reference, by entPhysicalIndex value, to the + EntPhysicalEntry representing the physical port entity that + this phone entry is associated with in an entity MIB + instantiation within the IP Office agent. If no MIB + definitions specific to the particular media are available, or + the entry is for a IP phone which may not be connected to a + physical port on the IP Office, the value should be set to the + value 0." + ::= { ipoPhonesEntry 7 } + +ipoPhonesPortNumber OBJECT-TYPE + SYNTAX Unsigned32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The port number on the module that the operator uses to + identify the port. + + The port numbers on the expansion modules will follow standard + numbering, beginning at 1 and incrementing until the last port. + The phone ports on the base units, however, are numbered + according to how they are collected into 'banks' on the unit. + + IP Office IP500 + The entire front of the product consists of 4 plug-in modules. + Each module has its own numbering from 1..12. + So from the left: 101..112, 201..212, etc. + + IP Office IP412 + There is no way to plug phones into the unit, so only + expansion modules should be present. + + IP Office IP406v2 + The leftmost bank of ports are Digital (DS/DT) and labeled + as 1-8 on the product, and so are labelled ports 101..108 + in the mib. + + The next bank of ports are Analogue and labeled as 1-2 + on the product and so are labelled ports 201..202 in the mib. + + The next bank of phones are LAN and labeled as 1-8 on the + product. Not phones, so not in this mib. + + IP Office Small Office Edition + The leftmost bank of 4 ports are Trunk ports, and so are not + available in this mib. + + The next bank of 8 ports are Digital (DS/DT), and so are + labelled ports 101..108 in the mib. + + The next bank of 4 ports are Analogue, and so are labelled + ports 201..204 in the mib. + + The next bank of ports are LAN, and so are not available in + this mib." + ::= { ipoPhonesEntry 8 } + +ipoPhonesModuleNumber OBJECT-TYPE + SYNTAX Unsigned32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The number that the operator uses to + identify the module. + + The module numbers are assigned according to the expansion + port number that it's plugged into on the Control unit. + + Example: Module number '2' = Expansion unit plugged into + expansion port 2 on the Control unit. + + Module number '0' is reserved for the Control unit itself." + ::= { ipoPhonesEntry 9 } + +ipoPhonesIPAddress OBJECT-TYPE + SYNTAX IpAddress + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The IP Address of the phone. In network-byte order. In the usual + IP Address format - xxx.xxx.xxx.xxx. + + The IP address will only be present if the phone is an IP phone. If + it is not, it will contain zeros (0.0.0.0)." + + ::= { ipoPhonesEntry 10 } + +ipoPhonesPhysAddress OBJECT-TYPE + SYNTAX PhysAddress + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The Physical Address of the phone, such as the MAC Address. + + The physical address will only be present if the phone is an IP + phone. If it is not, it will contain zeros (00.00.00.00.00.00)." + + ::= { ipoPhonesEntry 11 } + +--******************************************************************** +-- IPOPhone Notifications +--******************************************************************** + +-- +-- Notifications +-- + +ipoPhonesChangeEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventSeverity, + ipoGTEventDateTime, + ipoPhonesExtID, + ipoPhonesType, + ipoPhonesPort + } + STATUS deprecated + DESCRIPTION + "This notification is generated whenever the type of phone + connected to a logical extension entity is detected as having + changed after completion of normal start up of the Agent + entity. + + Its purpose is to allow a management application to identify + the removal or switching of phone types on the IP Office + entity. + + **NOTE: This notification is deprecated and replaced by + ipoPhonesChangeSvcEvent." + ::= { ipoPhonesMibNotifications 1 } + +ipoPhonesChangeSvcEvent NOTIFICATION-TYPE + OBJECTS { + ipoGTEventStdSeverity, + ipoGTEventDateTime, + ipoGTEventDevID, + sysDescr, + ipoPhonesExtID, + ipoPhonesType, + ipoPhonesPort, + ipoGTEventEntityName + } + STATUS current + DESCRIPTION + "This notification is generated whenever the type of phone + connected to a logical extension entity is detected as having + changed after completion of normal start up of the Agent + entity. + + Its purpose is to allow a management application to identify + the removal or switching of phone types on the IP Office + entity. + + Newer implementations of this MIB should put in place this + event in favour of ipoPhonesChangeEvent." + ::= { ipoPhonesMibNotifications 2 } + +--******************************************************************** +-- IPO-PHONES compliance +--******************************************************************** + +ipoPhonesCompliances OBJECT IDENTIFIER ::= { ipoPhonesConformance 1 } +ipoPhonesGroups OBJECT IDENTIFIER ::= { ipoPhonesConformance 2 } + +-- +-- compliance statements +-- + +ipoPhonesCompliance MODULE-COMPLIANCE + STATUS deprecated + DESCRIPTION + "The compliance statement for the IP Office Phones MIB" + MODULE -- this module + MANDATORY-GROUPS { + ipoPhonesGroup, + ipoPhonesNotificationsGroup + } + ::= { ipoPhonesCompliances 1 } + +ipoPhonesv2Compliance MODULE-COMPLIANCE + STATUS deprecated + DESCRIPTION + "The compliance statement for the IP Office Phones MIB" + MODULE -- this module + MANDATORY-GROUPS { + ipoPhonesGroup, + ipoPhonesv2NotificationsGroup + } + ::= { ipoPhonesCompliances 2 } + +ipoPhonesv3Compliance MODULE-COMPLIANCE + STATUS current + DESCRIPTION + "The compliance statement for the IP Office Phones MIB" + MODULE -- this module + MANDATORY-GROUPS { + ipoPhonesGroup, + ipoPhones2Group, + ipoPhonesv2NotificationsGroup + } + ::= { ipoPhonesCompliances 3 } + +-- +-- MIB groupings +-- + +ipoPhonesGroup OBJECT-GROUP + OBJECTS { + ipoPhonesNumber, + ipoPhonesIndex, + ipoPhonesExtID, + ipoPhonesExtNumber, + ipoPhonesUserShort, + ipoPhonesUserLong, + ipoPhonesType, + ipoPhonesPort + } + STATUS current + DESCRIPTION + "The collection of objects which are used to represent IP + Office phones, for which a single agent provides management + information." + ::= { ipoPhonesGroups 1 } + +ipoPhonesNotificationsGroup NOTIFICATION-GROUP + NOTIFICATIONS { + ipoPhonesChangeEvent + } + STATUS deprecated + DESCRIPTION + "The notifications which indicate specific changes in the + state of IP Office phones." + ::= { ipoPhonesGroups 2 } + +ipoPhonesv2NotificationsGroup NOTIFICATION-GROUP + NOTIFICATIONS { + ipoPhonesChangeSvcEvent + } + STATUS current + DESCRIPTION + "The notifications which indicate specific changes in the + state of IP Office phones for newer implementations of this + MIB." + ::= { ipoPhonesGroups 3 } + +ipoPhones2Group OBJECT-GROUP + OBJECTS { + ipoPhonesPortNumber, + ipoPhonesModuleNumber, + ipoPhonesIPAddress, + ipoPhonesPhysAddress + } + STATUS current + DESCRIPTION + "Additional collection of objects which are used to represent + physical information about IP Office phones, for which a + single agent provides management information. These objects + provide more information on where phones are directly + connected to an IP Office and further details on IP Phones for + their identification." + ::= { ipoPhonesGroups 4 } + +END diff --git a/mibs/avaya/IPO-PROD-MIB.mib b/mibs/avaya/IPO-PROD-MIB.mib new file mode 100644 index 000000000..d4310f145 --- /dev/null +++ b/mibs/avaya/IPO-PROD-MIB.mib @@ -0,0 +1,1202 @@ +--======================================================== +-- +-- MIB : IPO-PROD Avaya Inc. +-- +-- Version : 1.0.26 06 Aug 2014 +-- +--======================================================== +-- +-- Copyright (c) 2003 - 2012 Avaya Inc. +-- All Rights Reserved. +-- +--======================================================== +IPO-PROD-MIB DEFINITIONS ::= BEGIN + +IMPORTS + MODULE-IDENTITY, OBJECT-IDENTITY + FROM SNMPv2-SMI + products + FROM AVAYAGEN-MIB; + +ipoProdMIB MODULE-IDENTITY + LAST-UPDATED "201408060000Z" -- 06 Aug 2014 + ORGANIZATION "Avaya Inc." + CONTACT-INFO + "Avaya Customer Services + Postal: Avaya, Inc. + 211 Mt Airy Rd. + Basking Ridge, NJ 07920 + USA + Tel: +1 908 953 6000 + + WWW: http://www.avaya.com" + + DESCRIPTION + "Avaya IP Office Products OID tree. + + This MIB module defines the product/sysObjectID values for + use with Avaya IP Office family of telephone switches." + + REVISION "201408060000Z" -- 06 Aug 2014 + DESCRIPTION + "Rev 1.00.26 + J Modules are now part of IP500v2." + + REVISION "201405300000Z" -- 30 May 2014 + DESCRIPTION + "Rev 1.00.25 + Additional IOD for IP500v2 Select and + IP Office Server Edition Expansion Select Mode." + REVISION "201402270000Z" -- 27 Feb 2014 + DESCRIPTION + "Rev 1.00.24 + Additional IOD for IP 500 UCM V2 module" + REVISION "201312100000Z" -- 10 Dec 2013 + DESCRIPTION + "Rev 1.00.23 + Update description for Unified Communications Module" + REVISION "201207230000Z" -- 23 July 2012 + DESCRIPTION + "Rev 1.00.22 + Additional IOD for IP 500 ATM4U V2 module." + REVISION "201203260000Z" -- 26 March 2012 + DESCRIPTION + "Rev 1.00.21 + Additional IOD for IP 500 VCM module." + REVISION "201111141128Z" -- 14 November 2011 + DESCRIPTION + "Rev 1.00.20 + Additional OID for IP Office Server Edition Expansion Mode." + REVISION "201108111658Z" -- 11 August 2011 + DESCRIPTION + "Rev 1.00.19 + Added new C110 UCP Module." + REVISION "201102101457Z" -- 10 February 2011 + DESCRIPTION + "Rev 1.00.18 + Added new OID for TCM 8 card." + REVISION "201102011457Z" -- 01 February 2011 + DESCRIPTION + "Rev 1.00.17 + Added new OID for DS30A Expansion module." + REVISION "201101111630Z" -- 11 January 2011 + DESCRIPTION + "Rev 1.00.16 + Avaya Inside OIDs removed. + Additional OIDs added for Norstar, Branch and Quick IP Office + modes." + REVISION "201006091515Z" -- 09 June 2010 + DESCRIPTION + "Rev 1.00.15 + Added new OID for Combo Card VCM sub module." + REVISION "201004281626Z" -- 28 April 2010 + DESCRIPTION + "Rev 1.00.14 + Added new OID for Avaya Inside." + REVISION "200908261713Z" -- 26 August 2009 + DESCRIPTION + "Rev 1.00.13 + Added new OIDs for IP500v2, combo card and ETR card." + REVISION "200908051048Z" -- 05 August 2009 + DESCRIPTION + "Rev 1.00.12 + Added a new OID for IP500 4 Port Expansion Module." + REVISION "200608161100Z" -- 16 August 2006 + DESCRIPTION + "Rev 1.00.11 + Corrected PRI module defined for IP500 and revised description + for Ethernet wAN link ports to make common across units." + REVISION "200608021752Z" -- 02 August 2006 + DESCRIPTION + "Rev 1.00.10 + Added a new OID for Universal PRI module and revised + descriptions for LAN ports used on IP412." + REVISION "200607132220Z" -- 13 July 2006 + DESCRIPTION + "Rev 1.00.09 + Added further OIDs for missing modules. + Replaced references to IP408 with IP500" + REVISION "200606101416Z" -- 10 June 2006 + DESCRIPTION + "Rev 1.00.08 + Added new OIDs for IP500 chassis and plug-in cards." + REVISION "200606071014Z" -- 07 June 2006 + DESCRIPTION + "Rev 1.00.07 + Added new OID for generic IP Office License dongle." + REVISION "200605241620Z" -- 24 May 2006 + DESCRIPTION + "Rev 1.00.06 + Added new OID for revised variant of ATM4U + trunk module." + REVISION "200605241615Z" -- 24 May 2006 + DESCRIPTION + "Rev 1.00.05 + Corrected descriptions of E1 R2 modules/ports." + REVISION "200604040000Z" -- 04 April 2006 + DESCRIPTION + "Rev 1.00.04 + Added new OIDs for revised (v2) variants of DS and POTS + expansion modules." + REVISION "200408060000Z" -- 06 August 2004 + DESCRIPTION + "Rev 1.00.03 + Added SOG family products." + REVISION "200403030000Z" -- 03 March 2004 + DESCRIPTION + "Rev 1.00.02 + Revised for external publication." + REVISION "200401060000Z" -- 06 January 2004 + DESCRIPTION + "Rev 1.0.1 + New OIDs added for revised 403 and 406 variants." + REVISION "200310100000Z" -- 10 October 2003 + DESCRIPTION + "Rev 1.0.0 + The first published version of this MIB module." + ::= { products 2 } + +-- Product Groups + +ipoProdControllers OBJECT IDENTIFIER ::= { ipoProdMIB 1 } +ipoProdExpModules OBJECT IDENTIFIER ::= { ipoProdMIB 2 } +ipoProdSlots OBJECT IDENTIFIER ::= { ipoProdMIB 3 } +ipoProdSlotModules OBJECT IDENTIFIER ::= { ipoProdMIB 4 } +ipoProdPorts OBJECT IDENTIFIER ::= { ipoProdMIB 5 } +ipoProdDongleModules OBJECT IDENTIFIER ::= { ipoProdMIB 6 } +ipoProdSubModules OBJECT IDENTIFIER ::= { ipoProdMIB 7 } +ipoProdUCModules OBJECT IDENTIFIER ::= { ipoProdMIB 8 } + +-- Controller Product families + +ipoProd401Family OBJECT IDENTIFIER ::= { ipoProdControllers 1 } +ipoProd403Family OBJECT IDENTIFIER ::= { ipoProdControllers 2 } +ipoProd406Family OBJECT IDENTIFIER ::= { ipoProdControllers 3 } +ipoProd412Family OBJECT IDENTIFIER ::= { ipoProdControllers 4 } +ipoProdSmallOfficeEditionFamily OBJECT IDENTIFIER ::= { ipoProdControllers 5 } +ipoProdR403Family OBJECT IDENTIFIER ::= { ipoProdControllers 6 } +ipoProdR406Family OBJECT IDENTIFIER ::= { ipoProdControllers 7 } +ipoProdSogFamily OBJECT IDENTIFIER ::= { ipoProdControllers 8 } +ipoProd500Family OBJECT IDENTIFIER ::= { ipoProdControllers 9 } +ipoProd500v2Family OBJECT IDENTIFIER ::= { ipoProdControllers 10 } + +-- IP Office 401 Family units + +ipoProd401DT2 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP401 + Compact Office DT 2 Telephone Switch" + ::= { ipoProd401Family 1 } + +ipoProd401DT4 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP401 + Compact Office DT 4 Telephone Switch" + ::= { ipoProd401Family 2 } + +ipoProd401DS2 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP401 + Compact Office DS 2 Telephone Switch" + ::= { ipoProd401Family 3 } + +ipoProd401DS4 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP401 + Compact Office DS 4 Telephone Switch" + ::= { ipoProd401Family 4 } + +-- IP Office 403 Family units + +ipoProd403DT OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP403 DT + Office Platform Telephone Switch Controller Unit" + ::= { ipoProd403Family 1 } + +ipoProd403DS OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP403 DS + Office Platform Telephone Switch Controller Unit" + ::= { ipoProd403Family 2 } + +-- IP Office 406 Family units + +ipoProd406 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP406 + Office Platform Telephone Switch Controller Unit" + ::= { ipoProd406Family 1 } + +-- IP Office 412 Family units + +ipoProd412 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP412 + Office Platform Telephone Switch Controller Unit" + ::= { ipoProd412Family 1 } + +-- IP Office - Small Office Edition Family units + +ipoProdSmallOfficeEditionPOTS4 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office - + Small Office Edition Telephone Switch POTS 4" + ::= { ipoProdSmallOfficeEditionFamily 1 } + +ipoProdSmallOfficeEditionPOTS8 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office - + Small Office Edition Telephone Switch POTS 8" + ::= { ipoProdSmallOfficeEditionFamily 2 } + +ipoProdSmallOfficeEditionDT8 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office - + Small Office Edition Telephone Switch DT 8" + ::= { ipoProdSmallOfficeEditionFamily 3 } + +ipoProdSmallOfficeEditionDS8 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office - + Small Office Edition Telephone Switch DS 8" + ::= { ipoProdSmallOfficeEditionFamily 4 } + +-- IP Office Revised 403 Family units + +ipoProdR403DT OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Revised IP403 DT + Office Platform Telephone Switch Controller Unit" + ::= { ipoProdR403Family 1 } + +ipoProdR403DS OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Revised IP403 DS + Office Platform Telephone Switch Controller Unit" + ::= { ipoProdR403Family 2 } + +-- IP Office Revised 406 Family units + +ipoProdR406 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Revised IP406 + Office Platform Telephone Switch Controller Unit (2 POTs, no DS)" + ::= { ipoProdR406Family 1 } + +ipoProdR406DT OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Revised IP406 + Office Platform Telephone Switch Controller Unit (2 POTs, 8 DT)" + ::= { ipoProdR406Family 2 } + +ipoProdR406DS OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Revised IP406 + Office Platform Telephone Switch Controller Unit (2 POTs, 8 DS)" + ::= { ipoProdR406Family 3 } + +ipoProdR406Full OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Revised IP406 + Office Platform Telephone Switch Controller Unit (Full version)" + ::= { ipoProdR406Family 4 } + +-- IP Office - SOG Family units + +ipoProdSogSOEPOTS4 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office - + Small Office Edition Telephone Switch POTS 4" + ::= { ipoProdSogFamily 1 } + +ipoProdSogSOEPOTS8 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office - + Small Office Edition Telephone Switch POTS 8" + ::= { ipoProdSogFamily 2 } + +ipoProdSogSOEDT8 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office - + Small Office Edition Telephone Switch DT 8" + ::= { ipoProdSogFamily 3 } + +ipoProdSogSOEDS8 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office - + Small Office Edition Telephone Switch DS 8" + ::= { ipoProdSogFamily 4 } + +-- IP Office 500 Family units + +ipoProd500Slot4 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP500 + Office Platform Telephone Switch 4 Slot Controller Unit" + ::= { ipoProd500Family 1 } + +ipoProd500Slot8 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP500 + Office Platform Telephone Switch 8 Slot Controller Unit" + ::= { ipoProd500Family 2 } + +-- IP Office 500v2 Family units + +ipoProd500v2IPOffice OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP500v2 + Office Platform Telephone Switch in IP Office Mode" + ::= { ipoProd500v2Family 1 } + +ipoProd500v2Partner OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP500v2 + Office Platform Telephone Switch in Partner Mode" + ::= { ipoProd500v2Family 2 } + +ipoProd500v2Norstar OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP500v2 + Office Platform Telephone Switch in Norstar Mode" + ::= { ipoProd500v2Family 3 } + +ipoProd500v2Branch OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP500v2 + Office Platform Telephone Switch in Branch Gateway Mode" + ::= { ipoProd500v2Family 4 } + +ipoProd500v2Quick OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP500v2 + Office Platform Telephone Switch in Quick Mode" + ::= { ipoProd500v2Family 5 } + +ipoProd500v2SEditionExpansion OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP500v2 + Office Platform Telephone Switch in Server Edition Expansion Mode" + ::= { ipoProd500v2Family 6 } + +ipoProd500v2IPOfficeSelect OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP500v2 + Office Platform Telephone Switch in IP Office Select Mode" + ::= { ipoProd500v2Family 7 } + +ipoProd500v2SEditionExpansionSelect OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP500v2 + Office Platform Telephone Switch in Server Edition Expansion Select Mode" + ::= { ipoProd500v2Family 8 } + +-- Expansion Modules + +ipoProdExpModDT OBJECT IDENTIFIER ::= { ipoProdExpModules 1 } +ipoProdExpModDS OBJECT IDENTIFIER ::= { ipoProdExpModules 2 } +ipoProdExpModPhone OBJECT IDENTIFIER ::= { ipoProdExpModules 3 } +ipoProdExpModS0 OBJECT IDENTIFIER ::= { ipoProdExpModules 4 } +ipoProdExpModAnalog OBJECT IDENTIFIER ::= { ipoProdExpModules 5 } +ipoProdExpModWAN OBJECT IDENTIFIER ::= { ipoProdExpModules 6 } +ipoProdExpModRDS OBJECT IDENTIFIER ::= { ipoProdExpModules 7 } +ipoProdExpModRPhone OBJECT IDENTIFIER ::= { ipoProdExpModules 8 } +ipoProdExpModDSA OBJECT IDENTIFIER ::= { ipoProdExpModules 9 } + +ipoProdExpModDT16 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Digital + Terminal 16" + ::= { ipoProdExpModDT 1 } + +ipoProdExpModDT30 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Digital + Terminal 30" + ::= { ipoProdExpModDT 2 } + +ipoProdExpModDS16 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Digital + Station 16" + ::= { ipoProdExpModDS 1 } + +ipoProdExpModDS30 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Digital + Station 30" + ::= { ipoProdExpModDS 2 } + +ipoProdExpModPhone8 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Phone 8" + ::= { ipoProdExpModPhone 1 } + +ipoProdExpModPhone16 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Phone 16" + ::= { ipoProdExpModPhone 2 } + +ipoProdExpModPhone30 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Phone 30" + ::= { ipoProdExpModPhone 3 } + +ipoProdExpModS08 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office S0 8" + ::= { ipoProdExpModS0 1 } + +ipoProdExpModS016 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office S0 16" + ::= { ipoProdExpModS0 2 } + +ipoProdExpModATM8 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Analog Trunk 16" + ::= { ipoProdExpModAnalog 1 } + +ipoProdExpModATM16 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Analog Trunk 16" + ::= { ipoProdExpModAnalog 2 } + +ipoProdExpModWAN3 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office WAN 3" + ::= { ipoProdExpModWAN 1 } + +ipoProdExpModRDS16 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Revised + (V2) Digital Station 16" + ::= { ipoProdExpModRDS 1 } + +ipoProdExpModRDS30 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Revised + (V2) Digital Station 30" + ::= { ipoProdExpModRDS 2 } + +ipoProdExpModRPhone8 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Revised + (V2) Phone 8" + ::= { ipoProdExpModRPhone 1 } + +ipoProdExpModRPhone16 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Revised + (V2) Phone 16" + ::= { ipoProdExpModRPhone 2 } + +ipoProdExpModRPhone30 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Revised + (V2) Phone 30" + ::= { ipoProdExpModRPhone 3 } + +ipoProdExpModDSA16RJ21 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Revised + (Adaptive) Digital Station 16 RJ21" + ::= { ipoProdExpModDSA 1 } + +ipoProdExpModDSA30RJ21 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Revised + (Adaptive) Digital Station 30 RJ21" + ::= { ipoProdExpModDSA 2 } + +ipoProdExpModDSA16RJ45 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Revised + (Adaptive) Digital Station 16 RJ45" + ::= { ipoProdExpModDSA 3 } + +ipoProdExpModDSA30RJ45 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Revised + (Adaptive) Digital Station 30 RJ45" + ::= { ipoProdExpModDSA 4 } + +-- Slots + +ipoProdSlotVCM OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office VCM Slot" + ::= { ipoProdSlots 1 } + +ipoProdSlotModems OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Modem Slot" + ::= { ipoProdSlots 2 } + +ipoProdSlotVmailMemory OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP401 + Voicemail Memory Slot" + ::= { ipoProdSlots 3 } + +ipoProdSlotWAN OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP401 WAN + Slot" + ::= { ipoProdSlots 4 } + +ipoProdSlotPCCard OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office PC-Card + Slot" + ::= { ipoProdSlots 5 } + +ipoProdSlotTrunks OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Trunk + Slot" + ::= { ipoProdSlots 6 } + +ipoProdSlotExpansion OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Expansion + Slot" + ::= { ipoProdSlots 7 } + +ipoProdSlot500Generic OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP500 + Generic Expansion Slot" + ::= { ipoProdSlots 8 } + +ipoProdSlotMezzanine OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP500 + Mezzanine Slot" + ::= { ipoProdSlots 9 } + +ipoProdSlotCarrierVCM OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP500 + Carrier Module VCM Slot" + ::= { ipoProdSlots 10 } + +ipoProdSlotCarrierTrunk OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office IP500 + Carrier Module Trunk Slot" + ::= { ipoProdSlots 11 } + + +-- Slot Module Groups + +ipoProdIntegralModules OBJECT IDENTIFIER ::= { ipoProdSlotModules 1 } +ipoProdTrunkModules OBJECT IDENTIFIER ::= { ipoProdSlotModules 2 } +ipoProdPCCardModules OBJECT IDENTIFIER ::= { ipoProdSlotModules 3 } +ipoProdCarrierModules OBJECT IDENTIFIER ::= { ipoProdSlotModules 4 } +ipoProdPhonePortModules OBJECT IDENTIFIER ::= { ipoProdSlotModules 5 } +ipoProdVCMModules OBJECT IDENTIFIER ::= { ipoProdSlotModules 6 } +ipoProdExpansionModules OBJECT IDENTIFIER ::= { ipoProdSlotModules 7 } +ipoProdUCPModules OBJECT IDENTIFIER ::= { ipoProdSlotModules 8 } + +-- Integral Modules + +ipoProdIntModVCM OBJECT IDENTIFIER ::= { ipoProdIntegralModules 1 } +ipoProdIntModModem OBJECT IDENTIFIER ::= { ipoProdIntegralModules 2 } +ipoProdIntModWAN OBJECT IDENTIFIER ::= { ipoProdIntegralModules 3 } +ipoProdIntModMem OBJECT IDENTIFIER ::= { ipoProdIntegralModules 4 } + +ipoProdIntModVCM3 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office VCM 3 Module" + ::= { ipoProdIntModVCM 1 } + +ipoProdIntModVCM5 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office VCM 5 Module" + ::= { ipoProdIntModVCM 2 } + +ipoProdIntModVCM6 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office VCM 6 Module" + ::= { ipoProdIntModVCM 3 } + +ipoProdIntModVCM8 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office VCM 8 + Module." + ::= { ipoProdIntModVCM 4 } + +ipoProdIntModVCM10 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office VCM 10 Module" + ::= { ipoProdIntModVCM 5 } + +ipoProdIntModVCM12 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office VCM 12 Module" + ::= { ipoProdIntModVCM 6 } + +ipoProdIntModVCM16 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office VCM 16 + Module." + ::= { ipoProdIntModVCM 7 } + +ipoProdIntModVCM20 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office VCM 20 Module" + ::= { ipoProdIntModVCM 8 } + +ipoProdIntModVCM30 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office VCM 30 + Module." + ::= { ipoProdIntModVCM 9 } + +ipoProdIntModVCM24 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office VCM 24 + Module." + ::= { ipoProdIntModVCM 10 } + +ipoProdIntModVCM4 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office VCM 4 + Module." + ::= { ipoProdIntModVCM 11 } + +ipoProdIntModModemDual OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office Dual Modem Module" + ::= { ipoProdIntModModem 1 } + +ipoProdIntModModemMulti OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office Multi Modem Module" + ::= { ipoProdIntModModem 2 } + +ipoProdIntModWANModule OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office WAN Module" + ::= { ipoProdIntModWAN 1 } + +ipoProdIntModMemVmail OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office Voicemail + Memory Module" + ::= { ipoProdIntModMem 1 } + + +-- Trunk Modules + +ipoProdTrunkAnalogQuad OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office Quad Analog + Trunk Module" + ::= { ipoProdTrunkModules 1 } + +ipoProdTrunkBRIQuad OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office Quad BRI + Trunk Module" + ::= { ipoProdTrunkModules 2 } + +ipoProdTrunkE1PRISingle OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office Single PRI 30 + E1 Trunk Module" + ::= { ipoProdTrunkModules 3 } + +ipoProdTrunkE1PRIDual OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office Dual PRI 60 + E1 Trunk Module" + ::= { ipoProdTrunkModules 4 } + +ipoProdTrunkJ1PRISingle OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office IP500 + Single PRI 24J Trunk Module" + ::= { ipoProdTrunkModules 5 } + +ipoProdTrunkJ1PRIDual OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office IP500 + Dual PRI 48J Trunk Module" + ::= { ipoProdTrunkModules 6 } + +ipoProdTrunkT1PRISingle OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office Single PRI 24 + T1 Trunk Module" + ::= { ipoProdTrunkModules 7 } + +ipoProdTrunkT1PRIDual OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office Dual PRI 48 + T1 Trunk Module" + ::= { ipoProdTrunkModules 8 } + +ipoProdTrunkIndex OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office Index Module" + ::= { ipoProdTrunkModules 9 } + +ipoProdTrunkR2Single OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office Single E1 R2 30 + Trunk Module" + ::= { ipoProdTrunkModules 10 } + +ipoProdTrunkR2Dual OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office Dual E1 R2 60 + Trunk Module" + ::= { ipoProdTrunkModules 11 } + +ipoProdTrunkR2CoAxSingle OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office Single E1 R2 + CO-AX 30 Trunk Module" + ::= { ipoProdTrunkModules 12 } + +ipoProdTrunkR2CoAxDual OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office Single E1 R2 + CO-AX 30 Trunk Module" + ::= { ipoProdTrunkModules 13 } + +ipoProdTrunkRAnalogQuad OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office Revised Quad + Analog Trunk Module" + ::= { ipoProdTrunkModules 14 } + +ipoProdTrunk500AnalogQuad OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office IP500 + Quad Analog Trunk Module" + ::= { ipoProdTrunkModules 15 } + +ipoProdTrunk500BRIDual OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office IP500 + Dual BRI Trunk Module" + ::= { ipoProdTrunkModules 16 } + +ipoProdTrunk500BRIQuad OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office IP500 + Quad BRI Trunk Module" + ::= { ipoProdTrunkModules 17 } + +ipoProdTrunkUniversalPRIDS0Single OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office IP500 + Single Universal PRI (DS0) Trunk Module + 24 Channels in T1 configuration + 30 Channels in E1 configuration" + ::= { ipoProdTrunkModules 18 } + +ipoProdTrunkUniversalPRIDS0Dual OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office IP500 + Single Universal PRI (DS0) Trunk Module + 48 Channels across two ports in T1 configuration + 60 Channels across two ports in E1 configuration" + ::= { ipoProdTrunkModules 19 } + +ipoProdTrunk500AnalogQuadV2 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office IP500 + Quad Analog Trunk Module V2" + ::= { ipoProdTrunkModules 20 } + + +-- PC-Card Modules + +ipoProdPCCardMemVmail OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office PC-Card + Voicemail Memory Module" + ::= { ipoProdPCCardModules 1 } + +ipoProdPCCardWLAN OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office PC-Card + WLAN Module" + ::= { ipoProdPCCardModules 2 } + +-- Carrier Modules + +ipoProdCarrier OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office IP500 + Carrier Module for older IP Office plug-in modules" + ::= { ipoProdCarrierModules 1 } + +-- Phone Port Modules + +ipoProdPhonePortPOT8 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office IP500 + POT 8 Phone Port Module" + ::= { ipoProdPhonePortModules 1 } + +ipoProdPhonePortDS8 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office IP500 + Digital Station 8 Phone Port Module" + ::= { ipoProdPhonePortModules 2 } + +ipoProdPhonePortPOT2 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office IP500 + POT 2 Phone Port Module" + ::= { ipoProdPhonePortModules 3 } + +ipoProdPhonePortCombo OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office IP500v2 Combo + Phone Port and trunk Module which provides a 10 channel VCM, 6 + Digital Station Phone Ports, 2 POT Phone Ports and either a 4 + port ATM trunk module or a 4 port BRI module." + ::= { ipoProdPhonePortModules 4 } + +ipoProdPhonePortETR6 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office IP500v2 + ETR 6 Phone Port Module" + ::= { ipoProdPhonePortModules 5 } + +ipoProdPhonePortTCM8 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office IP500v2 + TCM 8 Phone Port Module" + ::= { ipoProdPhonePortModules 6 } + +-- VCM Modules + +ipoProdVCMMod32 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office DSP based + VCM 32 Module." + ::= { ipoProdVCMModules 1 } + +ipoProdVCMMod64 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office DSP based + VCM 64 Module." + ::= { ipoProdVCMModules 2 } + +ipoProdVCMMod32V2 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office DSP based + VCM 32 V2 Module." + ::= { ipoProdVCMModules 3 } + +ipoProdVCMMod64V2 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office DSP based + VCM 64 V2 Module." + ::= { ipoProdVCMModules 4 } + +-- Expansion Modules + +ipoProdExpMod4Port OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office 4 Port + Expansion Module." + ::= { ipoProdExpansionModules 1 } + +-- Ports + +ipoProdPortBRI OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office BRI Ports" + ::= { ipoProdPorts 1 } + +ipoProdPortE1PRI OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office E1 PRI Ports" + ::= { ipoProdPorts 2 } + +ipoProdPortJ1PRI OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office J1 PRI Ports" + ::= { ipoProdPorts 3 } + +ipoProdPortT1PRI OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office T1 PRI Ports" + ::= { ipoProdPorts 4 } + +ipoProdPortR2 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office E1 R2 Ports" + ::= { ipoProdPorts 5 } + +ipoProdPortR2CoAx OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office E1 R2 CO-AX + Ports" + ::= { ipoProdPorts 6 } + +ipoProdPortWAN OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office WAN Ports" + ::= { ipoProdPorts 7 } + +ipoProdPortAnalog OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office Analog Ports" + ::= { ipoProdPorts 8 } + +ipoProdPortPower OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office Power Port" + ::= { ipoProdPorts 9 } + +ipoProdPortDT OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office DT Phone Ports" + ::= { ipoProdPorts 10 } + +ipoProdPortDS OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office DS Phone Ports" + ::= { ipoProdPorts 11 } + +ipoProdPortPOT OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office POT Ports" + ::= { ipoProdPorts 12 } + +ipoProdPortS0 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office ISDN BRI S-Bus Ports" + ::= { ipoProdPorts 13 } + +ipoProdPortLAN OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office LAN + (10BASE-T/100BASE-TX) Ports" + ::= { ipoProdPorts 14 } + +ipoProdPortWLAN OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office LAN + WLAN (802.11) Ports" + ::= { ipoProdPorts 15 } + +ipoProdPortDTE OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office DTE Port" + ::= { ipoProdPorts 16 } + +ipoProdPortUSB OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office USB Port" + ::= { ipoProdPorts 17 } + +ipoProdPortAudio OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Audio I/P Port" + ::= { ipoProdPorts 18 } + +ipoProdPortEtherWANLink OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office Fast + Ethernet (10BASE-T/100BASE-TX) WAN Link Port" + ::= { ipoProdPorts 19 } + +ipoProdPortExtOP OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office - Small + Office Edition Telephone Switch Ethernet Ext O/P Port" + ::= { ipoProdPorts 20 } + +ipoProdPortNet1 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office + Fast Ethernet (10BASE-T/100BASE-TX) Network 1 Port" + ::= { ipoProdPorts 21 } + +ipoProdPortNet2 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office + Fast Ethernet (10BASE-T/100BASE-TX) Network 2 Port" + ::= { ipoProdPorts 22 } + +ipoProdGenericDongle OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the Avaya IP Office License + Dongle - A single representation for three dongle types, + Parallel, Serial and USB. The Parallel and USB ones not truly + connected directly to the IP Office but the managing PC." + ::= { ipoProdDongleModules 1 } + +ipoProdSubModVCM10 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for the 10 channel VCM sub module + resident on the Avaya IP Office IP500v2 Combo Phone Port and + trunk Module." + ::= { ipoProdSubModules 1 } + + + -- Unified Communications Module + +ipoProdC110UCM OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office + Unified Communications Module. model C110" + ::= { ipoProdUCModules 1 } + +ipoProdC110UCMV2 OBJECT-IDENTITY + STATUS current + DESCRIPTION + "The authoritative reference for Avaya IP Office + Unified Communications Module V2. model C110" + ::= { ipoProdUCModules 2 } + +END From c3b7363e037f702db22d8a7f70bff253de619a9d Mon Sep 17 00:00:00 2001 From: Tom Ferguson Date: Thu, 17 Sep 2015 06:48:42 -0400 Subject: [PATCH 254/263] Added basic support for Avaya IP Office discovery --- includes/definitions.inc.php | 6 ++++++ includes/discovery/os/avaya-ipo.inc.php | 7 +++++++ includes/polling/os/avaya-ipo.inc.php | 8 ++++++++ 3 files changed, 21 insertions(+) create mode 100644 includes/discovery/os/avaya-ipo.inc.php create mode 100644 includes/polling/os/avaya-ipo.inc.php diff --git a/includes/definitions.inc.php b/includes/definitions.inc.php index 618f871b3..762034ea9 100644 --- a/includes/definitions.inc.php +++ b/includes/definitions.inc.php @@ -634,6 +634,12 @@ $config['os'][$os]['icon'] = 'avaya'; $config['os'][$os]['over'][0]['graph'] = 'device_bits'; $config['os'][$os]['over'][0]['text'] = 'Device Traffic'; +$os = 'avaya-ipo'; +$config['os'][$os]['text'] = 'IP Office Firmware'; +$config['os'][$os]['type'] = 'network'; +$config['os'][$os]['icon'] = 'avaya'; + + $os = 'arista_eos'; $config['os'][$os]['text'] = 'Arista EOS'; $config['os'][$os]['type'] = 'network'; diff --git a/includes/discovery/os/avaya-ipo.inc.php b/includes/discovery/os/avaya-ipo.inc.php new file mode 100644 index 000000000..ec4dcfbae --- /dev/null +++ b/includes/discovery/os/avaya-ipo.inc.php @@ -0,0 +1,7 @@ + Date: Thu, 17 Sep 2015 13:19:26 +0200 Subject: [PATCH 255/263] I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md. --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 035e8383e..0c80ef0a8 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -52,6 +52,6 @@ Contributors to LibreNMS: - Arjit Chaudhary (arjit.c@gmail.com) (arjitc) - Sergiusz Paprzycki (spaprzycki) - Juho Vanhanen (juhovan) - +- Bart de Bruijn (bartdebruijn) [1]: http://observium.org/ "Observium web site" From 62328dab91106d77ab31a7b67b412f5f4dfd846f Mon Sep 17 00:00:00 2001 From: Rosiak Date: Thu, 17 Sep 2015 16:19:48 +0200 Subject: [PATCH 256/263] Add Device Notes Field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a “Notes” field for devices to accommodate #1897 --- html/includes/forms/update-notes.inc.php | 32 ++++++++++++++ html/pages/device.inc.php | 6 +++ html/pages/device/notes.inc.php | 56 ++++++++++++++++++++++++ sql-schema/072.sql | 1 + 4 files changed, 95 insertions(+) create mode 100644 html/includes/forms/update-notes.inc.php create mode 100644 html/pages/device/notes.inc.php create mode 100644 sql-schema/072.sql diff --git a/html/includes/forms/update-notes.inc.php b/html/includes/forms/update-notes.inc.php new file mode 100644 index 000000000..4848add6b --- /dev/null +++ b/html/includes/forms/update-notes.inc.php @@ -0,0 +1,32 @@ + + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + +$status = 'error'; +$message = 'unknown error'; + +$device_id = mres($_POST['device_id']); +$notes = mres($_POST['notes']); + +if (isset($notes) && (dbUpdate(array('notes' => $notes), 'devices', 'device_id = ?', array($device_id)))) { + $status = 'ok'; + $message = 'Updated'; +} +else { + $status = 'error'; + $message = 'ERROR: Could not update'; +} +die(json_encode(array( + 'status' => $status, + 'message' => $message, + 'notes' => $notes, + 'device_id' => $device_id +))); diff --git a/html/pages/device.inc.php b/html/pages/device.inc.php index dfb90a30e..6bb1bf4fa 100644 --- a/html/pages/device.inc.php +++ b/html/pages/device.inc.php @@ -357,6 +357,12 @@ if (device_permitted($vars['device']) || $check_device == $vars['device']) { '; + echo '
  • + + Notes + +
  • '; + echo '
  • https
  • ssh
  • diff --git a/html/pages/device/notes.inc.php b/html/pages/device/notes.inc.php new file mode 100644 index 000000000..94f3372cc --- /dev/null +++ b/html/pages/device/notes.inc.php @@ -0,0 +1,56 @@ + + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + +$data = dbFetchRow("SELECT `notes` FROM `devices` WHERE device_id = ?", array( + $device['device_id'] +)); +?> + + +

    Device Notes

    +
    +
    +
    + +
    +
    +
    +
    + Submit + '; +?> +
    +
    + + diff --git a/sql-schema/072.sql b/sql-schema/072.sql new file mode 100644 index 000000000..6748b6eb4 --- /dev/null +++ b/sql-schema/072.sql @@ -0,0 +1 @@ +ALTER TABLE `devices` ADD COLUMN `notes` text; From ff7e1f5e845b7725c7a163764ff08ff4b9350383 Mon Sep 17 00:00:00 2001 From: Rosiak Date: Thu, 17 Sep 2015 20:51:10 +0200 Subject: [PATCH 257/263] Use htmlentities --- html/pages/device/notes.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/pages/device/notes.inc.php b/html/pages/device/notes.inc.php index 94f3372cc..39e034ff1 100644 --- a/html/pages/device/notes.inc.php +++ b/html/pages/device/notes.inc.php @@ -21,7 +21,7 @@ $data = dbFetchRow("SELECT `notes` FROM `devices` WHERE device_id = ?", array(
    +echo htmlentities($data['notes']); ?>
    From eb1f5c7fcccc4f754432cefe049e1db72b21ba49 Mon Sep 17 00:00:00 2001 From: Tom Ferguson Date: Fri, 18 Sep 2015 04:21:21 -0400 Subject: [PATCH 258/263] Changed sysDescr SNMP request to built in one. --- includes/polling/os/avaya-ipo.inc.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/includes/polling/os/avaya-ipo.inc.php b/includes/polling/os/avaya-ipo.inc.php index d97af2143..0ca43ea34 100644 --- a/includes/polling/os/avaya-ipo.inc.php +++ b/includes/polling/os/avaya-ipo.inc.php @@ -1,8 +1,10 @@ Date: Sat, 19 Sep 2015 00:45:36 +0200 Subject: [PATCH 259/263] Update AUTHORS.md I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md. --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 0c80ef0a8..277bb2ad5 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -53,5 +53,6 @@ Contributors to LibreNMS: - Sergiusz Paprzycki (spaprzycki) - Juho Vanhanen (juhovan) - Bart de Bruijn (bartdebruijn) +- Christophe Martinet (chrisgfx) [1]: http://observium.org/ "Observium web site" From 3b3abe06c934905efa9c83a8cedda40ce2fd6f14 Mon Sep 17 00:00:00 2001 From: f0o Date: Sat, 19 Sep 2015 15:51:53 +0100 Subject: [PATCH 260/263] Honour IP Field for DNS Checks --- includes/services/dns/check.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/services/dns/check.inc b/includes/services/dns/check.inc index 28fa47993..0b259d68d 100644 --- a/includes/services/dns/check.inc +++ b/includes/services/dns/check.inc @@ -1,9 +1,10 @@ Date: Sat, 19 Sep 2015 23:06:12 +0200 Subject: [PATCH 261/263] fix issue-1931 --- includes/discovery/os/vrp.inc.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/includes/discovery/os/vrp.inc.php b/includes/discovery/os/vrp.inc.php index 6c49cf862..b57689271 100644 --- a/includes/discovery/os/vrp.inc.php +++ b/includes/discovery/os/vrp.inc.php @@ -1,15 +1,7 @@ Date: Sun, 20 Sep 2015 10:13:56 +0100 Subject: [PATCH 262/263] Added ability to filter top interfaces by type --- html/ajax_search.php | 22 ++++ html/includes/common/top-interfaces.inc.php | 124 +++++++++++++------- 2 files changed, 102 insertions(+), 44 deletions(-) diff --git a/html/ajax_search.php b/html/ajax_search.php index e42655ee9..7d82a1ac9 100644 --- a/html/ajax_search.php +++ b/html/ajax_search.php @@ -294,6 +294,28 @@ if (isset($_REQUEST['search'])) { }//end foreach }//end if + $json = json_encode($device); + die($json); + } + else if ($_REQUEST['type'] == 'iftype') { + // Device search + if (is_admin() === true || is_read() === true) { + $results = dbFetchRows("SELECT `ports`.ifType FROM `ports` WHERE `ifType` LIKE '%".$search."%' GROUP BY ifType ORDER BY ifType LIMIT 8"); + } + else { + $results = dbFetchRows("SELECT `I`.ifType FROM `ports` AS `I`, `devices` AS `D`, `devices_perms` AS `P`, `ports_perms` AS `PP` WHERE ((`P`.`user_id` = ? AND `P`.`device_id` = `D`.`device_id`) OR (`PP`.`user_id` = ? AND `PP`.`port_id` = `I`.`port_id` AND `I`.`device_id` = `D`.`device_id`)) AND `D`.`device_id` = `I`.`device_id` AND (`ifType` LIKE '%".$search."%') GROUP BY ifType ORDER BY ifType LIMIT 8", array($_SESSION['user_id'], $_SESSION['user_id'])); + } + if (count($results)) { + $found = 1; + $devices = count($results); + + foreach ($results as $result) { + $device[] = array( + 'filter' => $result['ifType'], + ); + }//end foreach + }//end if + $json = json_encode($device); die($json); }//end if diff --git a/html/includes/common/top-interfaces.inc.php b/html/includes/common/top-interfaces.inc.php index 3299be1ae..07ebabf55 100644 --- a/html/includes/common/top-interfaces.inc.php +++ b/html/includes/common/top-interfaces.inc.php @@ -27,74 +27,110 @@ if( defined('show_settings') || empty($widget_settings) ) { $common_output[] = ' -
    +
    -
    - -
    -
    - -
    -
    -
    -
    -
    - -
    -
    - + +
    +
    -
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + + '; } else { $interval = $widget_settings['time_interval']; - (integer) $interval_seconds = ($interval * 60); + (integer) $lastpoll_seconds = ($interval * 60); (integer) $interface_count = $widget_settings['interface_count']; - $common_output[] = ' -

    Top '.$interface_count.' interfaces (last '.$interval.' minutes)

    - '; - $params = array('user' => $_SESSION['user_id'], 'interval' => array($interval_seconds), 'count' => array($interface_count)); + $params = array('user' => $_SESSION['user_id'], 'lastpoll' => array($lastpoll_seconds), 'count' => array($interface_count), 'filter' => ($widget_settings['interface_filter']?:(int)1)); if (is_admin() || is_read()) { $query = ' SELECT *, p.ifInOctets_rate + p.ifOutOctets_rate as total - FROM ports as p, devices as d - WHERE d.device_id = p.device_id - AND unix_timestamp() - p.poll_time < :interval - AND ( p.ifInOctets_rate > 0 - OR p.ifOutOctets_rate > 0 ) - ORDER BY total desc + FROM ports as p + INNER JOIN devices ON p.device_id = devices.device_id + AND unix_timestamp() - p.poll_time <= :lastpoll + AND ( p.ifType = :filter || 1 = :filter ) + AND ( p.ifInOctets_rate > 0 || p.ifOutOctets_rate > 0 ) + ORDER BY total DESC LIMIT :count '; } else { $query = ' - SELECT ports.*, devices.hostname, ports.ifInOctets_rate + ports.ifOutOctets_rate as total - FROM devices, ports - LEFT JOIN ports_perms ON ports.port_id = ports_perms.port_id - WHERE ports_perms.user_id = :user - AND unix_timestamp() - ports.poll_time < :interval - AND (ports.ifInOctets_rate > 0 OR ports.ifOutOctets_rate > 0) - GROUP BY ports.port_id - UNION ALL - SELECT ports.*, devices.hostname, ports.ifInOctets_rate + ports.ifOutOctets_rate as total - FROM ports, devices LEFT JOIN devices_perms ON devices.device_id = devices_perms.device_id - WHERE devices_perms.user_id = :user - AND ports.device_id = devices.device_id - AND unix_timestamp() - ports.poll_time < :interval - AND (ports.ifInOctets_rate > 0 OR ports.ifOutOctets_rate > 0) - GROUP BY ports.port_id - ORDER BY total DESC LIMIT :count + SELECT ports.*, devices.hostname, ports.ifInOctets_rate + ports.ifOutOctets_rate as total + FROM ports + INNER JOIN devices ON ports.device_id = devices.device_id + LEFT JOIN ports_perms ON ports.port_id = ports_perms.port_id + LEFT JOIN devices_perms ON devices.device_id = devices_perms.device_id + WHERE ( ports_perms.user_id = :user || devices_perms.user_id = :user ) + AND unix_timestamp() - ports.poll_time <= :lastpoll + AND ( ports.ifType = :filter || 1 = :filter ) + AND ( ports.ifInOctets_rate > 0 || ports.ifOutOctets_rate > 0 ) + GROUP BY ports.port_id + ORDER BY total DESC + LIMIT :count '; } - $common_output[] = ' +

    Top '.$interface_count.' interfaces polled within '.$interval.' minutes

    Enable Application'.$api['token_hash'].' '.$api['description'].'
    From 6aafa2c94945d379583e5ad4af4f4bec75afc8c7 Mon Sep 17 00:00:00 2001 From: laf Date: Sun, 20 Sep 2015 19:28:43 +0000 Subject: [PATCH 263/263] Updated changelog 20/09/2015 --- doc/General/Changelog.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/doc/General/Changelog.md b/doc/General/Changelog.md index 86c04213e..f4d083117 100644 --- a/doc/General/Changelog.md +++ b/doc/General/Changelog.md @@ -5,6 +5,13 @@ - Process followups if there are changes (PR1817) - Typo in alert_window setting (PR1841) - Issue alert-trigger as test object (PR1850) + - WebUI: + - Fix permissions for World-map widget (PR1866) + - Clean up Gloabl / World Map name mixup (PR1874) + - Services: + - Honour IP field for DNS checks (PR1933) + - Discovery / Poller: + - Fix Huawei VRP os detection (PR1931)t - General: - Remove 'sh' from cronjob (PR1818) - Remove MySQL Locks (PR1822,PR1826,PR1829,PR1836) @@ -15,19 +22,26 @@ - Honour Mouseout/Mouseleave on map widget (PR1814) - Make syslog/eventlog responsive (PR1816) - Reformat Proxmox UI (PR1825,PR1827) - - Misc Changes (PR1828,PR1830) + - Misc Changes (PR1828,PR1830,PR1875,PR1885,PR1886,PR1887,PR1891,PR1896,PR1901,PR1913) - Added support for Oxidized versioning (PR1842) - - Added graph widget + settings for widgets (PR1835) + - Added graph widget + settings for widgets (PR1835,PR1861) + - Added Support for multiple dashboards (PR1869) + - Added settings page for Worldmap widget (PR1872) + - Added uptime to availability widget (PR1881) + - Added top devices and ports widgets (PR1903) + - Added support for saving notes for devices (PR1927) - Added detection for: - FortiOS (PR1815) - Discovery / Poller: - Added Proxmox support (PR1789) - Documentation: - Add varnish docs (PR1809) + - Added CentOS 7 RRCached docs (1893) - General: - Make installer more responsive (PR1832) - Update fping millisec option to 200 default (PR1833) - Reduced cleanup of device_perf (PR1837) + - Added support for negative values in munin-plugins (PR1907) ### August 2015