PHP Script for Windows Server Information -
i have created below script works fine , me uptime of current server -
<?php $server = $_post['server']; // digits $pattern = '/[^0-9]/'; ?> <html> <head> <title>uptime</title> </head> <body> <?php $uptime = `c:\windows\system32\uptime2.bat $server`; $uptime = explode(": ", $uptime); $uptime = explode(", ", $uptime[1]); $uptime_days = preg_replace($pattern, '', $uptime[0]); $uptime_hours = preg_replace($pattern, '', $uptime[1]); $uptime_minutes = preg_replace($pattern, '', $uptime[2]); $uptime_seconds = preg_replace($pattern, '', $uptime[3]); echo '<b>uptime:</b><br><br>'; echo 'days: '.$uptime_days.'<br>'; echo 'hours: '.$uptime_hours.'<br>'; echo 'minutes: '.$uptime_minutes.'<br>'; echo 'seconds: '.$uptime_seconds.'<br>'; ?> </body> </html>
in uptime2.bat consist of following information -
@echo off uptime.exe %1
i know, how can modify code pass multiple servers input , below servers details -
ram hdd cpu usage uptime server online/offline
i hope able convey question here. pointers on appreciated.
thank in advance.
check out phpsysinfo. pretty wanting single servers. maybe can take @ code , modify suit use case.
Comments
Post a Comment