SNMP Pools
I'm trying to probe the status of a pool via SNMP and not translating the whole pool name into an OID as doing that for each and every pool is not efficient. On the F5 I can run the following command: snmpwalk -v2c -c public localhost F5-BIGIP-LOCAL-MIB::ltmPoolStatusAvailState.\"/Common/Pool1\" Returned: F5-BIGIP-LOCAL-MIB::ltmPoolStatusAvailState."/Common/Pool1" = INTEGER: green(1) Now to test without the MIB: snmpwalk -v2c -c public localhost 1.3.6.1.4.1.3375.2.2.5.5.2.1.2.\"/Common/Pool1\" Returned: F5-BIGIP-LOCAL-MIB::ltmPoolStatusAvailState."/Common/Pool1" = INTEGER: green(1) However, if I SNMP walk the device outside of the F5 with Nagios or Solarwinds SNMP walk tool 1.3.6.1.4.1.3375.2.2.5.5.2.1.2.\"/Common/Pool1\" neither program returns anything. Is there a better way to probe it outside the F5 without converting "/Common/Pool1" to an OID/decimal format?Solved1.3KViews0likes7CommentsPython BigRest VS and Pool status
Problem this snippet solves: This gets the status of all Virtual servers and the pool members and write to a text file. If one of the pool member is up, then the pool will be marked as up as well. How to use this snippet: Based on Python 3 and BigREST SDK Code : #Import needed libraries from bigrest.bigip import BIGIP import getpass #Replace the host name as needed host="xx.xx.xx.xx" user=input('Username') pw= getpass.getpass(prompt='Password:') #Declare the Output filename out="output.txt" #Connect to device device = BIGIP(host, user, pw) #Open output file for writing outf=open(out, 'w') #Get the virtual server info virtuals = device.load("/mgmt/tm/ltm/virtual") for virtual in virtuals: #Get the status of the VS vstat=device.load("/mgmt/tm/ltm/virtual/"+virtual.properties["fullPath"].replace("/","~")+"/stats") vss=list(vstat.properties['entries'].values())[0]['nestedStats']['entries']['status.availabilityState']['description'] print("VS name is ", virtual.properties["fullPath"], vss) outf.write("VS name is " + virtual.properties["fullPath"]+'\t'+vss+'\n') #Get the pool name, if exists try: pool= virtual.properties["pool"] except: pool = None print ('Unassigned pool') outf.write("No pool assigned to this VS \n\n") if pool: #Get the pool members info and their status pool= virtual.properties["pool"] pooldetail= device.load("/mgmt/tm/ltm/pool/"+pool.replace('/', '~')+"/members") pstate = 'Down' print ("Pool members are: ") outf.write("Pool members are: \n") for members in pooldetail: print (members.properties['fullPath'], members.properties['state']) outf.write(members.properties['fullPath']+'\t' +members.properties['state']+'\n') #Mark the pool as up, if atleast one member is up if pstate=='Down': if members.properties['state'] == 'up': pstate = 'up' print ("Pool is ", pool, pstate, '\n') outf.write("Pool is "+ pool + '\t' +pstate+'\n\n') outf.flush() outf.close() Tested this on version: 13.1525Views0likes0Comments