Balanced

Best way to have a good idea, is to have lots of ideas

Scheduled BigIPReport CSV exports via mail

Today I got a feature request over at Devcentral from a BigIPReport admin to add the possibility to add scheduled exports of BigIPReport via mail. While it does not really fit into the project itself actually doing it is actually simpler than you might think!

Using a mix of Powershell and .Net we can download the Json files, parse them and generate a CSV file that can be sent to anyone in the organisation.

Please note that as usual there’s a thousand ways to skin a cat (funny expression right there) and this script could be improved quite a bit. Some potential examples:

  • Creating the attachment from memory instead of a temporary file
  • Changing the mail format to HTML and adding some useful statistics like virtual server count, pool count, node count etc.
  • Adding a database, or using a flat file could also give out trends.

If anyone is up to the task and wants to share the result I’d be happy to post it here along with your name. πŸ™‚

Anyways, here’s the script!

 

Previous

F5 case creation tweaks

Next

Protecting BigIP Report behind an APM – By Shannon Poole

7 Comments

  1. Abed

    Hi

    The CSV is only with one line , the description line .. maybe something i configured wrong . … but the bigipreport is working fine which is weird why the csv is not good.

    And I would advise that the CSV be in culumn not hierarchy πŸ™‚

    • Thanks for the feedback. The script worked for me when testing with SMTP2Go. Perhaps there’s GPO’s that hinders you from sending some of the content?
      What do you mean that the csv should be in column and not hierarchy?

      /Patrik

      • Abed

        yes we do have ironport
        but we whitelisted the sender but still sending the csv without the content ..
        the wierd part is that the content has only the CSVHeader .. thats all
        in the server temp file is ok ..only when it has been sent via the mail
        i dont this the ironport has to do something here … maximum is will block the file .. not deleting some of its content .. anyway we whitelisted the sender

        • You’re completely right Abed. There was a hard coded path left in the script.

          Please try again with the new version?

          /Patrik

          • Abed

            Great! πŸ™‚ It’s working fine now ! Thanks !
            one last thing (recommendation) . I think csv file in column way , I mean virtical view, would be more clear than horizontal view.

          • How would you accomplish that when the data is multidimensional? Do you want to remove the pool information?

            If you can publish an example of how you want it to be I can most likely fix it.

  2. Abed

    I meant that when the file is created on the folder it is ok
    But when it sent over the mail it is not ok .. it received empty without information and just the first line

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Powered by WordPress & Theme by Anders Norén