Skip to content

Apps to track resource usage for Nokia SROS routers before and after commit configuration elements like services and policies

Notifications You must be signed in to change notification settings

CSPDevLabs/usage-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

App to Track Resource Usage for Nokia SROS

This app is used to create a dashboard to monitor CPU and Memory Pools before and after adding configuration elements and combinations to NOkia SROS router

Tested versions:

  • Tested with: 21.10.R6 / 7250 IXR-x

Setup

Create Python Env and Install Required Modules

Create a pythin enviroment inside python folder

cd python
python3 -m venv .venv
source .venv/bin/active

Install required modules

pip3 install -r requirements.txt 

Start up Visualization

Check monitoring/docker-compose.yaml file to see if it fits with what you want and avoid port conflicts with other apps.

monitoring
├── dashboards
│   └── grafana-dashboard.json
├── docker-compose.yml
├── gnmic
│   └── gnmic.yaml ## Modify to use with your router
├── prometheus
│   └── prometheus.yaml
└── provisioning
    ├── dashboards
    │   └── dashboards.yaml
    └── datasources
        └── datasource.yaml

Also, consider to check gnmic/gnmic.yaml for router connection info.

cd monitoring
docker compose up -d

You should see, using docker ps | grep tracker three docker containers like this:

468ead4b70c6   ghcr.io/openconfig/gnmic:latest                                       "/app/gnmic subscrib…"   7 hours ago   Up 7 hours               0.0.0.0:9273->9273/tcp, :::9273->9273/tcp                                                           tracker-gnmic
31059d9d9a60   grafana/grafana:11.1.0                                                "/run.sh"                7 hours ago   Up 7 hours               0.0.0.0:3001->3000/tcp, [::]:3001->3000/tcp                                                         tracker-grafana
aa9781ba38b0   prom/prometheus:latest                                                "/bin/prometheus --c…"   7 hours ago   Up 7 hours               0.0.0.0:9099->9090/tcp, [::]:9099->9090/tcp                                                         tracker-prometheus

Grafana Dashboard for Resource Usage Tracker Nokia SROS

Use docker logs to see if there are errors for the connectivity.

Configuration Tester and Deployment Plan (Python)

File/Folder structure:

python
├── config_templates.json
├── conftester.py
├── connection_profile.json ## Modify to use with your router
├── deployment_plan.json
├── func
│   ├── conf_generator.py
│   ├── gnmi_func.py
│   ├── json_func.py
└── requirements.txt ## required python modules

After python env and modules are installed (check sections above), then you need to change connection profile to your router in connection_profile.json

config_templates.json provides information of simple settings for the configuration elements used on the tests.

Use deployment_plan.json to set the order and time intervals for the settings:

  • deployment_order defines the order for the configurations. For example, you can't have VPLS customer defintions without the actual customers already defined in advance.
  • update_interval_seconds time interval between every configuration
  • configurations are the actual configurations including the range of IDs to use for service's or custmomer's IDs and compositions for names and descriptions. Check also the notes for dependencies. Provides also info for GNMI, like paths and keys.

Important to avoid to use overlapping IDs for services like VPLS and VRPNs.

to start the deployment use:

python3 conftester.py deploy

To delete configurations use:

python3 conftester.py undeploy

Kubenet Setup (optional)

In case you prefer to use intents, you can optionlly work with SDCIO

Install kinD Kubernetes

cd kubenet
mkdir tools
cd tools
[ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.30.0/kind-linux-amd64
chmod +x kind

Create cluster:

./kind create cluster --name kubenet --config <(cat <<EOF
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
networking:
  ipFamily: dual
EOF
)

Check health using kubectl get pods -A

Install Manifests SDCIO

cd manifests/sdcio
kubectl apply -f cert-manager.yaml
kubectl wait -n cert-manager --for=condition=Available=True --timeout=300s deployments.apps cert-manager-webhook
kubectl apply -f colocated.yaml

Apply SROS schema note: check access to git repo in advanced inside the manifest

cd ../schemas
kubectl apply -f sros-21.10.6.yaml 

Discovering targets

use all manifest related to gnmi at cd manifests/targets

Testing configuration

use manifest related to gnmi at cd manifests/config

About

Apps to track resource usage for Nokia SROS routers before and after commit configuration elements like services and policies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages