7 Replies Latest reply: Jan 7, 2015 7:59 AM by Jamie Lozan RSS

trafficsummary.py pulling more data than what's seen in the GUI

Jamie Lozan

Having an issue.........more than likely it's a misunderstanding with the syntax I'm using.  In the screenshot, you'll see the report I'm trying to run and that it's only producing 446 rows.  I want to see traffic from group ByLocationSummary:ca to/from ByLocation:PCI_MDC and ByLocation:PCI_NDC.  Both directions.  When I run the following script, it produces 7843 rows.

 

python C:\Python27\share\doc\steelscript\examples\netprofiler\traffic_summary.py ***-u lozja001 -p "***" --trafficexpr "(src hostgroup ByLocationSummary:ca and dst hostgroup ByLocation:PCI_MDC) or (src hostgroup ByLocationSummary:ca and dst hostgroup ByLocation:PCI_NDC) or (src hostgroup ByLocation:PCI_MDC and dst hostgroup ByLocationSummary:ca) or (src hostgroup ByLocation:PCI_NDC and dst hostgroup ByLocationSummary:ca)" --groupby hpr --columns cli_group_name,cli_host_dns,cli_host_ip,srv_group_name,srv_host_dns,srv_host_ip,protoport,avg_bytes --csv --timefilter="1/5/2015 8:00 to 1/6/2015 8:00"

  • Re: trafficsummary.py pulling more data than what's seen in the GUI
    Mike Garabedian

    Strange problem ... I've tried to replicate the report you are running using our demo data and it seems to work okay here.

     

    Your traffic expression and groupby looks okay, but maybe there are some other criteria that aren't obvious?

     

    One troubleshooting approach you can do: In another report page remove the host groups from the two boxes at the top (or change the radio button to "Any" in both cases) and instead just add your traffic expression under the traffic expression box.  That should report the same data results in both reports as well.

    • Re: trafficsummary.py pulling more data than what's seen in the GUI
      Jamie Lozan

      thanks, good to know the syntax was correct........although I was kind of hoping that was the simple solution.  I did what you recommended and it produced the same 446 rows that was shown previously in the GUI.  See attached.gui_pci_trafficexp_any.JPG.jpg

    • Re: trafficsummary.py pulling more data than what's seen in the GUI
      Jamie Lozan

      as another troubleshooting step, I changed the report in the GUI to be run as shown below:

       

      pci_more.JPG.jpg

       

      and then shortened the script to be like that here:

       

      python C:\Python27\share\doc\steelscript\examples\netprofiler\traffic_summary.py ** -u lozja001 -p "**" --trafficexpr "(src hostgroup ByLocationSummary:ca and dst hostgroup ByLocation:PCI_MDC)" --groupby hpr --columns cli_group_name,cli_host_dns,cli_host_ip,srv_group_name,srv_host_dns,srv_host_ip,protoport,avg_bytes --csv --timefilter="1/5/2015 8:00 to 1/6/2015 8:00"

       

      Same result - GUI = 189 rows, python = 4107 rows.

    • Re: trafficsummary.py pulling more data than what's seen in the GUI
      Jamie Lozan

      always something simple right?oops.JPG.jpg

       

      Since resolution isn't an option that can be called from command line, if I change that line to "1 hour" or "15 min", will it take it fine?  Here's a snippet.

       

       

              with TrafficSummaryReport(self.netprofiler) as report:

                  report.run(columns=self.options.columns.split(','),

                             groupby=self.groupby,

                             sort_col=self.options.sortby,

                             timefilter=self.timefilter,

                             trafficexpr=self.trafficexpr,

                             centricity=self.centricity,

                             resolution='1 min')

      • Re: trafficsummary.py pulling more data than what's seen in the GUI
        Mike Garabedian

        That highlight might be it - try changing the groupby from "hpr" to "gpr". 

         

        hpr - Host Pairs with Ports

        gpr - Host Group Pair with Ports

         

        And for resolution, yes, you can manually change that resolution argument to one of the following valid values:

        'auto'

        '1 min'

        '15 min'

        '1 hour'

        ...

         

        But usually 'auto' will be sufficient and should use the same logic for selecting a resolution that the GUI does.

        • Re: trafficsummary.py pulling more data than what's seen in the GUI
          Jamie Lozan

          yea, it made them match - I just accidentally chose the wrong one and didn't notice it until last night after I went to look again.

           

          Thanks for the answer on the resolution Mike!

        • Re: trafficsummary.py pulling more data than what's seen in the GUI
          Jamie Lozan

          yea, so seems to bomb when I make the change to the resolution.  I'll just leave it at auto for now.

           

          Traceback (most recent call last):

            File "C:\Python27\share\doc\steelscript\examples\netprofiler\traffic_summary.p

          y", line 105, in <module>

              TrafficSummaryApp().run()

            File "C:\Python27\lib\site-packages\steelscript\common\app.py", line 31, in ru

          n

              self.parse(sys.argv[1:])

            File "C:\Python27\lib\site-packages\steelscript\commands\steel.py", line 302,

          in parse

              self.main()

            File "C:\Python27\share\doc\steelscript\examples\netprofiler\traffic_summary.p

          y", line 98, in main

              data = report.get_data()

            File "C:\Python27\lib\site-packages\steelscript\netprofiler\core\report.py", l

          ine 644, in get_data

              return super(SingleQueryReport, self).get_data(0, columns)

            File "C:\Python27\lib\site-packages\steelscript\netprofiler\core\report.py", l

          ine 426, in get_data

              return query.get_data(columns)

            File "C:\Python27\lib\site-packages\steelscript\netprofiler\core\report.py", l

          ine 174, in get_data

              return list(self.get_iterdata(columns))

            File "C:\Python27\lib\site-packages\steelscript\netprofiler\core\report.py", l

          ine 168, in get_iterdata

              self._get_querydata(columns)

            File "C:\Python27\lib\site-packages\steelscript\netprofiler\core\report.py", l

          ine 159, in _get_querydata

              params=params)

            File "C:\Python27\lib\site-packages\steelscript\netprofiler\core\_api1.py", li

          ne 87, in queries

              return self._json_request(uri, params=params)

            File "C:\Python27\lib\site-packages\steelscript\netprofiler\core\_api1.py", li

          ne 21, in _json_request

              body=data, params=params)

            File "C:\Python27\lib\site-packages\steelscript\common\connection.py", line 28

          9, in json_request

              raw_json=raw_json)

            File "C:\Python27\lib\site-packages\steelscript\common\connection.py", line 25

          3, in _request

              raise exc

          steelscript.common.exceptions.RvbdHTTPException: 500 Internal reporting error