What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Is there an easy way to monitor the health of a PHP web server?

Votes:

0

I would like to monitor if my web server is in a good condition. It supports PHP.

health http-sensor monitor php prtg script web-server

Created on Feb 16, 2010 2:12:28 PM by  Daniel Zobel [Product Manager]

Last change on Feb 18, 2010 12:59:58 PM by  Daniel Zobel [Product Manager]



1 Reply

Accepted Answer

Votes:

0

This article applies to PRTG Network Monitor 7.x

Using phpSysInfo to Monitor the System Health of a PHP Web Server With PRTG

Using scripts from Open Source project phpSysInfo it is quite easy to set up a simple system-health monitoring on any webserver that can run PHP files. You cannot, however, monitor specific parameters, but you can monitor the overall health of your server very easily.

The Trick

The trick is that phpSysInfo shows red bars as soon as the available memory, CPU resources or disk space fall below a certain threshold. These red bars are shown using images with the word "redbar" in their file name. Using an HTTP Advanced sensor we can monitor the resulting HTML file and check for the word "red". As long as this word is not included in the HTML, the server works fine.

Compatible Server Systems

phpSysInfo runs on these server systems:

  • 32-bit MS Windows (NT/2000/XP)
  • Microsoft Windows Server 2003
  • All BSD Platforms (FreeBSD/NetBSD/OpenBSD/Apple Mac OS X)
  • All POSIX (Linux/BSD/UNIX-like OSes)

Steps to Take On Your Web Server

  • Download the latest version of phpSysInfo from the project's webpages at SourceForge: http://sourceforge.net/projects/phpsysinfo/
  • Copy the files into a dedicated folder of your PHP web server (protecting the folder using a password is recommended because the scripts shows a LOT of information about your web server, although no serious security related information)
  • Open the corresponding URL in a web browser
  • You should now see the status information in your browser that looks like this: http://sourceforge.net/project/screenshots.php?group_id=15
  • Note: Usually the script takes about 10 - 15 second to complete

Steps to Take in PRTG

  • In the PRTG web interface, create a new device with the IP address or DNS name of your web server running the PHP script.
  • Create a HTTP Advanced sensor (from section "Web Servers") on this device:
    • Enter the URL for the phpSysInfo script that you used above
    • Enter the word red in the "Response must not include" field
    • Optional: If you have enabled password protection on your web server, enter the necessary credentials in the Authentication section
    • Leave other settings unchanged and click on Save
  • Now you should see a new green-lighted sensor for your server.
  • You should add a notification trigger for that sensor so you will be notified in case the sensor is "Down". See user manual section Notifications for more details.

See also

Remotely Monitoring Free Disk Space on a PHP Enabled Web Server

Created on Feb 16, 2010 2:14:34 PM by  Daniel Zobel [Product Manager]

Last change on Feb 22, 2010 4:36:04 PM by  Daniel Zobel [Product Manager]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.