This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ vi /home/usage/check_data.py | |
... | |
#cpu usage | |
status, cpu_usage = commands.getstatusoutput("""mpstat 1 1 | tail -n 1 | awk '{print 100-$NF}'""") | |
... | |
$ tail /var/log/usage_per_min.log | |
LOG_DATE:2020/06/08 15:45 | CPU_USAGE:2% | CONN_NUMBER:1 | DISK_USAGE:3.72% (total 80.14GB) | MEM_USAGE:4.98% (total 3.92GB) | |
LOG_DATE:2020/06/08 15:46 | CPU_USAGE:1.51% | CONN_NUMBER:0 | DISK_USAGE:3.72% (total 80.14GB) | MEM_USAGE:4.9% (total 3.92GB) | |
LOG_DATE:2020/06/08 15:47 | CPU_USAGE:2.01% | CONN_NUMBER:0 | DISK_USAGE:3.72% (total 80.14GB) | MEM_USAGE:4.92% (total 3.92GB) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ vi /home/usage/check_data.py | |
... | |
#cpu usage | |
status, cpu_usage = commands.getstatusoutput("""mpstat | tail -n 1 | awk '{print 100-$NF}'""") | |
... | |
$ tail /var/log/usage_per_min.log | |
LOG_DATE:2020/06/08 15:13 | CPU_USAGE:1.46% | CONN_NUMBER:0 | DISK_USAGE:3.72% (total 80.14GB) | MEM_USAGE:4.9% (total 3.92GB) | |
LOG_DATE:2020/06/08 15:14 | CPU_USAGE:1.46% | CONN_NUMBER:0 | DISK_USAGE:3.72% (total 80.14GB) | MEM_USAGE:4.9% (total 3.92GB) | |
LOG_DATE:2020/06/08 15:15 | CPU_USAGE:1.46% | CONN_NUMBER:0 | DISK_USAGE:3.72% (total 80.14GB) | MEM_USAGE:4.9% (total 3.92GB) |