On 22.02.21 09:29, Faik OZCAN wrote:
> Hi , How can I show the total disk capacity on the rule I created with 
> Prometheus alert manager. Sample code
> 
>    - 
>    
>    alert: Windows_Low_Disk_Alert
>    
>    expr: 100.0 - 100 * ((windows_logical_disk_free_bytes / 1024 / 1024 ) / 
>    (windows_logical_disk_size_bytes / 1024 / 1024)) > 99.10
>    
>    for: 5m
>    
>    labels:
>    
>    severity: 'Warning'
>    
>    annotations:
>    
>    Runbook_url:
>    
>    DiskTotalSize : ?? 

There is no real straightforward way to do that, but you can include
queries in the templating. As a starting point, something like the
following could work as an annotation:

```
description: 'Disk {{$labels.volume}} on {{$labels.instance}} is {{$value | 
humanize}}% full. Total size is {{ printf 
`windows_logical_disk_size_bytes{instance="%s",volume="%s"}` $labels.instance 
$labels.volume | query | first | humanize }} bytes.'
```

-- 
Björn Rabenstein
[PGP-ID] 0x851C3DA17D748D03
[email] [email protected]

-- 
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/20210226144119.GN2747%40jahnn.

Reply via email to