CentOS7无法安装Nagios代理

Unable to install Nagios agent on CentOS7

当我尝试安装从 (http://assets.nagios.com/downloads/nagiosxi/agents/linux-nrpe-agent.tar.gz) 下载的代理时,出现 firewalld 错误。我能找到的唯一解决方案是启用防火墙,但我不想。

2,我试过这个命令"cat /dev/null > 4-firewall"。但是安装程序也返回错误“失败的脚本是:'./A-subcomponents'

有解决办法吗?

    ============================
Nagios Linux Agent Installer
============================

This script will install the Nagios Linux Agent by executing all necessary
sub-scripts.

IMPORTANT: This script should only be used on a clean installed system:

RedHat Enterprise, CentOS, Fedora, or Oracle
OpenSUSE or SUSE Enterprise
Ubuntu or Debian

Do NOT use this on a system running any other distro or that
does not allow additional package installation.

Do you want to continue? [Y/n] y
Proceeding with installation...
Running './0-repos'...
Configuring Repos...
epel-release RPM installed OK
Repos configured OK
RESULT=0
Running './1-prereqs'...
Installing prerequisites...
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: anorien.csc.warwick.ac.uk
* epel: epel.besthosting.ua
* extras: centos.hyve.com
* rpmforge: apt.sw.be
* updates: centos.mirroring.pulsant.co.uk
Package autoconf-2.69-11.el7.noarch already installed and latest version
Package gcc-4.8.3-9.el7.x86_64 already installed and latest version
Package glibc-2.17-78.el7.x86_64 already installed and latest version
Package libmcrypt-devel-2.5.8-13.el7.x86_64 already installed and latest version
Package 1:make-3.82-21.el7.x86_64 already installed and latest version
Package 1penssl-devel-1.0.1e-42.el7.9.x86_64 already installed and latest version
Package sudo-1.8.6p7-13.el7.x86_64 already installed and latest version
Package sysstat-10.1.5-7.el7.x86_64 already installed and latest version
Package 2:xinetd-2.3.15-12.el7.x86_64 already installed and latest version
Package bc-1.06.95-13.el7.x86_64 already installed and latest version
Nothing to do
Prerequisites installed OK
RESULT=0
Running './2-usersgroups'...
Adding users and groups...
useradd: user 'nagios' already exists
groupadd: group 'nagios' already exists
useradd: user 'nagios' already exists
groupadd: group 'nagcmd' already exists
Users and groups added OK
RESULT=0
Running './3-services'...
/etc/services updated
RESULT=0
Running './4-firewall'...
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.
FirewallD is not running
RESULT=252

===================
INSTALLATION ERROR!
===================
Installation step failed - exiting.
Check for error messages in the install log (install.log).

If you require assistance in resolving the issue, please include install.log
in your communications with Nagios XI technical support.

The script that failed was: './4-firewall' 

在包含 fullinstall 的同一文件夹中,尝试通过执行以下命令创建一个空 installed.firewall 文件:

touch installed.firewall

然后重新尝试运行

./fullinstall

这是基于4-firewall的第12行:

# Was this step already completed?
if [ -f installed.firewall ]; then
    echo "Firewall rules already configured - skipping."
    exit 0
fi

如果该目录中存在名为 installed.firewall 的文件,则应跳过防火墙配置步骤。

您也可以使用以下命令在您的服务器上启用 firewalld。

要启用 firewalld,

systemctl enable firewalld

启动firewalld

systemctl start firewalld

检查 firewalld 的状态

systemctl status firewalld