Re: [prometheus-users] server uptime

2023-02-21 Thread Stuart Clark

On 21/02/2023 09:56, sri L wrote:

Thanks for your reply Julius Volz.
Yes, we are monitoring servers with Node Exporter. We are looking for 
Uptime average based on calendar Month instead of last 30 days.
For example, February Month it should give the uptime average for 
28days i.e., 1st Feb to 28th feb


On Saturday, February 18, 2023 at 2:11:33 AM UTC+5:30 Julius Volz wrote:

Assuming you are monitoring your servers via something like the
Node Exporter, and you want the trailing 30-day upness percentage,
you could use the Node Exporters "up" metric like this:

    avg_over_time(up{job="node"}[30d]) * 100


You would need to adjust the query to be

avg_over_time(up{job="node"}[28d]) * 100

--
Stuart Clark

--
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 prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/4af97a2d-03c6-3cc5-c173-ec5cd01b6d44%40Jahingo.com.


Re: [prometheus-users] server uptime

2023-02-21 Thread sri L
Thanks for your reply Julius Volz. 
Yes, we are monitoring servers with Node Exporter. We are looking for 
Uptime average based on calendar Month instead of last 30 days. 
For example, February Month it should give the uptime average for 28days 
i.e., 1st Feb to 28th feb

On Saturday, February 18, 2023 at 2:11:33 AM UTC+5:30 Julius Volz wrote:

> Assuming you are monitoring your servers via something like the Node 
> Exporter, and you want the trailing 30-day upness percentage, you could use 
> the Node Exporters "up" metric like this:
>
> avg_over_time(up{job="node"}[30d]) * 100
>
> This is assuming that the scrape interval is not changing over those 30d, 
> as otherwise you would be weighting some periods (the ones with a higher 
> scrape frequency) more than others.
>
> On Fri, Feb 17, 2023 at 5:25 AM sri L  wrote:
>
>> Hi all,
>>
>> I am looking for server uptime percentage metrics on a monthly basis
>> Example: If server is down for 60hrs out of 720hrs of a month the uptime 
>> has to show 91.66% in dashboard
>>
>> Please suggest if you have a relevant expression to serve this purpose
>>
>> Thanks
>>
>> -- 
>> 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 prometheus-use...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/prometheus-users/e34b891c-a5ea-43c8-b567-83588354f831n%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> 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 prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/9a0eb1cd-fc79-4eb4-a3fe-d088cc09bc81n%40googlegroups.com.


Re: [prometheus-users] server uptime

2023-02-17 Thread Julius Volz
Assuming you are monitoring your servers via something like the Node
Exporter, and you want the trailing 30-day upness percentage, you could use
the Node Exporters "up" metric like this:

avg_over_time(up{job="node"}[30d]) * 100

This is assuming that the scrape interval is not changing over those 30d,
as otherwise you would be weighting some periods (the ones with a higher
scrape frequency) more than others.

On Fri, Feb 17, 2023 at 5:25 AM sri L  wrote:

> Hi all,
>
> I am looking for server uptime percentage metrics on a monthly basis
> Example: If server is down for 60hrs out of 720hrs of a month the uptime
> has to show 91.66% in dashboard
>
> Please suggest if you have a relevant expression to serve this purpose
>
> Thanks
>
> --
> 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 prometheus-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/e34b891c-a5ea-43c8-b567-83588354f831n%40googlegroups.com
> 
> .
>


-- 
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 prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CAObpH5yQLYm-o-WCucJSB9i2vO2Ah2Br7fKdc8hbbd2vTC2qUg%40mail.gmail.com.


[prometheus-users] server uptime

2023-02-16 Thread sri L
Hi all,

I am looking for server uptime percentage metrics on a monthly basis
Example: If server is down for 60hrs out of 720hrs of a month the uptime 
has to show 91.66% in dashboard

Please suggest if you have a relevant expression to serve this purpose

Thanks

-- 
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 prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/e34b891c-a5ea-43c8-b567-83588354f831n%40googlegroups.com.