Closed antonroman closed 5 years ago
I've done a shell script that gets the number of WAC instances counting the number of lines that match with a specific pattern and writes the result in the /tmp/wac-instances.txt file to SNMP monitoring . It could be in the /opt/wac-instances/wacs.sh path of rp-vnf.
#!/bin/bash
destdir=/tmp/wac-instances.txt
while true
do
wacinstances=$(grep -c -E -o 'server ([0-9]{1,3}[\.]){3}[0-9]{1,3} max_fails' /etc/nginx/sites-enabled/wac-nginx.conf)
echo "$wacinstances" > "$destdir"
sleep 10
done
I leave it here to test it when the rp-fsm will be able to support more than one WAC instances #85 It could be executed from the snmpd.conf file. In this way it would be executed each time the variable SNMP is updated.
It could be useful to include the scenario where the WAC is referred as a host instead of a numeric IP. The new IOD of the wacInstances SNMP variables is in the next picture:
snmpget -v2c -c public localhost snmpget -v2c -c public localhost .1.3.6.1.4.1.8072.1.3.2.3.1.1.12.119.97.99.73.110.115.116.97.110.99.101.115
The checksum of the image that contains the wacInstances SNMP variable is:
619e9709edb86f97f671b4e6c8ee69ea
The RP must return the value of a SNMP variable with the total number of WAC instances. The RP is the right VNF to control this as each VNF-WAC must be provisioned in the right upstream group.