From 3a65fab2fbe01d87c0aac5e40b3378a1e3f68820 Mon Sep 17 00:00:00 2001 From: f0o Date: Wed, 2 Mar 2016 16:31:17 +0000 Subject: [PATCH 01/23] Added HTML switch for mail transport --- includes/alerts/transport.mail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/alerts/transport.mail.php b/includes/alerts/transport.mail.php index 60837b300a..56608aa694 100644 --- a/includes/alerts/transport.mail.php +++ b/includes/alerts/transport.mail.php @@ -21,4 +21,4 @@ * @subpackage Alerts */ -return send_mail($obj['contacts'], $obj['title'], $obj['msg']); +return send_mail($obj['contacts'], $obj['title'], $obj['msg'], $opts['html'] ? true : false ); From 34e0146d8e462293c0ea8145dc8979a562d65dbb Mon Sep 17 00:00:00 2001 From: f0o Date: Wed, 2 Mar 2016 16:33:46 +0000 Subject: [PATCH 02/23] Added {calc} operation to produce inline calculations in templates --- alerts.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/alerts.php b/alerts.php index 6d791d213d..4be4e34a61 100755 --- a/alerts.php +++ b/alerts.php @@ -390,6 +390,10 @@ function FormatAlertTpl($obj) { $pos = $x; $for = true; } + else if ($buff == '{calc') { + $pos = $x; + $calc = true; + } if ($pos != -1 && $msg[$x] == '}') { $orig = $buff; @@ -411,6 +415,14 @@ function FormatAlertTpl($obj) { ' as $key=>$value) { $ret .= "', ); } + else if ($calc) { + $calc = false; + $o = 5; + $native = array( + '"; $ret .= (float) (0+(', + ')); $ret .= "', + ); + } else { continue; } From 1dc99b83c59a5ede6a46746ea7b47113f16fd0e6 Mon Sep 17 00:00:00 2001 From: f0o Date: Wed, 2 Mar 2016 16:53:53 +0000 Subject: [PATCH 03/23] Added %diff as placeholder for changed objects between worsens/betters Added %elapsed in all cases --- alerts.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/alerts.php b/alerts.php index 4be4e34a61..669c64d643 100755 --- a/alerts.php +++ b/alerts.php @@ -195,10 +195,12 @@ function RunFollowUp() { if ($n > $o) { $ret .= ' Worsens'; $state = 3; + $alert['details']['diff'] = array_diff($chk,$alert['details']['rule']); } else if ($n < $o) { $ret .= ' Betters'; $state = 4; + $alert['details']['diff'] = array_diff($alert['details']['rule'],$chk); } if ($state > 0 && $n > 0) { @@ -485,6 +487,10 @@ function DescribeAlert($alert) { } } } + $obj['elapsed'] = TimeFormat(time() - strtotime($alert['time_logged'])); + if( !empty($extra['diff']) ) { + $obj['diff'] = $extra['diff']; + } } else if ($alert['state'] == 0) { $id = dbFetchRow('SELECT alert_log.id,alert_log.time_logged,alert_log.details FROM alert_log WHERE alert_log.state != 2 && alert_log.state != 0 && alert_log.rule_id = ? && alert_log.device_id = ? && alert_log.id < ? ORDER BY id DESC LIMIT 1', array($alert['rule_id'], $alert['device_id'], $alert['id'])); From 702fa614583febfdb73a8847c0a7d4a2d25aa3db Mon Sep 17 00:00:00 2001 From: f0o Date: Wed, 2 Mar 2016 17:08:45 +0000 Subject: [PATCH 04/23] Fix Math issue in rule generation --- includes/alerts.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/alerts.inc.php b/includes/alerts.inc.php index 684426f4d5..a1b14d07be 100644 --- a/includes/alerts.inc.php +++ b/includes/alerts.inc.php @@ -37,7 +37,7 @@ function GenSQL($rule) { return false; } //Pretty-print rule to dissect easier - $pretty = array('*' => ' * ', '(' => ' ( ', ')' => ' ) ', '/' => ' / ', '&&' => ' && ', '||' => ' || ', 'DATE_SUB ( NOW ( )' => 'DATE_SUB( NOW()'); + $pretty = array('*' => '*', '(' => ' ( ', ')' => ' ) ', '/' => '/', '&&' => ' && ', '||' => ' || ', 'DATE_SUB ( NOW ( )' => 'DATE_SUB( NOW()'); $rule = str_replace(array_keys($pretty),$pretty,$rule); $tmp = explode(" ",$rule); $tables = array(); From d85a9f688f83ce879c73a55ab490685b3e780d0d Mon Sep 17 00:00:00 2001 From: laf Date: Thu, 3 Mar 2016 20:52:23 +0000 Subject: [PATCH 05/23] Removed innodb check from daily and updated validate to warn --- daily.php | 22 ---------------------- validate.php | 2 +- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/daily.php b/daily.php index 7e42c4066d..238400ead1 100644 --- a/daily.php +++ b/daily.php @@ -22,28 +22,6 @@ if ($options['f'] === 'update') { exit(0); } - $innodb_buffer = innodb_buffer_check(); - if ($innodb_buffer['used'] > $innodb_buffer['size']) { - if (!empty($config['alert']['default_mail'])) { - $subject = $config['project_name'] . ' auto-update action required'; - $message = ' -Hi, - -We have just tried to update your installation but it looks like the InnoDB buffer size is too low. - -Because of this we have stopped the auto-update running to ensure your system is ok. - -You currently have a configured innodb_buffer_pool_size of ' . $innodb_buffer['size'] / 1024 / 1024 . ' MiB but is currently using ' . $innodb_buffer['used'] / 1024 / 1024 . ' MiB - -Take a look at https://dev.mysql.com/doc/refman/5.6/en/innodb-buffer-pool.html for further details. - -The ' . $config['project_name'] . ' team.'; - send_mail($config['alert']['default_mail'],$subject,$message,$html=false); - } - echo warn_innodb_buffer($innodb_buffer); - exit(2); - } - if ($config['update_channel'] == 'master') { exit(1); } diff --git a/validate.php b/validate.php index f16178d3b0..2ed6750061 100755 --- a/validate.php +++ b/validate.php @@ -139,7 +139,7 @@ if(strstr($strict_mode, 'STRICT_TRANS_TABLES')) { // Test for MySQL InnoDB buffer size $innodb_buffer = innodb_buffer_check(); if ($innodb_buffer['used'] > $innodb_buffer['size']) { - print_fail('Your Innodb buffer size is not big enough...'); + print_warn("Your Innodb buffer is full, consider increasing it's size"); echo warn_innodb_buffer($innodb_buffer); } From 29eea12b08e7b3fb9a57e8a5c1d74dfa5a0deba7 Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Fri, 4 Mar 2016 14:36:47 +0000 Subject: [PATCH 06/23] Scrut fixes --- alerts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alerts.php b/alerts.php index 669c64d643..818ae66704 100755 --- a/alerts.php +++ b/alerts.php @@ -372,7 +372,7 @@ function FormatAlertTpl($obj) { $s = strlen($msg); $x = $pos = -1; $buff = ''; - $if = $for = false; + $if = $for = $calc = false; while (++$x < $s) { if ($msg[$x] == '{' && $buff == '') { $buff .= $msg[$x]; From 46bee4021f0045b7c8df5f835e2aee35b56524af Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Fri, 4 Mar 2016 16:25:51 +0000 Subject: [PATCH 07/23] Changed `else if` to `elseif` --- alerts.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/alerts.php b/alerts.php index 818ae66704..ad38f2e567 100755 --- a/alerts.php +++ b/alerts.php @@ -197,7 +197,7 @@ function RunFollowUp() { $state = 3; $alert['details']['diff'] = array_diff($chk,$alert['details']['rule']); } - else if ($n < $o) { + elseif ($n < $o) { $ret .= ' Betters'; $state = 4; $alert['details']['diff'] = array_diff($alert['details']['rule'],$chk); @@ -377,10 +377,10 @@ function FormatAlertTpl($obj) { if ($msg[$x] == '{' && $buff == '') { $buff .= $msg[$x]; } - else if ($buff == '{ ') { + elseif ($buff == '{ ') { $buff = ''; } - else if ($buff != '') { + elseif ($buff != '') { $buff .= $msg[$x]; } @@ -388,11 +388,11 @@ function FormatAlertTpl($obj) { $pos = $x; $if = true; } - else if ($buff == '{foreach') { + elseif ($buff == '{foreach') { $pos = $x; $for = true; } - else if ($buff == '{calc') { + elseif ($buff == '{calc') { $pos = $x; $calc = true; } @@ -409,7 +409,7 @@ function FormatAlertTpl($obj) { ' ) { $ret .= "', ); } - else if ($for) { + elseif ($for) { $for = false; $o = 8; $native = array( @@ -417,7 +417,7 @@ function FormatAlertTpl($obj) { ' as $key=>$value) { $ret .= "', ); } - else if ($calc) { + elseif ($calc) { $calc = false; $o = 5; $native = array( @@ -471,10 +471,10 @@ function DescribeAlert($alert) { if ($alert['state'] == 2) { $obj['title'] .= ' got acknowledged'; } - else if ($alert['state'] == 3) { + elseif ($alert['state'] == 3) { $obj['title'] .= ' got worse'; } - else if ($alert['state'] == 4) { + elseif ($alert['state'] == 4) { $obj['title'] .= ' got better'; } @@ -492,7 +492,7 @@ function DescribeAlert($alert) { $obj['diff'] = $extra['diff']; } } - else if ($alert['state'] == 0) { + elseif ($alert['state'] == 0) { $id = dbFetchRow('SELECT alert_log.id,alert_log.time_logged,alert_log.details FROM alert_log WHERE alert_log.state != 2 && alert_log.state != 0 && alert_log.rule_id = ? && alert_log.device_id = ? && alert_log.id < ? ORDER BY id DESC LIMIT 1', array($alert['rule_id'], $alert['device_id'], $alert['id'])); if (empty($id['id'])) { return false; From f0fb602046553fd8f78c23daec99100240df5999 Mon Sep 17 00:00:00 2001 From: laf Date: Sat, 5 Mar 2016 00:48:51 +0000 Subject: [PATCH 08/23] Added support for os in oxidized groups --- doc/Extensions/Oxidized.md | 8 +++++++- html/includes/api_functions.inc.php | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/Extensions/Oxidized.md b/doc/Extensions/Oxidized.md index 9123c2ed80..da00b7df9e 100644 --- a/doc/Extensions/Oxidized.md +++ b/doc/Extensions/Oxidized.md @@ -62,7 +62,7 @@ $config['oxidized']['reload_nodes'] = TRUE; #### Using Groups -To return a group to Oxidized you can do this by matching a regex for either hostname or location. The order is hostname is matched first, if nothing is found then location is attempted. +To return a group to Oxidized you can do this by matching a regex for either hostname, os or location. The order is hostname is matched first, if nothing is found then os is tried and then location is attempted. The first match found will be used. To match on the device hostnames that contain 'lon-sw' or if the location contains 'London' then you would place the following within config.php: ```php @@ -70,6 +70,12 @@ $config['oxidized']['group']['hostname'][] = array('regex' => '/^lon-sw/', 'grou $config['oxidized']['group']['location'][] = array('regex' => '/london/', 'group' => 'london-switches'); ``` +To match on a device os of edgeos then please use the following: + +```php +$config['oxidized']['group']['os'][] = array('match' => 'edgeos', 'group' => 'wireless'); +``` + If you need to, you can specify credentials for groups by using the following in your Oxidized config: ```bash diff --git a/html/includes/api_functions.inc.php b/html/includes/api_functions.inc.php index 8db6f28a4e..83ad9b5117 100644 --- a/html/includes/api_functions.inc.php +++ b/html/includes/api_functions.inc.php @@ -953,6 +953,14 @@ function list_oxidized() { break; } } + if (empty($device['group'])) { + foreach ($config['oxidized']['group']['os'] as $host_group) { + if ($host_group['match'] === $device['os']) { + $device['group'] = $host_group['group']; + break; + } + } + } if (empty($device['group'])) { foreach ($config['oxidized']['group']['location'] as $host_group) { if (preg_match($host_group['regex'].'i', $device['location'])) { From d2db4a4af24335272b76bbf989b4928e03ff3ee1 Mon Sep 17 00:00:00 2001 From: David Bell Date: Mon, 7 Mar 2016 11:40:47 +0000 Subject: [PATCH 09/23] Corrected aggregate graph on smokeping page --- html/pages/device/latency.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/html/pages/device/latency.inc.php b/html/pages/device/latency.inc.php index bc3f962e4e..6f1211c373 100644 --- a/html/pages/device/latency.inc.php +++ b/html/pages/device/latency.inc.php @@ -49,6 +49,7 @@ if ($vars['view'] == 'incoming') { echo ''; $graph_array['type'] = 'device_smokeping_in_all'; + $graph_array['device'] = $device['device_id']; $graph_array['legend'] = no; echo ''; echo '

Aggregate

'; From 02ca54b9a54f84a4e47264e08603ab101348fb62 Mon Sep 17 00:00:00 2001 From: pblasquez Date: Mon, 7 Mar 2016 19:03:17 -0800 Subject: [PATCH 10/23] Update Configuration.md --- doc/Support/Configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Support/Configuration.md b/doc/Support/Configuration.md index 8070df0ce5..e7d305cf25 100644 --- a/doc/Support/Configuration.md +++ b/doc/Support/Configuration.md @@ -385,7 +385,7 @@ $config['location_map']['Under the Sink'] = "Under The Sink, The Office, London, ``` Regex Matching: ```php -$config['location_map']['/Sink/'] = "Under The Sink, The Office, London, UK"; +$config['location_map_regex']['/Sink/'] = "Under The Sink, The Office, London, UK"; ``` The above are examples, these will rewrite device snmp locations so you don't need to configure full location within snmp. From a33d16dafa8c0be415b5ddd66d03ac7c7198978c Mon Sep 17 00:00:00 2001 From: David Bell Date: Tue, 8 Mar 2016 11:18:33 +0000 Subject: [PATCH 11/23] Corrected inserting ' into overide syslocation string --- html/pages/device/edit/device.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/pages/device/edit/device.inc.php b/html/pages/device/edit/device.inc.php index 0f395b032c..54f56d7311 100644 --- a/html/pages/device/edit/device.inc.php +++ b/html/pages/device/edit/device.inc.php @@ -5,7 +5,7 @@ if ($_POST['editing']) { $override_sysLocation_bool = mres($_POST['override_sysLocation']); if (isset($_POST['sysLocation'])) { - $override_sysLocation_string = mres($_POST['sysLocation']); + $override_sysLocation_string = $_POST['sysLocation']; } if ($device['override_sysLocation'] != $override_sysLocation_bool || $device['location'] != $override_sysLocation_string) { From 9f136c06de2bdafa8c04a892ca322f43d436f464 Mon Sep 17 00:00:00 2001 From: Richard Lawley Date: Mon, 7 Mar 2016 12:48:27 +0000 Subject: [PATCH 12/23] Update Billing UI to match rest of app --- html/includes/modal/new_bill.inc.php | 67 +++++ html/pages/bill.inc.php | 276 +++++++++----------- html/pages/bill/addoreditbill.inc.php | 89 +++++++ html/pages/bill/delete.inc.php | 12 +- html/pages/bill/edit.inc.php | 347 +++++++++----------------- html/pages/bill/reset.inc.php | 9 +- html/pages/bill/transfer.inc.php | 157 +++++++----- html/pages/bills.inc.php | 239 ++++-------------- html/pages/bills/search.inc.php | 26 +- 9 files changed, 557 insertions(+), 665 deletions(-) create mode 100644 html/includes/modal/new_bill.inc.php create mode 100644 html/pages/bill/addoreditbill.inc.php diff --git a/html/includes/modal/new_bill.inc.php b/html/includes/modal/new_bill.inc.php new file mode 100644 index 0000000000..7cd4196016 --- /dev/null +++ b/html/includes/modal/new_bill.inc.php @@ -0,0 +1,67 @@ + + * + * 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(is_admin() !== false) { + if (is_numeric($vars['port'])) { + $port = dbFetchRow('SELECT * FROM `ports` AS P, `devices` AS D WHERE `port_id` = ? AND D.device_id = P.device_id', array($vars['port'])); + } +?> + + + +

- Bill : '.$bill_data['bill_name'].'

'; - - print_optionbar_start(); - - echo "Bill » "; - + if (!$vars['view']) { $vars['view'] = 'quick'; } + + function print_port_list() { + global $ports; +?>
+
+

Billed Ports

+
+
+ +
+ on +
+ +
+
+ - if ($vars['view'] == 'quick') { - echo ""; +

+ +Bill » "; + $menu_options = array( + 'quick' => 'Quick Graphs', + 'accurate' => 'Accurate Graphs', + 'transfer' => 'Transfer Graphs', + 'history' => 'Historical Graphs' + ); + if($_SESSION['userlevel'] >= '10') + { + $menu_options['edit'] = 'Edit'; + $menu_options['delete'] = 'Delete'; + $menu_options['reset'] = 'Reset'; } - - echo 'Quick Graphs'; - if ($vars['view'] == 'quick') { - echo '
'; - } - - echo ' | '; - - if ($vars['view'] == 'accurate') { - echo ""; - } - - echo 'Accurate Graphs'; - if ($vars['view'] == 'accurate') { - echo ''; - } - - echo ' | '; - - if ($vars['view'] == 'transfer') { - echo ""; - } - - echo 'Transfer Graphs'; - if ($vars['view'] == 'transfer') { - echo ''; - } - - echo ' | '; - - if ($vars['view'] == 'history') { - echo ""; - } - - echo 'Historical Usage'; - if ($vars['view'] == 'history') { - echo ''; - } - - if ($_SESSION['userlevel'] >= '10') { - echo ' | '; - if ($vars['view'] == 'edit') { + $sep = ''; + foreach ($menu_options as $option => $text) { + echo $sep; + if ($vars['view'] == $option) { echo ""; } - echo 'Edit'; - if ($vars['view'] == 'edit') { + echo generate_link($text, $vars, array('view' => $option)); + if ($vars['view'] == $option) { echo ''; } - echo ' | '; - if ($vars['view'] == 'delete') { - echo ""; - } - - echo 'Delete'; - if ($vars['view'] == 'delete') { - echo ''; - } - - echo ' | '; - if ($vars['view'] == 'reset') { - echo ""; - } - - echo 'Reset'; - if ($vars['view'] == 'reset') { - echo ''; - } - }//end if - + $sep = ' | '; + } + echo ''; print_optionbar_end(); @@ -166,59 +141,71 @@ if (bill_permitted($bill_id)) { include 'pages/bill/transfer.inc.php'; } else if ($vars['view'] == 'quick' || $vars['view'] == 'accurate') { - echo '

Billed Ports

'; +?> - // Collected Earlier - foreach ($ports as $port) { - echo generate_port_link($port).' on '.generate_device_link($port).'
'; - } + +

Quota Bill

+ +

+ CDR / 95th Bill +

+ +Billing Period from to +

- echo '

Bill Summary

'; - - if ($bill_data['bill_type'] == 'quota') { +
+
+ +
+
+
+
+

+ Bill Summary +

+
+ + +Quota Bill'; - $percent = round((($total_data) / $bill_data['bill_quota'] * 100), 2); $unit = 'MB'; $total_data = round($total_data, 2); - echo 'Billing Period from '.$fromtext.' to '.$totext; - echo '
Transferred '.format_bytes_billing($total_data).' of '.format_bytes_billing($bill_data['bill_quota']).' ('.$percent.'%)'; - echo '
Average rate '.formatRates($rate_average); - $background = get_percentage_colours($percent); - - echo '

'.print_percentage_bar(350, 20, $percent, null, 'ffffff', $background['left'], $percent.'%', 'ffffff', $background['right']).'

'; - $type = '&ave=yes'; +?> + + +CDR / 95th Bill'; - $unit = 'kbps'; $cdr = $bill_data['bill_cdr']; $rate_95th = round($rate_95th, 2); - $percent = round((($rate_95th) / $cdr * 100), 2); - $type = '&95th=yes'; +?> + + - echo ''.$fromtext.' to '.$totext.' -
Measured '.format_si($rate_95th).'bps of '.format_si($cdr).'bps ('.$percent.'%) @ 95th %ile'; + + +
+ of + - Average rate + + of (95th%ile) + + +
+
+
+
- $background = get_percentage_colours($percent); - - echo '

'.print_percentage_bar(350, 20, $percent, null, 'ffffff', $background['left'], $percent.'%', 'ffffff', $background['right']).'

'; - - // echo("

Billing Period : " . $fromtext . " to " . $totext . "
- // " . $paidrate_text . "
- // " . $total_data . "MB transfered in the current billing cycle.
- // " . $rate_average . "Kbps Average during the current billing cycle.

- // " . $rate_95th . "Kbps @ 95th Percentile. (" . $dir_95th . ") (" . $bill_text . ") - // - //
"); - }//end if +"; $li = " - +?> +
+
+

Billing View

+
+ +
+ +
+
+

24 Hour View

+
+ +
-
- - - - - - From: - - - To: - - - -
- - "; - }//end if - - if ($_GET['all']) { - $ai = ''; - echo "

Entire Data View

$ai"; - } - else if ($_GET['custom']) { - $cg = ''; - echo "

Custom Graph

$cg"; - } - else { - echo "

Billing View

$bi"; - // echo("

Previous Bill View

$li"); - echo "

24 Hour View

$di"; - echo "

Monthly View

$mi"; - // echo("
Graph All Data (SLOW)"); - }//end if +
+
+

Monthly View

+
+ +
+ \ No newline at end of file diff --git a/html/pages/bill/addoreditbill.inc.php b/html/pages/bill/addoreditbill.inc.php new file mode 100644 index 0000000000..75e64ff201 --- /dev/null +++ b/html/pages/bill/addoreditbill.inc.php @@ -0,0 +1,89 @@ +
+ +
+ +
+
+
+ +
+ + +
+
+
+
+ +
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ +
+ +
+
+
+

Optional Information

+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ + \ No newline at end of file diff --git a/html/pages/bill/delete.inc.php b/html/pages/bill/delete.inc.php index 6a7d247b50..e02666b40d 100644 --- a/html/pages/bill/delete.inc.php +++ b/html/pages/bill/delete.inc.php @@ -10,8 +10,12 @@ } -

Delete Bill

-
+ +
+
+
+ +

Delete Bill

@@ -31,4 +35,8 @@
+
+
+
+ diff --git a/html/pages/bill/edit.inc.php b/html/pages/bill/edit.inc.php index 3fd69c3612..9c5a84dcab 100644 --- a/html/pages/bill/edit.inc.php +++ b/html/pages/bill/edit.inc.php @@ -60,240 +60,121 @@ ); } }//end if - ?> -
- - -

Bill Properties

-
-
-
- - +
+
+
+
+

Bill Properties

+
+
+ + + + +
+
+ +
+
+ +
-
-
-
- -
-
- -
-
- -
-
-
- - -
-
- - -
-
-
-

Optional Information

-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
-
-
- - -
-
- - -
-

Billed Ports

-
-
- ", $devicebtn); - $devicebtn = str_replace("
',;", "
',", $devicebtn); - $portbtn = str_replace('interface-upup', 'btn', generate_port_link($port)); - $portbtn = str_replace('interface-updown', 'btn btn-warning', $portbtn); - $portbtn = str_replace('interface-downdown', 'btn btn-warning', $portbtn); - $portbtn = str_replace('interface-admindown', 'btn btn-warning disabled', $portbtn); - $portbtn = str_replace("overlib('", "overlib('
", $portbtn); - $portbtn = str_replace("
',;", "
',", $portbtn); - $portalias = (empty($port['ifAlias']) ? '' : ' - '.$port['ifAlias'].''); - $devicebtn = str_replace('">'.$port['hostname'], '" style="color: #000;"> '.$port['hostname'], $devicebtn); - $portbtn = str_replace('">'.strtolower($port['ifName']), '" style="color: #000;"> '.$port['ifName'].''.$portalias, $portbtn); - echo '
\n"; - echo " \n"; - echo ' \n"; - echo "
\n"; - echo "
\n"; - echo "
\n"; - echo ' '.$devicebtn."\n"; - echo ' '.$portbtn."\n"; - echo "
\n"; - echo "
\n"; - echo ' Remove Interface\n"; - echo "
\n"; - echo "
\n"; - } - - if (!$emptyCheck) { - echo "
\n"; - echo " There are no ports assigned to this bill\n"; - echo "
\n"; - } - } - ?>
- -
- - -
-

Add Port

-
-
-
- - +
+
+
+

Billed Ports

+
+
+
+ +
+ +
+ + + + + + + + + +
+ +
There are no ports assigned to this bill + + +
+ + +
+ +

Add Port

+ +
+ + + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
-
-
-
- - -
-
- - +
diff --git a/html/pages/bill/reset.inc.php b/html/pages/bill/reset.inc.php index 728963abdb..5dc2b18244 100644 --- a/html/pages/bill/reset.inc.php +++ b/html/pages/bill/reset.inc.php @@ -12,8 +12,10 @@ } -

Reset Bill

-
+
+
+
+

Reset Bill

@@ -39,4 +41,7 @@
+
+
+
\ No newline at end of file diff --git a/html/pages/bill/transfer.inc.php b/html/pages/bill/transfer.inc.php index 8898382943..bcbc60beef 100644 --- a/html/pages/bill/transfer.inc.php +++ b/html/pages/bill/transfer.inc.php @@ -30,12 +30,6 @@ $lastmonth = dbFetchCell('SELECT UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 1 $yesterday = dbFetchCell('SELECT UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 1 DAY))'); $rightnow = date(U); -echo '

Billed Ports

'; - -foreach ($ports as $port) { - echo generate_port_link($port).' on '.generate_device_link($port).'
'; -} - $cur_days = date('d', (strtotime('now') - strtotime($datefrom))); $total_days = date('d', (strtotime($dateto) - strtotime($datefrom))); @@ -81,65 +75,84 @@ function showPercent($per) { $background = get_percentage_colours($per); $right_background = $background['right']; $left_background = $background['left']; - $res = print_percentage_bar(350, 20, $per, null, 'ffffff', $left_background, $per.'%', 'ffffff', $right_background); + $res = print_percentage_bar(200, 20, $per, null, 'ffffff', $left_background, $per.'%', 'ffffff', $right_background); return $res; }//end showPercent() +?> -echo '

Bill Summary

'; -echo '

Quota Bill (Billing Period from '.$fromtext.' to '.$totext.')

'; -echo ''; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; +

Transfer Report

+Billing Period from to +

-echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -echo ' '; -if ($ousage['over'] > 0 && $bill_data['bill_type'] == 'quota') { - echo ' '; - echo ' '; - echo ' '; - echo ' '; - echo ' '; - echo ' '; - echo ' '; - echo ' '; -} +
+
+ +
+
+
+
+

+ Bill Summary +

+
+
BandwidthUsedAllowedAverageEstimated
Transferred:'.$total['data'].''.$total['allow'].''.$total['ave'].''.$total['est'].''.showPercent($total['per']).'
Inbound:'.$in['data'].''.$in['allow'].''.$in['ave'].''.$in['est'].''.showPercent($in['per']).'
Outbound:'.$out['data'].''.$out['allow'].''.$out['ave'].''.$out['est'].''.showPercent($out['per']).'
Already overusage:'.$ousage['data'].''.$ousage['allow'].''.$ousage['ave'].''.$ousage['est'].''.showPercent($ousage['per']).'
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 && $bill_data['bill_type'] == 'quota') { ?> + + + + + + + + + + + +
BandwidthUsedAllowedAverageEstimated
Transferred
Inbound
Outbound
Already overusage
+
+
+
-echo ''; + +"; +?> -echo "

Billing Period View

$bi"; -echo "

Rolling 24 Hour View

$di"; -echo "

Rolling Monthly View

$mi"; +
+
+

Billing Period View

+
+
+ +
+
+ +
+
+

Rolling 24 Hour View

+
+
+ +
+
+ +
+
+

Rolling Monthly View

+
+
+ +
+
\ No newline at end of file diff --git a/html/pages/bills.inc.php b/html/pages/bills.inc.php index f9fef2120c..fbb62fabed 100644 --- a/html/pages/bills.inc.php +++ b/html/pages/bills.inc.php @@ -1,6 +1,13 @@ '; - if (is_numeric($bill_id) && is_numeric($_POST['port'])) { dbInsert(array('bill_id' => $bill_id, 'port_id' => $_POST['port']), 'bill_ports'); - $message .= $message_break.'Port '.mres($_POST['port']).' added!'; - $message_break .= '
'; } + + header('Location: /' . generate_url(array('page' => 'bill', 'bill_id' => $bill_id))); + exit(); } $pagetitle[] = 'Billing'; @@ -86,171 +91,12 @@ if ($vars['view'] == 'history') { include 'pages/bills/search.inc.php'; include 'pages/bills/pmonth.inc.php'; } -else if ($vars['view'] == 'add') { - if (is_numeric($vars['port'])) { - $port = dbFetchRow('SELECT * FROM `ports` AS P, `devices` AS D WHERE `port_id` = ? AND D.device_id = P.device_id', array($vars['port'])); - } - -?> - -Bill » "; - if (!$vars['view']) { - $vars['view'] = 'add'; - } - - if ($_SESSION['userlevel'] >= '10') { - if ($vars['view'] == 'add') { - echo ""; - } - - echo 'Add'; - if ($vars['view'] == 'add') { - echo ''; - } - } - - echo ''; - print_optionbar_end(); -?> - -

Bill : Add Bill

- -
- - -'.$port['hostname'], '" style="color: #000;"> '.$port['hostname'], $devicebtn); - $devicebtn = str_replace("overlib('", "overlib('
", $devicebtn); - $devicebtn = str_replace("
',;", "
',", $devicebtn); - $portbtn = str_replace('">'.strtolower($port['ifName']), '" style="color: #000;"> '.$port['ifName'].''.$portalias, $portbtn); - $portbtn = str_replace("overlib('", "overlib('
", $portbtn); - $portbtn = str_replace("
',;", "
',", $portbtn); - echo "
\n"; - echo ' \n"; - echo " Ports\n"; - echo "
\n"; - echo "
\n"; - echo "
\n"; - echo ' '.$devicebtn."\n"; - echo ' '.$portbtn."\n"; - echo "
\n"; - echo "
\n"; - echo "
\n"; - echo "
\n"; - } -?> - -
- -
- -
-
-
-
-
- -
- CDR 95th - Quota -
-
-
-
-
-
-
- -
-
- -
-
-
-
- -
-
- -
- -
-
-
-
-

Optional Information

-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
- -
- - - + include 'includes/modal/new_bill.inc.php'; +?> + + @@ -259,7 +105,9 @@ else { - "; + + + - - - - - - - - - - "; - - $i++; - } +?> + + + + + + + + + + + + +
Billing name TypeOverusage
'bill', 'bill_id' => $bill['bill_id']))."'>".$bill['bill_name'].'
'.strftime('%F', strtotime($datefrom)).' to '.strftime('%F', strtotime($dateto))."
$notes$type$allowed$used$overuse".print_percentage_bar(250, 20, $percent, null, 'ffffff', $background['left'], $percent.'%', 'ffffff', $background['right'])." 'bill', 'bill_id' => $bill['bill_id'], 'view' => 'edit'))."'>Edit Edit
+ 'bill', 'bill_id' => $bill['bill_id'])) ?>'> +
+ to +
'bill', 'bill_id' => $bill['bill_id'], 'view' => 'edit')) ?>'>Edit Edit
+ + +'; } diff --git a/html/pages/bills/search.inc.php b/html/pages/bills/search.inc.php index b4662ca602..ffa5f6e7f6 100644 --- a/html/pages/bills/search.inc.php +++ b/html/pages/bills/search.inc.php @@ -5,47 +5,39 @@ ?>
-
+
Bills -
-
-
-
-
-
-
-
-
- -
+ + +
Current Billing Period Current Billing Period'; + echo ' Current Billing Period'; } else { // FIXME - generate_url - echo 'Previous Billing Period Previous Billing Period'; + echo ' Previous Billing Period'; } ?> -
-
- Add Add Bill += 10) { ?> + +
From bd640ebc084d371ffc2d3ea3e57372a04d3c0234 Mon Sep 17 00:00:00 2001 From: Richard Lawley Date: Tue, 8 Mar 2016 18:45:55 +0000 Subject: [PATCH 13/23] Update History Page to match --- html/pages/bill/history.inc.php | 48 ++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/html/pages/bill/history.inc.php b/html/pages/bill/history.inc.php index 6770271c82..95de8a76b2 100644 --- a/html/pages/bill/history.inc.php +++ b/html/pages/bill/history.inc.php @@ -9,9 +9,18 @@ $img['his'] = ''; +?> -echo $img['his']; +

Historical Usage

+
+
+

Monthly Usage

+
+ +
+ + 'yes')); $url = $PHP_SELF.'/bill/'.$bill_id.'/history/detail=all/'; -echo ' +echo '
+ - - - - - - - - - - + + + + + + + + + '; + + + + '; foreach (dbFetchRows('SELECT * FROM `bill_history` WHERE `bill_id` = ? ORDER BY `bill_datefrom` DESC LIMIT 24', array($bill_id)) as $history) { if (bill_permitted($history['bill_id'])) { @@ -68,7 +80,6 @@ foreach (dbFetchRows('SELECT * FROM `bill_history` WHERE `bill_id` = ? ORDER BY $total_data = format_number($history['traf_total'], $config['billing']['base']); $background = get_percentage_colours($percent); - $row_colour = ((!is_integer($i / 2)) ? $list_colour_a : $list_colour_b); if ($type == 'CDR') { $allowed = formatRates($history['bill_allowed']); @@ -91,7 +102,7 @@ foreach (dbFetchRows('SELECT * FROM `bill_history` WHERE `bill_id` = ? ORDER BY $url = generate_url($vars, array('detail' => $history['bill_hist_id'])); echo ' - + @@ -123,9 +134,8 @@ foreach (dbFetchRows('SELECT * FROM `bill_history` WHERE `bill_id` = ? ORDER BY '; } - - $i++; } //end if }//end foreach -echo '
PeriodTypeAllowedInboundOutboundTotal95th %ileOverusage + PeriodTypeAllowedInboundOutboundTotal95th %ileOverusage Show details Show all details - -
'.strftime('%Y-%m-%d', strtotime($datefrom)).' to '.strftime('%Y-%m-%d', strtotime($dateto))." $type
'; +echo ' +'; From fca483439ea2e0e34e19e3fd6c102698c0fea3e4 Mon Sep 17 00:00:00 2001 From: Richard Lawley Date: Tue, 8 Mar 2016 19:12:15 +0000 Subject: [PATCH 14/23] Remove Edit link if not admin --- html/pages/bills.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/html/pages/bills.inc.php b/html/pages/bills.inc.php index fbb62fabed..01deb9d873 100644 --- a/html/pages/bills.inc.php +++ b/html/pages/bills.inc.php @@ -154,7 +154,11 @@ else { - 'bill', 'bill_id' => $bill['bill_id'], 'view' => 'edit')) ?>'>Edit Edit + + = 10) { ?> + 'bill', 'bill_id' => $bill['bill_id'], 'view' => 'edit')) ?>'>Edit Edit + + From 972429838b7c2f935257ada8c39c4721244f2dfe Mon Sep 17 00:00:00 2001 From: Richard Lawley Date: Wed, 9 Mar 2016 08:26:32 +0000 Subject: [PATCH 15/23] Redirect to edit page afer add bill --- html/pages/bills.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/pages/bills.inc.php b/html/pages/bills.inc.php index 01deb9d873..759a0697d1 100644 --- a/html/pages/bills.inc.php +++ b/html/pages/bills.inc.php @@ -79,7 +79,7 @@ if ($_POST['addbill'] == 'yes') { dbInsert(array('bill_id' => $bill_id, 'port_id' => $_POST['port']), 'bill_ports'); } - header('Location: /' . generate_url(array('page' => 'bill', 'bill_id' => $bill_id))); + header('Location: /' . generate_url(array('page' => 'bill', 'bill_id' => $bill_id, 'view' => 'edit'))); exit(); } From 572fc207c1cd00ffa812aa0e9225e2892fbf5a4e Mon Sep 17 00:00:00 2001 From: Richard Lawley Date: Wed, 9 Mar 2016 12:18:22 +0000 Subject: [PATCH 16/23] Import Notifications with Original Date/Time --- includes/notifications.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/includes/notifications.php b/includes/notifications.php index 313dcabd5e..7d842cd9d8 100644 --- a/includes/notifications.php +++ b/includes/notifications.php @@ -46,6 +46,7 @@ function get_notifications() { $obj = array_reverse(array_merge($obj,$feed)); echo '('.sizeof($obj).')'.PHP_EOL; } + $obj = array_sort($obj, 'datetime'); return $obj; } @@ -76,7 +77,12 @@ function parse_rss($feed) { $feed['channel']['item'] = array( $feed['channel']['item'] ); } foreach ($feed['channel']['item'] as $item) { - $obj[] = array('title'=>$item['title'],'body'=>$item['description'],'checksum'=>hash('sha512',$item['title'].$item['description'])); + $obj[] = array( + 'title'=>$item['title'], + 'body'=>$item['description'], + 'checksum'=>hash('sha512',$item['title'].$item['description']), + 'datetime'=>strftime('%F', strtotime($item['pubDate'])) + ); } return $obj; } @@ -92,7 +98,12 @@ function parse_atom($feed) { $feed['entry'] = array( $feed['entry'] ); } foreach ($feed['entry'] as $item) { - $obj[] = array('title'=>$item['title'],'body'=>$item['content'],'checksum'=>hash('sha512',$item['title'].$item['content'])); + $obj[] = array( + 'title'=>$item['title'], + 'body'=>$item['content'], + 'checksum'=>hash('sha512',$item['title'].$item['content']), + 'datetime'=>strftime('%F', strtotime($item['updated'])) + ); } return $obj; } From 60bb400202b40b73b0b1fe0195f910d7abb1237b Mon Sep 17 00:00:00 2001 From: Richard Lawley Date: Wed, 9 Mar 2016 12:41:10 +0000 Subject: [PATCH 17/23] Add sysName for top-interfaces with force_ip_to_sysname for normal user --- html/includes/common/top-interfaces.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html/includes/common/top-interfaces.inc.php b/html/includes/common/top-interfaces.inc.php index cb9e16720b..964ba5f9fd 100644 --- a/html/includes/common/top-interfaces.inc.php +++ b/html/includes/common/top-interfaces.inc.php @@ -103,7 +103,7 @@ else { $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 + SELECT p.*, devices.*, p.ifInOctets_rate + p.ifOutOctets_rate as total FROM ports as p INNER JOIN devices ON p.device_id = devices.device_id AND unix_timestamp() - p.poll_time <= :lastpoll @@ -115,7 +115,7 @@ else { } else { $query = ' - SELECT ports.*, devices.hostname, ports.ifInOctets_rate + ports.ifOutOctets_rate as total + SELECT ports.*, devices.*, 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 From 8fbcdfc62b8e427882227679a6581def18a6bf63 Mon Sep 17 00:00:00 2001 From: Richard Lawley Date: Wed, 9 Mar 2016 12:47:11 +0000 Subject: [PATCH 18/23] Remove unnecessary array reverse --- includes/notifications.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/notifications.php b/includes/notifications.php index 7d842cd9d8..9a7fa587fa 100644 --- a/includes/notifications.php +++ b/includes/notifications.php @@ -43,7 +43,7 @@ function get_notifications() { $feed = parse_atom($feed); } array_walk($feed,function(&$items,$key,$url) { $items['source'] = $url; },$url); - $obj = array_reverse(array_merge($obj,$feed)); + $obj = array_merge($obj,$feed); echo '('.sizeof($obj).')'.PHP_EOL; } $obj = array_sort($obj, 'datetime'); From 55002aced1d3704f852a2f3acc66d9b36bb2d01b Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Wed, 9 Mar 2016 10:02:53 -0600 Subject: [PATCH 19/23] Check the sysObjectID before trying to detect ILO temp sensors. --- .../sensors/temperatures/hpilo.inc.php | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/includes/discovery/sensors/temperatures/hpilo.inc.php b/includes/discovery/sensors/temperatures/hpilo.inc.php index ef50a10036..da180d003e 100644 --- a/includes/discovery/sensors/temperatures/hpilo.inc.php +++ b/includes/discovery/sensors/temperatures/hpilo.inc.php @@ -1,26 +1,28 @@ Date: Wed, 9 Mar 2016 18:30:59 +0100 Subject: [PATCH 20/23] Update services SQL --- check-services.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/check-services.php b/check-services.php index e053126b22..a39171a3d7 100755 --- a/check-services.php +++ b/check-services.php @@ -48,13 +48,9 @@ foreach (dbFetchRows('SELECT * FROM `devices` AS D, `services` AS S WHERE S.devi if ($service_status != $status) { $update['service_changed'] = time(); } - else { - unset($updated); - } - - $update = array_merge(array('service_status' => $status, 'service_message' => $check, 'service_checked' => time()), $update); - dbUpdate($update, 'services', '`service_id` = ?', array($service['service_id'])); - unset($update); + $update = array_merge(array('service_status' => $status, 'service_message' => $check, 'service_checked' => time()), $update); + dbUpdate($update, 'services', '`service_id` = ?', array($service['service_id'])); + unset($update); } else { $status = '0'; From 1a59171ccc71e40455e36adb4ffd113b07d002be Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Wed, 9 Mar 2016 19:21:11 +0100 Subject: [PATCH 21/23] Updated UI --- html/includes/print-service.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/includes/print-service.inc.php b/html/includes/print-service.inc.php index 200fb27742..ac0f3dca19 100644 --- a/html/includes/print-service.inc.php +++ b/html/includes/print-service.inc.php @@ -70,7 +70,7 @@ echo " $desc - ".date('r',$service['service_changed'])." + ".date('r',$service['service_checked'])." "; From eb9281ff10497084f219dd41a12caa440e14aa60 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Wed, 9 Mar 2016 12:34:29 -0600 Subject: [PATCH 22/23] Fixes for Avtech Trim quotes from description Correct sensor type Allow sensor id of 0 Correct indexes for sensors --- includes/discovery/functions.inc.php | 6 +++--- .../sensors/temperatures/avtech.inc.php | 20 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/includes/discovery/functions.inc.php b/includes/discovery/functions.inc.php index 7845d70a39..6329886292 100644 --- a/includes/discovery/functions.inc.php +++ b/includes/discovery/functions.inc.php @@ -725,7 +725,7 @@ function avtech_add_sensor($device, $sensor) { global $valid; // set the id, must be unique - if ($sensor['id']) { + if (isset($sensor['id'])) { $id = $sensor['id']; } else { @@ -755,13 +755,13 @@ function avtech_add_sensor($device, $sensor) { d_echo('Sensor value: ' . $value . "\n"); // get the type - $type = $device['type'] ? $device['type'] : 'temperature'; + $type = $sensor['type'] ? $sensor['type'] : 'temperature'; d_echo('Sensor type: ' . $type . "\n"); // set the description if ($sensor['descr_oid']) { - $descr = snmp_get($device, $sensor['descr_oid'], '-OvQ'); + $descr = trim(snmp_get($device, $sensor['descr_oid'], '-OvQ'), '"'); } elseif ($sensor['descr']) { $descr = $sensor['descr']; diff --git a/includes/discovery/sensors/temperatures/avtech.inc.php b/includes/discovery/sensors/temperatures/avtech.inc.php index a9f907fc10..956fed49a4 100644 --- a/includes/discovery/sensors/temperatures/avtech.inc.php +++ b/includes/discovery/sensors/temperatures/avtech.inc.php @@ -8,21 +8,21 @@ if ($device['os'] == 'avtech') { $device_oid = '.1.3.6.1.4.1.20916.1.7.'; $internal = array( - 'id' => 1, + 'id' => 0, 'oid' => $device_oid.'1.1.1.1.0', 'descr_oid' => $device_oid.'1.1.2.0', ); avtech_add_sensor($device, $internal); $sen1 = array( - 'id' => 2, + 'id' => 1, 'oid' => $device_oid.'1.2.1.1.0', 'descr_oid' => $device_oid.'1.2.1.3.0', ); avtech_add_sensor($device, $sen1); $sen2 = array( - 'id' => 3, + 'id' => 2, 'oid' => $device_oid.'1.2.2.1.0', 'descr_oid' => $device_oid.'1.2.2.3.0', ); @@ -33,7 +33,7 @@ if ($device['os'] == 'avtech') { $device_oid = '.1.3.6.1.4.1.20916.1.1.'; $internal = array( - 'id' => 1, + 'id' => 0, 'oid' => $device_oid.'1.1.1.0', 'descr' => 'Internal', 'max_oid' => $device_oid.'3.1.0', @@ -42,7 +42,7 @@ if ($device['os'] == 'avtech') { avtech_add_sensor($device, $internal); $sen1 = array( - 'id' => 2, + 'id' => 1, 'oid' => $device_oid.'1.1.2.0', 'descr' => 'Sensor 1', 'max_oid' => $device_oid.'3.3.0', @@ -51,7 +51,7 @@ if ($device['os'] == 'avtech') { avtech_add_sensor($device, $sen1); $sen2 = array( - 'id' => 3, + 'id' => 2, 'oid' => $device_oid.'1.1.3.0', 'descr' => 'Sensor 2', 'max_oid' => $device_oid.'3.5.0', @@ -60,7 +60,7 @@ if ($device['os'] == 'avtech') { avtech_add_sensor($device, $sen2); $sen3 = array( - 'id' => 4, + 'id' => 3, 'oid' => $device_oid.'1.1.4.0', 'descr' => 'Sensor 3', 'max_oid' => $device_oid.'3.7.0', @@ -74,7 +74,7 @@ if ($device['os'] == 'avtech') { $divisor = 1; $internal = array( - 'id' => 1, + 'id' => 0, 'oid' => $device_oid.'1.1.1.2.0', 'descr_oid' => $device_oid.'1.1.2.1.0', 'divisor' => $divisor, @@ -82,7 +82,7 @@ if ($device['os'] == 'avtech') { avtech_add_sensor($device, $internal); $sen1 = array( - 'id' => 2, + 'id' => 1, 'oid' => $device_oid.'1.2.2.1.0', 'descr_oid' => $device_oid.'1.2.1.6.0', 'divisor' => $divisor, @@ -90,7 +90,7 @@ if ($device['os'] == 'avtech') { avtech_add_sensor($device, $sen1); $sen2 = array( - 'id' => 3, + 'id' => 2, 'oid' => $device_oid.'1.2.2.1.0', 'descr_oid' => $device_oid.'1.2.2.6.0', 'divisor' => $divisor, From 4ce1b43692f7ba6222088e0dddbbf420a4862f91 Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Wed, 9 Mar 2016 21:01:02 +0100 Subject: [PATCH 23/23] Updated UI again --- html/includes/print-service.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/includes/print-service.inc.php b/html/includes/print-service.inc.php index ac0f3dca19..0cac82cc07 100644 --- a/html/includes/print-service.inc.php +++ b/html/includes/print-service.inc.php @@ -70,7 +70,7 @@ echo " $desc - ".date('r',$service['service_checked'])." + $checked ";