CentOS / RHEL: View Vnstat Graphs Using PHP Web Interface Frontend

‮tual.www‬turi.com
CentOS / RHEL: View Vnstat Graphs Using PHP Web Interface Frontend

To view vnStat graphs using the PHP web interface frontend on CentOS or RHEL, you can follow these steps:

  1. Install the vnStat and vnstati packages using the yum or dnf package manager:
sudo yum install vnstat vnstati

or

sudo dnf install vnstat vnstati

This will install the vnStat and vnstati packages, which are required to generate and display vnStat graphs.

  1. Install the php package using the yum or dnf package manager:
sudo yum install php

or

sudo dnf install php

This will install the php package, which is required to run the PHP web interface frontend.

  1. Download and extract the vnStat PHP frontend package:
wget https://www.sqweek.com/sqweek/files/vnstat_php_frontend-1.5.1.tar.gz
tar xzf vnstat_php_frontend-1.5.1.tar.gz

This will download and extract the vnStat PHP frontend package.

  1. Copy the vnstat_php_frontend directory to the desired location on your web server. For example:
sudo cp -r vnstat_php_frontend /var/www/html

This will copy the vnstat_php_frontend directory to the /var/www/html directory, which is the default document root for the Apache web server on CentOS and RHEL.

  1. Edit the config.php file in the vnstat_php_frontend directory to set the correct path to the vnstat and vnstati binaries. For example:
sudo nano /var/www/html/vnstat_php_frontend/config.php

Change the following lines:

$vnstat_bin  = '/usr/local/bin/vnstat';
$vnstati_bin = '/usr/local/bin/vnstati';

To the correct path on your system:

$vnstat_bin  = '/usr/bin/vnstat';
$vnstati_bin = '/usr/bin/vnstati';

Save and close the file.

  1. Open a web browser and navigate to the vnstat_php_frontend directory on your web server. For example:
http://localhost/vnstat_php_frontend

This will display the vnStat PHP frontend interface, which allows you to view vnStat graphs for the network interfaces on your system.

  1. Select the desired network interface from the drop-down menu and click the Show button .
Created Time:2017-10-16 14:38:41  Author:lautturi