Web based statistics: Difference between revisions

From DXSpider Documentation Wiki
Jump to navigation Jump to search
m 1 revision imported
WI3W (talk | contribs)
m Grammar
 
(One intermediate revision by one other user not shown)
Line 3: Line 3:
===Generic installation===
===Generic installation===


From version 1.50, you can use the freeware software MRTG to produce really nice graphical statistics on your web site. For an example try http://www.gb7mbc.net/mrtg/stats.html.
The Multi Router Traffic Grapher ([https://oss.oetiker.ch/mrtg/ MRTG]) uses network traffic to provide a graphical representation of cluster traffic. An example can be seen with the [https://dxc.mx0nca.uk/mrtg/stats.html node statistics for MX0NCA]


The following should help you get it all working.
Setting up a web environment such as Apache2 is outside the scope of this page, and whilst MRTG can be downloaded from its [https://oss.oetiker.ch/mrtg/download.en.html website], it can generally be installed as a Linux package. Under Debian the package is called mrtg, installing it this way will ensure that all dependencies are installed. Using the root account at the Linux prompt:


First you need to download the latest version of MRTG from http://people.ee.ethz.ch/~oetiker/webtools/mrtg/.  You will also need the following files..
sudo apt-get update
sudo apt-get -y install mrtg


libpng-1.0.14.tar.gz
As sysop, copy the image files from MRTG (in /usr/share/mrtg) to your ../spider/html/mrtg. MRTG can make many graphs, and it's possible to select which you do and don't want, but initially it's worth getting them all. At the console run the command:
zlib-1.1.4.tar.gz
gd-1.8.3.tar.gz


Login to your machine as the root user, put all the downloaded files in /usr/local/src/ (or wherever you prefer) and untar and compile them.  All the information to compile and install these sources come with them.  After compilation and installation, you will find MRTG in /usr/local/mrtg-2.
  mrtg all
 
Now copy all the files in /usr/local/src/mrtg-2.9.22/images/ to /spider/html/mrtg/
 
You now need to make 2 symbolic links like below...
 
ln -s /usr/local/mrtg-2/bin/mrtg /usr/bin/mrtg
ln -s /usr/local/mrtg-2/lib/mrtg2 /usr/lib/mrtg2


Now login to the cluster with your sysop callsign and run the command "mrtg all".
Then at the Linux command prompt, as sysop, in ../spider/html/mrtg run the command below putting your node callsign in place of <node-name>


Now you are nearly there! Login as the sysop user and change to the /spider/html/mrtg/ directory.  Now run the command indexmaker as shown below...
  indexmaker --output stats.html --columns=1 --title "Node statistics for <node-name>" ../../mrtg/mrtg.cfg


indexmaker --output stats.html --columns=1 --title "MRTG statistics for GB7DJK" ../../mrtg/mrtg.cfg
Your web server needs to know where the files are to publish, using the link below is one approach. As the sysop, in /home/sysop/ run the following command


Changing the callsign for your own cluster callsign of course!
sudo ln -s /spider/html/mrtg /var/www/<domain name>/public_html


And finally you need to login as the root user and create one last symbolic link. Where this points will depend on where your html documents are kept.  For RedHat systems you use...
Your browser should now see the graphs at http(s)://<domain-name>/mrtg/stats.html


ln -s /home/sysop/spider/html/mrtg /home/httpd/html/mrtg
To get refreshed graphs every 5 minutes, add the following line into your dxspider crontab:-
 
and for SuSE systems...
 
ln -s /home/sysop/spider/html/mrtg /usr/local/httpd/htdocs/mrtg
 
If you now point your browser to your website as below it should all be happening!
 
http://www.xxx.xxx/mrtg/stats.html
 
Of course, to get the stats to update, you need to add some information in the spider crontab file as below...


  # Update stats for mrtg on website
  # Update stats for mrtg on website
Line 48: Line 30:


This will update the site every 5 minutes.
This will update the site every 5 minutes.
===Ubuntu 8.04 Installation===
To install on the latest versions of Ubuntu (8.04 at the time of writing) is really very simple.  Either use Synaptic or apt-get install to get the latest mrtg.  Once you have done this and it is installed, do the following..
chmod 01777 /var/lock mrtg /var/lib/mrtg
Now log into the cluster using your sysop console and issue the command..
mrtg all
log in at the command line as the user 'sysop' and type the following commands..
cd /spider/html/mrtg
indexmaker --output stats.html --columns=1 --title "MRTG statistics for GB7DJK" ../../mrtg/mrtg.cfg
Making sure you change GB7DJK to your own cluster node call!
Finally create the following symlink
ln -s /home/sysop/spider/html/mrtg /var/www/mrtg
and all should now be working!  You can create a crontab entry as above.

Latest revision as of 00:00, 6 April 2025

Web based statistics

Generic installation

The Multi Router Traffic Grapher (MRTG) uses network traffic to provide a graphical representation of cluster traffic. An example can be seen with the node statistics for MX0NCA

Setting up a web environment such as Apache2 is outside the scope of this page, and whilst MRTG can be downloaded from its website, it can generally be installed as a Linux package. Under Debian the package is called mrtg, installing it this way will ensure that all dependencies are installed. Using the root account at the Linux prompt:

sudo apt-get update
sudo apt-get -y install mrtg

As sysop, copy the image files from MRTG (in /usr/share/mrtg) to your ../spider/html/mrtg. MRTG can make many graphs, and it's possible to select which you do and don't want, but initially it's worth getting them all. At the console run the command:

mrtg all

Then at the Linux command prompt, as sysop, in ../spider/html/mrtg run the command below putting your node callsign in place of <node-name>

indexmaker --output stats.html --columns=1 --title "Node statistics for <node-name>" ../../mrtg/mrtg.cfg

Your web server needs to know where the files are to publish, using the link below is one approach. As the sysop, in /home/sysop/ run the following command

sudo ln -s /spider/html/mrtg /var/www/<domain name>/public_html

Your browser should now see the graphs at http(s)://<domain-name>/mrtg/stats.html

To get refreshed graphs every 5 minutes, add the following line into your dxspider crontab:-

# Update stats for mrtg on website
00,05,10,15,20,25,30,35,40,45,50,55 * * * * run_cmd('mrtg all')

This will update the site every 5 minutes.