Giter Club home page Giter Club logo

cli-dashboard's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli-dashboard's Issues

Display errors in a separate window

The errors (such as 404) are displayed over the dashboard; there should be separate window to display them and still being able to use the dashboard.

New version does not poll for stream throughput with new API

Starting graylog-dashboard results in 404's to http://:API_PATH/streams/:stream_id/throughput, which is 404. This needs to be updated to the current stream throughput path, which I cannot find the Graylog API Docs (nor can I find the entry in the Graylog REST API codebase to update it myself). It looks like it should be here: https://github.com/Graylog2/graylog2-server/blob/master/graylog2-server/src/main/java/org/graylog2/rest/resources/streams/StreamResource.java , around line 264, but it is not listed.

14:41:23.879477 IP a.b.c.d.48310 > graylog-api-server.9601: Flags [P.], seq 1:136, ack 1, win 229, options [nop,nop,TS val 351730439 ecr 68026481], length 135
E.....@.@..(.......<..%...'....x...........
.......qGET /api/streams/580524244345491d9a3508cc/throughput HTTP/1.1
host: graylog-api-server:9601
accept: application/json
Connection: close

14:41:23.880730 IP graylog-api-server.9601 > a.b.c.d.48310: Flags [P.], seq 1:265, ack 136, win 235, options [nop,nop,TS val 68026481 ecr 351730439], length 264
E..<.
@.@......<....%......x..(q...."......
...q....HTTP/1.1 404 Not Found
X-Graylog-Node-ID: 4da9e014-b444-4a33-8b03-d797eeadfa4b
Vary: Accept-Encoding
Content-Type: application/json
Date: Mon, 17 Oct 2016 19:41:53 GMT
Connection: close
Content-Length: 50

Error 404 with server v1.3.3

With Graylog server version 1.3.3, the CLI dashboard reports:

Could not get messages of stream. Error: HTTP 404
Could not get stream throughput. Error: HTTP 404
Could not get alerts of stream. Error: HTTP 404
Could not get total throughput. Error: HTTP 404 

Not sure how much the API has changed, maybe just an URL needs to be updated?

Could not get stream throughput

When opening a valid stream (I get another error when using an invalid title), I get the following error. The dashboard is not even displayed.

Error: Could not get stream throughput. Bad status code: 404 Not Found [object Object]
    at makeRequest.then.catch (/home/xhardy/Programs/node/lib/node_modules/graylog-cli-dashboard/lib/graylog-api.js:77:13)
    at tryCatcher (/home/xhardy/Programs/node/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/xhardy/Programs/node/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:510:31)
    at Promise._settlePromise (/home/xhardy/Programs/node/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/home/xhardy/Programs/node/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/home/xhardy/Programs/node/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:687:18)
    at Async._drainQueue (/home/xhardy/Programs/node/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/async.js:138:16)
    at Async._drainQueues (/home/xhardy/Programs/node/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/async.js:148:10)
    at Immediate.Async.drainQueues (/home/xhardy/Programs/node/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:637:20)
    at tryOnImmediate (timers.js:610:5)
    at processImmediate [as _immediateCallback] (timers.js:582:5)

Message list doesn't update, but throughput graphs update

I've tried running the latest version of cli-dashboard in a Docker container using various versions of node, currently current-buster-slim, which is node 12.10. (I've tried other node in Docker versions back to 6.17 with the same results.)

The dashboard displays just fine, and the graphs seem to update in realtime. However, the message list seems to be stuck on the first few events in the stream, and never updates. For example, it is now 21:25 UTC, but the last message displayed in the widget is from 15:58 UTC. If I check the stream in Graylog, the last message I see is 21:23.

Does anyone have any ideas? My working hypothesis is that this is something to do with changes to the Graylog API.

Error on run

$ graylog-dashboard --server-url http://my.graylogserver.com:1234 --username ***** --password ******
/usr/local/lib/node_modules/graylog-cli-dashboard/graylog-dashboard.js:46
    const {argv} = yargs;

Get the above error on run no matter the arguments passed. Installed via NPM on Linux Mint 18.1 using Node v4.2.6

Intermittent error "Could not get stream throughput" 404; api response "I do not have a metric called [org.graylog2.plugin.streams.Stream.5891ca6995186c0001613209.incomingMessages]."

Issue: The API call to graylog which gets a stream throughput is sometimes failing, being given a 404 response with the message that there is no such metric. This is unpredictable, sometimes failing for a given stream but sometimes succeeding

Details of setup

  • running both graylog and cli-dashboard in docker containers, on different hosts
  • graylog version is 2.1.3-1 (graylog2/server:latest from https://hub.docker.com/r/graylog2/server/ as of 2017-02-02)
  • graylog's api is listening on port 12901
  • there is an nginx reverse proxy in front of it, listening on port 12900 (this is for the convenience of seeing the api requests, for debugging)
  • graylog-cli-dashboard is version 1.0.0 (npm install as of 2017-02-02)
  • graylog-cli-dashboard is running on node v6.9.5 (most recent node v6 build available in docker as of 2017-02-02)
  • graylog-cli-dashboard is running in a docker container, with the image built using an npm install as of 2017-02-02 with the following Dockerfile:
FROM node:6
RUN npm install graylog-cli-dashboard -g
ENTRYPOINT ["graylog-dashboard"]
  • graylog-cli-dashboard is invoked with the following docker command:
docker run \
--rm \
-it \
myprivatedockerrepository:graylog-cli \
--server-url http://myprivatedevbox:12900 \
--stream-title "si-w2" \
--username user \
--password password
  • the name of the repository and the ip address of the dev box have been changed, otherwise this is verbatim; the stream title is correct, and accessible by the configured user account
  • note that I have deliberately configured graylog so it can be accessed on port 12900, to avoid confusion with the advice given in issue #25.

Expected Results

  • graylog-cli runs when started
  • all api requests connect and get a 200 response
  • the stream's messages are shown
  • I can switch streams in the UI, with the same successful results

Actual results

  1. (sometimes) graylog-cli runs, and makes a number of successful api calls, before getting a 404 on the call which is trying to get the stream throughput (GET /system/metrics/...) and crashes out.
  2. (sometimes) graylog-cli runs successfully. When I pick a different stream from the UI by double-clicking, it gets a 404 on the call which is trying to get the stream throughput (GET /system/metrics/...) and crashes out.

Error and callstack shown at the command-line:

Error: Could not get stream throughput. Bad status code: 404 Not Found [object Object]
    at makeRequest.then.catch (/usr/local/lib/node_modules/graylog-cli-dashboard/lib/graylog-api.js:77:13)
    at tryCatcher (/usr/local/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:510:31)
    at Promise._settlePromise (/usr/local/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/usr/local/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/usr/local/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:687:18)
    at Async._drainQueue (/usr/local/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/usr/local/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/usr/local/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:649:20)
    at tryOnImmediate (timers.js:622:5)
    at processImmediate [as _immediateCallback] (timers.js:594:5)

nginx log showing the api calls made by cli-dashboard:

"GET /streams HTTP/1.1" 200 8182 "-" "-"
"GET /system/metrics/org.graylog2.plugin.streams.Stream.5891bf7595186c0001612671.incomingMessages.1-sec-rate HTTP/1.1" 404 152 "-" "-"
"GET /streams/5891bf7595186c0001612671/alerts/check HTTP/1.1" 200 77 "-" "-"
"GET /search/universal/relative?query=%2A&range=86400&fields=timestamp%2Cmessage&filter=streams%3A5891bf7595186c0001612671&limit=50 HTTP/1.1" 499 0 "-" "-"
"GET /system/throughput HTTP/1.1" 499 0 "-" "-"

Note:

  1. The first call (GET /streams) gets a 200 response; this confirms that the server-url configuration is correct and that graylog-cli-dashboard can connect to the graylog api
  2. The second call (GET /system/metrics/... ) fails with a 404
  3. The third call (GET /streams/.../alerts/check) succeeds with a 200
  4. The fourth call (GET search/...) receives a 499 response
  5. The fifth call (GET /system/throughput) also receives a 499 response

Double-checking in the API browser

On the graylog server (http://myprivatedevbox:12900), it is possible to load the api-browser page to examine and try out api calls. The metrics call can be retried here, again getting a 404 response:
031693_screenshot

{
  "type": "ApiError",
  "message": "I do not have a metric called [org.graylog2.plugin.streams.Stream.5891bf7595186c0001612671.incomingMessages.1-sec-rate]."
}

Further notes

  • The problem is semi-intermittent. Most often, if I run graylog-cli-dashboard for the same stream as before, it will fail as before (or succeed as before). No obvious pattern about when and why it changes.

  • see further screenshots (031694-031696) showing an example of when it starts successfully, but then fails on switching to a different stream, getting the same 404 response and crashing out.

  • 031694_screenshot

  • 031695_screenshot

  • 031696_screenshot

Bad status code: 404 Not Found {"type":"ApiError","message":"HTTP 404 Not Found"}

Does this support Graylog 3.2+?

I'm trying to run this from the CLI on a Ubuntu 18.04.
But i keep getting an error when launching it.
I'm on graylog version 3.0.2+1686930, codename Space Moose

My startup is:
graylog-dashboard -g --api-host 127.0.0.1:9000 --api-protocol http --stream-title "All messages" --username ***** --password *****

And the error message i keep getting is:

Error: Could not get Graylog version. Bad status code: 404 Not Found {"type":"ApiError","message":"HTTP 404 Not Found"}
    at makeRequest.then.catch (/usr/local/lib/node_modules/graylog-cli-dashboard/lib/graylog-api.js:111:13)
    at tryCatcher (/usr/local/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:517:31)
    at Promise._settlePromise (/usr/local/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:574:18)
    at Promise._settlePromise0 (/usr/local/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:619:10)
    at Promise._settlePromises (/usr/local/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:695:18)
    at _drainQueueStep (/usr/local/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/async.js:138:12)
    at _drainQueue (/usr/local/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/async.js:131:9)
    at Async._drainQueues (/usr/local/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/async.js:147:5)
    at Immediate.Async.drainQueues (/usr/local/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:794:20)
    at tryOnImmediate (timers.js:752:5)
    at processImmediate [as _immediateCallback] (timers.js:729:5)

Any ideas? :)

Windows version

Are you having any plan to bring this client to windows ?

att.

Alternatives for storing the passwords

Storing the password in a file is not secure at all. It would be better to have a prompt on startup (add an option for that) or to use Linux keyring.

On the other hand, the host and the default stream values could also be stored in the configuration file.

graylog2 2.0.2

any chance this will be fixed so it works with latest graylog, was nice having it running in a terminal window on part of a second screen...

Cannot read property 'id' of undefined

Node version: v7.4.0
Npm version: 4.0.5

When I try to pull our graylog server, I get an error.

The web interface is available at this url: https://server.example.com/streams/#streamID#/

When I try to use the graylog-dashboard, I get this error:

graylog-dashboard --server-url https://server.example.com --stream-title #streamID#
TypeError: Cannot read property 'id' of undefined at storeStreams (/PathToNodeLibrary/lib/node_modules/graylog-cli-dashboard/graylog-dashboard.js:106:31) at PassThroughHandlerContext.finallyHandler (/PathToNodeLibrary/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/finally.js:56:23) at PassThroughHandlerContext.tryCatcher (/PathToNodeLibrary/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/PathToNodeLibrary/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:510:31) at Promise._settlePromise (/PathToNodeLibrary/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:567:18) at Promise._settlePromise0 (/PathToNodeLibrary/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:612:10) at Promise._settlePromises (/PathToNodeLibrary/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:691:18) at Promise._fulfill (/PathToNodeLibrary/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:636:18) at Promise._settlePromise (/PathToNodeLibrary/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:580:21) at Promise._settlePromise0 (/PathToNodeLibrary/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:612:10) at Promise._settlePromises (/PathToNodeLibrary/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:691:18) at Promise._fulfill (/PathToNodeLibrary/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:636:18) at Promise._resolveCallback (/PathToNodeLibrary/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:431:57) at Promise._settlePromiseFromHandler (/PathToNodeLibrary/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:522:17) at Promise._settlePromise (/PathToNodeLibrary/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:567:18) ar Promise._settlePromise0 (/PathToNodeLibrary/lib/node_modules/graylog-cli-dashboard/node_modules/bluebird/js/release/promise.js:612:10)

Any idea what I am doing wrong?

Could not get stream throughput

I can now see the logs coming through, but I get a repeating message saying "Could not get stream throughput. Error: HTTP 404". Given enough time, this will start to overrun the log window portion.

Unexpected token

Hi,
I was trying to run the dashboard as I have seen most of the tickets I've opened are closed/going to be closed. I have installed node v5.9.1 (requirement is > v4.0.0), and I can't start the dashboard (not even --help).

./node/bin/graylog-dashboard --help
/home/xhardy/Programs/node/lib/node_modules/graylog-cli-dashboard/graylog-dashboard.js:46
    const {argv} = yargs;
          ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:142:18)
    at node.js:939:3

https

Is it possible to use https , seems like it doesnt work

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.