Jump to content

Recommended Posts

Posted

Thanks for that.

 

Also if you run this on a linux/bsd server, change the part where it says ...

 

      //check target IP or domain
  $pingreply = exec("ping -n $count $value");
  if ( substr($pingreply, -2) == 'ms')

 

to say

 

      //check target IP or domain
  $pingreply = exec("ping [b]-c[/b] $count $value");
  if ( substr($pingreply, -2) == 'ms')

 

This is now running on a monitor which rotates between a few different scripts. Thanks again.

Posted

Cool, glad it was some use.

 

I forgot to add the server graphic.

 

Just download the attached picture and pop into a folder called "images" in the root.

server.jpg

  • 1 month later...
  • 2 weeks later...
Posted
As long as its on an internal IP it should work fine. All it does is ping the machine so make sure its pingable and it will work.
  • 7 months later...
Posted

I have just set this up but all i get is down and timeout in the right hand coloum? is there anything special i have to install as atm i have just got apache and php5

 

Toby

Posted
^ Can your webserver resolve the hostnames (from the cli)?
Posted
^ Can your webserver resolve the hostnames (from the cli)?

 

yeah never had any problems with dns from it - also tried via ip

 

i have got it right and it used the $host[1] = "server name"; for the lookup?

Posted
try via ip address and see if it works

 

if so then its your dns lookups which are failing.

 

I get timeout when I use the IP address also. I am able to ping both the hostnames and IP addresses successfully from the server that I'm trying to run the server monitor on.

Posted

Sorry not heard of that problem before, if you can ping it from a cmd prompt it should work in the php script.

 

Might want to check any firewalls or ports that are open

Posted

sounds like something is blocking the php's ping request. I have never used php and iis so not sure why its doing that.

 

but with apache after i stopped being a moron it just worked.

Posted
Is there any specific IIS settings or permissions that need to be changed for this to work?

 

Yes you probably need to allow script and application rights in the site properties.

Posted
Yes you probably need to allow script and application rights in the site properties.

 

I've given the site permission to run script executable permissions and still nothing.

 

Might end up having to set up another physical server :(

Posted
Try it on your work pc, that's what I do. Its pretty simple to install IIS on xp or windows 7 with the php platform installer.
Posted (edited)

Just installed IIS and PHP using the Microsoft Web Platform installer on my XP work PC. I got the same results. Everything returns timeout.

 

Installed WAMP server and it seems to be working. Although it says that there is undefined variables on line 7 and 42 of index.php

Edited by Chris_
  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...