AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-579863

NikolaS's questions

Martin Hope
NikolaS
Asked: 2020-09-20 08:43:19 +0800 CST

启动collectd.service时如何解决“活动:激活(自动重启)”?

  • 0

我在通过命令安装的 Fedora 31 64 位操作系统中启动collectd.serivce时遇到问题。sudo dnf install collectd当我输入时,sudo systemctl status collectd.service我得到以下输出:

    ● collectd.service - statistics collection daemon
       Loaded: loaded (/etc/systemd/system/collectd.service; enabled; vendor preset: disabled)
       Active: activating (auto-restart) since Sat 2020-09-19 18:18:47 CEST; 3s ago
         Docs: man:collectd(1)
      Process: 3796 ExecStart=/usr/sbin/collectd (code=exited, status=0/SUCCESS)
     Main PID: 3796 (code=exited, status=0/SUCCESS)
          CPU: 7ms

顺便说一句,我不得不手动创建collectd.service位于/etc/systemd/system/目录中的文件。真正奇怪的是我在上述输出中不断收到激活(自动重启) 状态=0/成功。我还按相应的顺序执行了以下命令:

  1. sudo systemctl daemon-reload
  2. sudo systemctl stop collectd.service
  3. sudo systemctl start collectd.service

...但没有任何改变,我已经尝试重新启动计算机并执行所有提到的 1)-3) 步骤,但没有任何帮助。顺便说一句,这是我的collectd.service:

[Unit]
Description=statistics collection daemon
Documentation=man:collectd(1)
After=local-fs.target network.target
Requires=local-fs.target network.target

[Service]
ExecStart=/usr/sbin/collectd
Restart=always
RestartSec=10
StandardOutput=syslog
StandardError=syslog

[Install]
WantedBy=multi-user.target

这是我的/etc/collectd.conf文件的样子:

#
# Config file for collectd(1).
# Please read collectd.conf(5) for a list of options.
# http://collectd.org/
#

##############################################################################
# Global                                                                     #
#----------------------------------------------------------------------------#
# Global settings for the daemon.                                            #
##############################################################################

#Hostname    "localhost"
FQDNLookup   true
#BaseDir     "/var/lib/collectd"
#PIDFile     "/var/run/collectd.pid"
PluginDir   "/usr/lib64/collectd"
TypesDB     "/usr/share/collectd/types.db"

LoadPlugin cpu

<Plugin cpu>
  ReportByCpu false
  ReportByState false
#  Interval 1
  ValuesPercentage true
#  ReportNumCpu false
#  ReportGuestState false
#  SubtractGuestState true
</Plugin>

<Plugin memory>
        ValuesAbsolute false
        ValuesPercentage true
</Plugin>

Include "/etc/collectd.d"
LoadPlugin syslog
LoadPlugin logfile
#LoadPlugin log_logstash

<Plugin logfile>
        LogLevel info
        File "/var/log/error_syslog"
        Timestamp true
#       PrintSeverity false
</Plugin>

#<Plugin log_logstash>
#       LogLevel info
#       File "/var/log/collectd.json.log"
#</Plugin>

<Plugin syslog>
        LogLevel info
</Plugin>
Include "/etc/collectd.d"

更新1:

这是我得到的日志文件(在文件中设置)的输出:/var/log/error_syslogcollectd.conf

[2020-09-20 11:04:25] plugin_dispatch_values: No write callback has been registered. Please load at least one output plugin, if you want the collected data to be stored.
[2020-09-20 11:04:25] Filter subsystem: Built-in target `write': Dispatching value to all write plugins failed with status 2 (ENOENT). Most likely this means you didn't load any write plugins.
[2020-09-20 11:04:25] Available write targets:: [none]
[2020-09-20 11:04:25] Available write targets:: [none]
[2020-09-20 11:04:25] Available write targets:: [none]
[2020-09-20 11:04:25] Available write targets:: [none]
[2020-09-20 11:04:25] Available write targets:: [none]
[2020-09-20 11:04:25] Available write targets:: [none]
[2020-09-20 11:04:25] collectd: Stopping 5 write threads.
[2020-09-20 11:04:35] plugin_load: plugin "cpu" successfully loaded.
[2020-09-20 11:04:35] plugin_load: plugin "memory" successfully loaded.
[2020-09-20 11:04:35] Initialization complete, entering read-loop.
[2020-09-20 11:04:35] Exiting normally.
[2020-09-20 11:04:35] plugin_dispatch_values: No write callback has been registered. Please load at least one output plugin, if you want the collected data to be stored.
[2020-09-20 11:04:35] collectd: Stopping 5 read threads.
[2020-09-20 11:04:35] Filter subsystem: Built-in target `write': Dispatching value to all write plugins failed with status 2 (ENOENT). Most likely this means you didn't load any write plugins.
[2020-09-20 11:04:35] Available write targets:: [none]
[2020-09-20 11:04:35] Available write targets:: [none]
[2020-09-20 11:04:35] Available write targets:: [none]
[2020-09-20 11:04:35] Available write targets:: [none]
[2020-09-20 11:04:35] Available write targets:: [none]
[2020-09-20 11:04:35] Available write targets:: [none]
[2020-09-20 11:04:35] collectd: Stopping 5 write threads.

非常感谢任何建议/指出我如何解决这个问题的正确方向。

bash fedora systemd collectd
  • 1 个回答
  • 8545 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve