I want to diplay the Memory usage, Disk Usage and CPU Load in the following format:
Memory Usage: 33/512MB (6%)
Disk usage: 4.2/20GB (23%)
CPU Load: 0.01
How can I do that?
I want to diplay the Memory usage, Disk Usage and CPU Load in the following format:
How can I do that? |
|||||||||
|
Try this, it works on my Debian system, the details may vary depending on your the implementation of these tools that your OS uses:
If you save the above as a script and run it, you will get (example from my system):
Note that the script above is giving the disk usage for the |
|||||||||||||
|
Check atop. Read this, https://lwn.net/Articles/387202/ See,
You can see load of disk / memory / cpu by apps: For example, disk usage: atop gathered statistics in the directory |
|||
|
There's nothing to display exactly in your particular format, but these provide some of the info, as an alternative it's possible to read valuse from /proc and /sys.
|
|||||
|
I think you need nagios help, for all this plugins/srcipts for nagios are already made and you can download and test without nagios installation. |
|||
|
If you are using solaris, check this out: showcpucount This will give you an idea of how to go about writing your code. |
||||
|