Skip to content

Commit 916c76a

Browse files
committed
store more history, fix php warning
1 parent 0b91144 commit 916c76a

5 files changed

Lines changed: 17 additions & 6 deletions

File tree

INFO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[info]
22
name = snver
3-
version = 0.4
3+
version = 0.5
44
longname = Serial number and version
55
author = Petr Macek
66
email = petr.macek@kostax.cz

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ If you find a problem, let me know via github or https://forums.cacti.net
3535

3636

3737
## Changelog
38+
--- 0.5
39+
Fix lenght of stored history
40+
Fix php warning about $config variable
3841
--- 0.4
3942
Add history
4043
Fix unfiltered variable

TODO

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
more than one history record
1+
more than one history record?
2+
- add to configuration
23

34
send mail when hw is changed
4-
5+
- add to configuration
56

67

78
lepsi zpusob, jak vlozit jquery, ted to mam pres hook dole pod device
89

9-
add aruba switch (os-cx)
10+
test aruba switch (os-cx)
1011

1112
instant ap works with controller?
1213

functions.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ function snver_get_allowed_devices($user_id, $array = false) {
5959

6060

6161
function plugin_snver_get_info($host_id) {
62+
global $config;
63+
64+
include_once('./lib/snmp.php');
6265

6366
$out = '';
6467

setup.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function plugin_snver_setup_database() {
147147

148148
$data = array();
149149
$data['columns'][] = array('name' => 'host_id', 'type' => 'int(11)', 'NULL' => false);
150-
$data['columns'][] = array('name' => 'data', 'type' => 'varchar(512)', 'NULL' => true);
150+
$data['columns'][] = array('name' => 'data', 'type' => 'text', 'NULL' => true);
151151
$data['columns'][] = array('name' => 'last_check', 'type' => 'timestamp', 'NULL' => false, 'default' => '0000-00-00 00:00:00');
152152
$data['primary'] = 'host_id';
153153
$data['type'] = 'InnoDB';
@@ -229,7 +229,7 @@ function plugin_snver_upgrade_database() {
229229

230230
if (!cacti_version_compare($oldv, $current, '=')) {
231231

232-
if (cacti_version_compare($oldv, '0.4', '<')) {
232+
if (cacti_version_compare($oldv, '0.4', '<=')) {
233233

234234
$data = array();
235235
$data['columns'][] = array('name' => 'host_id', 'type' => 'int(11)', 'NULL' => false);
@@ -240,6 +240,10 @@ function plugin_snver_upgrade_database() {
240240
$data['comment'] = 'snver history';
241241
api_plugin_db_table_create ('snver', 'plugin_snver_history', $data);
242242
}
243+
244+
if (cacti_version_compare($oldv, '0.5', '<=')) {
245+
db_execute('ALTER TABLE plugin_snver_history MODIFY COLUMN data text');
246+
}
243247
}
244248
}
245249

0 commit comments

Comments
 (0)