In my previous blog, I’ve shared a script to check CAVA services. That post inspired me to work on NetApp’s Vscan alerting script!!
Vscan command in NetApp 7Mode 8.1.x has very less options or switches to check whether AV server and its storage services are running or not. We only get console messages that service is available or not.
Since, most of of filers are enabled with mandatory scan (on). AV server and services are critical for CIFS shares to be available to end users. Otherwise CIFS shares would be inaccessible and causes a business outage!
VSCAN work on NetApp proprietary RPC protocol and uses TCP ports 139 and 445. These two ports help us to monitor VSCAN services availability to NetApp filers. I’ve made a simple batch and Perl script to check the status and alert to storage / security admin about the AV server and services status.
Batch script contains a simple command as mentioned below. This script is placed in AV server and polled at 2 hour interval scheduled using task scheduler
netstat -an | find <IP Address of Netapp Filers>
About output would list the TCP connections of port 139 and 445 established between AV servers and NetApp filers. Output is saved to a file to parse it using Perl script and do a simple validation whether RPC connections are established or not.
Click below to download Perl script for reference.
Attached script would run from script host or one of the AV server which can access the netstat output. Perl script runs every two hours as a scheduled job.
Logic / Validation:
Each AV server need to have atleast 1 RPC port connection established with NetApp [Atleast in our setup*]. Based on this logic, we’ll come to know if AV services are available to NetApp or not. We have two controllers in our setup which means we need to have 2 RPC connections. If number of connections are less than 2 then an email alert sent to recipients which contains AV server name for easier troubleshooting.
Note: We need to have Perl & libraries, SMTP access to send email alerts and little knowledge on netstat to customize script according your setup requirements.