CentOS   发布时间:2022-04-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了centos – 无法启动nagios.service:单元nagios.service无法加载:没有这样的文件或目录大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

我一直关注 this tutorial: $sudo systemctl start nagios Failed to start nagios.service: Unit nagios.service failed to load: No such file or directory. 问题的原因是什么? 我有: $sudo /usr/local/nagios/bin/nagios -v /us
我一直关注 this tutorial
$sudo systemctl start nagios
Failed to start nagios.service: Unit nagios.service Failed to load: No such file or directory.

问题的原因是什么?@H_675_18@

我有:@H_675_18@

$sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.0.8
Copyright (C) 2009-present Nagios Core Development Team and Community Contributors
Copyright (C) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
   Read object config files okay...

Running pre-flight check on configuration data...

checking objects...
    checked 8 services.
    checked 1 hosts.
    checked 1 host groups.
    checked 0 service groups.
    checked 1 contacts.
    checked 1 contact groups.
    checked 24 commands.
    checked 5 time periods.
    checked 0 host escalations.
    checked 0 service escalations.
checking for circular paths...
    checked 1 hosts
    checked 0 service dependencies
    checked 0 host dependencies
    checked 5 timeperiods
checking global event handlers...
checking obsessive compulsive processor commands...
checking misc setTings...

@R_635_10586@l Warnings: 0
@R_635_10586@l Errors:   0

Things look okay - No serIoUs problems were detected during the pre-flight check
我创建了这个文件
sudo vi /etc/systemd/system/nagios.service

添加以下内容:@H_675_18@

[Unit]
Description=Nagios
BindTo=network.target


[Install]
WantedBy=multi-user.target

[service]
User=nagios
Group=nagios
Type=simple
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg

然后是以下内容:@H_675_18@

sudo systemctl enable /etc/systemd/system/nagios.service
   sudo systemctl  start nagios
   sudo systemctl  restart nagios

大佬总结

以上是大佬教程为你收集整理的centos – 无法启动nagios.service:单元nagios.service无法加载:没有这样的文件或目录全部内容,希望文章能够帮你解决centos – 无法启动nagios.service:单元nagios.service无法加载:没有这样的文件或目录所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。