Just another IT site ※IT系の記事は当方環境での実施内容となるため実施する場合は自己責任でお願いいたします。At Your Own Risk!! TURN BACK WHILE YOU CAN
PR

【後で読む】zabbix管理画面からエージェントサーバ上でリモートコマンドを実行する

※IT系の記事は当方環境での実施内容となるため実施する場合は自己責任でお願いいたします。スクリプトはAI生成のものも多いのでコピー&ペーストの際は文字コードに注意ください!

リモートコマンド実行しようとすると、

Zabbixサーバーによるスクリプト実行は設定により無効化されています

と出てしまうことへの対処。

Zabbix-Server側設定

/etc/zabbix/zabbix_server.conf
EnableGlobalScripts=1

【Zabbix】「Zabbixサーバーによるスクリプト実行は設定により無効化されています。」の解決方法 | Linux入門速報

EnableGlobalScripts=1 にして、pingは成功したが、コマンドによっては以下のようなエラーが。さらにzabbixユーザでsudoの設定が必要みたい。

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required

エージェント側でコマンドを実行したい場合のエージェント側の設定

Zabbix-Agent2側設定

スクリプトの実行先はzabbix-agentにする

/etc/zabbix/zabbix_agent2.conf
AllowKey=system.run[*]

 

タイトルとURLをコピーしました