Forum Discussion

Jeff_Witkowski_'s avatar
Jeff_Witkowski_
Icon for Altostratus rankAltostratus
Dec 19, 2017

LTM commands output and reporting

I'm trying to gather and document details for LTMs 11.n including virtual server Names, VIPs, Pools, Services and Nodes. While I can run a recursive command and output the data I haven't found a simple or reasonably fast way to organize it into Excel workbooks. Maybe I don't have to reinvent the wheel if someone has done this. The best I've found is to bring in the source data then run "Find" functions against all the values but that's as much as creating cell by cell which I'd like to shortcut. Anyone done this?

 

2 Replies

  • You can try going with bash with tmsh commands, save the output in csv format. winscp it to windows and use it.

    Making headings & intialize the file
    echo Virtual-Server, Destination, Pool, Pool-Members > /var/tmp/$HOSTNAME.csv
    Capture all virtuals in the LTM
    VIRTUALS=$(tmsh list ltm virtual | grep "ltm virtual" | cut -d" " -f3)
    for VS in $VIRTUALS;
    do
      DEST=$(tmsh list ltm virtual $VS | grep destination | cut -d" " -f6)
      POOL=$(tmsh list ltm virtual $VS | grep pool | cut -d" " -f6)
      if [ -n "$POOL" ];
      then
        MBRS=$(tmsh list ltm pool "$POOL" | grep address | cut -d" " -f14)
      fi
      echo $VS,$DEST,$POOL,$MBRS >> /var/tmp/$HOSTNAME.csv
    done