DEV Community

Atsushi Suzuki
Atsushi Suzuki

Posted on

SQLServer service status monitoring on Windows with Prometheu.

This is the procedure for monitoring the service status of SQLServer on Windows with Prometheu.

++++++++++++++++++++++++++++++++
[environment].
prometheus : Ver. 2.23.0
prometheus-alertmanager : Ver. 0.15.3
++++++++++++++++++++++++++++++++

Describe the SQLserver service monitoring rules in the yml file (rules.yml by default) where the monitoring rules are set.
In this case, we will describe a configuration that alerts when the state of the SQLServer service is anything other than ‘started’.

- alert: SQLServer-ServiceDown
  expr: windows_service_state{job="[job name]", name="[target instance service name]", state="running"} == 0   #1 is running, 0 is not running
  for: 7m   #If this duration is exceeded, the alert will change from Warning to Critical. s(seconds) m(minutes)
  labels:
      AlertGp: [alert group name]  #This name is arbitrary. You can set any group label for the alert. This label can be used in alertmanager.yml.
Enter fullscreen mode Exit fullscreen mode

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay