Virtual Customer Equipment
The following installation assumes a Centos7 machine. It also assumes that rabbitmq is installed and running. See here for RabbitMQ installation instructions.
Requires VCE, SIMP, TSDS, and Grafana.
- Edit
/etc/yum.repos.d/grnoc-public.repo
to install the GlobalNOC's Centos7 RPM repository.[grnoc-public] name=GlobalNOC Public el7 Packages - $basearch baseurl=https://repo-public.grnoc.iu.edu/repo/7/$basearch enabled=1 gpgcheck=1 gpgkey=https://repo-public.grnoc.iu.edu/repo/RPM-GPG-KEY-GRNOC7
- Update your local RPM cache:
sudo yum makecache
- Install additional RPM repositories:
sudo yum install globalnoc-grafana
- Install VCE:
sudo yum install vce
- Ensure VCE Database is fully updated:
sudo perl /usr/bin/vce-update-db
- Setup the web credentials of the VCE admin user:
sudo htpasswd -c /usr/share/vce/www/.htpasswd admin
- Start VCE:
sudo systemctl start rabbitmq-server redis vce
- Configure your network devices' login credentials in:
/etc/vce/password.json
{ "hostname1": { "username": "username", "password": "password" }, "hostname2": { "username": "username", "password": "password" }, ... }
- Navigate to
http://hostname/vce/admin/switches.html
and finish configuring your network devices. - Restart VCE:
sudo systemctl restart vce
Note: You'll need to restart vce whenever a new host is created.
SIMP is an SNMP poller which is used to collect network statistics from devices controlled by VCE.
- Ensure prerequiste SIMP components are running:
sudo systemctl start rabbitmq-server redis
- The SIMP packages were installed along with VCE. Complete configuration of these packages as described here.
- Ensure SIMP components are running:
sudo systemctl restart simp-poller simp-data simp-comp simp-tsds
TSDS is a timeseries database which will persist collected statistics to disk. This databse may be used for any type of timeseries data. As the TSDS installation is somewhat complex, please be sure to follow the provided instructions carefully.
- Install the TSDS package:
sudo yum install grnoc-tsds-services
- Begin configuration the TSDS installation using the following command:
sudo /usr/bin/tsds_setup.pl
. - When asked for number of config servers and shards, enter:
1
- You will be asked to provide a password for the
root
mongodb user, enter any password:...
- You will be asked to provide a password for the
tsds_ro
mongodb user, enter any password:...
- You will be asked to provide a password for the
tsds_rw
mongodb user, enter any password:...
- It will then initialize the mongo database with necessatry databases and collections. Please enter
y
when asked 'Are you sure?' - Copy
/etc/vce/httpd/conf.d/grnoc/tsds-services.conf
to/etc/httpd/conf.d/grnoc/tsds-services.conf
and overwrite. - Restart httpd:
sudo systemctl restart httpd
Grafana provides network statistic graphs.
-
Grafana configuration: The grafana runs on localhost and need not be directly access by unauthorized user. So in order to make sure only vce users can access grafana, edit
/etc/grafana/grafana.ini
and perform below steps:-
Note: Make sure below changes do not start with ';'
-
In [server], update the following:
protocol = http root_url = http://localhost/grafana
-
In [auth.proxy], update the following:
enabled = true header_name = X-WEBAUTH-USER header_property = username auto_sign_up = true
-
In [security], update the following
allow_embedding = true
-
-
Assuming the previous steps finished successfully, VCE, SIMP, TSDS, and Grafana are now installed. Restart all services to ensure everything is running as expected, and complete the final steps in this section.
sudo systemctl daemon-reload; sudo systemctl restart rabbitmq-server; sudo systemctl restart redis; sudo systemctl restart vce; sudo systemctl restart httpd; sudo systemctl restart simp-data; sudo systemctl restart simp-comp; sudo systemctl restart simp-poller; sudo systemctl restart mongod-config1; sudo systemctl restart mongod-shard1; sudo systemctl restart mongos; sudo systemctl restart simp-tsds; sudo systemctl restart memcached; sudo systemctl restart searchd; sudo systemctl restart tsds_writer; sudo systemctl restart grafana-server;
-
Using the web credentials of the VCE admin user, visit
https://<hostname>/grafana/datasources/new
and select theGlobalNOC TSDS
datasource. -
When prompted for configuration set URL to
http://<hostname>/tsds/services/
-
Check Basic Auth
-
Check Skip TLS Verify
-
Under Basic Auth Details, enter the web credentials of the VCE admin user and click Save & Test.
-
Click '+' on the left bar and select 'import' to import the dashboard with graph configurations.
-
Copy and paste
/etc/vce/grafana-dashboard.json
or grafana-dashboard.json into the JSON textarea and click Load. -
At this point you should now see port statistics visualized under each port in VCE under the statistics tab.
- Execute
sudo systemctl stop httpd
- Execute
sudo systemctl stop vce
Ensure that /etc/vce/access_policy.xml
contains the following
network_model
tag. Verify the path is set to
/var/lib/vce/database.sqlite
. An example config can be
found
here.
<network_model path="/var/lib/vce/database.sqlite"/>
- Execute
sudo yum install globalnoc-grafana
- Execute
sudo yum install vce
- Execute
sudo /bin/vce-update-db
NOTE: Make sure that you have gone through the SIMP, TSDS, and Grafana steps in the installation section. If yes, please proceed with step 3.
- Execute
sudo systemctl restart vce
- Execute
sudo systemctl restart httpd
VCE's configuration file is located at /etc/vce/access_policy.xml
. This file is used to configure the following:
- RabbitMQ credentials
<rabbit host="localhost" port="5672" user="guest" pass="guest" />
<accessPolicy>
<rabbit host="localhost" port="5672" user="guest" pass="guest"/>
<network_model path="/var/lib/vce/database.sqlite"/>
</accessPolicy>
To quickly verify that the configuration is valid use the vce-run-check
command.
/usr/bin/vce-run-check --config /etc/vce/access_policy.xml
The frontend is installed to /usr/share/vce/www/
. Below is an Apache configuration that may be used to host the frontend and the API.
Alias /vce/api /usr/share/vce/www/api
Alias /vce /usr/share/vce/www/frontend
ProxyPass /grafana http://localhost:3000
ProxyPassReverse /grafana http://localhost:3000
RequestHeader unset Authorization
<Location /grafana>
AuthType Basic
AuthName GrafanaAuthProxy
AuthBasicProvider file
AuthUserFile /usr/share/vce/www/.htpasswd
Require valid-user
RewriteEngine On
RewriteRule .* - [E=PROXY_USER:%{LA-U:REMOTE_USER},NS]
RequestHeader set X-WEBAUTH-USER "%{PROXY_USER}e"
Order allow,deny
Allow from all
</Location>
<Location /vce>
AuthType Basic
AuthName "VCE"
AuthUserFile /usr/share/vce/www/.htpasswd
Require valid-user
SSLRequireSSL
Order allow,deny
Allow from all
Options +ExecCGI
DirectoryIndex index.html
</Location>
<Location /vce/api>
AuthType Basic
AuthName "VCE"
AuthUserFile /usr/share/vce/www/.htpasswd
Require valid-user
SSLRequireSSL
Order allow,deny
Allow from all
AddHandler cgi-script .cgi
Options +ExecCGI
</Location>
Users are managed via htpasswd file. Add them using the below command. Create the password file /usr/share/vce/www/.htpasswd
and first user using the -c
flag; If the file has already been created do not specify this flag. See the htpasswd documentation for more information.
htpasswd /usr/share/vce/www/.htpasswd user