mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge remote-tracking branch 'refs/remotes/librenms/master'
This commit is contained in:
@@ -98,6 +98,7 @@ LibreNMS contributors:
|
||||
- Michael Nguyen <mnguyen1289@gmail.com> (mnguyen1289)
|
||||
- Casey Schoonover <casey.schoonover@llcc.edu> (cschoonover91)
|
||||
- Chris A. Evans <thecityofguanyu@outlook.com> (thecityofguanyu)
|
||||
- Rainer Schüler <github@layer3.de> (rschueler)
|
||||
|
||||
[1]: http://observium.org/ "Observium web site"
|
||||
Observium was written by:
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
- [`get_devices_by_group`](#api-route-get_devices_by_group)
|
||||
- [`routing`](#api-routing)
|
||||
- [`list_bgp`](#api-route-1)
|
||||
- [`list_ipsec`](#list_ipsec)
|
||||
- [`switching`](#api-switching)
|
||||
- [`get_vlans`](#api-route-4)
|
||||
- [`alerts`](#api-alerts)
|
||||
@@ -866,6 +867,43 @@ Output:
|
||||
}
|
||||
```
|
||||
|
||||
### <a name="list_ipsec">Function: `list_ipsec`</a> [`top`](#top)
|
||||
|
||||
List the current IPSec tunnels which are active.
|
||||
|
||||
Route: /api/v0/routing/ipsec/data/:hostname
|
||||
|
||||
- hostname can be either the device hostname or id
|
||||
|
||||
Input:
|
||||
|
||||
-
|
||||
|
||||
Example:
|
||||
```curl
|
||||
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/routing/ipsec/data/localhost
|
||||
```
|
||||
|
||||
Output:
|
||||
```text
|
||||
{
|
||||
"status": "ok",
|
||||
"err-msg": "",
|
||||
"count": 0,
|
||||
"ipsec": [
|
||||
"tunnel_id": "1",
|
||||
"device_id": "1",
|
||||
"peer_port": "0",
|
||||
"peer_addr": "127.0.0.1",
|
||||
"local_addr": "127.0.0.2",
|
||||
"local_port": "0",
|
||||
"tunnel_name": "",
|
||||
"tunnel_status": "active"
|
||||
]
|
||||
}
|
||||
```
|
||||
> Please note, this will only show active VPN sessions not all configured.
|
||||
|
||||
## <a name="api-switching">`Switching`</a> [`top`](#top)
|
||||
|
||||
### <a name="api-route-4">Function: `get_vlans`</a> [`top`](#top)
|
||||
|
||||
@@ -44,6 +44,7 @@ $config['discovery_modules']['processors'] = 1;
|
||||
$config['discovery_modules']['mempools'] = 1;
|
||||
$config['discovery_modules']['ipv4-addresses'] = 1;
|
||||
$config['discovery_modules']['ipv6-addresses'] = 1;
|
||||
$config['discovery_modules']['route'] = 0;
|
||||
$config['discovery_modules']['sensors'] = 1;
|
||||
$config['discovery_modules']['storage'] = 1;
|
||||
$config['discovery_modules']['hr-device'] = 1;
|
||||
@@ -84,6 +85,8 @@ $config['discovery_modules']['charge'] = 1;
|
||||
|
||||
`ipv6-addresses`: IPv6 Address detection
|
||||
|
||||
`route`: Route detection
|
||||
|
||||
`sensors`: Sensor detection such as Temperature, Humidity, Voltages + More
|
||||
|
||||
`storage`: Storage detection for hard disks
|
||||
|
||||
@@ -35,6 +35,7 @@ if ($type == 'placeholder') {
|
||||
elseif (is_file('includes/common/'.$type.'.inc.php')) {
|
||||
|
||||
$results_limit = 10;
|
||||
$typeahead_limit = $config['webui']['global_search_result_limit'];
|
||||
$no_form = true;
|
||||
$title = ucfirst($type);
|
||||
$unique_id = str_replace(array("-","."),"_",uniqid($type,true));
|
||||
|
||||
@@ -128,6 +128,19 @@ $app->group(
|
||||
}
|
||||
);
|
||||
// End Inventory
|
||||
// Routing section
|
||||
$app->group(
|
||||
'/routing',
|
||||
function () use ($app) {
|
||||
$app->group(
|
||||
'/ipsec',
|
||||
function () use ($app) {
|
||||
$app->get('/data/:hostname', 'authToken', 'list_ipsec')->name('list_ipsec');
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
// End Routing
|
||||
}
|
||||
);
|
||||
$app->get('/v0', 'authToken', 'show_endpoints');
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
@@ -1288,3 +1288,33 @@ function get_devices_by_group() {
|
||||
echo _json_encode($output);
|
||||
|
||||
}
|
||||
|
||||
function list_ipsec() {
|
||||
$app = \Slim\Slim::getInstance();
|
||||
$router = $app->router()->getCurrentRoute()->getParams();
|
||||
$status = 'error';
|
||||
$code = 404;
|
||||
$message = '';
|
||||
$hostname = $router['hostname'];
|
||||
// use hostname as device_id if it's all digits
|
||||
$device_id = ctype_digit($hostname) ? $hostname : getidbyname($hostname);
|
||||
if (!is_numeric($device_id)) {
|
||||
$message = "No valid hostname or device ID provided";
|
||||
}
|
||||
else {
|
||||
$ipsec = dbFetchRows("SELECT `D`.`hostname`, `I`.* FROM `ipsec_tunnels` AS `I`, `devices` AS `D` WHERE `I`.`device_id`=? AND `D`.`device_id` = `I`.`device_id`", array($device_id));
|
||||
$total = count($ipsec);
|
||||
$status = 'ok';
|
||||
$code = 200;
|
||||
}
|
||||
|
||||
$output = array(
|
||||
'status' => $status,
|
||||
'err-msg' => $message,
|
||||
'count' => $total,
|
||||
'ipsec' => $ipsec,
|
||||
);
|
||||
$app->response->setStatus($code);
|
||||
$app->response->headers->set('Content-Type', 'application/json');
|
||||
echo _json_encode($output);
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@ $temp_output .= '
|
||||
<tr class="active">
|
||||
<td><a href="services/">Services</a></td>
|
||||
<td><a href="services/"><span>'.$services['count'].'</span></a></td>
|
||||
<td><a href="services/state=up/view=details/"><span class="green">'.$services['up'].'</span></a></td>
|
||||
<td><a href="services/state=down/view=details/"><span class="red"> '.$services['down'].'</span></a></td>
|
||||
<td><a href="services/state=ok/view=details/"><span class="green">'.$services['up'].'</span></a></td>
|
||||
<td><a href="services/state=critical/view=details/"><span class="red"> '.$services['down'].'</span></a></td>
|
||||
<td><a href="services/ignore=1/view=details/"><span class="grey"> '.$services['ignored'].'</span></a></td>
|
||||
<td><a href="services/disabled=1/view=details/"><span class="black"> '.$services['disabled'].'</span></a></td>
|
||||
'.($config['summary_errors'] ? '<td>-</td>' : '').'
|
||||
|
||||
@@ -31,7 +31,7 @@ $temp_output .= '
|
||||
if ($config['show_services']) {
|
||||
|
||||
$temp_output .= '
|
||||
<td><a href="services/view=details/state=up/"><span class="green">'. $services['up'] .'</span></a></td>
|
||||
<td><a href="services/view=details/state=ok/"><span class="green">'. $services['up'] .'</span></a></td>
|
||||
';
|
||||
|
||||
}
|
||||
@@ -47,7 +47,7 @@ $temp_output .= '
|
||||
if ($config['show_services']) {
|
||||
|
||||
$temp_output .= '
|
||||
<td><a href="services/view=details/state=down/"><span class="red">'. $services['down'] .'</span></a></td>
|
||||
<td><a href="services/view=details/state=critical/"><span class="red">'. $services['down'] .'</span></a></td>
|
||||
';
|
||||
|
||||
}
|
||||
|
||||
@@ -204,6 +204,7 @@ function '.$unique_id.'() {
|
||||
},
|
||||
{
|
||||
source: '.$unique_id.'_device.ttAdapter(),
|
||||
limit: '.$typeahead_limit.',
|
||||
async: false,
|
||||
templates: {
|
||||
header: "<h5><strong> Devices</strong></h5>",
|
||||
@@ -240,6 +241,7 @@ function '.$unique_id.'() {
|
||||
},
|
||||
{
|
||||
source: '.$unique_id.'_port.ttAdapter(),
|
||||
limit: '.$typeahead_limit.',
|
||||
async: false,
|
||||
templates: {
|
||||
header: "<h5><strong> Ports</strong></h5>",
|
||||
@@ -275,6 +277,7 @@ function '.$unique_id.'() {
|
||||
},
|
||||
{
|
||||
source: '.$unique_id.'_application.ttAdapter(),
|
||||
limit: '.$typeahead_limit.',
|
||||
async: false,
|
||||
templates: {
|
||||
header: "<h5><strong> Applications</strong></h5>",
|
||||
@@ -312,6 +315,7 @@ function '.$unique_id.'() {
|
||||
},
|
||||
{
|
||||
source: '.$unique_id.'_munin.ttAdapter(),
|
||||
limit: '.$typeahead_limit.',
|
||||
async: false,
|
||||
templates: {
|
||||
header: "<h5><strong> Munin</strong></h5>",
|
||||
@@ -346,6 +350,7 @@ function '.$unique_id.'() {
|
||||
},
|
||||
{
|
||||
source: '.$unique_id.'_bill.ttAdapter(),
|
||||
limit: '.$typeahead_limit.',
|
||||
async: false,
|
||||
templates: {
|
||||
header: "<h5><strong><i class=\'fa fa-money\'></i> Bill</strong></h5>",
|
||||
@@ -432,3 +437,4 @@ else {
|
||||
$common_output[] = '<a href="graphs/'.$param.'/type='.$widget_settings['graph_type'].'/from='.$config['time'][$widget_settings['graph_range']].'"><img class="minigraph-image" width="'.$widget_dimensions['x'].'" height="'.$widget_dimensions['y'].'" src="graph.php?'.$param.'&from='.$config['time'][$widget_settings['graph_range']].'&to='.$config['time']['now'].'&width='.$widget_dimensions['x'].'&height='.$widget_dimensions['y'].'&type='.$widget_settings['graph_type'].'&legend='.($widget_settings['graph_legend'] == 1 ? 'yes' : 'no').'&absolute=1"/></a>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ $i = 0;
|
||||
if ($handle = opendir($rrddir)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != '.' && $file != '..') {
|
||||
if (eregi('app-shoutcast-'.$app['app_id'], $file)) {
|
||||
if (stripos($file, 'app-shoutcast-'.$app['app_id']) != false) {
|
||||
array_push($files, $file);
|
||||
}
|
||||
}
|
||||
@@ -35,8 +35,8 @@ if ($handle = opendir($rrddir)) {
|
||||
}
|
||||
|
||||
foreach ($files as $id => $file) {
|
||||
$hostname = eregi_replace('app-shoutcast-'.$app['app_id'].'-', '', $file);
|
||||
$hostname = eregi_replace('.rrd', '', $hostname);
|
||||
$hostname = str_ireplace('app-shoutcast-'.$app['app_id'].'-', '', $file);
|
||||
$hostname = str_ireplace('.rrd', '', $hostname);
|
||||
list($host, $port) = explode('_', $hostname, 2);
|
||||
$rrd_filenames[] = $rrddir.'/'.$file;
|
||||
$rrd_list[$i]['filename'] = $rrddir.'/'.$file;
|
||||
|
||||
@@ -15,7 +15,7 @@ $x = 0;
|
||||
if ($handle = opendir($rrddir)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != '.' && $file != '..') {
|
||||
if (eregi('app-shoutcast-'.$app['app_id'], $file)) {
|
||||
if (stripos($file, 'app-shoutcast-'.$app['app_id']) !== false) {
|
||||
array_push($files, $file);
|
||||
}
|
||||
}
|
||||
@@ -23,8 +23,8 @@ if ($handle = opendir($rrddir)) {
|
||||
}
|
||||
|
||||
foreach ($files as $id => $file) {
|
||||
$hostname = eregi_replace('app-shoutcast-'.$app['app_id'].'-', '', $file);
|
||||
$hostname = eregi_replace('.rrd', '', $hostname);
|
||||
$hostname = str_ireplace('app-shoutcast-'.$app['app_id'].'-', '', $file);
|
||||
$hostname = str_ireplace('.rrd', '', $hostname);
|
||||
list($host, $port) = explode('_', $hostname, 2);
|
||||
$rrd_filenames[] = $rrddir.'/'.$file;
|
||||
$rrd_list[$i]['filename'] = $rrddir.'/'.$file;
|
||||
|
||||
@@ -3,8 +3,9 @@ require $config['install_dir'].'/includes/object-cache.inc.php';
|
||||
|
||||
// FIXME - this could do with some performance improvements, i think. possible rearranging some tables and setting flags at poller time (nothing changes outside of then anyways)
|
||||
|
||||
$service_status = get_service_status();
|
||||
$if_alerts = dbFetchCell("SELECT COUNT(port_id) FROM `ports` WHERE `ifOperStatus` = 'down' AND `ifAdminStatus` = 'up' AND `ignore` = '0'");
|
||||
$service_status = get_service_status();
|
||||
$typeahead_limit = $config['webui']['global_search_result_limit'];
|
||||
$if_alerts = dbFetchCell("SELECT COUNT(port_id) FROM `ports` WHERE `ifOperStatus` = 'down' AND `ifAdminStatus` = 'up' AND `ignore` = '0'");
|
||||
|
||||
if ($_SESSION['userlevel'] >= 5) {
|
||||
$links['count'] = dbFetchCell("SELECT COUNT(*) FROM `links`");
|
||||
@@ -717,6 +718,7 @@ $('#gsearch').typeahead({
|
||||
},
|
||||
{
|
||||
source: devices.ttAdapter(),
|
||||
limit: '<?php echo($typeahead_limit); ?>',
|
||||
async: true,
|
||||
display: 'name',
|
||||
valueKey: 'name',
|
||||
@@ -727,6 +729,7 @@ $('#gsearch').typeahead({
|
||||
},
|
||||
{
|
||||
source: ports.ttAdapter(),
|
||||
limit: '<?php echo($typeahead_limit); ?>',
|
||||
async: true,
|
||||
display: 'name',
|
||||
valueKey: 'name',
|
||||
@@ -737,6 +740,7 @@ $('#gsearch').typeahead({
|
||||
},
|
||||
{
|
||||
source: bgp.ttAdapter(),
|
||||
limit: '<?php echo($typeahead_limit); ?>',
|
||||
async: true,
|
||||
display: 'name',
|
||||
valueKey: 'name',
|
||||
@@ -749,3 +753,4 @@ $('#gsearch').bind('typeahead:open', function(ev, suggestion) {
|
||||
$('#gsearch').addClass('search-box');
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ $files = array();
|
||||
if ($handle = opendir($rrddir)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != '.' && $file != '..') {
|
||||
if (eregi('app-shoutcast-'.$app['app_id'], $file)) {
|
||||
if (stripos($file, 'app-shoutcast-'.$app['app_id']) !== false) {
|
||||
array_push($files, $file);
|
||||
}
|
||||
}
|
||||
@@ -45,8 +45,8 @@ if (isset($total) && $total === true) {
|
||||
}
|
||||
|
||||
foreach ($files as $id => $file) {
|
||||
$hostname = eregi_replace('app-shoutcast-'.$app['app_id'].'-', '', $file);
|
||||
$hostname = eregi_replace('.rrd', '', $hostname);
|
||||
$hostname = str_ireplace('app-shoutcast-'.$app['app_id'].'-', '', $file);
|
||||
$hostname = str_ireplace('.rrd', '', $hostname);
|
||||
list($host, $port) = explode('_', $hostname, 2);
|
||||
$graphs = array(
|
||||
'shoutcast_bits' => 'Traffic Statistics - '.$host.' (Port: '.$port.')',
|
||||
|
||||
@@ -10,7 +10,7 @@ $ports['disabled'] = dbFetchCell("SELECT COUNT(*) FROM `ports` WHERE device_id =
|
||||
$services = get_service_status($device['device_id']);
|
||||
$services['total'] = array_sum($services);
|
||||
|
||||
if ($services[0]) {
|
||||
if ($services[2]) {
|
||||
$services_colour = $warn_colour_a;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
<?php
|
||||
|
||||
$sensors = dbFetchRows('SELECT * FROM `sensors` WHERE `sensor_class` = ? AND device_id = ? ORDER BY `poller_type`, `sensor_oid`, `sensor_index`', array($sensor_class, $device['device_id']));
|
||||
|
||||
if ($sensor_class == 'state') {
|
||||
$sensors = dbFetchRows('SELECT * FROM `sensors` LEFT JOIN `sensors_to_state_indexes` ON sensors_to_state_indexes.sensor_id = sensors.sensor_id LEFT JOIN state_indexes ON state_indexes.state_index_id = sensors_to_state_indexes.state_index_id WHERE `sensor_class` = ? AND device_id = ? ORDER BY `poller_type`, `sensor_oid`, `sensor_index`', array($sensor_class, $device['device_id']));
|
||||
$sensors = dbFetchRows('SELECT * FROM `sensors` LEFT JOIN `sensors_to_state_indexes` ON sensors_to_state_indexes.sensor_id = sensors.sensor_id LEFT JOIN state_indexes ON state_indexes.state_index_id = sensors_to_state_indexes.state_index_id WHERE `sensor_class` = ? AND device_id = ? ORDER BY `poller_type`, `sensor_index`+0, `sensor_oid`', array($sensor_class, $device['device_id']));
|
||||
}
|
||||
else {
|
||||
$sensors = dbFetchRows('SELECT * FROM `sensors` WHERE `sensor_class` = ? AND device_id = ? ORDER BY `poller_type`, `sensor_oid`, `sensor_index`', array($sensor_class, $device['device_id']));
|
||||
}
|
||||
|
||||
if (count($sensors)) {
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
if ($services['total']) {
|
||||
// Build the string.
|
||||
foreach (service_get ($device['device_id']) as $data) {
|
||||
if ($data['service_status'] == '1') {
|
||||
if ($data['service_status'] == '0') {
|
||||
// Ok
|
||||
$status = 'green';
|
||||
} elseif ($data['service_status'] == '0') {
|
||||
// Critical
|
||||
} elseif ($data['service_status'] == '1') {
|
||||
// Warning
|
||||
$status = 'red';
|
||||
} elseif ($data['service_status'] == '2') {
|
||||
// Warning
|
||||
// Critical
|
||||
$status = 'red';
|
||||
} else {
|
||||
// Unknown
|
||||
@@ -29,9 +29,9 @@ if ($services['total']) {
|
||||
<table class="table table-hover table-condensed table-striped">
|
||||
<tr>
|
||||
<td title="Total"><img src='images/16/cog.png'> <?=$services['total']?></td>
|
||||
<td title="Status - Ok"><img src='images/16/cog_add.png'> <?=$services[1]?></td>
|
||||
<td title="Status - Critical"><img src='images/16/cog_delete.png'> <?=$services[0]?></td>
|
||||
<td title="Status - Unknown"><img src='images/16/cog_error.png'> <?=$services[2]?></td>
|
||||
<td title="Status - Ok"><img src='images/16/cog_add.png'> <?=$services[0]?></td>
|
||||
<td title="Status - Warning"><img src='images/16/cog_error.png'> <?=$services[1]?></td>
|
||||
<td title="Status - Critical"><img src='images/16/cog_delete.png'> <?=$services[2]?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='4'><?=$string?></td>
|
||||
|
||||
@@ -157,7 +157,7 @@ echo ' </div>
|
||||
//From default.php - This code is not part of above license.
|
||||
if ($config['enable_syslog']) {
|
||||
$sql = "SELECT *, DATE_FORMAT(timestamp, '".$config['dateformat']['mysql']['compact']."') AS date from syslog ORDER BY seq DESC LIMIT 20";
|
||||
$query = mysql_query($sql);
|
||||
|
||||
echo('<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@@ -196,8 +196,6 @@ echo('<div class="container-fluid">
|
||||
P.device_id AND P.user_id = " . $_SESSION['user_id'] . " ORDER BY `datetime` DESC LIMIT 0,15";
|
||||
}
|
||||
|
||||
$data = mysql_query($query);
|
||||
|
||||
echo('<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
if ($_SESSION['userlevel'] >= 5) {
|
||||
$data['count'] = array( 'query' => 'SELECT COUNT(*) FROM services');
|
||||
$data['up'] = array( 'query' => "SELECT COUNT(*) FROM services WHERE `service_ignore` = '0' AND `service_disabled` = '0' AND `service_status` = '1'");
|
||||
$data['down'] = array( 'query' => "SELECT COUNT(*) FROM services WHERE `service_ignore` = '0' AND `service_disabled` = '0' AND `service_status` = '0'");
|
||||
$data['up'] = array( 'query' => "SELECT COUNT(*) FROM services WHERE `service_ignore` = '0' AND `service_disabled` = '0' AND `service_status` = '0'");
|
||||
$data['down'] = array( 'query' => "SELECT COUNT(*) FROM services WHERE `service_ignore` = '0' AND `service_disabled` = '0' AND `service_status` = '2'");
|
||||
$data['ignored'] = array( 'query' => "SELECT COUNT(*) FROM services WHERE `service_ignore` = '1' AND `service_disabled` = '0'");
|
||||
$data['disabled'] = array( 'query' => "SELECT COUNT(*) FROM services WHERE `service_disabled` = '1'");
|
||||
}
|
||||
@@ -14,12 +14,12 @@ else {
|
||||
);
|
||||
|
||||
$data['up'] = array(
|
||||
'query' => "SELECT COUNT(*) FROM services AS S, devices AS D, devices_perms AS P WHERE P.`user_id` = ? AND P.`device_id` = D.`device_id` AND S.`device_id` = D.`device_id` AND S.`service_ignore` = '0' AND S.`service_disabled` = '0' AND S.`service_status` = '1'",
|
||||
'query' => "SELECT COUNT(*) FROM services AS S, devices AS D, devices_perms AS P WHERE P.`user_id` = ? AND P.`device_id` = D.`device_id` AND S.`device_id` = D.`device_id` AND S.`service_ignore` = '0' AND S.`service_disabled` = '0' AND S.`service_status` = '0'",
|
||||
'params' => array($_SESSION['user_id']),
|
||||
);
|
||||
|
||||
$data['down'] = array(
|
||||
'query' => "SELECT COUNT(*) FROM services AS S, devices AS D, devices_perms AS P WHERE P.`user_id` = ? AND P.`device_id` = D.`device_id` AND S.`device_id` = D.`device_id` AND S.`service_ignore` = '0' AND S.`service_disabled` = '0' AND S.`service_status` = '0'",
|
||||
'query' => "SELECT COUNT(*) FROM services AS S, devices AS D, devices_perms AS P WHERE P.`user_id` = ? AND P.`device_id` = D.`device_id` AND S.`device_id` = D.`device_id` AND S.`service_ignore` = '0' AND S.`service_disabled` = '0' AND S.`service_status` = '2'",
|
||||
'params' => array($_SESSION['user_id']),
|
||||
);
|
||||
|
||||
|
||||
+2
-2
@@ -699,8 +699,8 @@ function get_smokeping_files($device) {
|
||||
if ($handle = opendir($smokeping_dir)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != '.' && $file != '..') {
|
||||
if (eregi('.rrd', $file)) {
|
||||
if (eregi('~', $file)) {
|
||||
if (stripos($file, '.rrd') !== false) {
|
||||
if (strpos($file, '~') !== false) {
|
||||
list($target,$slave) = explode('~', str_replace('.rrd', '', $file));
|
||||
$target = str_replace('_', '.', $target);
|
||||
$smokeping_files['in'][$target][$slave] = $file;
|
||||
|
||||
@@ -439,7 +439,7 @@ $config['enable_pseudowires'] = 1;
|
||||
$config['enable_vrfs'] = 1;
|
||||
// Enable VRFs
|
||||
$config['enable_vrf_lite_cisco'] = 1;
|
||||
// Enable VRF lite cisco
|
||||
// Enable routes for VRF lite cisco
|
||||
$config['enable_printers'] = 0;
|
||||
// Enable Printer support
|
||||
$config['enable_sla'] = 0;
|
||||
@@ -728,6 +728,7 @@ $config['discovery_modules']['mempools'] = 1;
|
||||
$config['discovery_modules']['cisco-vrf-lite'] = 1;
|
||||
$config['discovery_modules']['ipv4-addresses'] = 1;
|
||||
$config['discovery_modules']['ipv6-addresses'] = 1;
|
||||
$config['discovery_modules']['route'] = 0;
|
||||
$config['discovery_modules']['sensors'] = 1;
|
||||
$config['discovery_modules']['storage'] = 1;
|
||||
$config['discovery_modules']['hr-device'] = 1;
|
||||
@@ -871,3 +872,4 @@ $config['ignore_unmapable_port'] = False;
|
||||
// InfluxDB default configuration
|
||||
$config['influxdb']['timeout'] = 0;
|
||||
$config['influxdb']['verifySSL'] = false;
|
||||
|
||||
|
||||
@@ -95,6 +95,16 @@ $config['os'][$os]['over'][1]['text'] = 'Processor Usage';
|
||||
$config['os'][$os]['over'][2]['graph'] = 'device_ucd_memory';
|
||||
$config['os'][$os]['over'][2]['text'] = 'Memory Usage';
|
||||
|
||||
$os = 'viprinux';
|
||||
$config['os'][$os]['text'] = 'Viprinux';
|
||||
$config['os'][$os]['type'] = 'network';
|
||||
$config['os'][$os]['icon'] = 'viprinux';
|
||||
$config['os'][$os]['ifname'] = 1;
|
||||
$config['os'][$os]['over'][0]['graph'] = 'device_bits';
|
||||
$config['os'][$os]['over'][0]['text'] = 'Device Traffic';
|
||||
$config['os'][$os]['over'][1]['graph'] = 'device_processor';
|
||||
$config['os'][$os]['over'][1]['text'] = 'Processor Usage';
|
||||
|
||||
$os = 'edgeos';
|
||||
$config['os'][$os]['text'] = 'EdgeOS';
|
||||
$config['os'][$os]['type'] = 'network';
|
||||
|
||||
@@ -1,11 +1,45 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'ironware' || $device['os_type'] == 'ironware') {
|
||||
echo 'Ironware Dynamic: ';
|
||||
|
||||
$percent = snmp_get($device, 'snAgGblDynMemUtil.0', '-OvQ', 'FOUNDRY-SN-AGENT-MIB');
|
||||
$is_netiron = snmp_get($device, 'sysObjectID.0', '-OvQ', 'FOUNDRY-SN-AGENT-MIB');
|
||||
|
||||
if (strpos($is_netiron, 'NI') === false && strpos($is_netiron, 'MLX') === false && strpos($is_netiron, 'Cer') === false) {
|
||||
|
||||
echo 'Ironware Dynamic: ';
|
||||
|
||||
$percent = snmp_get($device, 'snAgGblDynMemUtil.0', '-OvQ', 'FOUNDRY-SN-AGENT-MIB');
|
||||
|
||||
if (is_numeric($percent)) {
|
||||
discover_mempool($valid_mempool, $device, 0, 'ironware-dyn', 'Dynamic Memory', '1', null, null);
|
||||
} //end_if
|
||||
} //end_if
|
||||
else {
|
||||
|
||||
echo 'NetIron: ';
|
||||
|
||||
d_echo('caching');
|
||||
$ni_mempools_array = snmpwalk_cache_multi_oid($device, 'snAgentBrdMainBrdDescription', $ni_mempools_array, 'FOUNDRY-SN-AGENT-MIB', $config['install_dir'].'/mibs');
|
||||
$ni_mempools_array = snmpwalk_cache_multi_oid($device, 'snAgentBrdMemoryUtil100thPercent', $ni_mempools_array, 'FOUNDRY-SN-AGENT-MIB', $config['install_dir'].'/mibs');
|
||||
$ni_mempools_array = snmpwalk_cache_multi_oid($device, 'snAgentBrdMemoryAvailable', $ni_mempools_array, 'FOUNDRY-SN-AGENT-MIB', $config['install_dir'].'/mibs');
|
||||
$ni_mempools_array = snmpwalk_cache_multi_oid($device, 'snAgentBrdMemoryTotal', $ni_mempools_array, 'FOUNDRY-SN-AGENT-MIB', $config['install_dir'].'/mibs');
|
||||
d_echo($ni_mempool_array);
|
||||
|
||||
if (is_array($ni_mempools_array)) {
|
||||
foreach ($ni_mempools_array as $index => $entry) {
|
||||
|
||||
d_echo($index.' '.$entry['snAgentBrdMainBrdDescription'].' -> '.$entry['snAgentBrdMemoryUtil100thPercent']."\n");
|
||||
|
||||
$usage_oid = '.1.3.6.1.4.1.1991.1.1.2.2.1.1.28.'.$index;
|
||||
$descr = $entry['snAgentBrdMainBrdDescription'];
|
||||
$usage = ($entry['snAgentBrdMemoryUtil100thPercent'] / 100);
|
||||
if (!strstr($descr, 'No') && !strstr($usage, 'No') && $descr != '') {
|
||||
discover_mempool($valid_mempool, $device, $index, 'ironware-dyn', $descr, '1', null, null);
|
||||
} //end_if
|
||||
} //end_foreach
|
||||
} //end_if
|
||||
} //end_else
|
||||
} //end_if
|
||||
|
||||
|
||||
|
||||
if (is_numeric($percent)) {
|
||||
discover_mempool($valid_mempool, $device, 0, 'ironware-dyn', 'Dynamic Memory', '1', null, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
if (!$os) {
|
||||
if (preg_match('/^POWERALERT/', $sysDescr)) {
|
||||
if (preg_match('/^POWERALERT/i', $sysDescr)) {
|
||||
$os = 'poweralert';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
if (!$os) {
|
||||
if (strstr($sysDescr, 'Viprinet VPN Router')) {
|
||||
$os = 'viprinux';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'viprinux') {
|
||||
|
||||
$usage = str_replace('"',"", snmp_get($device, 'VIPRINET-MIB::vpnRouterCPULoad.0', '-OvQ'));
|
||||
$descr = 'Processor';
|
||||
|
||||
echo 'Viprinet :';
|
||||
|
||||
if (is_numeric($usage)) {
|
||||
discover_processor($valid['processor'], $device, 'VIPRINET-MIB::vpnRouterCPULoad.0', '0', 'viprinet-cpu', $descr,
|
||||
'1', $usage, null, null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
<?php
|
||||
|
||||
/* Copyright (C) 2014 Nicolas Armando <nicearma@yahoo.com> and Mathieu Millet <htam-net@github.net>
|
||||
* 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 <http://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
//This file is a litle diferent, because the route depend of the vrf, not of the context,
|
||||
//like the others, so if i use the context, you will have the same information n time the context how have the same VRF
|
||||
global $debug;
|
||||
|
||||
|
||||
$ids = array();
|
||||
|
||||
// For the moment only will be cisco and the version 3
|
||||
if ($device['os_group'] == "cisco") {
|
||||
|
||||
echo ("ROUTE : ");
|
||||
//RFC1213-MIB
|
||||
$mib = "RFC1213-MIB";
|
||||
//IpRouteEntry
|
||||
$vrfs_lite_cisco = array();
|
||||
|
||||
if (key_exists('vrf_lite_cisco', $device) && (count($device['vrf_lite_cisco']) != 0)) {
|
||||
|
||||
//i will only get one context of vrf, read the begin of this file
|
||||
foreach ($device['vrf_lite_cisco'] as $vrf_lite) {
|
||||
if (!key_exists($vrf_lite['vrf_name'], $vrfs_lite_cisco)) {
|
||||
$vrfs_lite_cisco[$vrf_lite['vrf_name']] = $vrf_lite;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$vrfs_lite_cisco = array(array('context_name' => null));
|
||||
}
|
||||
|
||||
$tableRoute = array();
|
||||
|
||||
foreach ($vrfs_lite_cisco as $vrf_lite) {
|
||||
$device['context_name'] = $vrf_lite['context_name'];
|
||||
|
||||
////////////////ipRouteDest//////////////////
|
||||
$oid = '.1.3.6.1.2.1.4.21.1.1';
|
||||
$resultHelp = snmp_walk($device, $oid, "-Osqn", $mib, NULL);
|
||||
$resultHelp = trim($resultHelp);
|
||||
$resultHelp = str_replace("$oid.", "", $resultHelp);
|
||||
|
||||
foreach (explode("\n", $resultHelp) as $ipRouteDest) {
|
||||
list($ip, $value) = explode(" ", $ipRouteDest);
|
||||
$tableRoute[$ip]['ipRouteDest'] = $value;
|
||||
}
|
||||
|
||||
/////////////////ipRouteIfIndex//////////////
|
||||
$oid = '.1.3.6.1.2.1.4.21.1.2';
|
||||
$resultHelp = snmp_walk($device, $oid, "-Osqn", $mib, NULL);
|
||||
$resultHelp = trim($resultHelp);
|
||||
$resultHelp = str_replace("$oid.", "", $resultHelp);
|
||||
|
||||
foreach (explode("\n", $resultHelp) as $ipRouteIfIndex) {
|
||||
list($ip, $value) = explode(" ", $ipRouteIfIndex);
|
||||
$tableRoute[$ip]['ipRouteIfIndex'] = $value;
|
||||
}
|
||||
|
||||
///////////////ipRouteMetric1///////////////
|
||||
$oid = '.1.3.6.1.2.1.4.21.1.3';
|
||||
$resultHelp = snmp_walk($device, $oid, "-Osqn", $mib, NULL);
|
||||
$resultHelp = trim($resultHelp);
|
||||
$resultHelp = str_replace("$oid.", "", $resultHelp);
|
||||
|
||||
foreach (explode("\n", $resultHelp) as $ipRouteMetric) {
|
||||
list($ip, $value) = explode(" ", $ipRouteMetric);
|
||||
$tableRoute[$ip]['ipRouteMetric'] = $value;
|
||||
}
|
||||
|
||||
////////////ipRouteNextHop//////////////////
|
||||
$oid = '.1.3.6.1.2.1.4.21.1.7';
|
||||
$resultHelp = snmp_walk($device, $oid, "-Osqn", $mib, NULL);
|
||||
$resultHelp = trim($resultHelp);
|
||||
$resultHelp = str_replace("$oid.", "", $resultHelp);
|
||||
foreach (explode("\n", $resultHelp) as $ipRouteNextHop) {
|
||||
list($ip, $value) = explode(" ", $ipRouteNextHop);
|
||||
$tableRoute[$ip]['ipRouteNextHop'] = $value;
|
||||
}
|
||||
|
||||
////////////ipRouteType/////////////////////
|
||||
$oid = '.1.3.6.1.2.1.4.21.1.8';
|
||||
$resultHelp = snmp_walk($device, $oid, "-Osqn", $mib, NULL);
|
||||
$resultHelp = trim($resultHelp);
|
||||
$resultHelp = str_replace("$oid.", "", $resultHelp);
|
||||
|
||||
foreach (explode("\n", $resultHelp) as $ipRouteType) {
|
||||
list($ip, $value) = explode(" ", $ipRouteType);
|
||||
$tableRoute[$ip]['ipRouteType'] = $value;
|
||||
}
|
||||
|
||||
///////////ipRouteProto//////////////////////
|
||||
$oid = '.1.3.6.1.2.1.4.21.1.9';
|
||||
$resultHelp = snmp_walk($device, $oid, "-Osqn", $mib, NULL);
|
||||
$resultHelp = trim($resultHelp);
|
||||
$resultHelp = str_replace("$oid.", "", $resultHelp);
|
||||
|
||||
|
||||
foreach (explode("\n", $resultHelp) as $ipRouteProto) {
|
||||
list($ip, $value) = explode(" ", $ipRouteProto);
|
||||
$tableRoute[$ip]['ipRouteProto'] = $value;
|
||||
}
|
||||
|
||||
/*
|
||||
///////////ipRouteAge//////////////////////
|
||||
$oid = '.1.3.6.1.2.1.4.21.1.10';
|
||||
$resultHelp = snmp_walk($device, $oid, "-Osqn", $mib, NULL);
|
||||
$resultHelp = str_replace("$oid.", "", $resultHelp);
|
||||
|
||||
foreach (explode("\n", $resultHelp) as $ipRouteAge) {
|
||||
list($ip,$value)=explode(" ",$ipRouteAge);
|
||||
$tableRoute[$ip]['ipRouteAge']=$value;
|
||||
} */
|
||||
|
||||
///////////ipRouteMask//////////////////////
|
||||
$oid = '.1.3.6.1.2.1.4.21.1.11';
|
||||
$resultHelp = snmp_walk($device, $oid, "-Osqn -Ln", $mib, NULL);
|
||||
$resultHelp = trim($resultHelp);
|
||||
$resultHelp = str_replace("$oid.", "", $resultHelp);
|
||||
|
||||
foreach (explode("\n", $resultHelp) as $ipRouteMask) {
|
||||
list($ip, $value) = explode(" ", $ipRouteMask);
|
||||
$tableRoute[$ip]['ipRouteMask'] = $value;
|
||||
}
|
||||
|
||||
if ($debug) {
|
||||
echo 'Table routage';
|
||||
var_dump($tableRoute);
|
||||
}
|
||||
|
||||
foreach ($tableRoute as $ipRoute) {
|
||||
if (empty($ipRoute['ipRouteDest']) || $ipRoute['ipRouteDest'] == '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$oldRouteRow = dbFetchRow('select * from route where device_id = ? AND ipRouteDest = ? AND context_name = ?', array($device['device_id'], $ipRoute['ipRouteDest'], $device['context_name']));
|
||||
if (!empty($oldRouteRow)) {
|
||||
unset($oldRouteRow['discoveredAt']);
|
||||
$changeRoute = array();
|
||||
foreach ($ipRoute as $key => $value) {
|
||||
if ($oldRouteRow[$key] != $value) {
|
||||
$changeRoute[$key] = $value;
|
||||
}
|
||||
}
|
||||
if (!empty($changeRoute)) {
|
||||
dbUpdate($changeRoute, 'route', 'device_id = ? and ipRouteDest = ? and context_name = ?', array($device['device_id'], $ipRoute['ipRouteDest'], $device['context_name']));
|
||||
}
|
||||
} else {
|
||||
|
||||
$toInsert = array_merge($ipRoute, array('device_id' => $device['device_id'], 'context_name' => $device['context_name'], 'discoveredAt' => time()));
|
||||
dbInsert($toInsert, 'route');
|
||||
}
|
||||
}
|
||||
// unset($tableRoute);
|
||||
}
|
||||
|
||||
unset($vrfs_lite_cisco);
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
* Copyright (c) 2016 Tony Murray <murrayton@gmail.com>
|
||||
* 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 ($device['os'] == 'netonix') {
|
||||
|
||||
$temp = snmpwalk_cache_multi_oid($device, '.1.3.6.1.4.1.46242.5.1.2', array());
|
||||
$cur_oid = '.1.3.6.1.4.1.';
|
||||
|
||||
if (is_array($temp)) {
|
||||
//Create State Index
|
||||
$state_name = 'netonixPoeStatus';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
$states_ids = array(
|
||||
'Off' => 1,
|
||||
'24V' => 2,
|
||||
'48V' => 3
|
||||
);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id,'Off',0,1,-1) ,
|
||||
array($state_index_id,'24V',0,2,0) ,
|
||||
array($state_index_id,'48V',0,3,1) ,
|
||||
);
|
||||
foreach($states as $value){
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($temp as $index => $entry) {
|
||||
$id = substr($index, strrpos($index, '.')+1);
|
||||
$descr = 'Port ' . $id . ' PoE';
|
||||
$current = $states_ids[$entry['enterprises']];
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $id, $state_name, $descr, '1', '1', null, null, null, null, $current);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'dnos'){
|
||||
$temps = snmp_walk($device, '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.8.1.5', '-Osqn');
|
||||
//This will return at least 4 OIDs (multiplied by the number of switches if stacked) and associated values for various temperatures
|
||||
|
||||
$counter = 0;
|
||||
|
||||
|
||||
foreach (explode("\n", $temps) as $i => $t) {
|
||||
$t = explode(' ',$t);
|
||||
$oid = $t[0];
|
||||
$val = $t[1];
|
||||
|
||||
if (substr($oid, -1) == '1') {
|
||||
// This code will only pull CPU temp for each stack member, but there is no reason why the additional values couldn't be graphed
|
||||
$counter = $counter + 1;
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $oid, $counter, 'dnos',
|
||||
'Unit '.$counter.' CPU temperature', '1', '1', null, null, null, null, $val);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,6 +44,13 @@ function poll_sensor($device, $class, $unit) {
|
||||
}
|
||||
else if ($class == 'state') {
|
||||
$sensor_value = trim(str_replace('"', '', snmp_walk($device, $sensor['sensor_oid'], '-Oevq', 'SNMPv2-MIB')));
|
||||
if (!is_numeric($sensor_value)) {
|
||||
$state_value = dbFetchCell('SELECT `state_value` FROM `state_translations` LEFT JOIN `sensors_to_state_indexes` ON `state_translations`.`state_index_id` = `sensors_to_state_indexes`.`state_index_id` WHERE `sensors_to_state_indexes`.`sensor_id` = ? AND `state_translations`.`state_descr` LIKE ?', array($sensor['sensor_id'], $sensor_value));
|
||||
d_echo('State value of ' . $sensor_value . ' is ' . $state_value . "\n");
|
||||
if (is_numeric($state_value)) {
|
||||
$sensor_value = $state_value;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ($class == 'signal') {
|
||||
$currentOS = $device['os'];
|
||||
|
||||
@@ -1,7 +1,36 @@
|
||||
<?php
|
||||
|
||||
// Simple hard-coded poller for Brocade Ironware Dynamic Memory (old style)
|
||||
// Yes, it really can be this simple.
|
||||
$mempool['total'] = snmp_get($device, 'snAgGblDynMemTotal.0', '-OvQ', 'FOUNDRY-SN-AGENT-MIB');
|
||||
$mempool['free'] = snmp_get($device, 'snAgGblDynMemFree.0', '-OvQ', 'FOUNDRY-SN-AGENT-MIB');
|
||||
$mempool['used'] = ($mempool['total'] - $mempool['free']);
|
||||
$oid = $mempool['mempool_index'];
|
||||
|
||||
d_echo('Ironware Mempool'."\n");
|
||||
|
||||
$is_netiron = snmp_get($device, 'sysObjectID.0', '-OvQ', 'FOUNDRY-SN-AGENT-MIB');
|
||||
|
||||
if (strpos($is_netiron, 'NI') === false && strpos($is_netiron, 'MLX') === false && strpos($is_netiron, 'Cer') === false) {
|
||||
|
||||
$mempool['total'] = snmp_get($device, 'snAgGblDynMemTotal.0', '-OvQ', 'FOUNDRY-SN-AGENT-MIB');
|
||||
$mempool['free'] = snmp_get($device, 'snAgGblDynMemFree.0', '-OvQ', 'FOUNDRY-SN-AGENT-MIB');
|
||||
$mempool['used'] = ($mempool['total'] - $mempool['free']);
|
||||
|
||||
} //end_if
|
||||
|
||||
else {
|
||||
|
||||
d_echo('caching');
|
||||
$mempool_cache['ironware-dyn'] = array();
|
||||
$mempool_cache['ironware-dyn'] = snmpwalk_cache_multi_oid($device, 'snAgentBrdMemoryUtil100thPercent', $mempool_cache['ironware-dyn'], 'FOUNDRY-SN-AGENT-MIB', $config['install_dir'].'/mibs');
|
||||
$mempool_cache['ironware-dyn'] = snmpwalk_cache_multi_oid($device, 'snAgentBrdMemoryAvailable', $mempool_cache['ironware-dyn'], 'FOUNDRY-SN-AGENT-MIB', $config['install_dir'].'/mibs');
|
||||
$mempool_cache['ironware-dyn'] = snmpwalk_cache_multi_oid($device, 'snAgentBrdMemoryTotal', $mempool_cache['ironware-dyn'], 'FOUNDRY-SN-AGENT-MIB', $config['install_dir'].'/mibs');
|
||||
d_echo($mempool_cache);
|
||||
|
||||
$entry = $mempool_cache['ironware-dyn'][$mempool[mempool_index]];
|
||||
|
||||
$perc = $entry['snAgentBrdMemoryUtil100thPercent'];
|
||||
|
||||
$memory_available = $entry['snAgentBrdMemoryTotal'];
|
||||
|
||||
$mempool['total'] = $memory_available;
|
||||
$mempool['used'] = $memory_available / 10000 * $perc;
|
||||
$mempool['free'] = $memory_available - $mempool['used'];
|
||||
|
||||
} //end_else
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
$version = trim(snmp_get($device, "vpnRouterFirmware.0", "-OQv", "VIPRINET-MIB"),'"');
|
||||
$hardware = "VPN Router " . trim(snmp_get($device, "vpnRouterModel.0", "-OQv", "VIPRINET-MIB"),'"');
|
||||
$hostname = trim(snmp_get($device, "vpnRouterName.0", "-OQv", "VIPRINET-MIB"),'"');
|
||||
$serial = trim(snmp_get($device, "vpnRouterSerial.0", "-OQv", "VIPRINET-MIB"),'"');
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
echo 'Viprinet CPU Usage';
|
||||
|
||||
if ($device['os'] == 'viprinux') {
|
||||
$usage = str_replace('"',"", snmp_get($device, 'VIPRINET-MIB::vpnRouterCPULoad.0', '-OvQ'));
|
||||
if (is_numeric($usage)) {
|
||||
$proc = ($usage * 100);
|
||||
}
|
||||
}
|
||||
@@ -179,6 +179,11 @@ function poll_service($service) {
|
||||
$update['service_message'] = $msg;
|
||||
}
|
||||
|
||||
if ($service['service_message'] != $msg) {
|
||||
// Message has changed, update.
|
||||
$update['service_message'] = $msg;
|
||||
}
|
||||
|
||||
if (count($update) > 0) {
|
||||
edit_service($update,$service['service_id']);
|
||||
}
|
||||
|
||||
@@ -416,7 +416,7 @@ class ircbot {
|
||||
|
||||
private function chkdb() {
|
||||
if (!is_resource($this->sql)) {
|
||||
if (($this->sql = mysql_connect($this->config['db_host'], $this->config['db_user'], $this->config['db_pass'])) != false && mysql_select_db($this->config['db_name'])) {
|
||||
if (($this->sql = mysqli_connect($this->config['db_host'], $this->config['db_user'], $this->config['db_pass'])) != false && mysqli_select_db($this->sql, $this->config['db_name'])) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -0,0 +1,831 @@
|
||||
VIPRINET-MIB DEFINITIONS ::= BEGIN
|
||||
|
||||
IMPORTS
|
||||
MODULE-IDENTITY, OBJECT-TYPE, Integer32, Counter32, enterprises, TimeTicks
|
||||
FROM SNMPv2-SMI
|
||||
DisplayString
|
||||
FROM SNMPv2-TC
|
||||
OBJECT-GROUP, MODULE-COMPLIANCE
|
||||
FROM SNMPv2-CONF
|
||||
;
|
||||
|
||||
viprinet MODULE-IDENTITY
|
||||
LAST-UPDATED "201509281620Z" -- 28 September 2015
|
||||
ORGANIZATION "Viprinet"
|
||||
CONTACT-INFO "Viprinet"
|
||||
DESCRIPTION "This MIB complements the ViprinetMIB."
|
||||
REVISION "201509281620Z" -- 28 September 2015
|
||||
DESCRIPTION "Seventh revision."
|
||||
::= { enterprises 35424 }
|
||||
|
||||
vpnRouter OBJECT IDENTIFIER ::= { viprinet 1 }
|
||||
|
||||
vpnRouterInfo OBJECT IDENTIFIER ::= { vpnRouter 1 }
|
||||
vpnRouterHealth OBJECT IDENTIFIER ::= { vpnRouter 2 }
|
||||
vpnRouterFans OBJECT IDENTIFIER ::= { vpnRouter 3 }
|
||||
vpnRouterInterfaces OBJECT IDENTIFIER ::= { vpnRouter 4 }
|
||||
vpnRouterTunnels OBJECT IDENTIFIER ::= { vpnRouter 5 }
|
||||
vpnRouterTunnelChannels OBJECT IDENTIFIER ::= { vpnRouter 6 }
|
||||
|
||||
|
||||
vpnRouterName OBJECT-TYPE
|
||||
SYNTAX OCTET STRING (SIZE (64))
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"A short descriptive name of the router."
|
||||
::= { vpnRouterInfo 1 }
|
||||
|
||||
vpnRouterSerial OBJECT-TYPE
|
||||
SYNTAX OCTET STRING (SIZE (19))
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Serial number of this router."
|
||||
::= { vpnRouterInfo 2 }
|
||||
|
||||
vpnRouterModel OBJECT-TYPE
|
||||
SYNTAX OCTET STRING (SIZE (6))
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Router Model"
|
||||
::= { vpnRouterInfo 3 }
|
||||
|
||||
vpnRouterFirmware OBJECT-TYPE
|
||||
SYNTAX OCTET STRING (SIZE (22))
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Firmware Version currently running on this router."
|
||||
::= { vpnRouterInfo 4 }
|
||||
|
||||
vpnRouterMode OBJECT-TYPE
|
||||
SYNTAX Integer32 (0..3)
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Current mode that the router is running in. Possible values are:
|
||||
0 - Node
|
||||
1 - Hub
|
||||
2 - Hub running as HotSpare
|
||||
3 - Hotspare-Hub replacing another router"
|
||||
::= { vpnRouterInfo 5 }
|
||||
|
||||
vpnRouteruptime OBJECT-TYPE
|
||||
SYNTAX TimeTicks
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Elapsed time since the router has booted."
|
||||
::= { vpnRouterInfo 6 }
|
||||
|
||||
vpnRouterFirmwareStatus OBJECT-TYPE
|
||||
SYNTAX Integer32 (0..4)
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Current Status of the Update System. Possible values are:
|
||||
0 - Idle / No new firmware available
|
||||
1 - Updates Available
|
||||
2 - Checking for Updates
|
||||
3 - Downloading Update
|
||||
4 - Installing Update"
|
||||
::= { vpnRouterInfo 7 }
|
||||
|
||||
|
||||
vpnRouterCPULoad OBJECT-TYPE
|
||||
SYNTAX OCTET STRING (SIZE (3))
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Load average on this router"
|
||||
::= { vpnRouterHealth 1 }
|
||||
|
||||
vpnRouterMemoryUsage OBJECT-TYPE
|
||||
SYNTAX Integer32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Current total memory usage (in KByte)."
|
||||
::= { vpnRouterHealth 2 }
|
||||
|
||||
vpnRouterSystemTemperature OBJECT-TYPE
|
||||
SYNTAX Integer32(0..65535)
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Current system temperature (in degree Celsius)."
|
||||
::= { vpnRouterHealth 3 }
|
||||
|
||||
vpnRouterCPUTemperature OBJECT-TYPE
|
||||
SYNTAX Integer32(0..65535)
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Current CPU temperature (in degree Celsius)"
|
||||
::= { vpnRouterHealth 4 }
|
||||
|
||||
vpnRouterPowerSupplyFailure OBJECT-TYPE
|
||||
SYNTAX Integer32(0..1)
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Information about the PSU
|
||||
Possible Values are:
|
||||
0 = no failure
|
||||
1 = a single PSU is out of order"
|
||||
::= { vpnRouterHealth 5 }
|
||||
|
||||
vpnRouterFanCount OBJECT-TYPE
|
||||
SYNTAX Integer32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Number of Fans."
|
||||
::= { vpnRouterFans 1 }
|
||||
|
||||
vpnRouterFanTable OBJECT-TYPE
|
||||
SYNTAX SEQUENCE OF VpnRouterFanEntry
|
||||
MAX-ACCESS not-accessible
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The table holding information to each fan."
|
||||
::= { vpnRouterFans 2 }
|
||||
|
||||
vpnRouterFanEntry OBJECT-TYPE
|
||||
SYNTAX VpnRouterFanEntry
|
||||
MAX-ACCESS not-accessible
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The entry associated with each fan."
|
||||
INDEX {vpnRouterFanIndex}
|
||||
::= { vpnRouterFanTable 1 }
|
||||
|
||||
VpnRouterFanEntry ::= SEQUENCE {
|
||||
vpnRouterFanIndex Integer32,
|
||||
vpnRouterFanAdminStatus Integer32,
|
||||
vpnRouterFanOperativeStatus Integer32,
|
||||
vpnRouterFanRPM Integer32
|
||||
}
|
||||
|
||||
vpnRouterFanIndex OBJECT-TYPE
|
||||
SYNTAX Integer32(0..65535)
|
||||
MAX-ACCESS not-accessible
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"ID-Number of the fan"
|
||||
::= { vpnRouterFanEntry 1 }
|
||||
|
||||
vpnRouterFanAdminStatus OBJECT-TYPE
|
||||
SYNTAX Integer32(0..1)
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Desired state of this Fan
|
||||
Possible Values:
|
||||
0 = off
|
||||
1 = on"
|
||||
::= { vpnRouterFanEntry 2 }
|
||||
|
||||
vpnRouterFanOperativeStatus OBJECT-TYPE
|
||||
SYNTAX Integer32(0..2)
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Operative status of this fan
|
||||
0 = Disabled
|
||||
1 = OK
|
||||
2 = Faulty"
|
||||
::= { vpnRouterFanEntry 3 }
|
||||
|
||||
vpnRouterFanRPM OBJECT-TYPE
|
||||
SYNTAX Integer32(0..65535)
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Current RPM of this fan. Note that not all models supply this info."
|
||||
::= { vpnRouterFanEntry 4 }
|
||||
|
||||
vpnRouterInterfaceCount OBJECT-TYPE
|
||||
SYNTAX Integer32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Number of Interfaces."
|
||||
::= { vpnRouterInterfaces 1 }
|
||||
|
||||
vpnRouterInterfaceTable OBJECT-TYPE
|
||||
SYNTAX SEQUENCE OF VpnRouterInterfaceEntry
|
||||
MAX-ACCESS not-accessible
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The table holding information to each interface."
|
||||
::= { vpnRouterInterfaces 2 }
|
||||
|
||||
vpnRouterInterfaceEntry OBJECT-TYPE
|
||||
SYNTAX VpnRouterInterfaceEntry
|
||||
MAX-ACCESS not-accessible
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The entry associated with each interface."
|
||||
INDEX {vpnRouterInterfaceIndex}
|
||||
::= { vpnRouterInterfaceTable 1 }
|
||||
|
||||
VpnRouterInterfaceEntry ::= SEQUENCE {
|
||||
vpnRouterInterfaceIndex Integer32,
|
||||
vpnRouterInterfaceName DisplayString,
|
||||
vpnRouterInterfaceAdminStatus Integer32,
|
||||
vpnRouterInterfaceOperativeStatus Integer32,
|
||||
vpnRouterInterfaceBandwidthToWan Integer32,
|
||||
vpnRouterInterfaceBandwidthFromWan Integer32,
|
||||
vpnRouterInterfaceTrafficUp Counter32,
|
||||
vpnRouterInterfaceTrafficDown Counter32,
|
||||
vpnRouterInterfaceSignalStrength Integer32,
|
||||
vpnRouterInterfaceServiceType DisplayString,
|
||||
vpnRouterInterfaceServiceStatus DisplayString,
|
||||
vpnRouterInterfaceRoaming Integer32,
|
||||
vpnRouterInterfaceServiceStatus DisplayString,
|
||||
vpnRouterInterfaceNetworkName DisplayString,
|
||||
vpnRouterInterfaceBandInfo DisplayString,
|
||||
vpnRouterInterfaceIMSI DisplayString,
|
||||
vpnRouterInterfaceIMEI DisplayString,
|
||||
vpnRouterInterfacePINStatus DisplayString,
|
||||
vpnRouterInterfaceRFBand Integer32,
|
||||
vpnRouterInterfaceRFChannel Integer32,
|
||||
vpnRouterInterfaceSyncrateUpstream Counter32,
|
||||
vpnRouterInterfaceSyncrateDownstream Counter32
|
||||
}
|
||||
|
||||
vpnRouterInterfaceIndex OBJECT-TYPE
|
||||
SYNTAX Integer32(0..65535)
|
||||
MAX-ACCESS not-accessible
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"ID-Number of the interface."
|
||||
::= { vpnRouterInterfaceEntry 1 }
|
||||
|
||||
vpnRouterInterfaceName OBJECT-TYPE
|
||||
SYNTAX DisplayString
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"A short descriptive name of the interface"
|
||||
::= { vpnRouterInterfaceEntry 2 }
|
||||
|
||||
vpnRouterInterfaceAdminStatus OBJECT-TYPE
|
||||
SYNTAX Integer32(0..1)
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Desired state of the interface.
|
||||
possible values: 0 = disconnected, 1 = connected"
|
||||
::= { vpnRouterInterfaceEntry 3 }
|
||||
|
||||
vpnRouterInterfaceOperativeStatus OBJECT-TYPE
|
||||
SYNTAX Integer32(0..3)
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Current state of the interface.
|
||||
possible values:
|
||||
0 = disconnected,
|
||||
1 = connected,
|
||||
2 = connecting,
|
||||
3 = disconnecting"
|
||||
::= { vpnRouterInterfaceEntry 4 }
|
||||
|
||||
vpnRouterInterfaceBandwidthToWan OBJECT-TYPE
|
||||
SYNTAX Integer32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Theoretical maximum upstream (in KBit). Might be illusional."
|
||||
::= { vpnRouterInterfaceEntry 5 }
|
||||
|
||||
vpnRouterInterfaceBandwidthFromWan OBJECT-TYPE
|
||||
SYNTAX Integer32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Theoretical maximum downstream (in KBit)."
|
||||
::= { vpnRouterInterfaceEntry 6 }
|
||||
|
||||
vpnRouterInterfaceTrafficUp OBJECT-TYPE
|
||||
SYNTAX Counter32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Total upstream traffic made (in Byte) since router boot."
|
||||
::= { vpnRouterInterfaceEntry 7 }
|
||||
|
||||
vpnRouterInterfaceTrafficDown OBJECT-TYPE
|
||||
SYNTAX Counter32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Total downstream traffic made (in Byte) since router boot."
|
||||
::= { vpnRouterInterfaceEntry 8 }
|
||||
|
||||
vpnRouterInterfaceSignalStrength OBJECT-TYPE
|
||||
SYNTAX Integer32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Signal Strength (in percent)."
|
||||
::= { vpnRouterInterfaceEntry 9 }
|
||||
|
||||
vpnRouterInterfaceServiceType OBJECT-TYPE
|
||||
SYNTAX DisplayString
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Interface Service Type."
|
||||
::= { vpnRouterInterfaceEntry 10 }
|
||||
|
||||
vpnRouterInterfaceServiceStatus OBJECT-TYPE
|
||||
SYNTAX DisplayString
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Service Status."
|
||||
::= { vpnRouterInterfaceEntry 11 }
|
||||
|
||||
vpnRouterInterfaceRoaming OBJECT-TYPE
|
||||
SYNTAX Integer32(0..1)
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Interface Roaming.
|
||||
possible values:
|
||||
0 = off,
|
||||
1 = on"
|
||||
::= { vpnRouterInterfaceEntry 12 }
|
||||
|
||||
vpnRouterInterfaceNetworkName OBJECT-TYPE
|
||||
SYNTAX DisplayString
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Interface Network Name."
|
||||
::= { vpnRouterInterfaceEntry 13 }
|
||||
|
||||
vpnRouterInterfaceBandInfo OBJECT-TYPE
|
||||
SYNTAX DisplayString
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Interface Band Info."
|
||||
::= { vpnRouterInterfaceEntry 14 }
|
||||
|
||||
vpnRouterInterfaceIMSI OBJECT-TYPE
|
||||
SYNTAX DisplayString
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Interface IMSI."
|
||||
::= { vpnRouterInterfaceEntry 15 }
|
||||
|
||||
vpnRouterInterfaceIMEI OBJECT-TYPE
|
||||
SYNTAX DisplayString
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Interface IMEI."
|
||||
::= { vpnRouterInterfaceEntry 16 }
|
||||
|
||||
vpnRouterInterfacePINStatus OBJECT-TYPE
|
||||
SYNTAX DisplayString
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Interface PIN Status."
|
||||
::= { vpnRouterInterfaceEntry 17 }
|
||||
|
||||
vpnRouterInterfaceRFBand OBJECT-TYPE
|
||||
SYNTAX Integer32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Interface RF Band."
|
||||
::= { vpnRouterInterfaceEntry 18 }
|
||||
|
||||
vpnRouterInterfaceRFChannel OBJECT-TYPE
|
||||
SYNTAX Integer32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Interface RF Channel."
|
||||
::= { vpnRouterInterfaceEntry 19 }
|
||||
|
||||
vpnRouterInterfaceSyncrateUpstream OBJECT-TYPE
|
||||
SYNTAX Counter32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Interface Syncrate Upstream."
|
||||
::= { vpnRouterInterfaceEntry 20 }
|
||||
|
||||
vpnRouterInterfaceSyncrateDownstream OBJECT-TYPE
|
||||
SYNTAX Counter32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Interface Syncrate Downstream."
|
||||
::= { vpnRouterInterfaceEntry 21 }
|
||||
|
||||
vpnRouterTunnelCount OBJECT-TYPE
|
||||
SYNTAX Integer32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Number of Tunnels."
|
||||
::= { vpnRouterTunnels 1 }
|
||||
|
||||
vpnRouterTunnelTable OBJECT-TYPE
|
||||
SYNTAX SEQUENCE OF VpnRouterTunnelEntry
|
||||
MAX-ACCESS not-accessible
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The table holding information to each tunnel."
|
||||
::= { vpnRouterTunnels 2 }
|
||||
|
||||
vpnRouterTunnelEntry OBJECT-TYPE
|
||||
SYNTAX VpnRouterTunnelEntry
|
||||
MAX-ACCESS not-accessible
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The entry associated with each tunnel."
|
||||
INDEX {vpnRouterTunnelIndex}
|
||||
::= { vpnRouterTunnelTable 1 }
|
||||
|
||||
VpnRouterTunnelEntry ::= SEQUENCE {
|
||||
vpnRouterTunnelIndex Integer32,
|
||||
vpnRouterTunnelName DisplayString,
|
||||
vpnRouterTunnelAdminStatus Integer32,
|
||||
vpnRouterTunnelOperativeStatus Integer32,
|
||||
vpnRouterTunnelCumulatedBandwidthToWan Integer32,
|
||||
vpnRouterTunnelCumulatedBandwidthFromWan Integer32,
|
||||
vpnRouterTunnelCurrentCumulatedBandwidthToWan Integer32,
|
||||
vpnRouterTunnelCurrentCumulatedBandwidthFromWan Integer32,
|
||||
vpnRouterTunnelTrafficUp Counter32,
|
||||
vpnRouterTunnelTrafficDown Counter32,
|
||||
vpnRouterTunnelRemoteRouterSerial DisplayString
|
||||
}
|
||||
|
||||
vpnRouterTunnelIndex OBJECT-TYPE
|
||||
SYNTAX Integer32(0..65535)
|
||||
MAX-ACCESS not-accessible
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"ID-Number of the tunnel."
|
||||
::= { vpnRouterTunnelEntry 1 }
|
||||
|
||||
vpnRouterTunnelName OBJECT-TYPE
|
||||
SYNTAX DisplayString
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Name of VPN tunnel"
|
||||
::= { vpnRouterTunnelEntry 2 }
|
||||
|
||||
vpnRouterTunnelAdminStatus OBJECT-TYPE
|
||||
SYNTAX Integer32(0..1)
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Desired state of the tunnel.
|
||||
possible values: 0 = disconnected, 1 = connected"
|
||||
::= { vpnRouterTunnelEntry 3 }
|
||||
|
||||
vpnRouterTunnelOperativeStatus OBJECT-TYPE
|
||||
SYNTAX Integer32(0..1)
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Current state of the tunnel.
|
||||
possible values:
|
||||
0 = disconnected,
|
||||
1 = connected"
|
||||
::= { vpnRouterTunnelEntry 4 }
|
||||
|
||||
vpnRouterTunnelCumulatedBandwidthToWan OBJECT-TYPE
|
||||
SYNTAX Integer32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Theoretical maximum cumulated downstream (in KBit), considering all active channels."
|
||||
::= { vpnRouterTunnelEntry 5 }
|
||||
|
||||
vpnRouterTunnelCumulatedBandwidthFromWan OBJECT-TYPE
|
||||
SYNTAX Integer32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Theoretical maximum cumulated upstream (in KBit), considering all active channels."
|
||||
::= { vpnRouterTunnelEntry 6 }
|
||||
|
||||
vpnRouterTunnelCurrentCumulatedBandwidthToWan OBJECT-TYPE
|
||||
SYNTAX Integer32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Current cumulated upstream (in KBit)."
|
||||
::= { vpnRouterTunnelEntry 7 }
|
||||
|
||||
vpnRouterTunnelCurrentCumulatedBandwidthFromWan OBJECT-TYPE
|
||||
SYNTAX Integer32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Current cumulated downstream (in KBit)."
|
||||
::= { vpnRouterTunnelEntry 8 }
|
||||
|
||||
vpnRouterTunnelTrafficUp OBJECT-TYPE
|
||||
SYNTAX Counter32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Total upstream traffic made (in Byte) since router boot."
|
||||
::= { vpnRouterTunnelEntry 9 }
|
||||
|
||||
vpnRouterTunnelTrafficDown OBJECT-TYPE
|
||||
SYNTAX Counter32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Total downstream traffic made (in Byte) since router boot."
|
||||
::= { vpnRouterTunnelEntry 10 }
|
||||
|
||||
vpnRouterTunnelRemoteRouterSerial OBJECT-TYPE
|
||||
SYNTAX DisplayString
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Serial of the remote router."
|
||||
::= { vpnRouterTunnelEntry 11 }
|
||||
|
||||
vpnRouterTunnelChannelCount OBJECT-TYPE
|
||||
SYNTAX Integer32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Number of TunnelChannel."
|
||||
::= { vpnRouterTunnelChannels 1 }
|
||||
|
||||
vpnRouterTunnelChannelTable OBJECT-TYPE
|
||||
SYNTAX SEQUENCE OF VpnRouterTunnelChannelEntry
|
||||
MAX-ACCESS not-accessible
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The table holding information to each tunnelchannel."
|
||||
::= { vpnRouterTunnelChannels 2 }
|
||||
|
||||
vpnRouterTunnelChannelEntry OBJECT-TYPE
|
||||
SYNTAX VpnRouterTunnelChannelEntry
|
||||
MAX-ACCESS not-accessible
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The entry associated with each tunnelchannel."
|
||||
INDEX {vpnRouterTunnelChannelIndex}
|
||||
::= { vpnRouterTunnelChannelTable 1 }
|
||||
|
||||
VpnRouterTunnelChannelEntry ::= SEQUENCE {
|
||||
vpnRouterTunnelChannelIndex Integer32,
|
||||
vpnRouterTunnelChannelName DisplayString,
|
||||
vpnRouterTunnelChannelAdminStatus Integer32,
|
||||
vpnRouterTunnelChannelOperativeStatus Integer32,
|
||||
vpnRouterTunnelChannelMaxBandwidthToWan Integer32,
|
||||
vpnRouterTunnelChannelMaxBandwidthFromWan Integer32,
|
||||
vpnRouterTunnelChannelCurrentBandwidthToWan Integer32,
|
||||
vpnRouterTunnelChannelCurrentBandwidthFromWan Integer32,
|
||||
vpnRouterTunnelChannelTrafficUp Counter32,
|
||||
vpnRouterTunnelChannelTrafficDown Counter32,
|
||||
vpnRouterTunnelChannelReferencedTunnel Integer32,
|
||||
vpnRouterTunnelChannelIsBackup Integer32,
|
||||
vpnRouterTunnelChannelModuleSlot Integer32,
|
||||
vpnRouterTunnelChannelPacketLoss Integer32,
|
||||
vpnRouterTunnelChannelLinkStability Integer32
|
||||
}
|
||||
|
||||
vpnRouterTunnelChannelIndex OBJECT-TYPE
|
||||
SYNTAX Integer32(0..65535)
|
||||
MAX-ACCESS not-accessible
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"ID-Number of the tunnelchannel."
|
||||
::= { vpnRouterTunnelChannelEntry 1 }
|
||||
|
||||
vpnRouterTunnelChannelName OBJECT-TYPE
|
||||
SYNTAX DisplayString
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Name of tunnelchannel. It will be in the form tunnel.tunnelname"
|
||||
::= { vpnRouterTunnelChannelEntry 2 }
|
||||
|
||||
vpnRouterTunnelChannelAdminStatus OBJECT-TYPE
|
||||
SYNTAX Integer32(0..1)
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Desired state of the tunnelchannel.
|
||||
possible values: 0 = disconnected, 1 = connected"
|
||||
::= { vpnRouterTunnelChannelEntry 3 }
|
||||
|
||||
vpnRouterTunnelChannelOperativeStatus OBJECT-TYPE
|
||||
SYNTAX Integer32(0..8)
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Current state of the tunnelchannel.
|
||||
possible values:
|
||||
0 = disconnected,
|
||||
1 = connected,
|
||||
2 = connecting,
|
||||
3 = disconnecting,
|
||||
4 = connectedpingtest,
|
||||
5 = connectedpingtestwait,
|
||||
6 = connectedtooslow,
|
||||
7 = connectedstalled,
|
||||
8 = error"
|
||||
::= { vpnRouterTunnelChannelEntry 4 }
|
||||
|
||||
vpnRouterTunnelChannelMaxBandwidthToWan OBJECT-TYPE
|
||||
SYNTAX Integer32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Maximum possible bandwidth to WAN (in KBit/sec)."
|
||||
::= { vpnRouterTunnelChannelEntry 5 }
|
||||
|
||||
vpnRouterTunnelChannelMaxBandwidthFromWan OBJECT-TYPE
|
||||
SYNTAX Integer32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Maximum possible bandwidth from WAN (in KBit/sec)."
|
||||
::= { vpnRouterTunnelChannelEntry 6 }
|
||||
|
||||
vpnRouterTunnelChannelCurrentBandwidthToWan OBJECT-TYPE
|
||||
SYNTAX Integer32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Current bandwidth to WAN (in KBit/sec)."
|
||||
::= { vpnRouterTunnelChannelEntry 7 }
|
||||
|
||||
vpnRouterTunnelChannelCurrentBandwidthFromWan OBJECT-TYPE
|
||||
SYNTAX Integer32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Current bandwidth from WAN (in KBit/sec)."
|
||||
::= { vpnRouterTunnelChannelEntry 8 }
|
||||
|
||||
vpnRouterTunnelChannelTrafficUp OBJECT-TYPE
|
||||
SYNTAX Counter32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Total upstream traffic made (in Byte) since router boot."
|
||||
::= { vpnRouterTunnelChannelEntry 9 }
|
||||
|
||||
vpnRouterTunnelChannelTrafficDown OBJECT-TYPE
|
||||
SYNTAX Counter32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Total downstream traffic made (in Byte) since router boot."
|
||||
::= { vpnRouterTunnelChannelEntry 10 }
|
||||
|
||||
vpnRouterTunnelChannelReferencedTunnel OBJECT-TYPE
|
||||
SYNTAX Integer32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The OID of the tunnel that this channel is referencing to."
|
||||
::= { vpnRouterTunnelChannelEntry 11 }
|
||||
|
||||
vpnRouterTunnelChannelIsBackup OBJECT-TYPE
|
||||
SYNTAX Integer32(0..1)
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Is this channel configured as fallback? Possible Values:
|
||||
0 = no,
|
||||
1 = yes"
|
||||
::= { vpnRouterTunnelChannelEntry 12 }
|
||||
|
||||
vpnRouterTunnelChannelModuleSlot OBJECT-TYPE
|
||||
SYNTAX Integer32(0..6)
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Module that the channel is using.
|
||||
Possible Values:
|
||||
0 = Hub WAN-Interface,
|
||||
1 = Module in Slot 1,
|
||||
2 = Module in Slot 2,
|
||||
3 = Module in Slot 3,
|
||||
4 = Module in Slot 4,
|
||||
5 = Module in Slot 5,
|
||||
6 = Module in Slot 6"
|
||||
::= { vpnRouterTunnelChannelEntry 13 }
|
||||
|
||||
vpnRouterTunnelChannelPacketLoss OBJECT-TYPE
|
||||
SYNTAX Integer32(0..100)
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Overall packetloss experienced (in %) on the channel-connection."
|
||||
::= { vpnRouterTunnelChannelEntry 14 }
|
||||
|
||||
vpnRouterTunnelChannelLinkStability OBJECT-TYPE
|
||||
SYNTAX Integer32(0..100)
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Estimated Link Stability (in %) of the channel-connection."
|
||||
::= { vpnRouterTunnelChannelEntry 15 }
|
||||
|
||||
|
||||
-- Conformance information
|
||||
|
||||
vpnRouterConformance OBJECT IDENTIFIER ::= { vpnRouter 7 }
|
||||
vpnRouterGroups OBJECT IDENTIFIER ::= { vpnRouterConformance 1 }
|
||||
vpnRouterCompliances OBJECT IDENTIFIER ::= { vpnRouterConformance 2 }
|
||||
|
||||
-- Compliance statements
|
||||
|
||||
vpnRouterReadOnlyCompliance MODULE-COMPLIANCE
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"When this MIB is implemented without support for read-
|
||||
create (i.e., in read-only mode), the implementation can
|
||||
claim read-only compliance."
|
||||
MODULE -- this module
|
||||
MANDATORY-GROUPS { vpnRouterObjects }
|
||||
::= { vpnRouterCompliances 1 }
|
||||
|
||||
|
||||
-- units of conformance
|
||||
|
||||
vpnRouterObjects OBJECT-GROUP
|
||||
OBJECTS { vpnRouterTunnelChannelName,
|
||||
vpnRouterTunnelChannelAdminStatus,
|
||||
vpnRouterTunnelChannelOperativeStatus,
|
||||
vpnRouterTunnelChannelMaxBandwidthToWan,
|
||||
vpnRouterTunnelChannelMaxBandwidthFromWan,
|
||||
vpnRouterTunnelChannelCurrentBandwidthToWan,
|
||||
vpnRouterTunnelChannelCurrentBandwidthFromWan,
|
||||
vpnRouterTunnelChannelTrafficUp,
|
||||
vpnRouterTunnelChannelTrafficDown,
|
||||
vpnRouterTunnelChannelReferencedTunnel,
|
||||
vpnRouterTunnelChannelIsBackup,
|
||||
vpnRouterTunnelChannelModuleSlot,
|
||||
vpnRouterTunnelChannelPacketLoss,
|
||||
vpnRouterTunnelChannelLinkStability,
|
||||
vpnRouterTunnelName,
|
||||
vpnRouterTunnelAdminStatus,
|
||||
vpnRouterTunnelOperativeStatus,
|
||||
vpnRouterTunnelCumulatedBandwidthToWan,
|
||||
vpnRouterTunnelCumulatedBandwidthFromWan,
|
||||
vpnRouterTunnelCurrentCumulatedBandwidthToWan,
|
||||
vpnRouterTunnelCurrentCumulatedBandwidthFromWan,
|
||||
vpnRouterTunnelTrafficUp,
|
||||
vpnRouterTunnelTrafficDown,
|
||||
vpnRouterTunnelRemoteRouterSerial,
|
||||
vpnRouterInterfaceName,
|
||||
vpnRouterInterfaceAdminStatus,
|
||||
vpnRouterInterfaceOperativeStatus,
|
||||
vpnRouterInterfaceBandwidthToWan,
|
||||
vpnRouterInterfaceBandwidthFromWan,
|
||||
vpnRouterInterfaceTrafficUp,
|
||||
vpnRouterInterfaceTrafficDown,
|
||||
vpnRouterFanAdminStatus,
|
||||
vpnRouterFanOperativeStatus,
|
||||
vpnRouterFanRPM,
|
||||
vpnRouterName,
|
||||
vpnRouterSerial,
|
||||
vpnRouterModel,
|
||||
vpnRouterFirmware,
|
||||
vpnRouterMode,
|
||||
vpnRouteruptime,
|
||||
vpnRouterFirmwareStatus,
|
||||
vpnRouterCPULoad,
|
||||
vpnRouterMemoryUsage,
|
||||
vpnRouterSystemTemperature,
|
||||
vpnRouterCPUTemperature,
|
||||
vpnRouterPowerSupplyFailure,
|
||||
vpnRouterFanCount,
|
||||
vpnRouterInterfaceCount,
|
||||
vpnRouterTunnelCount,
|
||||
vpnRouterTunnelChannelCount
|
||||
}
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The Objects of the vpnRouter."
|
||||
::= { vpnRouterGroups 1 }
|
||||
|
||||
END
|
||||
@@ -25,7 +25,7 @@ $cmd2 = shell_exec($ntpdc.' -c iostats');
|
||||
$vars = array();
|
||||
$vars2 = array();
|
||||
$vars = explode(',', $cmd);
|
||||
$vars2 = eregi_replace(' ', '', $cmd2);
|
||||
$vars2 = str_replace(' ', '', $cmd2);
|
||||
$vars2 = explode("\n", $vars2);
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
CREATE TABLE IF NOT EXISTS `route` ( `device_id` int(11) NOT NULL, `context_name` varchar(128) CHARACTER SET utf8 collate utf8_general_ci not null, `ipRouteDest` varchar(256) not null, `ipRouteIfIndex` varchar(256), `ipRouteMetric` varchar(256) not null, `ipRouteNextHop` varchar(256) not null, `ipRouteType` varchar(256) not null, `ipRouteProto` varchar(256) not null, `discoveredAt` int(11) NOT NULL, `ipRouteMask` varchar(256) not null ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
ALTER TABLE `route` ADD INDEX `device` (`device_id` ASC, `context_name` ASC, `ipRouteDest`(255) ASC, `ipRouteNextHop` ASC);
|
||||
+1
-1
@@ -109,7 +109,7 @@ if (isset($config['user'])) {
|
||||
// This isn't just the log directory, let's print the list to the user
|
||||
$files = explode(PHP_EOL, $find_result);
|
||||
if (is_array($files)) {
|
||||
print_fail("We have found some files that are owned by a different user than $tmp_user, this will stop you updating automatically and / or rrd files being updated causing graphs to fail:\n");
|
||||
print_fail("We have found some files that are owned by a different user than $tmp_user, this will stop you updating automatically and / or rrd files being updated causing graphs to fail:\nIf you don't run a bespoke install then you can fix this by running `chown -R $tmp_user:$tmp_user ".$config['install_dir']."`");
|
||||
foreach ($files as $file) {
|
||||
echo "$file\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user