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

Node uses koa2 to implement a simple JWT authentication method

Introduction to JWT What is JWT The full name is ...

Explanation of the concept and usage of Like in MySQL

Like means "like" in Chinese, but when ...

Detailed analysis of the blocking problem of js and css

Table of contents DOMContentLoaded and load What ...

Three common uses of openlayers6 map overlay (popup window marker text)

Table of contents 1. Write in front 2. Overlay to...

Specific use of Docker anonymous mount and named mount

Table of contents Data volume Anonymous and named...

It's the end of the year, is your MySQL password safe?

Preface: It’s the end of the year, isn’t it time ...

DOCTYPE type detailed introduction

<br />We usually declare DOCTYPE in HTML in ...

How to implement image mapping with CSS

1. Introduction Image maps allow you to designate...

Issues with using Azure Container Registry to store images

Azure Container Registry is a managed, dedicated ...

Vue uses filters to format dates

This article example shares the specific code of ...

Detailed tutorial on integrating Apache Tomcat with IDEA editor

1. Download the tomcat compressed package from th...

How to install Windows Server 2008 R2 on Dell R720 server

Note: All pictures in this article are collected ...

Native javascript+CSS to achieve the effect of carousel

This article uses javascript+CSS to implement the...

Solution to ES memory overflow when starting docker

Add the jvm.options file to the elasticsearch con...