It was initially thought as a control panel but now it is just a page to monitor the behavior of your server and the status of your witness.
Thank you all for the support I received in the previous post, I realized that there are many people interested..
DEMO HERE:
https://zuun.net/monitor/
--== INSTALLATION ==--
You must have a web server installed and it must support PHP.
if you don't have a web server in your witness you can install just PHP
Ubuntu
sudo apt-get install php
Fedora
dnf install php
1 Download the file: (81.8 Kb)
wget https://zuun.net/monitor/monitor.tar.gz
2 Create a Directory and Unzip there.
mkdir monitor & tar -vxzf monitor.tar.gz -C monitor & cd monitor
3 Edit the data.json file and change the witness name to yours.
nano data.json
IMPORTANT "Server" it should point to your local server
Please check your config.ini file where hived is and see if you have this line
webserver-http-endpoint = 127.0.0.1:8091 and write http://127.0.0.1:8091 in the server directive of data.json
on the other hand, if your node is public or you want it to be public you can put it like this in the image. 0.0.0.0:8091
And in the data.json file you write it like this http://0.0.0.0:8091 in the server directive of data.json ..
For the purpose of this example I use, https://api.deathwing.me/ which is the best public node that there is at the moment... but the ideal is that you use your own node because we are going to make many http requests and we don't want to saturate the bandwidth of any witness..
With this config your server is LIVE and working..!
If you don't have a web server and you just installed the PHP you can start the web server that comes internal in PHP, the only disadvantage is that it is not multithreaded so it attends several simultaneous requests but it can get slow.
locate yourself in the directory called monitor and run this:
php -S 0.0.0.0:9000 -t .
This will start the PHP web server on port 9000 .. and you can access it simply like this http://IPADDRESS:9000/
In the project you will find a file called monitor.php which has execution permissions, if it doesn't have execution permissions grant them like this.
chmod 777 monitor.php
then you can run it like this ./monitor.php or better to send it to the background you can do this:
nohup ./monitor.php 2> /dev/null > /dev/null &
./monitor.php
The purpose of this program is to create a file in which the last 10 blocks you have produced are stored, saving the date and time, the block number and the frequency in which you are generating the blocks, it is intended that it be in the background so that you close your browser, the information continues to be captured and it will help you to know how often you generate the blocks and how often the blocks were assigned to you.. the use of this file is completely optional.
500 HIGHEST VOTES
Show accounts and HP
To show the votes, i get data from other project of the arcange witness
https://hive.arcange.eu/witnesses/
System Commands:
There are a few commands I've had to use to make it easier to display server resources like these:
df -h
To see how much space is free on the hard drives.
free -m
to see the free space in memory
ps -x | grep hived
to check if the ./hived process is running.
This code could have been made as an executable and not deliver the source code and it could be more optimal, but I have decided to use PHP so that anyone can study the code and there is transparency.
DELIVERED AS IS
Finally
at the bottom of the web page you will see from time to time a subliminal message reminding you to vote for me as witness, since it is the only support that I request, keep in mind that I have dedicated 1 week and a half of work day and night, to finish this and there are many lines of code, a lot of late night and effort in the middle of all this.. from Colombia with Love.. 🇨🇴