Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does zabbix monitor Linux system services

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how zabbix monitors Linux system services, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Zabbix automatic Discovery rules Monitoring service units of Linux system

Project requirements: check the service units of Linux system through systemctl command

Monitoring premise: the zabbix environment has been set up

Monitoring principle: send the result returned by systemctl command to zabbix in json format through 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 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 web interface of zabbix. The monitoring items of the template are done by automatically discovering rules, and the automatic discovery rules are as follows:

Definition of the key value of the monitor 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:

The above is all the contents of the article "how zabbix monitors Linux system Services". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report