0 Replies Latest reply on May 17, 2017 8:57 AM by feickholt

    How to export Proxy Counters? (build in and Self defined)

    feickholt

      How to export Proxy Counters? (build in and Self defined)

      Since 3 years I’d like to fetch the proxy counters out of the proxy for visualization. (it would be great to get them using SNMP)

      First I've tried to analyze the counter database for myself.  this won't work for me.

       

      Now I find a solution I’d like to share. Maybe someone else might be interested in this solution also.

       

      We’ve created a rule which is only be entered if the proxy finds its IP-Adr. In url.host and

      an extension called counter

      Within this rule I look for parameters which are equal the counters name. If we found the parameter we add the counters name and the value to a temp. string.

      For easier working with the parameters I’ve created a user-defined Variable with the name of the Counter containing the name of the counter.

      (Example: User-Defined.Counter.Name.Blocked.403=Blocked.403)

      Accessing the counters by this variable makes it very easy to find where we use the variable in the policy and this prevents also for any typing mistake)

       

      You have to enter a line for each value you like to export.

      .1.png

      At the end you must replace the return string and define the right mime-type

      2.png

       

      Example: http://<proxyip>/counter?Blocked.403&Blocked.ShowBlockpage will return


      Blocked.403=10 ShowBlockpage=4


      If you omit the parameters the proxy will return all Counters you’ve defined in the ruleset.

       

      For Nagios we use the following easy command to fetch the values:

      echo "OK|`curl --silent  http://$ARG1$:$ARG2$@$HOSTADDRESS$:8080/counter?$ARG3$`

      The following examples shows the number of SSL Intercepted connections…

      3.png

       

      I know I can extend the return value to answer valid JSON requests - but for now: problem solved :-)

       

      Regards

      Frank