Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

โ€œInvest in yourself โ€” your confidence is always worth it.โ€

Explore Cosmetic Hospitals

Start your journey today โ€” compare options in one place.

How to monitor a service of windows where service name changes on every restart zabbix?

Monitoring a Windows service with a changing name using Zabbix can be complex due to the changing service name. One approach is to use Zabbix’s LLD (Low-Level Discovery) feature along with scripting to dynamically discover and monitor the changing service.

Method – 1

Here’s a step-by-step guide:

Create a PowerShell Script:

Write a PowerShell script that discovers the service name each time it’s executed. The script should output JSON in a specific format that Zabbix understands for LLD.


$services = Get-Service | Where-Object { $_.Status -eq "Running" } | Select-Object -Property DisplayName

$discoveryResult = @()
foreach ($service in $services) {
    $discoveryResult += @{
        "{#SERVICE_NAME}" = $service.DisplayName
    }
}

$discoveryResult | ConvertTo-Json
Code language: PHP (php)

  1. Configure LLD Rule in Zabbix: In Zabbix, create a discovery rule that uses the PowerShell script to discover the running services. Define a LLD rule that processes the JSON output from the script.
  2. Create Item Prototypes: Once services are discovered, you can create item prototypes based on the discovered services. These item prototypes will monitor the status of each service.
  3. Create Trigger Prototypes: Similarly, create trigger prototypes for each item prototype to raise alerts based on the service status.
  4. Configure Host: Set up a Zabbix host for the Windows machine you’re monitoring. Associate the discovery rule and item prototypes with this host.
  5. Schedule Discovery: Configure a schedule for the discovery rule so that Zabbix runs the PowerShell script at regular intervals.

With this setup, Zabbix will dynamically discover the running services and monitor them accordingly, even if the service name changes on every restart.

Method – 2

There are a few ways to monitor a service of Windows where the service name changes on every restart in Zabbix.

One way is to use the service.active item key. The service.active item key returns the name of the service that is currently running. So, if the service name changes, the Zabbix item will also change.

To do this, you can create a Zabbix item that monitors the service using the service.active item key. In the Params field, specify the name of the service that you want to monitor.

You can also create a Zabbix trigger that is based on the service.active item. The trigger will be triggered if the service name changes.

Method -3

Another way to monitor a service of Windows where the service name changes on every restart in Zabbix is to use the service.info item key. The service.info item key returns the current name of the service. So, if the service name changes, the Zabbix item will also change.

To do this, you can create a Zabbix item that monitors the service using the service.info item key. In the Params field, specify the name of the service that you want to monitor.

You can also create a Zabbix trigger that is based on the service.info item. The trigger will be triggered if the service name changes.

Finally, you can also use the service.state item key to monitor a service of Windows where the service name changes on every restart in Zabbix. The service.state item key returns the state of the service as a number. The following values are possible:

  • 0: The service is not running.
  • 1: The service is running.
  • 2: The service is starting.
  • 3: The service is stopping.

You can use the service.state item key to create a Zabbix trigger that monitors the state of the service and generates an alert if the state changes.

Can you use regular expression in service name?

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services โ€” all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Top 10 AI Presentation Design Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, AI presentation design tools have become indispensable for professionals, educators, and students aiming to create visually stunning and impactful slide decks with minimal effort….

Read More

Top 10 Presentation Software Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, creating engaging and impactful presentations is more than just slides with bullet pointsโ€”itโ€™s about telling a story, conveying ideas visually, and keeping your audience…

Read More

Should A Student Use ChatGPT To Learn DevOps Instead Of Courses?

As a student looking to learn DevOps, you might be wondering if ChatGPT is a good alternative to traditional courses. While there are some benefits to using…

Read More

Top 10 Digital Signature Software Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, digital transformation has reshaped the way businesses manage documents, sign agreements, and engage with clients. Digital signatures have become an essential component of this…

Read More

Top 10 Graphics Design Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, graphics design tools are more essential than ever for businesses, content creators, designers, and marketers across industries. From creating brand identities and advertising materials…

Read More

How to Optimize Your headless CMS for Multilingual Websites

A multilingual site enables a company to internationalize itself to different audiences for better engagement and ultimately, international brand awareness. However, without the proper considerations with the…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x