Bosun Filtrar, ordenar, limitar y graficar


Ejemplo

Cuando utilice GraphAll, es posible que aún desee filtrar los resultados, en cuyo caso puede usar una variable de alerta con las funciones de filtro , clasificación y límite .

template graph.template {
    subject = ...

    body = `{{template "header" .}}

    <strong>Graph Filtered Variable</strong>
    <div>{{.Graph .Alert.Vars.graph_below_5 .Alert.Vars.graph_unit}}</div>

    <strong>Graph Filter+Sort+Limit Variable (Maximum of 10 series)</strong>
    <div>{{.Graph .Alert.Vars.graph_lowest_10 .Alert.Vars.graph_unit2}}</div>

    `
}

alert os.low.memory {
    template = graph.template
    ...
    $graph_all = q("avg:300s-avg:os.mem.percent_free{host=ny-*}", "1d", "")
    $graph_unit = All Systems with Less than 5 Percent Free Memory
    $graph_below_5 = filter($graph_all, min($graph_all) < 5)

    $graph_unit2 = Ten Systems with lowest Percent Free Memory
    $graph_lowest_10 = filter($graph_all, limit(sort(min($graph_min_5),"asc"),10))        
    ...
}