Closed jamesboswell closed 8 years ago
Sorry but with npm install and npm start won't work. You should follow the instructions on the readme.
https://github.com/toni-moreno/snmpcollector/blob/master/README.md
cd $GOPATH/src/github.com/toni-moreno/snmpcollector
go run build.go setup (only needed once to install godep)
godep restore (will pull down all golang lib dependencies in your current GOPATH)
go run build.go build
npm install
PATH=$(npm bin):$PATH
npm run tsc
cd public/
ln -s ../node_modules/ ./node_modules
cd ..
cp ./conf/sample.config.toml ./conf/config.toml
./bin/snmpcollector
Now you will be able to log into the tool by http://localhost:8090/ with user "adm1" and password "adm1pass"
@toni-moreno Firstly, thanks for the quick reply. It quite literally dawned on me early this morning as I awoke, that the backend must be serving some content.
I've followed these steps exactly. I get nothing but Loading....
when browsing to http://localhost:8090/
Macron is reporting some 404 for Angular bootstrap.js (see output at bottom)
$ go run build.go build 130 ↵
Version: 0.5.2, Linux Version: 0.5.2, Package Iteration:
rm -r dist
rm -r tmp
rm -r /Users/jboswell/go/pkg/darwin_amd64/github.com/toni-moreno/snmpcollector
rm -r ./bin/snmpcollector
rm -r ./bin/snmpcollector.md5
GOPATH=/Users/jboswell/go
go version
go version go1.7.1 darwin/amd64
go build -ldflags -w -X main.version=0.5.2 -X main.commit=8c66122 -X main.buildstamp=1478124156 -o ./bin/snmpcollector ./pkg/
$
$ npm install
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
npm WARN deprecated to-iso-string@0.0.2: to-iso-string has been deprecated, use @segment/to-iso-string instead.
npm WARN deprecated jade@0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN prefer global leasot@3.2.2 should be installed with -g
> fsevents@1.0.15 install /Users/jboswell/go/src/snmpcollector/node_modules/fsevents
> node-pre-gyp install --fallback-to-build
[fsevents] Success: "/Users/jboswell/go/src/snmpcollector/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node" is installed via remote
> snmpcollector@0.5.2 postinstall /Users/jboswell/go/src/snmpcollector
> typings install
typings WARN deprecated 10/14/2016: "registry:npm/lodash#4.0.0+20160416211519" is deprecated (updated, replaced or removed)
├── lodash@4.0.0
├── es6-shim (global)
└── jasmine (global)
<SNIP the file tree output>
$PATH=$(npm bin):$PATH
$npm run tsc
> snmpcollector@0.5.2 tsc /Users/jboswell/go/src/snmpcollector
> tsc
$ cd public/
$ ln -s ../node_modules/ ./node_modules
$ cd ..
$ cp ./conf/sample.config.toml ./conf/config.toml
$ ./bin/snmpcollector
WARN[2016-11-06 13:02:52] No Output default found influxdb devices found !!
SELFMON enabled {Enabled:true Freq:60 Prefix:gvm ExtraTags:[instance=snmpcollector01] Influx:0x4a0c480 runtimeStatsRunning:false TagMap:map[instance:snmpcollector01] bps:<nil>}n
Seeing 404s here
╰─$ ./bin/snmpcollector
WARN[2016-11-06 13:13:07] No Output default found influxdb devices found !!
SELFMON enabled {Enabled:true Freq:60 Prefix:gvm ExtraTags:[instance=snmpcollector01] Influx:0x4a0c480 runtimeStatsRunning:false TagMap:map[instance:snmpcollector01] bps:<nil>}n
[Macaron] 2016-11-06 13:13:10: Started GET / for [::1]
[Macaron] [Static] Serving /index.html
[Macaron] 2016-11-06 13:13:10: Completed / 304 Not Modified in 269.38µs
[Macaron] 2016-11-06 13:13:10: Started GET /public/css/simple-sidebar.css for [::1]
[Macaron] 2016-11-06 13:13:10: Completed /public/css/simple-sidebar.css 304 Not Modified in 110.838µs
[Macaron] 2016-11-06 13:13:10: Started GET /systemjs.config.js for [::1]
[Macaron] [Static] Serving /systemjs.config.js
[Macaron] 2016-11-06 13:13:10: Completed /systemjs.config.js 304 Not Modified in 152.549µs
[Macaron] 2016-11-06 13:13:10: Started GET /node_modules/ng2-bootstrap/bundles/ng2-bootstrap.js for [::1]
[Macaron] 2016-11-06 13:13:10: Completed /node_modules/ng2-bootstrap/bundles/ng2-bootstrap.js 404 Not Found in 888.182µs
[Macaron] 2016-11-06 13:13:10: Started GET /node_modules/ng2-bootstrap/bundles/ng2-bootstrap.js for [::1]
[Macaron] 2016-11-06 13:13:10: Completed /node_modules/ng2-bootstrap/bundles/ng2-bootstrap.js 404 Not Found in 96.61µs
[Macaron] 2016-11-06 13:13:10: Started GET /public/main.js for [::1]
[Macaron] 2016-11-06 13:13:10: Completed /public/main.js 200 OK in 4.124223ms
[Macaron] 2016-11-06 13:13:10: Started GET /public/main.module.js for [::1]
[Macaron] 2016-11-06 13:13:10: Completed /public/main.module.js 200 OK in 203.361µs
[Macaron] 2016-11-06 13:13:10: Started GET /node_modules/ng2-bootstrap/ng2-bootstrap.js/ng2-bootstrap for [::1]
[Macaron] 2016-11-06 13:13:10: Completed /node_modules/ng2-bootstrap/ng2-bootstrap.js/ng2-bootstrap 404 Not Found in 116.991µs
@toni-moreno Chrome console
http://localhost:8090/node_modules/ng2-bootstrap/bundles/ng2-bootstrap.js Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:8090/node_modules/ng2-bootstrap/ng2-bootstrap.js/ng2-bootstrap Failed to load resource: the server responded with a status of 404 (Not Found)
localhost/:23 Error: (SystemJS) Error: XHR error (404 Not Found) loading http://localhost:8090/node_modules/ng2-bootstrap/ng2-bootstrap.js/ng2-bootstrap(…)(anonymous function) @ localhost/:23
Appears some JS files are not found. This is a git clone from your repo. Is something missing that perhaps exists on your system?
$ pwd
/Users/jboswell/go/src/snmpcollector
$ ls public/node_modules/ng2-bootstrap/bundles/ng2-bootstrap.js
ls: public/node_modules/ng2-bootstrap/bundles/ng2-bootstrap.js: No such file or directory
Thanks for looking into this, I just wanted to check out what you've done here. Your Go code has given me some ideas for a similar thing I was trying to do (but purely backend no GUI)
Can you show me if you have installed the ng2-bootstrap module and what version ?
# ls -l public/node_modules/ng2-bootstrap/*
# npm ls
There's a ton of files here is just the bundles dir/
$ ls -l public/node_modules/ng2-bootstrap/bundles/*
-rw-r--r-- 1 jboswell staff 246288 Oct 26 18:16 public/node_modules/ng2-bootstrap/bundles/ng2-bootstrap.umd.js
-rw-r--r-- 1 jboswell staff 246288 Oct 26 18:16 public/node_modules/ng2-bootstrap/bundles/ng2-bootstrap.umd.min.js
$ npm ls ng2-bootstrap
snmpcollector@0.5.2 /Users/jboswell/go/src/snmpcollector
└── ng2-bootstrap@1.1.16
Can you try force the intallation of the ng2-bootstrap@1.1.13 version ?
Well that fixed the 404s, but introduced more problems. I think there is some node dependency issues going on here. Can you npm shrinkwrap your working copy? If you provide the npm-shrinkwrap.json then we should be identical, after a npm install
zone.js:388 Unhandled Promise rejection: Template parse errors:
Unexpected closing tag "i" (" http User Agent, defaults to \"InfluxDBClient\"(useful for debugin data write in the server site)">[ERROR ->]</i>
<div class="col-sm-9">
<input formControlName="UserAgent" id="UserAgent" />
"): InfluxServerCfgComponent@123:125
Unexpected closing tag "i" (" http User Agent, defaults to \"InfluxDBClient\"(useful for debugin data write in the server site)">[ERROR ->]</i>
<div class="col-sm-9">
<input formControlName="UserAgent" id="UserAgent" [ngModel] = "testinfl"): InfluxServerCfgComponent@227:125 ; Zone: <root> ; Task: Promise.then ; Value: Error: Template parse errors:(…) Error: Template parse errors:
Unexpected closing tag "i" (" http User Agent, defaults to \"InfluxDBClient\"(useful for debugin data write in the server site)">[ERROR ->]</i>
<div class="col-sm-9">
<input formControlName="UserAgent" id="UserAgent" />
"): InfluxServerCfgComponent@123:125
Unexpected closing tag "i" (" http User Agent, defaults to \"InfluxDBClient\"(useful for debugin data write in the server site)">[ERROR ->]</i>
<div class="col-sm-9">
<input formControlName="UserAgent" id="UserAgent" [ngModel] = "testinfl"): InfluxServerCfgComponent@227:125
at DirectiveNormalizer.normalizeLoadedTemplate (http://localhost:8090/node_modules/@angular/compiler/bundles/compiler.umd.js:13373:21)
at eval (http://localhost:8090/node_modules/@angular/compiler/bundles/compiler.umd.js:13366:53)
at ZoneDelegate.invoke (http://localhost:8090/node_modules/zone.js/dist/zone.js:232:26)
at Zone.run (http://localhost:8090/node_modules/zone.js/dist/zone.js:114:43)
at http://localhost:8090/node_modules/zone.js/dist/zone.js:502:57
at ZoneDelegate.invokeTask (http://localhost:8090/node_modules/zone.js/dist/zone.js:265:35)
at Zone.runTask (http://localhost:8090/node_modules/zone.js/dist/zone.js:154:47)
at drainMicroTaskQueue (http://localhost:8090/node_modules/zone.js/dist/zone.js:401:35)
at XMLHttpRequest.ZoneTask.invoke (http://localhost:8090/node_modules/zone.js/dist/zone.js:339:25)consoleError @ zone.js:388_loop_1 @ zone.js:417drainMicroTaskQueue @ zone.js:421ZoneTask.invoke @ zone.js:339
zone.js:390 Error: Uncaught (in promise): Error: Template parse errors:(…)consoleError @ zone.js:390_loop_1 @ zone.js:417drainMicroTaskQueue @ zone.js:421ZoneTask.invoke @ zone.js:339
Ok. I will send you ASAP.
Hi @jamesboswell
The error shown above is just an html error, it is not related with any dependencies or missing files: escaping char syntax can't be used on html attribute content.
It is fixed on the pull request #29
It will be merged soon, so, please, try it again later and give us some feedback!
Thanks for all!
@sbengo @toni-moreno re-pulled with PR #29 merged in. I now get a GUI and can login. Closing this issue. Thank you both.
Hi @jamesboswell as @sbengo told you the error was not a dependency issue rather than a html mistake. We are released new 0.5.3 version with this issue fixed and other enhancements .
Could you try to test with your current npm module versions?. If errors I will send you the requested npm shrinkwrap. ASAP.
Thank you very much to help us to test this tool.
@jamesboswell you are really fast!!
Hi @toni-moreno I just cloned your repo, as I wanted to check it out. Sadly the front end seems to have several 404 path issues
node version :
v6.9.1 (Boron LTS)