Username: Password:

Author Topic: Gunbot Monitor - Oversee all GUNBOTs in one screen  (Read 17328 times)

Offline beer-k0in

  • Trust: (0)
  • Contributor
  • **
  • Posts: 140
  • Beer beer beer
    • View Profile
Gunbot Monitor - Oversee all GUNBOTs in one screen
« on: May 24, 2017, 10:57:02 AM »
Hello everybody,

as mentioned in Generator-Gunbot - Setup GUNBOT in less than 5 minutes (linux), I'm building a monitor to view all running GUNBOTs on my servers in one table. My brain is to slow to follow the log outputs. :)

In this thread I would like to share the current version of the monitor with you.

Warning - The current state of the Monitor is still a BETA version.
So,
- it works best on Unix based systems (Linux and OSX) but runs on all major OS
- it requires nodejs 6 and npm
- the monitor and I as creator of it are not responsible/liable for wrong numbers or wrong calculations
- it uses up to 100MB memory
- you should not use it if your server has less than 230MB available free memory
- it shows stats I'm interested in, so chances are high you'll miss some information
- it is not very efficient in parsing the logs for the "profit information", so it will slow down your server
- there are issues with some VNC clients which do not display the UTF-8 chars correctly
- you need a wide window / screen
- Finally: use at own risk


Please be aware of this:

The current way how gmon counts the number of your trades and your profit is wrong. What you see is the number of TRIES of trades, not the real trades.

So please read those values as "ah, Gunbot is doing something" - but your actual number of trades and your actual profit is lower than those!

Not sure if there is a performant way of reading only the successful trades from the log. The way to go is to read this from the markets. There is something on the horizon - but for now:
Please ignore "# Buys", "1 6 h d +", "# Sells", "1 6 h d +" and "Profit" values in gmon.



Installation - Linux, OSX, Windows

You only need nodejs 6 or newer installed on you system (Check https://nodejs.org how to install it on your system).

Then just run
Code: [Select]
npm install -g gunbot-monitor
Here is a post talking about further options when using Windows:
https://gunthy.org/index.php?topic=319.msg2015#msg2015

Usage

Code: [Select]
gmon [options]
Code: [Select]
  Options:

    -h, --help                               Output usage information
    -v, --version                            Output the version number
    -p, --path <path>                        Path to the GUNBOT folder. Separate multiple paths with ":" (like: -p /path1:/path2). [Default: current folder]
    -N, --path-name <name>                   Optional name for each path to the GUNBOT folder(s). Separate multiple path names with ":" (like: -N Kraken_Bot:Proxy_Mega_Bot). [Default: No path name]
    -c, --compact [groupSize]                Do not draw row lines. Optional set the number of rows after which a line is drawn. [Default: 0]
    -s, --small                              Reduce columns for small screens
    -d, --digits <digits>                    Amount of digits for all numbers. Min = 0, max = 10. [Default: 4]
    -r, --refresh <seconds>                  Seconds between table refresh. Min = 1, max = 600. [Default: 60]
    -m, --markets <markets>                  List of markets to show. Separate multiple markets with ":" (like: -m poloniex:kraken) [Default: poloniex:kraken:bittrex]
    -P, --profit                             Use to activate the parsing of the profit. THIS WILL SLOW DOWN YOUR SYSTEM!
    -H, --hide-inactive <hours>              Hides trading pairs which last log entry is older than given hours. Min = 1, max = 854400. [Default: 720]
    -E, --show-all-errors                    Use to list 422 errors in the last column.
    -C, --connections-check-delay <seconds>  Seconds between netstats checks. Higher numbers result in more inaccurate statistics but reduce cpu usage. Min = 1, max = 600. [Default: 1]

Run the command inside the folder of your gunbot logs, or use `-p` to specify the path:
Code: [Select]
gmon -p /path/to/gunbot/logs/folder/
You can also monitor multiple folders. Use the -p parameter and separate the paths by colons.
Code: [Select]
gmon -p /path/to/the/logs:/another/path:a/relative/path

You can also combine the options like:
Code: [Select]
gmon -csPr 120 -p /path/to/GB/ --hide-inactive 1 -d 3 -E

If you are using the Generator-Gunbot your commands would look like this after you logged into your server:

Code: [Select]
gcd
gmon
or
Code: [Select]
gmon -p /opt/gunbot/
How to read the output



NameMarket name and trade pair name
StrBuy and sell strategy: First letter is buy, 2nd letter is sell.
pm2If the GUNBOT has been started via pm2 and the name is "BTC_XXX", this shows the pm2 process id and the status of the bot
LLlast log - seconds since the last log output of the GUNBOT. Should be lesser than the sleep timer if the bot is running
OO?open order? - says "yes" if there is an open order on the market
--
# CoinsAmount of coins in the bag of this altcoin
in BTCValue of the altcoins in BTC
Diff since buyIndicator how much the value of the holding altcoins has changed in BTC
--
Buy/BoughtIf numbers are white: Price which needs to be reached till the bot will buy altcoins (if coins is == 0)
If numbers are yellow: Price the bot paid to buy the altcoins
SellPrice which needs to be reached till the bot will sell the holding altcoins (if coins is > 0)
Last PriceCurrent market price for the altcoin and indicator whether the price is growing or falling
Price diffDifference between Last Price and the Buy/Bought if waiting to buy
or difference between Last Price and the Sell if waiting to sell.
If something is not correct (the log does not contain a last price) it shows an error hint
--
# BuysNumber of total buys - How often did the bot buy this altcoin and time since the last buy
1 6 h d +Number of buys in the last 1 hour / 6 hours / 12 hours / 24 hours / more than 24 hours.
# SellsNumber of total sells - How often did the bot sell this altcoin and time since the last sell
1 6 h d +Number of sells in the last 1 hour / 6 hours / 12 hours / 24 hours / more than 24 hours
--
ErrorsLatest errors in the past few minutes


Examples from the screen shot

BTC_BTS
The bot is running and has bought 1778.0754 BTS 5 days ago.
Since than, the value of the BTS coins in BTC has fallen by 0.0183 BTC (-26.2%).
The current market price is too low to sell. It needs to increase at least by 26.93% to 0.3966.

BTC_GAME
The bot is running and has no GAME coins at the moment.
It sold some coins 2h ago.
The current market price is too high to buy. It needs to decrease at least by 3.95% to 11.8820.

BTC_MAID
The bot is offline - not running - not trading.

BTC_STRAT
The bot is running and has no STRAT coins at the moment.
There is an open order at the market the bot is running on.
The logfile contains no information about the last price (a restart of the BTC_STRAT bot will help)


Small screens

You can run the monitor on small screens now with the parameters '-c' or '-s' or both '-c -s'.

Code: [Select]
gmon -c
Code: [Select]
gmon -s
Code: [Select]
gmon -c -s


Thanks

Thanks to your feedback so for and thanks to
https://github.com/toSvenson
https://github.com/jbogatay
for contributing!


Support & Tips


You like gmon and it helps you earning money?

- Report bugs in this forum thread or via pm in Telegram at @BeerK0in
- Support gmon and send a tip to BTC wallet: 1GJCGZPn6okFefrRjPPWU73XgMrctSW1jT


BK

« Last Edit: July 20, 2017, 12:50:48 PM by beer-k0in »
Tools:
Generator-Gunbot
Gunbot Monitor
Support gmon and send a tip: BTC wallet: 1GJCGZPn6okFefrRjPPWU73XgMrctSW1jT

Offline Alex_13

  • Trust: (0)
  • Rookie
  • *
  • Posts: 13
    • View Profile
Re: Gunbot Monitor - Oversee all GUNBOTs in one screen
« Reply #1 on: May 24, 2017, 05:08:57 PM »
Wonderful idea! But it doesn't run on Windows now)) I'm working in Linux, but bot runs on Win machine.
All the best!

btcjuice

  • Guest
  • Trust: (0)
Re: Gunbot Monitor - Oversee all GUNBOTs in one screen
« Reply #2 on: May 25, 2017, 10:09:38 PM »
This is amazing dude, have been using it for 2 days now and couldn't imagine GB without it. Great job!

Few improvements i would suggest:
- on the "diff since buy" column add a total at the bottom also.
- I dont know why but the pink arrows and the blue arrows show just squares to me. the yellow arrows are ok though!
- put profit column green? :) Today was a bad day... just saw reds on the  "diff since buy" so a little green would cheer us up? :)
- On "last error" the idea is "If a 422 only shows up once in a while is ok, but if it blocks a pair that is bad" so can we also see (what time was the error before the last?) understandable? Or X errors in the last Y minutes? Just basically something that would help on identifying if it was a one-off error or a persistent one.


Love the interface and its great as it is, the above are just reaaly some minor improvement sugestions, dont take them the bad way :D

Offline beer-k0in

  • Trust: (0)
  • Contributor
  • **
  • Posts: 140
  • Beer beer beer
    • View Profile
Re: Gunbot Monitor - Oversee all GUNBOTs in one screen
« Reply #3 on: May 25, 2017, 11:29:50 PM »
But it doesn't run on Windows now

I think I found the issue with Windows. Will look into it tomorrow.



This is amazing dude, have been using it for 2 days now and couldn't imagine GB without it. Great job!

Glad you like it.

Few improvements i would suggest:
- on the "diff since buy" column add a total at the bottom also.
- I dont know why but the pink arrows and the blue arrows show just squares to me. the yellow arrows are ok though!
- put profit column green? :) Today was a bad day... just saw reds on the  "diff since buy" so a little green would cheer us up? :)
- On "last error" the idea is "If a 422 only shows up once in a while is ok, but if it blocks a pair that is bad" so can we also see (what time was the error before the last?) understandable? Or X errors in the last Y minutes? Just basically something that would help on identifying if it was a one-off error or a persistent one.

Thank you for the feedback. I put it "on the list" :)

Arrows: What OS are you running GUNBOT on? Debian? Ubuntu? CentOS?

BK
Tools:
Generator-Gunbot
Gunbot Monitor
Support gmon and send a tip: BTC wallet: 1GJCGZPn6okFefrRjPPWU73XgMrctSW1jT

Offline Snapper_Head

  • Trust: (0)
  • Rookie
  • *
  • Posts: 4
    • View Profile
Re: Gunbot Monitor - Oversee all GUNBOTs in one screen
« Reply #4 on: May 26, 2017, 07:19:27 AM »
Thanks for your program.  It is great that so many people are contributing and sharing their work to make gunbot better.

I ran into trouble getting this to work but solved it by updating nodjs to version 6

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs

Offline dj_crypto

  • Trust: (0)
  • Rookie
  • *
  • Posts: 6
    • View Profile
Re: Gunbot Monitor - Oversee all GUNBOTs in one screen
« Reply #5 on: May 26, 2017, 08:36:36 AM »
Hey mate,

I also have a few windows servers I am running pairs on. Any plans on getting this amazing monitor working with a windows server?

Have a good day, and again, great work :)

dj

Offline finlay1888

  • Trust: (0)
  • Rookie
  • *
  • Posts: 6
    • View Profile
Re: Gunbot Monitor - Oversee all GUNBOTs in one screen
« Reply #6 on: May 26, 2017, 10:03:28 AM »
This is great work and solved my initial monitoring challenges with GunBot.

Top work!  Do you have a LTC wallet I can send something to?


Offline LastUser

  • Trust: (0)
  • Rookie
  • *
  • Posts: 7
    • View Profile
Re: Gunbot Monitor - Oversee all GUNBOTs in one screen
« Reply #7 on: May 26, 2017, 11:21:24 AM »
i can't make it work... i get only logo >>gunbot-monitor<< and refresh interval 20s and it stays like it forever...

Offline beer-k0in

  • Trust: (0)
  • Contributor
  • **
  • Posts: 140
  • Beer beer beer
    • View Profile
Re: Gunbot Monitor - Oversee all GUNBOTs in one screen
« Reply #8 on: May 26, 2017, 03:44:55 PM »
I've updated the monitor.

Run
Code: [Select]
npm install -g gunbot-monitor to update it on your server.



Few improvements i would suggest

Added hopefully all of it. Can you check the arrows again please?



Wonderful idea! But it doesn't run on Windows now)) I'm working in Linux, but bot runs on Win machine.
I also have a few windows servers I am running pairs on. Any plans on getting this amazing monitor working with a windows server?
i can't make it work... i get only logo >>gunbot-monitor<< and refresh interval 20s and it stays like it forever...

Should work on Windows and OSes other than Linux and OSX now.



Do you have a LTC wallet I can send something to?

I do. LTC wallet: LNwLXuf9Ry47n3GiFc4cGTBXLLX1Cov6Ha
Thank you! 8)

BK
Tools:
Generator-Gunbot
Gunbot Monitor
Support gmon and send a tip: BTC wallet: 1GJCGZPn6okFefrRjPPWU73XgMrctSW1jT

Offline deund

  • Trust: (0)
  • Rookie
  • *
  • Posts: 2
    • View Profile
Re: Gunbot Monitor - Oversee all GUNBOTs in one screen
« Reply #9 on: May 26, 2017, 05:24:12 PM »
hi ;

Gunbot monitor is big great

thanks you develloper :-)

1 question
is possible to execute GM in log in html ---> example    $ gmon html
in my browser view GM with 20sec refresh.......

Offline beer-k0in

  • Trust: (0)
  • Contributor
  • **
  • Posts: 140
  • Beer beer beer
    • View Profile
Re: Gunbot Monitor - Oversee all GUNBOTs in one screen
« Reply #10 on: May 26, 2017, 05:41:03 PM »
is possible to execute GM in log in html ---> example    $ gmon html
in my browser view GM with 20sec refresh.......

Right now out of the box: No, all the output is formatted for the console and not written into a file.

I could build a sweet webapp to view and control the bot. But that would took time from my other projects and I would have to charge money for it.
So if there is a big demand and more than 20 people would pay, lets say 0.05 BTC for it, then we can go into the web. :)

BK
Tools:
Generator-Gunbot
Gunbot Monitor
Support gmon and send a tip: BTC wallet: 1GJCGZPn6okFefrRjPPWU73XgMrctSW1jT

Offline LastUser

  • Trust: (0)
  • Rookie
  • *
  • Posts: 7
    • View Profile
Re: Gunbot Monitor - Oversee all GUNBOTs in one screen
« Reply #11 on: May 26, 2017, 06:29:14 PM »
i can't make it work... i get only logo >>gunbot-monitor<< and refresh interval 20s and it stays like it forever...

Should work on Windows and OSes other than Linux and OSX now.


i'm using ubuntu 16.04
nodejs v7.10.0
still same thing even after update...

btcjuice

  • Guest
  • Trust: (0)
Re: Gunbot Monitor - Oversee all GUNBOTs in one screen
« Reply #12 on: May 26, 2017, 07:08:48 PM »
i'm using ubuntu 16.04

Offline beer-k0in

  • Trust: (0)
  • Contributor
  • **
  • Posts: 140
  • Beer beer beer
    • View Profile
Re: Gunbot Monitor - Oversee all GUNBOTs in one screen
« Reply #13 on: May 26, 2017, 07:18:20 PM »
i'm using ubuntu 16.04
nodejs v7.10.0
still same thing even after update...

Can you go to the folder your GUNBOT is installed and run those commands and post the results here?

Code: [Select]
npm ls -g pm2 gunbot-monitor
Code: [Select]
free -m
Code: [Select]
ls -la *-log.txt
BK
Tools:
Generator-Gunbot
Gunbot Monitor
Support gmon and send a tip: BTC wallet: 1GJCGZPn6okFefrRjPPWU73XgMrctSW1jT

Offline beer-k0in

  • Trust: (0)
  • Contributor
  • **
  • Posts: 140
  • Beer beer beer
    • View Profile
Re: Gunbot Monitor - Oversee all GUNBOTs in one screen
« Reply #14 on: May 26, 2017, 07:24:52 PM »
i'm using ubuntu 16.04

Could be the Terminal software you are using to connect to your server. What is the OS on your local machine and how (which program) do you connect to your server?

BK
Tools:
Generator-Gunbot
Gunbot Monitor
Support gmon and send a tip: BTC wallet: 1GJCGZPn6okFefrRjPPWU73XgMrctSW1jT

btcjuice

  • Guest
  • Trust: (0)
Re: Gunbot Monitor - Oversee all GUNBOTs in one screen
« Reply #15 on: May 26, 2017, 07:40:07 PM »
Windows 10 with putty 0.66

Offline beer-k0in

  • Trust: (0)
  • Contributor
  • **
  • Posts: 140
  • Beer beer beer
    • View Profile
Re: Gunbot Monitor - Oversee all GUNBOTs in one screen
« Reply #16 on: May 26, 2017, 11:00:25 PM »
Windows 10 with putty 0.66

Looks like putty uses a non UTF-8 font by default. Maybe this helps you to switch to a more modern font: https://superuser.com/questions/393834/how-to-configure-putty-to-display-these-characters

BK
Tools:
Generator-Gunbot
Gunbot Monitor
Support gmon and send a tip: BTC wallet: 1GJCGZPn6okFefrRjPPWU73XgMrctSW1jT

Reibinga

  • Guest
  • Trust: (0)
Re: Gunbot Monitor - Oversee all GUNBOTs in one screen
« Reply #17 on: May 27, 2017, 11:40:54 PM »
Is there a reason as to why some prices in the last price column for pairs are blank and others are not?

https://gyazo.com/d664c58af15772b5855447030ade4ce5

Offline beer-k0in

  • Trust: (0)
  • Contributor
  • **
  • Posts: 140
  • Beer beer beer
    • View Profile
Re: Gunbot Monitor - Oversee all GUNBOTs in one screen
« Reply #18 on: May 28, 2017, 06:51:00 AM »
Is there a reason as to why some prices in the last price column for pairs are blank and others are not?

https://gyazo.com/d664c58af15772b5855447030ade4ce5

General answer: if the GUNBOT does not log something, the Monitor can not show it.

In your case a line like this is missing in the logs:
LP 1.7650000,<=,prBuy 1.7715878  secMargin 0.0000708635135333334  grows yes

This is not confirmed by Gunthar, but I think it is when the GUNBOT is in a bad state after an error on Poloniex. See this post in the Bugs thread.
https://gunthy.org/index.php?topic=270.msg1570#msg1570

I also noticed, the bots will not trade if 'last price' is empty, so I restart them (and wait ~10s between each restart):
Code: [Select]
pm2 restart BTC_XXXI'm not sure if restarting is the correct way to address this, but it works for me.

BK
Tools:
Generator-Gunbot
Gunbot Monitor
Support gmon and send a tip: BTC wallet: 1GJCGZPn6okFefrRjPPWU73XgMrctSW1jT

Offline Svenson

  • Trust: (0)
  • Rookie
  • *
  • Posts: 1
    • View Profile
Re: Gunbot Monitor - Oversee all GUNBOTs in one screen
« Reply #19 on: May 28, 2017, 07:56:12 AM »
Windows 10 with putty 0.66

Looks like putty uses a non UTF-8 font by default. Maybe this helps you to switch to a more modern font: https://superuser.com/questions/393834/how-to-configure-putty-to-display-these-characters

BK

The pull request I've issues a few days ago was meant to make the arrows work with default putty. :)