首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >个人服务的正常运行时间

个人服务的正常运行时间
EN

Server Fault用户
提问于 2017-01-09 19:25:42
回答 1查看 3K关注 0票数 2

我正在生产服务器上运行多个独角兽进程。现在,我想检查我的服务的单个服务正常运行时间。例如,如果任何独角兽进程自动重新启动,它应该开始记录其正常运行时间。通过这种方式,我想计算服务自上一次start/restart/reload以来的正常运行时间,注意:这里我不是在讨论服务器正常运行时间,可以使用uptime命令了解它,如下所示。

代码语言:javascript
运行
复制
$ uptime
 19:11:25 up 2 days, 21:28,  1 user,  load average: 0.11, 0.09, 0.11

我想知道个人服务的正常运行时间,比如nginx的正常运行时间。

有可能不知何故知道吗?

EN

回答 1

Server Fault用户

回答已采纳

发布于 2017-01-09 19:35:09

莫尼特在这方面做得很好。

monit status命令清楚地显示了这些信息:

代码语言:javascript
运行
复制
Process 'ssh'
  status                            Running
  monitoring status                 Monitored
  pid                               11239
  parent pid                        1
  uid                               0
  effective uid                     0
  gid                               0
  uptime                            32d 5h 1m
  children                          230
  memory                            1.2 MB
  memory total                      2.0 GB
  memory percent                    0.0%
  memory percent total              0.6%
  cpu percent                       0.0%
  cpu percent total                 0.1%
  data collected                    Mon, 09 Jan 2017 11:34:08

Process 'cron'
  status                            Running
  monitoring status                 Monitored
  pid                               669744
  parent pid                        1
  uid                               0
  effective uid                     0
  gid                               0
  uptime                            1m
  children                          0
  memory                            1.2 MB
  memory total                      1.2 MB
  memory percent                    0.0%
  memory percent total              0.0%
  cpu percent                       0.0%
  cpu percent total                 0.0%
  data collected                    Mon, 09 Jan 2017 11:34:08

Process 'newrelic'
  status                            Running
  monitoring status                 Monitored
  pid                               11377
  parent pid                        1
  uid                               495
  effective uid                     495
  gid                               495
  uptime                            32d 5h 1m
  children                          1
  memory                            500.0 kB
  memory total                      8.3 MB
  memory percent                    0.0%
  memory percent total              0.0%
  cpu percent                       0.0%
  cpu percent total                 0.0%
  data collected                    Mon, 09 Jan 2017 11:34:08
票数 3
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/825150

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档