PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 9th, 2012, 10:17 AM
tjswebdev tjswebdev is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 75 tjswebdev User rank is Private First Class (20 - 50 Reputation Level)tjswebdev User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 16 h 33 m 19 sec
Reputation Power: 1
Send a message via Skype to tjswebdev
[PHP DEV.] Server Status Monitor

Hello! Thanks for checking in on my post.

I am wanting to make a service checker that checks to see if services are up periodically and then put the data into a database. I think it would be best to use some type of Cron Job. (Something like this is what I'm talking about: So here is something I am not sure about, https://teamexon [DOT] eu/stav-sluzieb.html).

So how would I have the script that displays the data get a date, tell if it is on or off, and then Get the most recent data?

Thanks,
TJ

Reply With Quote
  #2  
Old December 9th, 2012, 10:34 AM
gw1500se gw1500se is online now
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,907 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 1 Month 1 Day 52 m 49 sec
Reputation Power: 581
This sounds like a 2 part question. The first part is to write a shell or perl script (possible with PHP but I wouldn't do it) to do the checking and maintain the database. The 2nd part, in PHP, would read the data from the database and display it appropriately. Depending on how often you run the first script, I would not think checking the status in the PHP script would be necessary. The database will always be up to date if you run the first script frequently enough.
__________________
There are 10 kinds of people in the world. Those that understand binary and those that don't.

Reply With Quote
  #3  
Old December 9th, 2012, 10:39 AM
tjswebdev tjswebdev is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 75 tjswebdev User rank is Private First Class (20 - 50 Reputation Level)tjswebdev User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 16 h 33 m 19 sec
Reputation Power: 1
Send a message via Skype to tjswebdev
Quote:
Originally Posted by gw1500se
This sounds like a 2 part question. The first part is to write a shell or perl script (possible with PHP but I wouldn't do it) to do the checking and maintain the database. The 2nd part, in PHP, would read the data from the database and display it appropriately. Depending on how often you run the first script, I would not think checking the status in the PHP script would be necessary. The database will always be up to date if you run the first script frequently enough.


Okay. Heres the deal, I am only some what good with PHP and dont know shell or perl.

How would I tell it to receive the last three days to display on the site? And also in the main script, how could I also tell it to put a date in the database.

Another question, how could when the status are okay, how could it put a "1" for okay in the database, and then when the script displays the data on the page "1" = an image?

Reply With Quote
  #4  
Old December 9th, 2012, 10:51 AM
gw1500se gw1500se is online now
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,907 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 1 Month 1 Day 52 m 49 sec
Reputation Power: 581
Quote:
Originally Posted by tjswebdev
Okay. Heres the deal, I am only some what good with PHP and dont know shell or perl.

Sounds like a good opportunity to learn, especially if you are going to be using cron.
Quote:
Originally Posted by tjswebdev
How would I tell it to receive the last three days to display on the site?

Structure your query to do that. You need to design your database schema before you do any programming.
Quote:
Originally Posted by tjswebdev
And also in the main script, how could I also tell it to put a date in the database.

They same way you do any other field. All databases have date field definitions.
Quote:
Originally Posted by tjswebdev
Another question, how could when the status are okay, how could it put a "1" for okay in the database, and then when the script displays the data on the page "1" = an image?

All databases also have boolean field definitions. How you display that on your page is a matter of personal preference. You could use an image or simply the words 'up' and 'down'. Perhaps in green and red respectively.

Reply With Quote
  #5  
Old December 9th, 2012, 01:26 PM
tjswebdev tjswebdev is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 75 tjswebdev User rank is Private First Class (20 - 50 Reputation Level)tjswebdev User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 16 h 33 m 19 sec
Reputation Power: 1
Send a message via Skype to tjswebdev
Quote:
Originally Posted by gw1500se
Sounds like a good opportunity to learn, especially if you are going to be using cron.

Structure your query to do that. You need to design your database schema before you do any programming.

They same way you do any other field. All databases have date field definitions.

All databases also have boolean field definitions. How you display that on your page is a matter of personal preference. You could use an image or simply the words 'up' and 'down'. Perhaps in green and red respectively.


Okay, sorry for delay.

How often should I have the service checking? 1, 5, 10, 20 times a day?

Reply With Quote
  #6  
Old December 9th, 2012, 02:34 PM
gw1500se gw1500se is online now
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,907 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 1 Month 1 Day 52 m 49 sec
Reputation Power: 581
That is entirely up to you. I have no idea what your users are expecting or what the purpose is with respect to history.

Reply With Quote
  #7  
Old December 9th, 2012, 03:02 PM
tjswebdev tjswebdev is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 75 tjswebdev User rank is Private First Class (20 - 50 Reputation Level)tjswebdev User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 16 h 33 m 19 sec
Reputation Power: 1
Send a message via Skype to tjswebdev
Quote:
Originally Posted by gw1500se
That is entirely up to you. I have no idea what your users are expecting or what the purpose is with respect to history.


True. Heres a question. If I have it update once every 30 minutes, can it delete the previous check from earlier in the day?

Reply With Quote
  #8  
Old December 9th, 2012, 03:07 PM
gw1500se gw1500se is online now
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,907 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 1 Month 1 Day 52 m 49 sec
Reputation Power: 581
Yes. You can pretty much delete/add/update anything you want, any time you want.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > [PHP DEV.] Server Status Monitor

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap