carstein.seeberg

NSA probe to create top-n QoS reports based on subscribing

Discussion created by carstein.seeberg on Aug 19, 2009
Latest reply on Aug 25, 2017 by smveloso

This probe/script will subscribe to the QOS_MESSAGE subject, and will build a QoS cache from which it calculates top-n reports.  The script is an example on how to unlock some of the powers of the NSA and NimBUS.  It currently writes its result to the probe log, but can easily be enhanced to write a HTML or text file instead.

The part that needs attention is the do_work function.  This is the probes main engine, and utilizes one spesific reporting function (for interface_traffic, due to its complex QoS structure), and one generic function that allows you to add more QoS data to your top-n reports. 

  -- Specific reporters   
    report_interface_traffic (10)
   
    -- Generic reporter
    report_qos ("QOS_CPU_USAGE",            10,"%")
    report_qos ("QOS_MEMORY_USAGE",  10,"MB")
    report_qos ("QOS_NET_CONNECT",       10,"ms")
    report_qos ("QOS_PROCESS_MEMORY",10,prtBytes)
    report_qos ("QOS_URL_RESPONSE",       10,"ms")

The above code, will make 6 top-10 reports.  The 3rd parameter of the report_qos function is a formatter (or unit) argument.

You could also consider to add a filter to the hubpost function to reduce the size of the QoS cache being kept in memory.

Enjoy,
Carstein

Outcomes