【RHCA+】nmon命令(监控系统资源)

发布时间:2026/11/2 10:55:59

【RHCA+】nmon命令(监控系统资源) “ 目录RHCA - 12 系统监控 - 7 nmon命令监控系统资源 ”监控系统资源语法格式nmon一、nmon1、下载官网https://nmon.sourceforge.io/pmwiki.php?nSite.Download[rootwuzuniao ~]# wget http://sourceforge.net/projects/nmon/files/nmon16e_x86_rhel72 #下载二进制文件[rootwuzuniao ~]# chmod x nmon16e_x86_rhel72 #赋予执行权限[rootwuzuniao ~]# mv nmon16e_x86_rhel72 /usr/sbin/nmon16e #重命名到系统命令目录文件名可任意命名2、使用[rootwuzuniao ~]# nmon16e #执行程序二、njmonnjmon和nmon一样但可以将结果保存为JSON格式文件或保存到InfluxDB1、下载官网https://zh.osdn.net/projects/sfnet_nmon/downloads/njmon_linux_binaries_v78.zip浏览器访问后下载到本地然后本地解压上传对应架构和系统的二进制文件到Linux服务器直接下载到Linux上unzip解压缩不了[rootwuzuniao ~]# chmod x njmon_RHEL7_x86_64_v78 #赋予执行权限[rootwuzuniao ~]# mv njmon_RHEL7_x86_64_v78 /usr/sbin/njmon #重命名到系统命令目录2、使用[rootwuzuniao ~]# njmon #执行程序默认每60s输出一次报告立即回显的为PID号61116[rootwuzuniao ~]#{timestamp: {datetime: 2024-06-26T23:30:53,UTC: 2024-06-26T15:30:53,snapshot_seconds: 60,snapshot_maxloops: -1,snapshot_loop: 1,sleeping: 59.953,execute_time: 0.047,sleep_overrun: 0.001,elapsed: 60.001},identity: {hostname: wuzuniao,fullhostname: wuzuniao,njmon_command: njmon ,njmon_version: njmon4Linux-v78-RHEL-7-x86_64-njmon_linux_v78.c (Sep 23 2021),username: root,userid: 0,fullhostname1: wuzuniao,lo_IP4: 127.0.0.1,ens33_IP4: 192.168.1.160,virbr0_IP4: 192.168.122.1,lo_IP6: ::1,ens33_IP6: 2408:8266:201:a67:5738:bc71:8ce4:c576,ens33_IP6_b: fe80::381f:f8bd:1052:2747,serial-number: VMware-56 4d 7b 83 ed a9 af 6a-98 31 17 5e 2a 29 9a e2,model: VMware Virtual Platform,vendor: VMware, Inc.},os_release: {name: CentOS Linux,version: 7 (Core),pretty_name: CentOS Linux 7 (Core),version_id: 7},proc_version: {version: Linux version 3.10.0-1160.el7.x86_64 (mockbuildkbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Mon Oct 19 16:18:59 UTC 2020},lscpu: {architecture: x86_64,byte_order: Little Endian,cpus: 1,online_cpu_list: 0,threads_per_core: 1,cores_per_socket: 1},cpu_total: {user: 0.133,nice: 0.000,sys: 0.233,idle: 99.299,iowait: 0.017,hardirq: 0.000,softirq: 0.000,steal: 0.000,guest: 0.000,guestnice: 0.000},cpus: {cpu0: {user: 0.133,nice: 0.000,sys: 0.233,idle: 99.299,iowait: 0.017,hardirq: 0.000,softirq: 0.000,steal: 0.000,guest: 0.000,guestnice: 0.000}},stat_counters: {ctxt: 91.832,btime: 1719410534,processes_forks: 0.350,procs_running: 2,procs_blocked: 0},cpuinfo: {proc0: {vendor_id: GenuineIntel,model_name: 12th Gen Intel(R) Core(TM) i5-12400,cpu_mhz: 2496.003,cache_size: 18432.000,physical_id: 0,siblings: 1,core_id: 0,cpu_cores: 1}},proc_meminfo: {MemTotal: 995672,MemFree: 67228,MemAvailable: 290024,Buffers: 0,Cached: 327860,SwapCached: 128,Active: 349816,Inactive: 245760,Active_anon: 189108,Inactive_anon: 90628,Active_file: 160708,Inactive_file: 155132,Unevictable: 0,Mlocked: 0,SwapTotal: 2097148,SwapFree: 2095604,Dirty: 4,Writeback: 0,AnonPages: 267552,Mapped: 40832,Shmem: 12020,Slab: 132656,SReclaimable: 69308,SUnreclaim: 63348,KernelStack: 7168,PageTables: 20836,NFS_Unstable: 0,Bounce: 0,WritebackTmp: 0,CommitLimit: 2594984,Committed_AS: 2147376,VmallocTotal: 34359738367,VmallocUsed: 213544,VmallocChunk: 34359277564,Percpu: 56320,HardwareCorrupted: 0,AnonHugePages: 67584,CmaTotal: 0,CmaFree: 0,HugePages_Total: 0,HugePages_Free: 0,HugePages_Rsvd: 0,HugePages_Surp: 0,Hugepagesize: 2048,DirectMap4k: 108416,DirectMap2M: 940032,DirectMap1G: 0},proc_vmstat: {nr_free_pages: 16807,nr_alloc_batch: 698,nr_inactive_anon: 22657,nr_active_anon: 47277,nr_inactive_file: 38783,nr_active_file: 40177,nr_unevictable: 0,nr_mlock: 0,nr_anon_pages: 49992,nr_mapped: 10208,nr_file_pages: 81997,nr_dirty: 1,nr_writeback: 0,nr_slab_reclaimable: 17327,nr_slab_unreclaimable: 15837,nr_page_table_pages: 5209,nr_kernel_stack: 448,nr_unstable: 0,nr_bounce: 0,nr_vmscan_write: 362,nr_vmscan_immediate_reclaim: 0,nr_writeback_temp: 0,nr_isolated_anon: 0,nr_isolated_file: 0,nr_shmem: 3005,nr_dirtied: 17643,nr_written: 16852,numa_hit: 4734218,numa_miss: 0,numa_foreign: 0,numa_interleave: 19450,numa_local: 4734218,numa_other: 0,workingset_refault: 17541,workingset_activate: 9213,workingset_nodereclaim: 0,nr_anon_transparent_hugepages: 33,nr_free_cma: 0,nr_dirty_threshold: 20309,nr_dirty_background_threshold: 6769,pgpgin: 759175,pgpgout: 104425,pswpin: 20,pswpout: 362,pgalloc_dma: 50937,pgalloc_dma32: 5143258,pgalloc_normal: 0,pgalloc_movable: 0,pgfree: 5211095,pgactivate: 120592,pgdeactivate: 106251,pgfault: 10829508,pgmajfault: 2023,pglazyfreed: 0,pgrefill_dma: 1546,pgrefill_dma32: 116882,pgrefill_normal: 0,pgrefill_movable: 0,pgsteal_kswapd_dma: 1162,pgsteal_kswapd_dma32: 100950,pgsteal_kswapd_normal: 0,pgsteal_kswapd_movable: 0,pgsteal_direct_dma: 0,pgsteal_direct_dma32: 0,pgsteal_direct_normal: 0,pgsteal_direct_movable: 0,pgscan_kswapd_dma: 1380,pgscan_kswapd_dma32: 119539,pgscan_kswapd_normal: 0,pgscan_kswapd_movable: 0,pgscan_direct_dma: 0,pgscan_direct_dma32: 0,pgscan_direct_normal: 0,pgscan_direct_movable: 0,pgscan_direct_throttle: 0,zone_reclaim_failed: 0,pginodesteal: 0,slabs_scanned: 61184,kswapd_inodesteal: 0,kswapd_low_wmark_hit_quickly: 7,kswapd_high_wmark_hit_quickly: 4,pageoutrun: 23,allocstall: 0,pgrotated: 362,drop_pagecache: 0,drop_slab: 0,numa_pte_updates: 0,numa_huge_pte_updates: 0,numa_hint_faults: 0,numa_hint_faults_local: 0,numa_pages_migrated: 0,pgmigrate_success: 0,pgmigrate_fail: 0,compact_migrate_scanned: 0,compact_free_scanned: 0,compact_isolated: 0,compact_stall: 0,compact_fail: 0,compact_success: 0,htlb_buddy_alloc_success: 0,htlb_buddy_alloc_fail: 0,unevictable_pgs_culled: 0,unevictable_pgs_scanned: 0,unevictable_pgs_rescued: 0,unevictable_pgs_mlocked: 0,unevictable_pgs_munlocked: 0,unevictable_pgs_cleared: 0,unevictable_pgs_stranded: 0,thp_fault_alloc: 247,thp_fault_fallback: 14,thp_collapse_alloc: 27,thp_collapse_alloc_failed: 0,thp_split: 14,thp_zero_page_alloc: 0,thp_zero_page_alloc_failed: 0,balloon_inflate: 0,balloon_deflate: 0,balloon_migrate: 0,swap_ra: 17,swap_ra_hit: 8},disks: {sda: {reads: 0.000,rmerge: 0.000,rkb: 0.000,rmsec: 0.000,writes: 0.117,wmerge: 0.000,wkb: 0.450,wmsec: 0.000,inflight: 0,busy: 0.000,backlog: 0.000,xfers: 0.117,bsize: 24576},sr0: {reads: 0.000,rmerge: 0.000,rkb: 0.000,rmsec: 0.000,writes: 0.000,wmerge: 0.000,wkb: 0.000,wmsec: 0.000,inflight: 0,busy: 0.000,backlog: 0.000,xfers: 0.000,bsize: 58368}},networks: {lo: {ibytes: 0.000,ipackets: 0.000,ierrs: 0.000,idrop: 0.000,ififo: 0.000,iframe: 0.000,obytes: 0.000,opackets: 0.000,oerrs: 0.000,odrop: 0.000,ofifo: 0.000,ocolls: 0.000,ocarrier: 0.000},ens33: {ibytes: 41.800,ipackets: 0.533,ierrs: 0.000,idrop: 0.200,ififo: 0.000,iframe: 0.000,obytes: 204.131,opackets: 0.317,oerrs: 0.000,odrop: 0.000,ofifo: 0.000,ocolls: 0.000,ocarrier: 0.000}},uptime: {days: 0,hours: 1,minutes: 28,users: 1},filesystems: {/dev/mapper/centos-root: {fs_dir: /,fs_type: xfs,fs_opts: rw,seclabel,relatime,attr2,inode64,noquota,fs_freqs: 0,fs_passno: 0,fs_bsize: 4096,fs_blocks: 23581440,fs_bfree: 22176871,fs_bavail: 22176871,fs_size_mb: 92115,fs_free_mb: 86628,fs_used_mb: 5487,fs_full_percent: 5.956,fs_avail: 86628,fs_files: 47185920,fs_files_free: 47021778,fs_namelength: 255},/dev/sda1: {fs_dir: /boot,fs_type: xfs,fs_opts: rw,seclabel,relatime,attr2,inode64,noquota,fs_freqs: 0,fs_passno: 0,fs_bsize: 4096,fs_blocks: 259584,fs_bfree: 215702,fs_bavail: 215702,fs_size_mb: 1014,fs_free_mb: 842,fs_used_mb: 172,fs_full_percent: 16.905,fs_avail: 842,fs_files: 524288,fs_files_free: 523948,fs_namelength: 255},/dev/mapper/centos-home: {fs_dir: /home,fs_type: xfs,fs_opts: rw,seclabel,relatime,attr2,inode64,noquota,fs_freqs: 0,fs_passno: 0,fs_bsize: 4096,fs_blocks: 1829376,fs_bfree: 1820116,fs_bavail: 1820116,fs_size_mb: 7146,fs_free_mb: 7109,fs_used_mb: 37,fs_full_percent: 0.506,fs_avail: 7109,fs_files: 3663872,fs_files_free: 3663706,fs_namelength: 255}}}[rootwuzuniao ~]# njmon -? #查看命令帮助njmon: help information. Version:njmon4Linux-v78-RHEL-7-x86_64-njmon_linux_v78.c (Sep 23 2021)- Performance stats collector outputting JSON or Influx Line Protocol format.- If the commend starts with njmon it runs in NJMON mode- If the commend starts with nimon it runs in NIJMON mode- -J forces NJMON mode regardless of the command name- -I forces NIMON mode regardless of the command name- Default is stdout- Core syntax : njmon -s seconds -c count- File output : -m directory -f- Check restart: -k and -K filename- Data options: -H -P -t % -b -d -W -r -n -R -F- Argument file: -a file (do not include the command name)- NJMON Network connection: -i njmond_host -p port- NIMON Network connection: -i InfluxDB_host -p portNIMON InfluxDB Details : -x database [-y username [-x password]]Prometheus mode : -w-! : Version check and immediate exit-? : This help informtion-s seconds : seconds between snapshots of data (default 60 seconds)-c count : number of snapshots (default forever)-m directory : Program will cd to the directory before output-f : Output to file (not stdout) to two files below: NIMON mode - Data: hostname__.influxlp: NJMON mode - Data: hostname__.json: Error: hostname__.err-ff : NIMON mode - Note: a second -f adds a timestamp so this data can be added to InfluxDB later-a file : Command line arguments are in the file (hides passwords): Use the same arguments, all on the first line, space separated: Only have the -a option on the actual command line-H : NIMON mode - Force host tag to be a Fully Qualified Domain Name-k : NIMON mode - Read /tmp/nimon.pid for a running nimon PID if found-k : NJMON mode - Read /tmp/njmon.pid for a running njmon PID if foundstill running then this process exits quietly-K filename : User defined pid filename (implies -k). Allows not using /tmp ormultiple concurrent data captures-I : Force to NIMON mode. Saving InfluxDB Line Protocol data or njmond.py or other Timeseries database-J : Force to NJMON mode. Set njmon mode for JSON format for njmond.py or other Timeseries database-P : Add process stats (take CPU cycles and large stats volume)-t percent : Set ignore process CPU use percent threshold (default 0.01%)-b : Switch of adding pid to the process names: ksh_76927 - ksh-? or -h : This output and stop-d : Switch on debug tracing (output no longer JSON/line protocol format)-D : Disk stats include all devices in /proc/diskstats, not just the real disks-W : Switch off warning messages in error output stream-r : Random start pause. Stops cron making every program send data in sync-n : No PID printed out at start up.-R : Reduced stats - skip logical CPU stats for SMT threads.-F : Switch off filesystem stats (autofs and tmpfs can cause issues)--- NIMON mode options ---- Sent data to InfluxDB (all of these are inportant for InfluxDB):-i hostname : Hostmane or IP address of the influxDB server-p port : InfluxDB port (default is 8086)-x njmon : InfluxDB database name created with influx create database njmon-y user : Mandatory InfluxDB username - if you have set a username for the API (otherwise ignored)-z pass : Mandatory InfluxDB password - if you have set a password for the API (otherwise ignored)-w : For output to Telegraf. Dont send POST, message type or packet size-v : Show data response to InfluxDB on stderrCurrently, InfluxDB security certificates are not implementedExamples:1 Take a look at the Line Protocol data/usr/local/bin/nimon -s 2 -c 3 -f then edit __.influxlp2 Every 1 minute all day using the default port of 8086/usr/local/bin/nimon -s 30 -c 2880 -i influxbox -x njmon -y Nigel -z passwd3 Add process stats use IP address/usr/local/bin/nimon -s 60 -c 1440 -P -i 9.137.62.12 -p 8086 -x njmon -y nag -z XXXX4 Crontab run 1 day - start 1 minute after midnight, save local data every 30 seconds1 0 * * * /usr/local/bin/nimon -s 30 -c 2880 -i influxbox -p 8086 -x njmon -y Nigel -z passwd5 Crontab - hourly check/restart nimon (if nimon is not running)0 * * * * /usr/lbin/nimon -k -s 60 -i influxbox -p 8086 -x njmon -y jane -z j1j1j16 Crontab - as 5 but output for telegraf0 * * * * /usr/lbin/nimon -w -k -s 60 -i influxbox -p 8086 -x njmon -y jane -z j1j1j1--- NJMON mode options or other Time-Series database ---Push data to central njmond daemon:-i ip/host : IP address or Hostname of the njmond central daemon-p port : Port number on njmond.py hostExamples:1 Every 5 mins all day/usr/local/bin/njmon -s 300 -c 288 -f -m /home/perf2 Piping to data handler all day at 30 second intervals/usr/local/bin/njmon -s 30 -c 1440 | myprog3 Use the defaults (-s 60 forever) and save to a file./njmon my_server_today.json4 Send data to the central daemon with no password./njmon -s 30 -c 2880 -i admin.acme.com -p 81815 Send data to the central daemon with process stats and with password./njmon -s 60 -c 1440 -P -i admin.acme.com -p 8181 -X passwordCrontab options:6 Crontab only save to a file (2 minutes past midnight)2 0 * * * /usr/local/bin/njmon -s 60 -c 1440 -f -m /home/perf7 Crontab daily at midnight start sending data to central server0 0 * * * /usr/local/bin/njmon -s 30 -c 2880 -i admin.acme.com -p 81818 Crontab send data to central server check hourly (if njmon is not running)0 * * * * /usr/local/bin/njmon -k -s 30 -i admin.acme.com -p 81819 Crontab use ssh to start njmon, send data back via socket to a local InfluxDB injector program0 0 * * * ssh rootendpoint /usr/local/bin/njmon -s 30 -c 2880 -i admin.acme.com -p 8181[rootwuzuniao ~]#
延伸阅读

更多相关文章

2026/11/2 10:50:57

关于霍夫曼算法的若干问题

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/11/2 11:46:10

Cobalt Strike Beacon隐蔽技术:BeaconGate+UDRL+Sleepmask实战

1. 项目概述在红队攻防对抗中,Cobalt Strike(简称CS)作为主流渗透测试框架,其Beacon载荷的隐蔽性直接决定了攻击行动的成败。最近我在实际项目中遇到了一个棘手问题:传统睡眠混淆技术已逐渐被EDR产品识别,急…

2026/11/2 11:46:10

AI辅助测试用例编写:提示词设计与实践

1. 为什么需要AI辅助测试用例编写 在软件测试领域,编写高质量的测试用例往往需要耗费大量时间。根据业界统计,测试人员平均每天要花费40%的工作时间在用例编写和维护上。传统手工编写方式存在三个明显痛点: 首先,测试场景覆盖率与…

2026/11/2 11:46:10

工业自动化TVA选型:避免误区与全生命周期成本优化

1. 项目概述:TVA选型的核心痛点解析 在工业自动化领域,终端执行器(Terminal Valve Actuator,简称TVA)的选型决策常常陷入两个极端:要么过度关注技术参数表中的数字竞赛,要么单纯追求采购成本最低…

2026/11/2 11:46:10

HTML转PDF实战:渲染引擎选型、分页控制与字体避坑指南

简介:这份资源面向.NET开发者与文档处理场景,聚焦HTML到PDF的转换需求,提供基于Aspose.Pdf库的完整示例工程。压缩包共32个文件,约10.62MB,以cs源码、aspx页面、dll程序集、config配置及pdf示例文档为主,另…

2026/11/2 11:46:10

CTFshow Web安全实战:Base64编码与HTTP头注入解析

1. CTFshow Web安全入门实战解析作为一名长期活跃在CTF赛场的Web安全研究员,我经常遇到新手对CTFshow平台上的Web题目感到困惑。今天我们就来深度剖析CTFshow《Web应用安全与防护》第一章的核心考点,通过6个典型场景带你掌握Web安全基础技能。1.1 Base64…

2026/11/2 11:41:09

城市运管服平台安全架构与关键技术解析

1. 城市运管服平台的安全定位与核心价值 城市运管服平台作为现代城市治理的"数字中枢",其安全防线直接决定了城市运行的底线保障能力。这个看似抽象的概念,在实际场景中体现为:当暴雨导致城市内涝时,平台能否实时感知积…

2026/11/2 6:08:01

面向复杂光照与角度的宠物面部识别鲁棒性增强策略

在智慧养宠时代,基于视觉的宠物身份识别技术正逐步从实验室走向家庭应用。然而,与配合度高的人类不同,宠物是典型的“非合作生物识别对象”——它们不会主动配合摄像头调整姿态,更无法控制光照环境。实际应用中,我们常…

2026/11/2 6:39:12

SSM电子书店源码全解析:结构、原理、部署与排错实战

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/11/2 1:04:04

工业级SPI隔离设计:硬件抗扰与信号完整性实战指南

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/11/2 1:04:04

PLFM_RADAR:主动探测数据通道,构建低误报的数据感知系统

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/11/2 1:04:04

工业SPI隔离设计:MAX14431与STM32F746硬件抗干扰实战

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/11/2 6:08:01

面向复杂光照与角度的宠物面部识别鲁棒性增强策略

在智慧养宠时代,基于视觉的宠物身份识别技术正逐步从实验室走向家庭应用。然而,与配合度高的人类不同,宠物是典型的“非合作生物识别对象”——它们不会主动配合摄像头调整姿态,更无法控制光照环境。实际应用中,我们常…

2026/11/2 6:39:12

SSM电子书店源码全解析:结构、原理、部署与排错实战

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

还想了解更多?直接咨询顾问

免费诊断 + 免费方案 + 透明报价。

全国咨询热线400-8866-253
免费获取方案
☎咨询二维码 ☎ ↑