Consulta Irule pool status
Good afternoon, friends. I am trying to create an iRule that can be used on any Virtual Server (without having to create one for each pool or node) that can analyze the state of the pool members and display an image according to their status. Case 1: If someone sets the nodes to a disabled or forced offline state, display a maintenance image. Case 2: If a node goes down due to a monitor failure (e.g., it stops responding on port 80), display a technical issues image. I want to upload all the images as iFiles within the F5. So far, I have this, but I am not able to get it working :( ######################################################################### Versión en Español: Buenas tardes amigos, estoy tratando de generar una irule que se pueda usar en cualquier VS (sin tener que crear una por cada pool o nodo existente) que pueda analizar el estado de los miembros de un pool y mostrar un imagen según su estado. Caso 1: si alguien coloca los nodos en estado disable o force offilne muestre una imagen de mantenimiento. Caso 2: si el nodo se cae por la falla del algún monitor (Ej: deja de responder el puerto 80) muestre una imagen de problemas técnicos. todas las imágenes las quiero cargar como ifile dentro del F5.. Hasta ahora tengo esto pero no lo estoy pudiendo hacer andar :( ######################################################################### when LB_FAILED { # Obtén el nombre del pool asociado con el Virtual Server actual set pool_name [LB::server pool] if { [active_members $pool_name] < 1 } { # Verifica el estado del pool dinámicamente if { [LB::status pool $pool_name] eq "user disabled" || [LB::status pool $pool_name] eq "forced offline"} { # Si los nodos están en disable o force offline manualmente set ifile_name "/Common/mantenimiento_image" ;# Nombre del iFile para mantenimiento } else { # Si los nodos están caídos por un fallo detectado por el monitor set ifile_name "/Common/problemas_tecnicos_image" ;# Nombre del iFile para problemas técnicos } # Leer el contenido del iFile y responder al cliente con la imagen set ifile_content [ifile get $ifile_name] HTTP::respond 200 content $ifile_content "Content-Type" "image/jpeg" } } Si alguien me puede ayudar se lo agradecería mucho.43Views0likes3CommentsSNMP 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.1547Views0likes0Comments