| |||||||
This is a discussion on PHP Script for monitoring services on your webserver within the PHP/MySQL section, part of the Programming category; I recently found this cool little script for checking which services are running on my webserver. For true effectiveness though, ...
![]() |
|
| | LinkBack | Thread Tools | Display Modes |
|
#1
| ||||
| ||||
|
I recently found this cool little script for checking which services are running on my webserver. For true effectiveness though, you should host this script on a second webserver so you can get feedback from the script even if your site is down. PHP Code:
__________________ Go placidly amid the noise and haste, and remember what peace there may be in silence The Desiderada |
|
#2
| ||||
| ||||
|
Works fine. Thanks for sharing
__________________ Would you like to Link To Us | Support TECH6 by going Premium Know more about me at Vinayaks.com | Follow TECH6 at Twitter |
|
#3
| ||||
| ||||
|
Maybe this will help, I use it myself. Just open a sock to some port, see if it's open, and you know it's ok Of course there are better alternatives which even check if a webpage works and such, but well, this does do the job for me. function scanport($host, $port, $beschrijving){ $sock = @fsockopen($host, $port, $num, $error, 2); if ($sock) { $status = $beschrijving.'<font color="#009900"><strong>Up</strong></font><br>'; fclose($sock); unset($sock); } else { #Fout! Nog een keer controleren! unset($sock); $sock = @fsockopen($host, $port, $num, $error, 2); if ($sock) { $status = $beschrijving.'<font color="#009900"><strong>Up</strong></font><br>'; fclose($sock); unset($sock); } else { # Nu is het dus echt mis $status = $beschrijving.'<font color="#FF0000"><strong>Down</strong></font><br>'; unset($sock); } } echo $status; }
__________________ quang cao nha dat |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |