Could anyone translate some of my objectives to prometheus metrics?

Hi there, I’m new to prometheus and have absolutly 0 dev skills and 0 metrics understanding, I know there are docs about prometheus on their github and tried to read them, but still, I can’t write my own metrics…
Could anyone translate some of my objectives to prometheus metrics ? (i would like creating alerts via alertmanager)
N.B : Everything works (prometheus, alertmanager, prom2teams and grafana), I just need to write the metrics about what I want to monitore :

These are on windows (wmi exporter) :

• Logical disk is nearly full (alert at 5%)
• Physical disk is nearly full (alert at 5%)
• network ok (ping) (alert when ping is nok since 5m)
• CPU above 90% (alert when CPU is above 90% since 1h, with some “servers exceptions”)
• memory above 90% (alert when memory is above 90% since 1h)
• network card is in DHCP instead of static IP
• number of “network packets” in error is above 0 (only on esxi and physical server, not on virtual machine)
More specifics :

• citrix : when citrix services aren’t available since 5 minutes
• sql : when sql server services aren’t available since 5 minutes
• IIS : when iis services aren’t available since 5 minutes
• printing : when spoolers aren’t available since 5 minutes
• oracle : when oracle services aren’t available since 5 minutes
• AD : when AD isn’t available since 5minutes
• DHCP & DNS : when DHCP & DNS services aren’t available since 5 minutes
Thanks in advance to anyone answering my questions :slightly_smiling_face:

That is a big question to ask and answer. But before you can get alert out for Prometheues, you need to get metrics in. It sounds like you have Windows services to monitor. Read about wmi_exporter. It has metrics for cpu, disk, memory, IIS and AD…should cover a lot of your needs.

Start with that, and you wil learn a lot.

Yes indeed its on Windows, I’ve read the doc on wmi metrics but my english and metrics understanding isn’t good enough to write my own promQL queries lol, I can barely understand the metrics from the github samples ^^

You don not need to write your own metrics. wmi_exporter does that for you. That is the idea behind exporters

Install wmi_exporter on a windows server, and scrape it with Prometheus

Yeah I got that part, I don’t wanna write my own metric, i want to write my own query from the metrics ^^ dunno if i’m explaining well what I need

https://awesome-prometheus-alerts.grep.to/rules.html

The wim_exporters are already installed on windows servers and I get their metrics

Wow nice link a lot of sample, i’ll try to steal them and adapt them to my use, thanks :open_mouth: