2
In linux if I do the command df -h
in the terminal it returns me the partitions, size etc ... as shown below:
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 25G 6.4G 17G 28% /
/dev/sda5 70G 2.9G 64G 5% /var
/dev/sda1 190M 29M 147M 17% /boot
/dev/sde1 394G 340G 34G 92% /u
You can take this result and bring it to php?
Example, save them to variables so I can display in a panel.
Right, but I can set which server I want, example: how would I do if it were 3 target servers ?
– Chefe Druida
Each PHP will pick up from its own server. It runs as if it were a user.
– Bacco
Got it, Thank you ! I already got your answer, thank you !
– Chefe Druida
@otaciojb if you need to run remote, you would have to use something like an ssh. You can do it with the same idea, but the complexity of the command increases a little.
– Bacco
is because I have 5 servers and would like to create a monitoring panel of them, a simple screen that shows this data. I’ll study the ssh question like you said, Thank you !
– Chefe Druida
Think of a shell script that makes a Curl for your PHP with the data, it can be much simpler. Very few lines, and with CURL you can make the result of the command give a GET in a central PHP panel. There you don’t need to install anything. Just put it on the crontab,
– Bacco
Blza, Thank you !
– Chefe Druida