Problem weathermap lines with plugin check_centreon_snmp_traffic

#22

I wonder where the additional data (load / traffic) has gone as the changes only affect the units, not other output.

(Maxime) #23

That’s normal when replacing my printf by yours that was removed, this was the one I had before

printf(
“|traffic_in=”.$in_perfparse_traffic_str.“Bits/s;$warningBit;$criticalBit;0;$speed_card
traffic_out=”.$out_perfparse_traffic_str.“Bits/s;$warningBit;$criticalBit;0;$speed_card
load_In=”.$in_usage."%%;$warningBit;$criticalBit;0;0
load_Out=".$out_usage."%%;$warningBit;$criticalBit;0;0
traffic_In=%.2f".$in_prefix.“b;”.$warningBit.";".$criticalBit.";0;0
traffic_Out=%.2f".$out_prefix.“b;”.$warningBit.";".$criticalBit.";0;0 \n",$in_traffic,$out_traffic);

#24

Darn. I searched for this plugin in the Centreon Github repository, didn’t find it there, found a version here which is missing the load and traffic metrics.

Taking your lines I’d try the following:

printf(
“|traffic_in=”.$in_perfparse_traffic_str.“b;$warningBit;$criticalBit;0;$speed_card
traffic_out=”.$out_perfparse_traffic_str.“b;$warningBit;$criticalBit;0;$speed_card
load_In=”.$in_usage."%%;$warningBit;$criticalBit;0;0
load_Out=".$out_usage."%%;$warningBit;$criticalBit;0;0
traffic_In=%.2f".$in_prefix.“b;”.$warningBit.";".$criticalBit.";0;0
traffic_Out=%.2f".$out_prefix.“b;”.$warningBit.";".$criticalBit.";0;0 \n",$in_traffic,$out_traffic);
(Maxime) #25

I succeeded! It was enough to set the Load_In Load_Out values ​​before the traffic_in traffic_out values, here is the result:
Its%20work%20

I still have to make sure that the value in bits fits itself in Mb or Kb but it’s just to perfect the display, thank you very much for your help and for taking time for me help, it was a week that I was on the problem, thank you again!

#26

Looking at the code once again it seems that traffic_in/traffic_out is shown twice so omitting the first two lines and adding the max values to the last ones might help

printf(
“|load_In=”.$in_usage."%%;$warningBit;$criticalBit;0;0
load_Out=".$out_usage."%%;$warningBit;$criticalBit;0;0
traffic_In=%.2f".$in_prefix.“b;”.$warningBit.";".$criticalBit.";0;$speed_card
traffic_Out=%.2f".$out_prefix.“b;”.$warningBit.";".$criticalBit.";0;$speed_card \n",$in_traffic,$out_traffic);
1 Like
(Maxime) #27

Now it’s perfect with this plugin configuration, I have nothing to change! Thanks again !

#28

Please select one posting as solution so the thread is marked as “Resolved” and might help others in the future ;-).

1 Like