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 Influencer Marketing Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, AI influencer marketing tools have become indispensable for brands navigating the dynamic world of social media marketing. These platforms leverage artificial intelligence to streamline…

Read More

Top 10 Digital Asset Management (DAM) Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, managing digital assets has become more important than ever. As organizations continue to create, store, and manage vast quantities of digital contentโ€”whether images, videos,…

Read More

The Main Challenges of Metaverse Game Development

The news about tech giants investing in metaverse development ignited a lot of discussions about its potential use cases. GameDev has turned up at the forefront of…

Read More

Top 10 AI Data Integration Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, AI data integration tools are pivotal for businesses navigating the complexities of modern data ecosystems. These tools combine artificial intelligence with data integration processes…

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

Top 10 AI Ad Copy Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, AI ad copy tools have become indispensable for marketers, businesses, and content creators aiming to craft compelling, high-converting advertisements at scale. These tools leverage…

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