MBU (Machine Basic Usage) is a system that provides basic machine information via HTTP.
With MBU you can get the following information from the machine it is installed on.
- CPU usage
- RAM usage
- Disk usage
MBU uses the port 7007 by default. If you want to change it just change the port number in the file: mbu.toml.
Execute these steps in you terminal.
git clone git@github.com:julianespinel/mbu.git
cd mbu
./mbu
You can access the information provided by MBU directly from your web browser or from an HTTP client.
You can copy and paste the following lines in your browser to see the information from the host MBU is installed on:
http://localhost:7007/mbu/admin/ping
http://localhost:7007/mbu/api/cpu
http://localhost:7007/mbu/api/ram
http://localhost:7007/mbu/api/disk
http://localhost:7007/mbu/api/all
For more information about the services offered by MBU please check the API section of this readme.
Request:
GET http://localhost:7007/mbu/api/all
Response:
{
"cpu": {
"numberOfCores": 4,
"averageUsagePercentage": 10.801282,
"usagePercentagePerCore": [
5,
23.076923,
5.1282053,
10
]
},
"ram": {
"totalGB": 7.612256,
"usedGB": 2.0867763,
"availableGB": 5.52548,
"usagePercentage": 27.413372
},
"disk": {
"totalGB": 976.49677,
"usedGB": 53.40926,
"availableGB": 923.08746,
"usagePercentage": 5.4694767
}
}
MBU provides the following 5 services:
Use the ping service to check the health of MBU.
Request:
GET http://localhost:7007/mbu/admin/ping
Response:
pong
Provides CPU usage information.
Request:
GET http://localhost:7007/mbu/api/cpu
Response:
{
"numberOfCores": 4,
"averageUsagePercentage": 13.351047,
"usagePercentagePerCore": [
7.692308,
22.5,
5.263158,
17.948719
]
}
Provides RAM usage information.
Request:
GET http://localhost:7007/mbu/api/ram
Response:
{
"totalGB": 7.612256,
"usedGB": 2.9295201,
"availableGB": 4.682736,
"usagePercentage": 38.484257
}
Provides disk usage information.
Request:
GET http://localhost:7007/mbu/api/disk
Response:
{
"totalGB": 976.49677,
"usedGB": 53.44063,
"availableGB": 923.0561,
"usagePercentage": 5.472689
}
Provides CPU, RAM and disk information in one JSON.
Request:
GET http://localhost:7007/mbu/api/all
Response:
{
"cpu": {
"numberOfCores": 4,
"averageUsagePercentage": 10.801282,
"usagePercentagePerCore": [
5,
23.076923,
5.1282053,
10
]
},
"ram": {
"totalGB": 7.612256,
"usedGB": 2.0867763,
"availableGB": 5.52548,
"usagePercentage": 27.413372
},
"disk": {
"totalGB": 976.49677,
"usedGB": 53.40926,
"availableGB": 923.08746,
"usagePercentage": 5.4694767
}
}
This project is under the MIT License. See the LICENSE file for the full license text.