Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Hi ,I want to export VIP and pool details in excel or csv . Can anybody help me regarding this . I am new in F5 world .

AmolAllewar_262
Nimbostratus
Nimbostratus

Hi ,I want to export VIP and pool and pool menbers details in excel or csv . Can anybody help me regarding this . I am new in F5 world .

 

Regards

 

Amol S. Allewar

 

6 REPLIES 6

Hannes_Rapp
Nimbostratus
Nimbostratus

F5 BigIP LTM configuration is not what you would normally manage in an Excel spreadsheet. Formatting would probably be a major overhead.

If you insist, you can get started by the following two commands:

 Print out all LTM Virtual Server configurations, one row per VS
tmsh list ltm virtual one-line
 Print out all LTM Pool configurations, one row per Pool
tmsh list ltm pool one-line

When done, you can paste the outputs to your Excel spreadsheet and split the values to multiple columns (use 'space' as field separator). You will still have to manually format what's left to make it human-usable documentation.

Regards,

Thanks . My LTM is configured in multiple partition . When i enter this command i am not getting any output . Version : 11.4.1 . Please suggest .

Hannes_Rapp_162
Nacreous
Nacreous

F5 BigIP LTM configuration is not what you would normally manage in an Excel spreadsheet. Formatting would probably be a major overhead.

If you insist, you can get started by the following two commands:

 Print out all LTM Virtual Server configurations, one row per VS
tmsh list ltm virtual one-line
 Print out all LTM Pool configurations, one row per Pool
tmsh list ltm pool one-line

When done, you can paste the outputs to your Excel spreadsheet and split the values to multiple columns (use 'space' as field separator). You will still have to manually format what's left to make it human-usable documentation.

Regards,

Thanks . My LTM is configured in multiple partition . When i enter this command i am not getting any output . Version : 11.4.1 . Please suggest .

Daniel_Epperson
F5 Employee
F5 Employee

See this post for a very similar question. The suggestion was to start by looking at the output of "tmsh list ltm virtual".

I put together a quick bash script for you for this purpose.

echo vs name, destination, pool, pool members
VIRTUALS=$(tmsh list ltm virtual | grep "ltm virtual" | cut -d" " -f3)
for VS in $VIRTUALS; 
do 
  echo -n $VS,
  DEST=$(tmsh list ltm virtual $VS | grep destination | cut -d" " -f6)
  echo -n $DEST,
  POOL=$(tmsh list ltm virtual $VS | grep pool | cut -d" " -f6)
  echo -n $POOL, 
  if [ -n "$POOL" ];
  then
    MBRS=$(tmsh list ltm pool "$POOL" | grep address | cut -d" " -f14)
    echo -n $MBRS
  fi
  echo
done

The output is like this. The vs2 virtual doesn't have a pool or pool members.

vs name, destination, pool, pool members
myvs,0.0.0.0:any,mypool,192.168.1.1 192.168.1.2
vs2,192.168.1.23:http,,

You may need to change some things but that should get you a head start.

seamlessfirework
Altocumulus
Altocumulus

Hey guys,

I stumbled upon this thread by the article https://my.f5.com/manage/s/article/K72255145. Together with my go to dev ops guy I refined the script a little bit. Especially he added regexp to filter the IP addresses. I added the columns for WAF policies. Because there are two ways to implement WAF policies there are two columns for this. If you don't need this just comment the strings out of the script.

Hope this helps.

echo BIG-IP,vs name,destination,pool,pool members,WAF_profiles,WAF_policies
VIRTUALS=$(tmsh -q -c "cd / ; list /ltm virtual  recursive" | grep "ltm virtual" | awk -F' ' '{print "/"$3}')
for VS in $VIRTUALS;
do
    HOST=$(tmsh list sys global-settings hostname | grep hostname | cut -d" " -f6)
    echo -n $HOST,
    echo -n $VS,
    DEST=$(tmsh list ltm virtual $VS | grep destination | grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}')
    echo -n $DEST,
    POOL=$(tmsh list ltm virtual $VS | grep pool | cut -d" " -f6)
    echo -n $POOL,
    if [ -n "$POOL" ];
    then
    MBRS=$(tmsh list ltm pool "$POOL" | grep address | grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}')
    echo -n $MBRS,
    fi
    WAF_profiles=$(tmsh list ltm virtual $VS | grep -A 1 profiles | grep ASM | cut -d" " -f9)
    echo -n $WAF_profiles,
    WAF_policies=$(tmsh list ltm virtual $VS | grep -A 1 policies | grep asm | cut -d" " -f9)
    echo -n $WAF_policies
    echo
done