Ad Widget

Collapse

F5 Big IP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • webgordy
    Junior Member
    • Jan 2006
    • 6

    #1

    F5 Big IP

    I was hoping to find someone that may have some experience in setting up the zabbix agent on a F5 bigip system. I could use some advice installing the agent.
    Thanks in advance for any information anyone can provide.
  • crashdummyMCH
    Member
    • Jun 2006
    • 33

    #2
    More information needed

    webgordy,

    What version of the F5 BIGIP software do you have. This is very important as different versions have different SNMP MIB's. I have worked with v4.5 and was able to get zabbix working to monitor them. Also, what kind of data are you looking to capture?

    Comment

    • webgordy
      Junior Member
      • Jan 2006
      • 6

      #3
      F5 BigIp

      Thanks for the response. We are running bigIP 4.5.14. Older version. I really just need ping to server and network bytes monitored at this point. Thanks again.

      Comment

      • chewie71
        Junior Member
        • Feb 2011
        • 12

        #4
        We're running F5 BigIP 10.2. Any chance either of you are still using Zabbix and monitoring your BigIP systems with it?

        Matt

        Comment

        • untergeek
          Senior Member
          Zabbix Certified Specialist
          • Jun 2009
          • 512

          #5
          We are monitoring F5 BigIP boxes at my company. We do so over SNMP, rather than via an agent.

          Comment

          • chewie71
            Junior Member
            • Feb 2011
            • 12

            #6
            Is there a published MIB for the BigIP that you've imported into Zabbix? Or did you just manually set it up?

            Thanks,
            Matt
            Last edited by chewie71; 20-04-2011, 16:26. Reason: MIB not OID

            Comment

            • untergeek
              Senior Member
              Zabbix Certified Specialist
              • Jun 2009
              • 512

              #7
              I imported these into /usr/share/snmp/mibs/ on my Zabbix Servers:
              Code:
              F5-BIGIP-APM-MIB.txt
              F5-BIGIP-COMMON-MIB.txt
              F5-BIGIP-GLOBAL-MIB.txt
              F5-BIGIP-LOCAL-MIB.txt
              F5-BIGIP-SYSTEM-MIB.txt
              and then restarted. I was then able to use MIBs rather than OIDs to monitor in SNMP configurations.

              We did these manually at first, then templated our tested results for the specific MIB/OID we wanted to monitor.

              Those MIBs can be found online pretty easily.

              Comment

              • danrog
                Senior Member
                • Sep 2009
                • 164

                #8
                Attached is a (1.8.3) template I use as the base or "global" template for all our F5's. I then create a separate "local" template that links the "global" template. The script below is used to add VIP stats to the "local" template. This allows you to have "global" items that can be propagated to all your F5's while still maintaining "local" F5 VIPs and POOLs. Then only the "local" template is assigned to the F5 LTM host.

                This PHP script imports different VIP stats to an already existing template with one Application assigned. It uses the PHP API class that you should be able to find on the forums. We have 500+ VIPs across all our F5's and didn't really feel like doing it manually. I haven't bothered to add other stats as we don't really care too much about the other stuff.

                PHP Code:
                require_once("classes/ZabbixAPI.class.php");

                $args = new Args();

                $template_id "<BIGIP LOCAL TEMPLATEID>";

                exec("snmpwalk -v2c -c '<YOUR COMM>' F5BIGIPHOST .1.3.6.1.4.1.3375.2.2.10.2.3.1.1 |sed -e 's/SNMPv2-SMI::enterprises.3375.2.2.10.2.3.1.1//' -e 's/STRING://' -e 's/=/,/' -e 's/\"//g'|tr -d ' '"$vips);


                // This enables debugging, this is rather verbose but can help debug problems
                ZabbixAPI::debugEnabled(TRUE);

                // This logs into Zabbix, and returns false if it fails
                ZabbixAPI::login('http://localhost/zabbix/','zabbix','password')
                    or die(
                'Unable to login: '.print_r(ZabbixAPI::getLastError(),true));

                $vipkeys = array( "ltmVirtualServStatClientTotConns" => array(
                                        
                "keytype"=>     4,
                                        
                "desc"=>        'Client Connections',
                                        
                "snmp_oid"=>    ".1.3.6.1.4.1.3375.2.2.10.2.3.1.11",
                                        
                "snmp_community"=>'<YOUR SNMP COMM>',
                                        
                "snmp_port"=>   161,
                                        
                "unit"=>        '',
                                        
                "valtype"=>     3,
                                        
                "delay"=>       300,
                                        
                "history"=>     7,
                                        
                "trends"=>      365,
                                        
                "delta"=>       2,
                                        
                "appid"=>       <YOUR APP ID>));



                $template ZabbixAPI::fetch_array('item','get',array('extendoutput'=>1,'filter'=>1,'status'=>0,'hostids'=>array($template_id)));

                foreach (
                $vips as $v) {
                        list(
                $oid$vip) = split(',',$v);
                        foreach (
                $vipkeys as $k => $val) {
                                
                $key str_replace(".","_",$vip)."_".$k;
                                if (!
                deep_in_array($key$template)) {
                                        print 
                "Adding: ".$vip." => ".$k." => ".$key."\n";
                                        print 
                "   OID: ".$val['snmp_oid'].$oid."\n";
                                        if (
                $argv[0] == '-u') {
                                                
                $newitems ZabbixAPI::query('item','create',array(
                                                                
                'hostid'=>      $template_id,
                                                                
                'type'=>        $val['keytype'],
                                                                
                'key_'=>        $key,
                                                                
                'snmp_oid'=>    $val['snmp_oid'].$oid,
                                                                
                'snmp_community'=>$val['snmp_community'],
                                                                
                'snmp_port'=>   $val['snmp_port'],
                                                                
                'description'=> $vip." ".$val['desc'],
                                                                
                'delay'=>       $val['delay'],
                                                                
                'status'=>      0,
                                                                
                'value_type'=>  $val['valtype'],
                                                                
                'units'=>       $val['unit'],
                                                                
                'applications'=>$val['appid'],
                                                                
                'delta'=>       $val['delta'],
                                                                
                'history'=>     $val['history'],
                                                                
                'trends'=>      $val['trends']))
                                                or print(
                'Unable to update: '.print_r(ZabbixAPI::getLastError(),true));
                                        }

                                }       
                        }
                }



                function 
                deep_in_array($value$array) {
                    foreach(
                $array as $item) {
                        if(!
                is_array($item)) {
                            if (
                $item == $value) return true;
                            else continue;
                        }
                        if(
                in_array($value$item)) return true;
                        else if(
                deep_in_array($value$item)) return true;
                    }
                    return 
                false;

                I haven't put this up on the wiki site yet (haven't had time).
                Attached Files
                Last edited by danrog; 22-04-2011, 00:49.

                Comment

                • mucknet
                  Member
                  • Dec 2004
                  • 59

                  #9
                  Originally posted by danrog
                  Attached is a (1.8.3) template I use as the base or "global" template for all our F5's. I then create a separate "local" template that links the "global" template. The script below is used to add VIP stats to the "local" template. This allows you to have "global" items that can be propagated to all your F5's while still maintaining "local" F5 VIPs and POOLs. Then only the "local" template is assigned to the F5 LTM host.

                  This PHP script imports different VIP stats to an already existing template with one Application assigned. It uses the PHP API class that you should be able to find on the forums. We have 500+ VIPs across all our F5's and didn't really feel like doing it manually. I haven't bothered to add other stats as we don't really care too much about the other stuff.

                  I haven't put this up on the wiki site yet (haven't had time).
                  Hi danrog --

                  Thanks for the script, however, it appears to return an OID format I'm not familiar with. Can you confirm that you're getting the same format, and that your zabbix server is able to process it?

                  Here is a snippet of what I'm getting when I run the command:
                  Code:
                  Adding: app-vip-80 => ltmVirtualServStatClientTotConns => app-vip-80_ltmVirtualServStatClientTotConns
                     OID: .1.3.6.1.4.1.3375.2.2.10.2.3.1.11F5-BIGIP-LOCAL-MIB::ltmVirtualServStatName.app-vip-80
                  And in the Item configuration in the zabbix GUI It is producing the following SNMP OID:

                  Code:
                  .1.3.6.1.4.1.3375.2.2.10.2.3.1.11F5-BIGIP-LOCAL-MIB::ltmVirtualServStatName.app-vip-80

                  And in zabbix_server.log, I'm getting the following error:

                  Code:
                  1160:20110531:171358.863 Item [bigip1.snv:app-vip-80_ltmVirtualServStatClientTotConns] error: OID [.1.3.6.1.4.1.3375.2.2.10.2.3.1.11F5-BIGIP-LOCAL-MIB::ltmVirtualServStatName.app-vip-80] value has unknown type [0x81]
                    1160:20110531:171358.863 Parameter [bigip1.snv:app-vip-80_ltmVirtualServStatClientTotConns] is not supported, old status [0]
                  I have all of the F5 mibs in /usr/share/snmp/mibs, and I have /etc/snmp/snmp.conf configured with:
                  mibs :ALL


                  Thanks!
                  Last edited by mucknet; 01-06-2011, 02:43.

                  Comment

                  • mucknet
                    Member
                    • Dec 2004
                    • 59

                    #10
                    So I played around with this some more tonight in my test environment. I decided to copy danrogs concept (Thanks danrog!), but to implement it without PHP, because A) my PHP skills are non existant, and B) Currently we don't have the PHP api deployed in production, but we DO have zabcon deployed. Fair warning, this is pretty hacky, and not horribly well thought out. It works for me, but YMMV I'm using Zabbix 1.8.4, and net-snmp 5.3.2.2

                    The basic idea is that I query the index table that contains the name (in STRING) format of whatever I want to monitor (in this case it is an F5 Virtual Server, with names like "app-vip" or "www-vip", etc and the index is called F5-BIGIP-LOCAL-MIB::ltmVirtualServStatName). Then you append all the strings you get back onto the SNMP OID you actually want to monitor (in this case: F5-BIGIP-LOCAL-MIB::ltmVirtualServStatClientTotConns turns into F5-BIGIP-LOCAL-MIB::ltmVirtualServStatClientTotConns."app-vip"). Since net-snmp is smart enough to look up the string in quotes against the index, this all works hunky dory

                    I then output it in zabcon format so that you can turn around and pipe it into zabcon.

                    You will need:
                    * The F5-BIGIP-LOCAL-MIB (or whatever) MIB Loaded into your MIB dir (in my RHEL/CENTOS world that is /usr/share/snmp/mibs)
                    * edit /etc/snmp/snmp.conf to say "mibs :ALL" or something more specific to your MIB if you like - The spacing of the colon matters
                    * Restart zabbix_server process to load the new MIB's -- (I'm not sure if this is required? but I did)
                    * A functional zabcon (you can find instructions elsewhere for that -- If I recall, I compiled ruby and gems from source).

                    Code:
                    #!/bin/bash
                    #For a new Bigip statistic you probably only have to change these:
                    DESCRIPTION="Client Connections"
                    #B for Bytes, b for bits, etc
                    UNIT=""
                    #The OIDINDEX is where you'll find the STRING name of the items you want to monitor
                    OIDINDEX="ltmVirtualServStatName"
                    #The OID of the actual statistic you want to monitor
                    OID="ltmVirtualServStatClientTotConns"
                    TEMPLATE="<YOUR_TEMPLATE_ID>"
                    ##
                    
                    #Host is only used for the initial SNMP query, The assumption for the rest of the script is that you're adding the item to a template.
                    HOST=192.168.30.121
                    #The KEYTYPE is a hack because zabcon (or at least my version) doesn't support SNMP types.. but you can just login afterwards and do a "Mass Edit"
                    KEYTYPE="trapper"
                    SNMP_COMMUNITY="public"
                    SNMP_PORT=161
                    #VALTYPE 0 is Floating Point
                    VALTYPE="0"
                    DELAY="30"
                    HISTORY="7"
                    TRENDS="365"
                    #DELTA 1 is "speed per second" 
                    DELTA="1"
                    #Application also doesn't seem to be supported with zabcon...
                    APPID=""
                    
                    #Replace the URL, username, and password with your own - make sure API access is enabled
                    ZABCON_LOGIN="login http://localhost/zabbix/ Username Password"
                    MIB="F5-BIGIP-LOCAL-MIB::"
                    
                    
                    WALK="`snmpwalk -v2c -c '$SNMP_COMMUNITY' $HOST $MIB$OIDINDEX  |sed  -e 's/STRING://' -e 's/=/,/' -e 's/\"//g'|tr -d ' ' | cut -d, -f2`"
                    echo "$ZABCON_LOGIN"
                    for i in $WALK
                    do
                            echo "add item hostid=\"$TEMPLATE\" type=\"$KEYTYPE\" key=\"$OID-$i\" snmp_oid=\"$MIB$OID.\"$i\"\" snmp_community=\"$SNMP_COMMUNITY\" snmp_port=\"$SNMP_PORT\" description=\"$i $DESCRIPTION\" delay=\"$DELAY\" status=\"0\" value_type=\"$VALTYPE\" units=\"$UNIT\" delta=\"$DELTA\" history=\"$HISTORY\" trends=\"$TRENDS\""
                    
                    done
                    Other notes:
                    * Because my version of zabcon doesn't support adding SNMP types, I output the type of "trapper" for now, and then I login, and do a mass edit.
                    * I spit out zabcon login information at the beginning of the output so that I can pipe it directly to zabcon after I run a test to make sure its going to work.
                    * For the different statistics I want to add, I just made multiple files, I currently have:
                    bigip_zabcon_ltmVirtualServStatClientBytesIn.sh
                    bigip_zabcon_ltmVirtualServStatClientBytesOut.sh
                    bigip_zabcon_ltmVirtualServStatClientTotConns.sh

                    But the script is designed to make it easy to modify it for pool statisticcs, Irule statistics, etc.
                    * I prefer to look at values in "items per second" instead of a true delta like danrog.
                    * This script does not check to see if the item already exists, but zabcon will error out with "No login permissions" if the item already exists, so no harm in trying to add it twice. -- like I said, its a hack! I think it took me longer to write this post than it did to write the script

                    Enjoy!

                    Comment

                    Working...