Zabbix monitors the process of Linux system services

Zabbix monitors the process of Linux system services

Zabbix automatically discovers rules to monitor service units in Linux systems

  • Project requirements: View the service units of the Linux system through the systemctl command;
  • Monitoring prerequisite: the zabbix environment has been set up;
  • Monitoring principle: Send the results returned by the systemctl command to zabbix in json format through a shell script;

1. Write a script in the scripts directory. The script content is as follows:

2. Write the configuration file in the /etc/zabbix_agentd.conf.d directory. The content is as follows:

vim service_status.conf

UserParameter=service.status,/usr/local/zabbix/scripts/service_status.sh

3. Restart zabbix_agentd:

systemctl restart zabbix_agentd

4. Create a template in the zabbix web interface. The monitoring items of the template are done through automatic discovery rules. The contents of the automatic discovery rules are as follows:

Definition of the key value of the monitoring item prototype:

 system.run[cat /tmp/service_status.txt | grep -w '{#SN}' | awk '{print $1" "$2" "$3" "$4}' | awk '{print $NF}',]

5. View the results in the latest data:

Summarize

The above is the process of Zabbix monitoring Linux system services introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Detailed explanation of Zabbix monitoring SQL Server service status
  • Tutorial on how to deploy zabbix server monitoring under ubuntu system
  • Teach you how to deploy zabbix service on saltstack

<<:  Using JS to implement a simple calculator

>>:  How to use Navicat to export and import mysql database

Recommend

Example of how to build a Mysql cluster with docker

Docker basic instructions: Update Packages yum -y...

MySQL foreign key (FOREIGN KEY) usage case detailed explanation

Introduction: The disadvantages of storing all da...

Complete steps to quickly build a vue3.0 project

Table of contents 1. We must ensure that the vue/...

Use image to submit the form instead of using button to submit the form

Copy code The code is as follows: <form method...

Detailed explanation of DIV+CSS naming rules can help achieve SEO optimization

1. CSS file naming conventions Suggestion: Use le...

Nginx monitoring issues under Linux

nginx installation Ensure that the virtual machin...

Example analysis of the principle and solution of MySQL sliding order problem

This article uses examples to explain the princip...

Design theory: Why are we looking in the wrong place?

I took the bus to work a few days ago. Based on m...

CSS implementation code for drawing triangles (border method)

1. Implement a simple triangle Using the border i...

Common operation commands of MySQL in Linux system

Serve: # chkconfig --list List all system service...

mysql server is running with the --skip-grant-tables option

The MySQL server is running with the --skip-grant...

Beginners learn some HTML tags (2)

Related article: Beginners learn some HTML tags (1...

Steps and pitfalls of upgrading linux mysql5.5 to mysql5.7

Table of contents Linux MySQL 5.5 upgraded to MyS...