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

JavaScript implements AI tic-tac-toe game through the maximum and minimum algorithm

Without further ado, let’s run the screenshot dir...

HTML mouse css control

Generally speaking, the mouse is displayed as an u...

Detailed explanation of docker entrypoint file

When writing a Dockerfile, include an entrypoint ...

Pure CSS to achieve the list pull-down effect in the page

You may often see the following effect: That’s ri...

Summary of experience in using div box model

Calculation of the box model <br />Margin + ...

Detailed explanation of the four transaction isolation levels in MySQL

The test environment of this experiment: Windows ...

Detailed explanation of mixed inheritance in Vue

Table of contents The effect of mixed inheritance...

Overview and Introduction to Linux Operating System

Table of contents 1. What is an Operating System ...

Markup Language - Image Replacement

Click here to return to the 123WORDPRESS.COM HTML ...

How to move mysql5.7.19 data storage location in Centos7

Scenario: As the amount of data increases, the di...