Skip to content

VNF monitoring

Panos Karkazis edited this page Jul 26, 2018 · 12 revisions

Despite the fact that in 5GTANGO/SONATA VNFs can be monitored directly from NFVI using the appropriate metric exporter, a VNF monitoring probe is provided as an alternative approach in order to gather monitoring data from VM's linux kernel (/proc/stat/, /proc/dev/net etc) and push them to the monitoring server.
The url of the pushgateway monitoring server must be set in node.conf file

Supported monitoring metrics are:

  • cpu usage
  • memory usage
  • disk usage
  • network traffic (transmitted bytes, received bytes, packets per second, bytes per second)

Installation

The easiest way to deploy monitoring probe is as docker container but it can be installed also as a service if you don't want to run docker engine only for this component.

Using container

Dependencies

  • docker-engine 1.10.2

1. Build container

git clone https://github.com/sonata-nfv/son-monitor-probe.git
cd son-monitor-probe
sudo docker build -f vm_mon/Dockerfile -t son-vm-probe .

Alternatively, you can pull the latest image from Sonata's repository in Docker Hub

sudo docker pull sonatanfv/son-monitor-probe:latest

2. Run probe

sudo docker run -d --name son-vm-probe -e NODE_NAME=VNF_1 -e PROM_SRV=http://<pushgateway_ip>:<port>/metrics --net="host" --privileged=true  -v /proc:/myhost/proc -v /:/rootfs:ro son-vm-probe

As service

Dependencies

  • python 2.7

1. Get the code

Download the code from Sonata's repository and set the monitoring server url (server_url) and vnf's name (node_name) in son-monitor-probe/vm_mon/node.conf file

git clone https://github.com/sonata-nfv/son-monitor-probe.git
nano son-monitor-probe/vm_mon/node.conf
sudo mkdir /opt/Monitoring
sudo mv son-monitor-probe/vm_mon/* /opt/Monitoring/

2. Create service

Ubuntu 14

  • Configure service
sudo mv /opt/Monitoring/mon-probe.conf /etc/init
sudo start mon-probe

Ubuntu 16

  • Install python 2.7
sudo apt-get update
sudo apt-get install python2.7
  • Configure service
sudo mv /opt/Monitoring/mon-probe.service  /etc/systemd/system/mon-probe.service
sudo systemctl daemon-reload
sudo systemctl enable mon-probe.service
sudo systemctl start mon-probe.service

3. Remote probe reconfiguration (ssh)

  • Load new configuration file
scp node.conf <user>@<vnf_ip>:~/
ssh <user>@<vnf_ip> "sudo mv ~/node.conf /opt/Monitoring/node.conf"
  • Restart service

Ubuntu 14

ssh <user>@<vnf_ip> "sudo service mon-probe restart"

Ubuntu 16

ssh <user>@<vnf_ip> "sudo systemctl restart mon-probe.service"

Usage

All metrics are exposed to the Pushgateway server.

Get last pushed value of VNFs cpu usage

Request:

curl http://<pushgateway>:9091/metrics | grep vm_cpu_perc | grep vnf

Response:

# TYPE vm_cpu_perc gauge
vm_cpu_perc{core="cpu",id="0035703e-afc5-46fc-acbf-0b57df8019c1",instance="TEST-VNF:0035703e-afc5-46fc-acbf-0b57df8019c1",job="vnf"} 56.06 1532528503000
vm_cpu_perc{core="cpu",id="843879eb-4004-40e0-90db-3303eaa923ad",instance="TEST_VM1_DEBIAN:843879eb-4004-40e0-90db-3303eaa923ad",job="vnf"} 0 1532528501000
vm_cpu_perc{core="cpu",id="be2479d4-fc0e-48d0-8c9b-92105a7b921c",instance="vtu-vnf:be2479d4-fc0e-48d0-8c9b-92105a7b921c",job="vnf"} 0 1532528501000
vm_cpu_perc{core="cpu0",id="0035703e-afc5-46fc-acbf-0b57df8019c1",instance="TEST-VNF:0035703e-afc5-46fc-acbf-0b57df8019c1",job="vnf"} 15.15 1532528503000
vm_cpu_perc{core="cpu0",id="843879eb-4004-40e0-90db-3303eaa923ad",instance="TEST_VM1_DEBIAN:843879eb-4004-40e0-90db-3303eaa923ad",job="vnf"} 0 1532528501000
vm_cpu_perc{core="cpu0",id="be2479d4-fc0e-48d0-8c9b-92105a7b921c",instance="vtu-vnf:be2479d4-fc0e-48d0-8c9b-92105a7b921c",job="vnf"} 0 1532528501000
vm_cpu_perc{core="cpu1",id="0035703e-afc5-46fc-acbf-0b57df8019c1",instance="TEST-VNF:0035703e-afc5-46fc-acbf-0b57df8019c1",job="vnf"} 97 1532528503000
vm_cpu_perc{core="cpu1",id="be2479d4-fc0e-48d0-8c9b-92105a7b921c",instance="vtu-vnf:be2479d4-fc0e-48d0-8c9b-92105a7b921c",job="vnf"} 0 1532528501000

Get last pushed value VNFs memory usage

Request:

curl http://<pushgateway>:9091/metrics | grep vm_mem_perc | grep vnf

Response:

# TYPE vm_mem_perc gauge
vm_mem_perc{id="0035703e-afc5-46fc-acbf-0b57df8019c1",instance="TEST-VNF:0035703e-afc5-46fc-acbf-0b57df8019c1",job="vnf"} 5.46 1532528656000
vm_mem_perc{id="843879eb-4004-40e0-90db-3303eaa923ad",instance="TEST_VM1_DEBIAN:843879eb-4004-40e0-90db-3303eaa923ad",job="vnf"} 88.92 1532528658000
vm_mem_perc{id="be2479d4-fc0e-48d0-8c9b-92105a7b921c",instance="vtu-vnf:be2479d4-fc0e-48d0-8c9b-92105a7b921c",job="vnf"} 79.94 1532528654000
Clone this wiki locally