Graph with warning lines from two metrics

Hi,

I have the following Bidirectional graph:

graph_monthly_traffic = graphs.Bidirectional(
    name='graph_monthly_traffic',
    title=Title("Monthly Traffic"),
    lower=graphs.Graph(
        name='graph_monthly_traffic_lower',
        title=Title("Outgoing Traffic"),
        compound_lines=['pmacct_out_total'],
        simple_lines=[
            metrics.WarningOf('pmacct_out_total'),
        ],
    ),
    upper=graphs.Graph(
        name='graph_monthly_traffic_upper',
        title=Title("Incoming Traffic"),
        compound_lines=['pmacct_in_total'],
        simple_lines=[
            metrics.WarningOf('pmacct_in_total'),
        ],
    ),
)

Both metrics are drawn as expected, the “Incoming Traffic” above and the “Outgoing Traffic” below the X axis.

But both yellow lines for the warning thresholds are drawn above the X axis. Even when the metrics.WarningOf('pmacct_out_total') is in the lower attribute of the Bidirectional.

Why is that so? IMHO this should be changed.

1 Like

Hi Robert,

in order to solve your problem, we need more information.

Let’s have a look at the check plugin and the performance data output:

OMD[<SITE>]:~$ cmk -vp --plugins <PLUGIN> <HOST>

In my example I get

OMD[v240]:~$ omd version
OMD - Open Monitoring Distribution Version 2.4.0-2025.10.09.cee

OMD[v240]:~$ cmk -vp --plugins local v240
CMK-GRAPHING-API-SCALARS-MIRRORED Pmacct out total: 10.00 (warn/crit at 7.00/8.00)(!!), Pmacct in total: 20.00 (warn/crit at 17.00/18.00)(!!) (pmacct_out_total=10;7;8;0;15 pmacct_in_total=20;17;18;0;25)

I use the following metric definitions and your graph definition:

#!/usr/bin/env python3

from cmk.graphing.v1 import graphs, metrics, Title                                                  
                                                                                                    
metric_pmacct_out_total = metrics.Metric(                                                           
    name="pmacct_out_total",                                                                        
    title=Title("pmacct out otal"),                                                                 
    unit=metrics.Unit(metrics.DecimalNotation("")),                                                 
    color=metrics.Color.GREEN,                                                                      
)                                                                                                   
                                                                                                    
metric_pmacct_in_total = metrics.Metric(                                                            
    name="pmacct_in_total",                                                                         
    title=Title("pmacct in otal"),                                                                  
    unit=metrics.Unit(metrics.DecimalNotation("")),                                                 
    color=metrics.Color.BLUE,                                                                       
)                                                                                                   
                                                                                                    
graph_monthly_traffic = graphs.Bidirectional(                                                       
    name="graph_monthly_traffic",                                                                   
    title=Title("Monthly Traffic"),                                                                 
    lower=graphs.Graph(                                                                             
        name="graph_monthly_traffic_lower",                                                         
        title=Title("Outgoing Traffic"),                                                            
        compound_lines=["pmacct_out_total"],                                                        
        simple_lines=[                                                                              
            metrics.WarningOf("pmacct_out_total"),                                                  
        ],                                                                                          
    ),                                                                                              
    upper=graphs.Graph(                                                                             
        name="graph_monthly_traffic_upper",                                                         
        title=Title("Incoming Traffic"),                                                            
        compound_lines=["pmacct_in_total"],                                                         
        simple_lines=[                                                                              
            metrics.WarningOf("pmacct_in_total"),                                                   
        ],                                                                                          
    ),                                                                                              
)

After an apache reload I can see:

Thus something is missing on your side. Please check you check the single steps?

Best Regards
Simon

I bet this is a version thing. I tried the standard Disk I/O check and configured Read and Write throughput thresholds (1, 2, 3, and 4 MB) and this is what it looks like:

I did this with 2.4.0b1. Somewhere between that version and the 2.4.0-2025.10.09.cee this must have been fixed.


Update: I also tried 2.4.0p12 and there the behaviour is fixed.