You could also use something like:

    changes(node_boot_time_seconds[1h]) > 0

...to tell you whether there was a reboot in the last hour. Note that all
of these types of alerts in Prometheus will eventually auto-resolve since
they alert based on a steadily moving window.

On Thu, Apr 28, 2022 at 7:31 AM Brian Candler <[email protected]> wrote:

> I don't know what you mean by "wrong alerts", but I use the following:
>
>       - alert: rebootNode
>         expr: node_boot_time_seconds > (node_boot_time_seconds offset 5m +
> 5)
>         labels:
>           severity: warning
>         annotations:
>           summary: 'Device rebooted at {{ $value | humanizeTimestamp }}'
>
> On Wednesday, 27 April 2022 at 15:43:20 UTC+2 [email protected] wrote:
>
>> Hello,
>>
>> I would like to monitor reboot of the server, when server reboots need to
>> send alert via alertmanager.
>>
>> Currently I am using following expression
>> expr: rate(node_boot_time{job="kubernetes-service-endpoints"} [1h])*
>> on(instance) group_left(nodename)
>> group(node_uname_info{})by(instance,nodename)>0 or
>>
>> rate(node_boot_time{job="kubernetes-service-endpoints"} [1h])>0
>>
>> But I can see wrong alerts are keep populating in my mail box.
>>
>> Could you please provide me expression we can use other than what I had
>> used.
>>
>> Thanks
>> DV
>>
> --
> 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/e5dbc0b4-452e-44ec-b1ed-dfb27e73b88bn%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/e5dbc0b4-452e-44ec-b1ed-dfb27e73b88bn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Julius Volz
PromLabs - promlabs.com

-- 
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/CAObpH5wH3Zc6vGFBkU9DTP_94sNUQed_UoDQ0f6LKDKrk0VzTQ%40mail.gmail.com.

Reply via email to