Big-IP F5 LTM Load Balancer Documentation Script with Powershell

Perform a report on your Big-IP LTM load balancers using powershell. The report currently includes virtual servers, pools, and their members along with various bits of status and usage information.

 
 
 
 
 
5 Star
(2)
2,830 times
Add to favorites
Networking
1/3/2014
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Reporting on systems using partitions
    1 Posts | Last post September 27, 2016
    • To enable the script to list all Virtual Servers from all partitions I added the following to the code:
      
      #to enable resurive queries the active folder must be set to "/" (defaults to "/Common")
      (Get-F5.iControl).SystemSession.set_active_folder("/")
      
      Insert the code just before the "#region Virtual Servers" (line 2392).
      
      
  • Mailto alerting hash literal error
    1 Posts | Last post February 12, 2015
    • I am pretty new to scripting in general, and when I found this script for F5, I thought I would try and have it send with the file attached.
      
       $ReportDeliverySplat = @{
                      'EmailSender' = $EmailSender
                      'emailrecipient' = $EmailRecipient
                      'emailsubject' = $EmailSubject
                      'emailrelay' = $EmailRelay
                      'sendmail' = $SendMail
                      'ForceAnonymous' = $ForceAnonymous
      
      I filled out the sender as myself, and the recipient (to test) as self. It alerts as hash literals are not allowed. 
      If I do not use the same address, it sends the email without attachment. 
      
      Apologies for such a noob question...
  • Script fails for me.
    1 Posts | Last post September 04, 2014
    • This looks like a great script but is not working fully for me. Running against 11.2 and 11.5 devices.
      
      When I run it I get:-
      Exception calling "get_statistics" with "2" argument(s): "There is an error in XML document (226, 74)."
      At C:\PS Scripts\Get-LTMReport.ps1:2445 char:21
      +                     $poolmemberstats = ((Get-F5.iControl).LocalLBPoolMember.get_ ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
          + FullyQualifiedErrorId : InvalidOperationException
      
      Cannot index into a null array.
      At C:\PS Scripts\Get-LTMReport.ps1:2455 char:46
      +                         'totalconnections' = Extract-Statistic $poolmemberstats[ ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
          + FullyQualifiedErrorId : NullArray
  • To get for 3-4 Pools and email
    2 Posts | Last post March 19, 2014
    • So when i run the report I get all the pools info for my ltm. How do i get it to run for only 3-4 app pools. And how do i get the report to be mailed to me . I would like to schedule it to run and mail me.
    • Sorry, I've not had time to round back to this to add filtering. I'm pretty certain that at least email functionality is in there somewhere if you are willing to dip into the code though.
  • Can I copy paste the entire Get-LTMReport.ps1 into Powershell ISE to run?
    2 Posts | Last post February 07, 2014
    • Thank You Zachary for taking the time to write this script.  I'm really new to the powershell life and really like the functionality and automation that people speak of.  Your text file has powershell script, HTML .NET maybe and should I paste all text file into my powershell ISE and then run?  Second Question is How is this script connecting to the BigIP LTM? is it SSH and then looks for the ltm config file to pull information? I have been tasked to get the inventory of the BigIP LTM and this really looks awesome.  I'm just a little shaky.  This is my first attempt to connect to the bigip.  I have practicing on smaller server tasks so far. Just want to understand a bit better.....Thanks for your time.  
    • Hello,
      
      Assuming you have installed the icontrol components on your workstation which allows you to connect to the Big-IP devices (https://devcentral.f5.com/d/microsoft-powershell-with-icontrol) you should be able to save the script then run it directly in a powershell prompt with the following:
      
      .\Get-LTMReport.ps1 -PromptForInput
      
      you may have to run this first if you get permissions issues:
      
      set-executionpolicy remotesigned
      
      Let me know how it works out.
      
      Zach