目录
Procstat 是一个 Linux 实用程序,用于显示由其 pid 参数标识的进程的详细信息。
为什么使用 Procstat Telegraf 输入插件?
Procstat Telegraf 插件监控一个或多个进程的资源使用情况。此数据可以帮助您了解进程何时运行以及运行多长时间。Procstat 数据还可以显示您的系统如何分配资源,并为优化进程提供智能。您还可以使用此数据设置阈值和警报,以便您可以主动解决在导致性能下降之前使用过多资源的进程。
如何使用 Telegraf 插件监控 procstat
可以通过 pid 文件、可执行文件名、命令行模式匹配、用户名、systemd 单元名称或 cgroup 名称/路径(按此优先级顺序)指定进程。当提供可执行文件名以获取 pid 时,此插件使用 pgrep。Procstat Telegraf 插件传输每个指定进程的 IO、内存、CPU、文件描述符相关指标。可以设置前缀以隔离各个进程特定的指标。
Procstat 输入插件将根据进程在配置中的指定方式标记进程。如果使用 pid 文件,将生成“pidfile”标签。另一方面,如果使用可执行文件,将生成“exe”标签。
Procstat 插件可以使用几种不同的方法来收集进程数据。这些包括
- pidfile
- exe
- pattern
- user
- systemd_unit
- cgroup
- win_service
关键 procstat 监控指标
Procstat 可以监控各种指标,包括
- procstat
- 标签
- pid(当 pid_tag 为 true 时)
- cmdline(当 'cmdline_tag' 为 true 时)
- process_name
- pidfile(当定义时)
- exe(当定义时)
- pattern(当定义时)
- user(当选择时)
- systemd_unit(当定义时)
- cgroup(当定义时)
- win_service(当定义时)
- 字段
- child_major_faults (int)
- child_minor_faults (int)
- cpu_time (int)
- cpu_time_guest (float)
- cpu_time_guest_nice (float)
- cpu_time_idle (float)
- cpu_time_iowait (float)
- cpu_time_irq (float)
- cpu_time_nice (float)
- cpu_time_soft_irq (float)
- cpu_time_steal (float)
- cpu_time_system (float)
- cpu_time_user (float)
- cpu_usage (float)
- involuntary_context_switches (int)
- major_faults (int)
- memory_data (int)
- memory_locked (int)
- memory_rss (int)
- memory_stack (int)
- memory_swap (int)
- memory_usage (float)
- memory_vms (int)
- minor_faults (int)
- nice_priority (int)
- num_fds (int, telegraf 可能需要以 root 身份运行)
- num_threads (int)
- pid (int)
- read_bytes (int, telegraf 可能需要以 root 身份运行)
- read_count (int, telegraf 可能需要以 root 身份运行)
- realtime_priority (int)
- rlimit_cpu_time_hard (int)
- rlimit_cpu_time_soft (int)
- rlimit_file_locks_hard (int)
- rlimit_file_locks_soft (int)
- rlimit_memory_data_hard (int)
- rlimit_memory_data_soft (int)
- rlimit_memory_locked_hard (int)
- rlimit_memory_locked_soft (int)
- rlimit_memory_rss_hard (int)
- rlimit_memory_rss_soft (int)
- rlimit_memory_stack_hard (int)
- rlimit_memory_stack_soft (int)
- rlimit_memory_vms_hard (int)
- rlimit_memory_vms_soft (int)
- rlimit_nice_priority_hard (int)
- rlimit_nice_priority_soft (int)
- rlimit_num_fds_hard (int)
- rlimit_num_fds_soft (int)
- rlimit_realtime_priority_hard (int)
- rlimit_realtime_priority_soft (int)
- rlimit_signals_pending_hard (int)
- rlimit_signals_pending_soft (int)
- signals_pending (int)
- voluntary_context_switches (int)
- write_bytes (int, telegraf 可能需要以 root 身份运行)
- write_count (int, telegraf 可能需要以 root 身份运行)
- 标签
- procstat_lookup
- 标签
- exe
- pid_finder
- pid_file
- pattern
- prefix
- user
- systemd_unit
- cgroup
- win_service
- result
- 字段
- pid_count (int)
- running (int)
- result_code (int, success = 0, lookup_error = 1)
- 标签
有关更多信息,请查看文档。