PHP for server status

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

Sejtan

Member
Oct 3, 2020
36
6
8
Hello Everyone,

I'm working on a simple website to display server info.
Using these commands to display info about HDD.
$disks[] = array("name" => "Disk1" , "path" => '/mnt/disk1') ;
$disks[] = array("name" => "Disk2" , "path" => '/mnt/disk2') ;

Using Unraid. When I get in the terminal and type
cd /mnt there I see my disks.

Wondering, is that right?
 

Attachments

CyklonDX

Well-Known Member
Nov 8, 2022
848
279
63
If you are looking for disk stats you need to look at /dev/ , but the info may be in very unformatted format. There may be dedicated tools to read stats you want.

mnt only shows 'mounted' devices (i.e. a partition created by in your case unraid, not actual disks), and does not include actual disk stats, but then again depends what kind of stats you are looking for.


On other hand i think it'd be better to create grafana influxdb, setup graphs of what you want, and use php to pull up each of those as iframes on your php site without exposing yourself to potential security exploits by having php doing rooted commands. (there should be code snippets publicly for all kinds of websites for embedding grafana dashboards, and single graphs.)
(grafana dashboards are quite customizable)
1699541493673.png
 

wsuff

Member
Aug 16, 2015
75
13
8
  • Like
Reactions: gb00s