Detailed explanation of zabbix executing scripts or instructions on remote hosts

Detailed explanation of zabbix executing scripts or instructions on remote hosts

Scenario Requirements

1. We can use the script function of the zabbix_server web interface to remotely shut down the host where zabbix_agent is installed without manually logging in and entering the shutdown command.

2,. We can start, shut down and restart a service through the script function of the zabbix_server web interface

Experimental configuration process

1. Create a script

Open the zabbix_server web configuration interface, select Management, then select the Script option in the blue navigation bar, and finally click Create Script.

[External link image transfer failed. The source site may have an anti-hotlink mechanism. It is recommended to save the image and upload it directly (img-NkHO93RH-1584329271250)

insert image description here

Script name: Custom

Type: If it is a window or Linux host type, select script. IPMI type (not discussed yet)

There are three types of execution:

(1) Zabbix client, indicating that the created script will be run on the host where the Zabbix client is installed.
(2) zabbix_server (agent), indicating that the script will be executed on the zabbix agent.
(3) Zabbix server, indicating that the script will be executed on the server.

Command: You can fill in the system command or the absolute path of a script

Required host permissions: Select the default

Create a script to display the host ip

insert image description here

Important: After the script is created, you must enable the zabbix client to execute remote commands in the zabbix_agent configuration file

insert image description here

Change the default EnableRemoteCommands=0 EnableRemoteCommands=1

Restart the zabbix client to make the configuration take effect

After the script is created, we go to the monitoring in the web interface of zabbix_server, then find the latest data in the blue navigation bar, and find a window host that has already installed the zabbix client to execute it. Because ifconfig is a system command of the Linux host, the test can only be performed on a Linux host with the Zabbix client installed.

insert image description here

Then in the host column, left-click the host name, and some of our custom and built-in scripts will appear. The script that displays the IP is the one we just created.

insert image description here

Execution Results

insert image description here

Normally displays the IP address of the Linux host where the Zabbix client is installed

Summarize

This is the end of this article about Zabbix executing remote host scripts or instructions. For more relevant Zabbix execution remote host content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Zabbix monitors Linux hosts based on snmp
  • Detailed steps for adding hosts you need to monitor in zabbix
  • Get the IP and host name of all hosts on Zabbix
  • Python gets the host through the zabbix api
  • Detailed explanation of how to call zabbix API to obtain the host
  • How to set up Zabbix to monitor Linux hosts
  • Graphical steps of zabbix monitoring vmware exsi host

<<:  Vue realizes the logistics timeline effect

>>:  Examples of using MySQL pessimistic locking and optimistic locking

Recommend

MySQL 5.7.17 installation and configuration graphic tutorial

The blogger said : I have been writing a series o...

Detailed tutorial on installing phpMyAdmin on Ubuntu 18.04

We will install phpMyAdmin to work with Apache on...

Semantics, writing, and best practices of link A

The semantics, writing style, and best practices ...

Nginx configuration PC site mobile site separation to achieve redirection

Use nginx to configure the separation of PC site ...

Common styles of CSS animation effects animation

animation Define an animation: /*Set a keyframe t...

Steps to solve the MySQL 8.0 time zone problem

Software Version Windows: Windows 10 MySQL: mysql...

Installation process of zabbix-agent on Kylin V10

1. Download the installation package Download add...

A brief discussion on this.$store.state.xx.xx in Vue

Table of contents Vue this.$store.state.xx.xx Get...

Detailed analysis of the blocking problem of js and css

Table of contents DOMContentLoaded and load What ...

Complete steps for using Echarts and sub-packaging in WeChat Mini Program

Preface Although the holiday is over, it shows up...

Web page header optimization suggestions

Logo optimization: 1.The logo image should be as ...

Font references and transition effects outside the system

Copy code The code is as follows: <span style=...

How to set the width attribute to the style of the span tag

If you directly set the width attribute to the sty...

How to use Linux locate command

01. Command Overview The locate command is actual...