Note: This NetApp Data collector solution requires a Linux host with Docker compute engine installed and the container created on this Linux host should be able to connect to https port of the NetApp Storage systems.
Follow these steps when using Amazon Linux EC2 instance to connect to on-prem NetApp Storage systems and for Amazon FSx for NetApp ONTAP
-
Install docker engine if not installed on the linux host.
sudo yum install -y docker
-
Enable docker service on the linux host used for this project and enable the non-root user to run docker container using the following commands. Then download docker-compose binary and restart the host.
sudo systemctl enable docker sudo systemctl start docker sudo usermod -aG docker $USER sudo curl -L "https://github.com/docker/compose/releases/download/v2.27.0/docker-compose-linux-x86_64" -o /usr/bin/docker-compose sudo chmod +x /usr/bin/docker-compose sudo docker-compose --version sudo reboot
-
Verify the docker service is running by running
docker info
. -
Verify the docker-compose is installed and is same or higher than version v2.27.0 using this command
docker-compose -v
. (Docker Compose version v2.27.0) -
Clone this git repository to this linux host and change directory to the cloned folder.
git clone https://github.com/aws-samples/netapp-cifs-and-nfs-sessions-data-collector-workshop cd netapp-cifs-and-nfs-sessions-data-collector-workshop
These should be the files present in the folder:
├── README.md ├── Setup.md ├── app │ ├── Dockerfile │ ├── Home.py │ ├── pages │ │ ├── 1_CIFS_and_NFS_Sessions_Report.py │ │ └── 99_Manage_storage_systems.py │ └── requirements.txt ├── collector.env ├── commons │ ├── __init__.py │ ├── database.py │ ├── encryptionKey.py │ ├── entrypoint.sh │ ├── netappCollector.py │ ├── setupDb.py │ └── streamlitDfs.py ├── database ├── docker-compose.yaml ├── logs │ ├── app.log │ ├── collector.log │ └── database.log └── output
-
Update the collector.env file:
- Set SSL_VERIFY to
False
- Set a secure string as
POSTGRES_PASSWORD
- Set
DATA_COLLECTION_INTERVAL
to 600 or higher. This is refersh interval in seconds to query NetApp Storage systems to collect NFS clients and CIFS sessions details.
SSL_VERIFY=False POSTGRES_PASSWORD=P0stGr3sP@ss DATA_COLLECTION_INTERVAL=600
- Set SSL_VERIFY to
-
Start NetApp data collector container using
docker-compose up -d
.docker-compose up -d
-
Check the running containers and verify an ecryption.key is created in output folder.
docker ps ls -lh output/
-
Docker ps command shows Postgres database running and listening on port
5432
and netappcollector running and listening on port8080
.docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1a6f56c74a33 netappcollector:1.1 "/bin/bash /usr/neta…" 10 seconds ago Up 4 seconds (health: starting) 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp netappcollector 2002208d0524 postgres:alpine3.20 "docker-entrypoint.s…" 10 seconds ago Up 9 seconds (healthy) 0.0.0.0:5432->5432/tcp, :::5432->5432/tcp postgres
-
User can now safely logout from this linux host.
-
Start a web browser and connect to this linux host to port 8080. On first lauch you will see empty tables as shown in this figure below:
-
Now click on
Manage storage systems
as highlighted to add new NetApp storage systems. -
Fill the form with NetApp Storage Details - Name, IP Address, Username and Password.
-
Navigate to Home page to verify the data collection was successful.
-
You can pause data collection for any storage system added to the data collector by navigating to
*Manage storage systems*
page and clicking on the toggle switch next to the Storage Name. -
Add storage systems as needed.
- SSH to the linux host.
- Verify the container is still running with
docker ps
command. - Change directory to
netapp-cifs-and-nfs-sessions-data-collector-workshop
. - Run
docker-compose down
command to stop containers and data collection.