Welcome to Pandora FMS Community!

Find answers, ask questions, and connect with our community around the world.

  • issues with generic_data_inc

    Posted by eXXon on December 19, 2011 at 04:14

    Hi there!

    I have some troubles with data type generic_data_inc:
    as says documentation:

    The whole numeric data equals to the differential being between the current value and the previous one. When this differential is negative, the value is fixed to 0.

    Im create a modules to monitor eth1 data flow, here the definition of modules:

    # Networking.
    module_begin
    module_name nettraf_eth1_in
    module_type generic_data_inc
    module_exec  cat /sys/class/net/eth1/statistics/rx_bytes
    module_postprocess 0.0009765625
    module_description Bytes IN (postprocess ti Kb)
    module_end
    
    module_begin
    module_name nettraf_eth1_out
    module_type generic_data_inc
    module_exec  cat /sys/class/net/eth1/statistics/tx_bytes
    module_postprocess 0.0009765625
    module_description Bytes OUT (postprocess to Kb)
    module_end
    

    but i get randomly “0” value in data( see screenshot ),
    as i know /sys/class/net/eth1/statistics/tx_bytes returns a value of total transmitted bytes on eth1 and this value always increment. But how there zerros appear? and why timestamp of zerro values are same. I look it in mysql

    SELECT * FROM  `tagente_datos`WHERE  `id_agente_modulo` =%AgentID% 

    the zerro values have same timestamp with the previous one (see screenshot)

    rnovoa replied 13 years ago 2 Members · 2 Replies
  • 2 Replies
  • eXXon

    Member
    December 23, 2011 at 13:08
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Find out problem:
    file Core.pm
    1860 str
    # Should not happen
    return 0 if ($utimestamp == $data_inc->{‘utimestamp’});
    that cases incorrect average data calculations in graphs.

    Also to devs – its better in inc data type check if last value = now value don’t write in db. Less records in db => better performance.

    attached corected file with catch this type of exception;

  • rnovoa

    Member
    December 26, 2011 at 15:21
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hi eXXon,

    Thank you for taking the time to send us a patch. I’ve fixed the part where 0 was returned when a second value with the same timestamp arrived, but data compression is already handled in the function pandora_process_module, it should work for incremental modules, ¿doesn’t it work for you? Thank you again.