I've got a php script the dumps out some system stats for our members to a
webpage. One of the things I threw in was the disk space used on the
server, so I just stuck in the following into the php script....
system("df -hl");
Grand. Worked, no problems. I went and added in an IDE drive into the
system there last week and that doesn't show up on the website.
Let me show you with an example from a command prompt.....
[dburke at hoth dburke]$ df -hl
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 486M 164M 297M 36% /
/dev/sda9 12G 5.9G 5.1G 53% /home
/dev/sda7 243M 366k 230M 0% /tmp
/dev/sda5 2.9G 852M 1.9G 30% /usr
/dev/sda6 1.4G 530M 877M 38% /var
/dev/hdd1 4.0G 1.8G 2.0G 47% /backup
//compserver/notes 2.0G 1.6G 443M 78% /mnt/notes
So we can see the scsi drive(sda), the ide drive (hdd) & an smbfs mount I
got.
So we go to the website and it's output from the same command is....
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 486M 164M 297M 36% /
/dev/sda9 12G 5.9G 5.1G 53% /home
/dev/sda7 243M 365k 230M 0% /tmp
/dev/sda5 2.9G 852M 1.9G 30% /usr
/dev/sda6 1.4G 530M 877M 38% /var
//compserver/notes 2.0G 1.6G 443M 78% /mnt/notes
So here we have the scsi drive & the smbfs mount, but somewhere along the
line, the line containing info about the IDE (hdd) drive has gone.
According to the PHP manual the system call "Execute an external program
and display output". It's not a major issue, but I'm just scratching my
head as to how I'm losing a line of output ?
Dave
Random Homer Quote......
----------------------------
Homer: The secret ingredient is --
Moe: Homer, no!
Homer: Cough syrup! Nothing but plain, ordinary, over-the-counter
children's cough syrup!
Flaming Moe's
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!