Thanks for the multiple suggestions.

Creating a recording rule makes sense and I actually tried creating a 
recording rule for this, but for some reason that is not working.
Can you help in the recording rule here a bit?
Thanks.

On Monday, April 20, 2020 at 2:33:26 PM UTC+5:30, Julius Volz wrote:
>
> You have a couple of options:
>
> A) If those interfaces are never relevant for anything, use the Node 
> Exporter's "--collector.netdev.device-blacklist" flag on the respective 
> machines to not even emit metrics for the intentionally disabled interfaces.
>
> B) Produce time series (sample value doesn't matter) that tell Prometheus 
> which interfaces on which host are supposed to be down, and join them into 
> your alerting expression with an "unless" ("<your expression> unless 
> on(instance, device) node_network_device_disabled) to remove alerts for 
> those. The production of those time series can either be done via static 
> recording rules (see e.g. the last code box in 
> https://www.robustperception.io/using-time-series-as-alert-thresholds), 
> or could come from an exporter, maybe even from the textfile module on each 
> machine's Node Exporter, if you have the info there.
>
> C) Hardcode the selection of those excepted devices directly into your 
> alerting expression, with multiple "unless"-es. Probably a bit ugly :)
>
> On Mon, Apr 20, 2020 at 9:45 AM Yagyansh S. Kumar <[email protected] 
> <javascript:>> wrote:
>
>> Hi. I have configured an alert to get notified whenever any of my Network 
>> Interfaces goes down. Now, on some servers some interfaces we have made 
>> down intentionally and I want to exclude those interfaces for those 
>> particular servers from the alert. 
>> What is the best possible way to do this? I know I can silence the alert, 
>> but that wouldn't be a good solution as the interface would be down for 
>> indefinite time.
>>
>> My configured alert looks like this:
>>   - alert: Network-Interface-Down
>>     expr: node_network_up{device!~"lo.*"} * on(instance) 
>> group_left(nodename) node_uname_info * on(instance,device) 
>> group_left(address) node_network_info == 0
>>     for: 5m
>>     labels:
>>       severity: "CRITICAL"
>>     annotations:
>>       summary: "Network interface down - {{ $labels.device }} on {{  
>> $labels.nodename }}"
>>
>> I want to disable the alert for eth1 on Host1, eth5,8 on Host2. 
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Prometheus Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/prometheus-users/4f018fd8-ae22-4dbe-bbcd-2fcdb4299895%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/prometheus-users/4f018fd8-ae22-4dbe-bbcd-2fcdb4299895%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/b99fd6ef-405f-4ec0-80cd-d272c5695a99%40googlegroups.com.

Reply via email to