Nice script but I find a better way ... maybe :-)
Use RestAPI and try to connect to SRM DataBase directly or, moreover, user SNMP !!
for example "snmpwalk -v2c -c public "IP" 18.104.22.168.4.1.122.214.171.124.4.1.5 (OID MIB are online or on the vplex )
Try, it's very good and simple !
After then, You can put the data in a mysql DB and make a "own" graph, with Zabbix for example