The name for the perfdata is created in one line (python):
interface_name = matching_interfaces[interface][interface_information]['name'].replace('.', '_')
Is it possible, that the snmp sends the wrong name?
In the next step the name is used to build the perfdata for traffic and for broadcast in the following way:
performance_data_traffic.append(formatPerformanceData(interface_name + '_In', interface_log_data_dict['traffic_in_perfdata'], critUsage, warnUsage, 0, speed))
performance_data_broadcast.append(formatPerformanceData(interface_name + '_BCast_In', interface_log_data_dict['broadcast_in_perfdata'], crit_values_dict['broadcast'], warn_values_dict['broadcast'], 0, 100))
//function formatPerformanceData()
def formatPerformanceData(label, value, crit, warn, min_value, max_value):
performance_string = "'{}'={};{};{};{};{}".format(label, value, warn, crit, min_value, max_value)
return performance_string
Join of performancedata to final output for Icinga:
//Initialisation
performance_data_traffic_message = ''
performance_data_broadcast_message = ''
//join for each interface to output message
performance_data_traffic_message += ' '.join(performance_data_traffic) + ' '
performance_data_broadcast_message += ' '.join(performance_data_broadcast) + ' '
Last step is joining icinga message and perfdata with:
if final_state < 3 and performance_data_traffic_message:
check_message += ' | ' + performance_data_traffic_message
# add broadcast performance data?
if add_broadcast_performance_data:
check_message += performance_data_broadcast_message
I had an idea, but I can’t find the point where an extra ‘_’ is joined to the result string coming out of the function formatPerformanceData(). This function gives the perfdata name the enclosing quotes. And the name
_‘lo_BCast_In’
looks like it happens, that the perfdata string “‘lo_BCast_In’=0.00%;40;50;0;100” gets anywhere a ‘_’ joined at the beginning. But I do not see where and so I thoughed maybe Icinga could it do.
We use check_nwc_health. All perfdata folders have a ‘_’ at the beginning:
But Icinga do not show the same names:

Many thanks for your help!