Skip to content

Commit c92f015

Browse files
author
Toni Moreno Gimenez
committed
released v0.13.0
1 parent f21bd53 commit c92f015

5 files changed

Lines changed: 54 additions & 37 deletions

File tree

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Go
1717
uses: actions/setup-go@v2
1818
with:
19-
go-version: 1.16
19+
go-version: 1.17.3
2020

2121
- name: Build
2222
run: go build ./pkg/...

.github/workflows/release-packages.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
2020
- name: Install Go
2121
uses: actions/setup-go@v2
22+
with:
23+
go-version: '1.17.3'
2224
- name: Checkout code
2325
uses: actions/checkout@v2
2426
- name: Build Go Binary

CHANGELOG.md

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
# v 0.13.0 ( unreleased )
1+
# v0.13.0 ( 2022-02-16 )
22

33
### New Features
44

55
* updated from go 1.16 to 1.17.3
66
* updates xorm from github/go-xorm/* to xorm.io/* (thanks to https://github.com/dcarbone )
7-
* fixes default value on SnmpDeviceCfg.Active to be compatible with mariadb, mysql, and pgsql (thanks to https://github.com/dcarbone )
7+
* fixes default value on SnmpDeviceCfg.Active to be compatible with mariadb, mysql, and pgsql (thanks to https://github.com/dcarbone )
8+
* updated build system to be generate release packages from github-actions CI
9+
810

911
### Fixes
1012

@@ -14,7 +16,7 @@
1416

1517
### breaking changes
1618

17-
# v 0.12.0 ( 2021-11-14 )
19+
# v0.12.0 ( 2021-11-14 )
1820

1921
### New Features
2022

@@ -28,7 +30,7 @@
2830
https://github.com/toni-moreno/snmpcollector/wiki/Troubleshooting#dashboards
2931

3032

31-
# v 0.11.0 ( 2021-10-13 )
33+
# v0.11.0 ( 2021-10-13 )
3234

3335
### New Features
3436

@@ -47,7 +49,7 @@
4749

4850
### breaking changes
4951

50-
# v 0.10.0 ( 2021-03-06 )
52+
# v0.10.0 ( 2021-03-06 )
5153
### New Features
5254
* added support for PostgreSQL as config database.
5355
* added option to redirect influxdb HTTP writes over HTTP(S)_PROXY variables.
@@ -67,7 +69,7 @@
6769

6870
### breaking changes
6971

70-
# v 0.9.0 ( 2021-01-04 )
72+
# v0.9.0 ( 2021-01-04 )
7173
### New Features
7274
* Added snmpmetric unit tests
7375
* Updated to last "gosnmp" v1.28.0 release
@@ -84,7 +86,7 @@
8486
### breaking changes
8587
* Measurement TagName property (only retrieved on runtime API) changed from `string` to `[]string`
8688

87-
# v 0.8.1 ( 2020-10-06 )
89+
# v0.8.1 ( 2020-10-06 )
8890
### New Features
8991
* Upgraded dependencies from dep to gomodules
9092
* Added config through environment vars ( docker friendly ),implements #420
@@ -103,7 +105,7 @@
103105
* no longer supported "-httpPort" command line parameter use "-httpListen" instead (still supported but deprecated Port option at config file)
104106
* DOCKER IMAGE upgrade needs for previous ownership change to UID/GID=472 on all its persistent files/volumes
105107

106-
# v 0.8.0 ( 2018-11-05)
108+
# v0.8.0 ( 2018-11-05)
107109
### New Features
108110
* Added new capabilities to add , modify and delete devices online ( avoids restart the gathering ocess on the other devices)
109111
* Go 1.9.8 to 1.11 binaries
@@ -118,7 +120,7 @@
118120
* STRINGPARSER SnmpMetric Type no longer will be Scaled with Scale/shift values.
119121

120122

121-
# v 0.7.7 (2018-05-28)
123+
# v0.7.7 (2018-05-28)
122124
### New Features
123125
* Added SIGTERM handler to stop gracefully all device gathering gourutines and flush pending data to its defined output db.
124126
* Added SIGHUP handler to reload complete configuration and restart gathering process (as in the 'Reload Config' WebUI option)
@@ -131,7 +133,7 @@ field | description
131133
fields_sent | number of fields sent to the DB on the last period
132134
fields_sent_max | max number of fields sent to the DB on the last period
133135

134-
# v 0.7.6 (2018-01-17)
136+
# v0.7.6 (2018-01-17)
135137
### New Features
136138
* Go 1.8.2 to 1.9.2 binaries
137139
* Added new value on NFR (Non Filtered Rows) with total index length before filter applied, for STRINGEVAL metric types.
@@ -184,7 +186,7 @@ mem.mCacheInuse| MCacheInuse is bytes of allocated mcache structures.
184186
cicle_gather_start_time|cycle_gather_start_time
185187

186188

187-
# v 0.7.5 (2017-12-16)
189+
# v0.7.5 (2017-12-16)
188190
### New Features
189191
* Added Hard snmp reset option to remap all measurements again when some problem happens when trying to do snmp connection init on first attemps. (fix #271)
190192
* Added a new Runtime option to Force Gather data even if device is not active ( useful for configuration testing )(implements #275)If active the current gathering period won't be changed, and this will be an extra point.
@@ -204,7 +206,7 @@ mem.mCacheInuse| MCacheInuse is bytes of allocated mcache structures.
204206
* Fixed table name field snmp_device_cfg.system_o_i_ds to snmp_device_cfg.systemoids , to migrate data you should only execute
205207
update snmp_device_cfg set systemoids = system_o_i_ds ;
206208

207-
# v 0.7.4 (2017-09-23)
209+
# v0.7.4 (2017-09-23)
208210
### New Features
209211
* added new Alternate SystemOID's map to extend snmpcollector to non MIB-2 based devices (as by example Proxy Squid), is important to get system description and also to check connectivity with the device.
210212
* added new SNMPv3 parameters ContextEngineID and ContextName
@@ -218,7 +220,7 @@ update snmp_device_cfg set systemoids = system_o_i_ds ;
218220

219221
### breaking changes
220222

221-
# v 0.7.3 (2017-06-26)
223+
# v0.7.3 (2017-06-26)
222224
### New Features
223225
* added new BITS snmp SMI type to send named array strings as Fields or tags.
224226
* added new BITS Check (BITSCHK) cooked type to check only a specific position.
@@ -235,7 +237,7 @@ update snmp_device_cfg set systemoids = system_o_i_ds ;
235237

236238
### breaking changes
237239

238-
# v 0.7.2 (2017-05-27)
240+
# v0.7.2 (2017-05-27)
239241
### New Features
240242
* added new ndif (numeric different) oid condition comparison
241243
* added new comunication Bus, improves webui to devices message send in unicast and broadcast mode.
@@ -251,7 +253,7 @@ update snmp_device_cfg set systemoids = system_o_i_ds ;
251253
### breaking changes
252254

253255

254-
# v 0.7.1 (2017-05-17)
256+
# v0.7.1 (2017-05-17)
255257
### New Features
256258
* Improved self monitoring process, renamed and added new device statistics metrics.
257259
* Added backgound colours on runtime data to validate or invalidate data.
@@ -276,7 +278,7 @@ process_t | cicle_gather_duration
276278
getsent | snmp_oid_get_processed
277279
geterror | snmp_oid_get_errors
278280

279-
# v 0.7.0 (2017-04-29)
281+
# v0.7.0 (2017-04-29)
280282
### New Features
281283
* added a gonsmp fix for snmpv3 performance problems.
282284
* updated all dependencies
@@ -287,7 +289,7 @@ geterror | snmp_oid_get_errors
287289

288290
### breaking changes
289291

290-
# v 0.6.6
292+
# v0.6.6
291293
### New Features
292294
* Compilation with Go1.8
293295
* added Docker image to hub tonimoreno/snmpcollector
@@ -304,7 +306,7 @@ geterror | snmp_oid_get_errors
304306

305307
### breaking changes
306308

307-
# v 0.6.5
309+
# v0.6.5
308310
### New Features
309311
* Refactored and Improved form Validation options,to allow dynamic validators on some parameters changes
310312
* Added new Multiple OID condition Filter and filter check improvements.
@@ -318,7 +320,7 @@ geterror | snmp_oid_get_errors
318320
### breaking changes
319321

320322

321-
# v 0.6.4
323+
# v0.6.4
322324
### New Features
323325
* Measurement Filters refactor , added CustomFilter.
324326
* Added OID condition as new SNMP Metric Type
@@ -347,10 +349,10 @@ DROP TABLE meas_filter_cfg_old;
347349
CREATE UNIQUE INDEX `UQE_meas_filter_cfg_id` ON `meas_filter_cfg` (`id`);
348350
```
349351

350-
# v 0.6.3
352+
# v0.6.3
351353
* this version have been bypassed for technical reasons
352354

353-
# v 0.6.2
355+
# v0.6.2
354356
### New Features
355357
* Metric Type standarization according to RFC2578 SMIv2.
356358
* new IndexTagFormat to the measurement enabling custom Tag names
@@ -372,7 +374,7 @@ update snmp_metric_cfg set datasrctype='IpAddress' where datasrctype = 'IPADDR'
372374
alter table influx_measurement_cfg rename to measurement_cfg;
373375
```
374376

375-
# v 0.6.1
377+
# v0.6.1
376378
### New Features
377379
* upgraded to angular 2.4.1/router 3.4.1/ng2-bootstrap 1.1.16-9/angular-cli 1.0.0-beta.24/ zone.js 0.7.4 /rxjs 5.0.1
378380
* new bundle system based on angular-cli and npm
@@ -387,7 +389,7 @@ alter table influx_measurement_cfg rename to measurement_cfg;
387389

388390
### breaking changes
389391

390-
# v 0.6.0
392+
# v0.6.0
391393
### New Features
392394
* new metric types based on SNMP ANS1 types
393395
* new snmp runtime console
@@ -400,7 +402,7 @@ alter table influx_measurement_cfg rename to measurement_cfg;
400402

401403
### breaking changes
402404

403-
# v 0.5.6
405+
# v0.5.6
404406
### New features.
405407
* UI Enhanced login aspect
406408
* added DisableBulk option to devices with problems in bulk queries like some IBM devices
@@ -419,7 +421,7 @@ alter table influx_measurement_cfg rename to measurement_cfg;
419421
### breaking changes
420422

421423

422-
# v 0.5.5
424+
# v0.5.5
423425
### New features.
424426
* Online Reload Configuration
425427
* New runtime WebUI option which enables user inspect online current gathered snmp values for all measurements on all devices, also allow interact to change logging and debug options and also deactivate device.
@@ -430,7 +432,7 @@ alter table influx_measurement_cfg rename to measurement_cfg;
430432
### breaking changes
431433
* no longer needed options flags: freq, repeat, verbose ; since all this features can be changed on the WebUI
432434

433-
# v 0.5.4
435+
# v0.5.4
434436
### New features.
435437
* added UpdateFltFreq option to periodically update the status of the tables and filters
436438
* added Security to the Collector API
@@ -443,12 +445,12 @@ alter table influx_measurement_cfg rename to measurement_cfg;
443445
### breaking changes
444446
* none
445447

446-
# v 0.5.3
448+
# v0.5.3
447449
### New features.
448450
* WebUI now shows data in tables and can be filtered.
449451

450452

451-
# v 0.5.2
453+
# v0.5.2
452454
### New features.
453455
* Added Runtime Version to the snmpcollector API
454456
* Estandarized Description for all objects.
@@ -461,7 +463,7 @@ alter table influx_measurement_cfg rename to measurement_cfg;
461463
* none
462464

463465

464-
# v 0.5.1
466+
# v0.5.1
465467
### New features.
466468
* Define field metric as Tag (IsTag = true) => type STRING,HWADDR,IP
467469
* Defined measurment Indexed "index" as value on special devices with no special Index OID.
@@ -476,7 +478,7 @@ alter table influx_measurement_cfg rename to measurement_cfg;
476478
### breaking changes
477479
* none
478480

479-
# v 0.5.0
481+
# v0.5.0
480482
### New features.
481483
* new WebIU with all forms to insert , update , delete objects.
482484
* Major internal snmpdeice/measurement refactor

build.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ func main() {
4242
log.SetOutput(os.Stdout)
4343
log.SetFlags(0)
4444

45-
ensureGoPath()
46-
//readVersionFromPackageJson()
45+
// ensureGoPath()
46+
// readVersionFromPackageJson()
4747
readVersionFromGit()
4848

4949
log.Printf("Version: %s, Linux Version: %s, Package Iteration: %s\n", version, linuxPackageVersion, linuxPackageIteration)
@@ -93,6 +93,10 @@ func main() {
9393
sha1FilesInDist()
9494
case "sha1-dist":
9595
sha1FilesInDist()
96+
case "pkg-all":
97+
os.Mkdir("./dist", 0755)
98+
createLinuxPackages()
99+
sha1FilesInDist()
96100
case "latest":
97101
os.Mkdir("./dist", 0755)
98102
createLinuxPackages()
@@ -155,6 +159,12 @@ func readVersionFromGit() {
155159
}
156160

157161
linuxPackageVersion = strings.TrimSpace(string(out))
162+
re := regexp.MustCompile(`(?m)v[0-9]+\.[0-9]+\.[0-9]+`)
163+
if !re.MatchString(linuxPackageVersion) {
164+
log.Fatalf("Error, Git Release doesn't match the patter vX.Y.Z: %s", linuxPackageVersion)
165+
}
166+
//remove v from version
167+
linuxPackageVersion = strings.TrimPrefix(linuxPackageVersion,"v")
158168
version = linuxPackageVersion
159169
linuxPackageIteration = ""
160170

@@ -396,7 +406,7 @@ func rmr(paths ...string) {
396406
func clean() {
397407
// rmr("bin", "Godeps/_workspace/pkg", "Godeps/_workspace/bin")
398408
rmr("public")
399-
//rmr("tmp")
409+
// rmr("tmp")
400410
rmr(filepath.Join(os.Getenv("GOPATH"), fmt.Sprintf("pkg/%s_%s/github.com/toni-moreno/snmpcollector", goos, goarch)))
401411
}
402412

pkg/data/snmp/client.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ func (c *Client) Connect(systemOIDs []string) (*SysInfo, error) {
152152
c.ConnectionParams.Timeout = 5
153153
goSNMPClient, err := GetClient(c.ConnectionParams, c.Log)
154154
if err != nil {
155+
c.ConnectionParams.Retries = retries
156+
c.ConnectionParams.Timeout = timeout
155157
return nil, fmt.Errorf("initializing the goSNMP client: %v", err)
156158
}
157159

@@ -167,12 +169,13 @@ func (c *Client) Connect(systemOIDs []string) (*SysInfo, error) {
167169

168170
sysinfo, err := c.SysInfoQuery(systemOIDs)
169171
// Restore configuration values
170-
c.snmpClient.Retries = retries
171-
c.snmpClient.Timeout = time.Duration(timeout) * time.Second
172+
c.ConnectionParams.Retries = retries
173+
c.ConnectionParams.Timeout = timeout
172174
if err != nil {
173175
return nil, fmt.Errorf("obtaining the sysInfo: %v", err)
174176
}
175-
177+
c.snmpClient.Retries = retries
178+
c.snmpClient.Timeout = time.Duration(timeout) * time.Second
176179
c.Connected = true
177180

178181
return sysinfo, nil

0 commit comments

Comments
 (0)