Author Topic: System Status  (Read 11176 times)

0 Members and 1 Guest are viewing this topic.

Offline ADM

  • Contributor
  • ***
  • Posts: 135
    • Barrow County Weather - Barrow County, Georgia
System Status
« on: November 21, 2008, 05:27:03 PM »
Hello,

Is there a script available to show the "system status" such as the one at http://saratoga-weather.org/status.php

or

http://espwxctr.com/     (look under "Info" then 'system status")

Many thanks!

Al

www.RockyCreekWeather.com



Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9282
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: System Status
« Reply #1 on: November 21, 2008, 07:15:21 PM »
Mine is fairly specific to my setup, but you're welcome to the code .. some adaptation will be necessary for your setup, I'm sure :)

Enjoy! and best regards,
Ken

Code: [Select]
<div id="content">
  <h1 id="pageName">Saratoga-Weather.org Weather Station Status </h1>
  <div class="story">
  <?php
    
include_once("version-info.php");
include_once("testtags.php");
include_once("WeatherLinktags.php");  // for the Weatherlink specific stuff

putenv("TZ=PST8PDT");

function 
check_file($chkfile,$maxFileSecs) {
  
$timeFormat 'd-M-Y g:i:sa T'
  
$now time();
  if (
file_exists($chkfile)) {
    
$age $now filemtime($chkfile);
$updateTime date($timeFormat,filemtime($chkfile));
  } else {
    
$age 'unknown';
$updateTime 'file not found';
  }
  
$status '';
  
  print 
"<!-- $chkfile age = $age secs. -->\n";
  if (
file_exists($chkfile) and (filemtime($chkfile) + $maxFileSecs $now) ) {     // stale file
    
$status "<span style=\"color: green\"><b>Current</b></span>\t$age\t$updateTime ";

  } else {
    
$status "<span style=\"color: red\"><b>NOT Current</b></span>\t$age\t > $maxFileSecs secs <br/><b>$updateTime</b>";
  }
  
  return(
$status);


}

function 
check_applic($applTime,$maxFileSecs) {
  
$timeFormat 'd-M-Y g:i:sa T'
  
$now time();
    
$age $now $applTime;
$updateTime date($timeFormat,$applTime);
  
$status '';
  
  print 
"<!-- $chkfile age = $age secs. -->\n";
  if (
$applTime $maxFileSecs $now ) {     // stale file
    
$status "<span style=\"color: green\"><b>Current</b></span>\t$age\t$updateTime ";

  } else {
    
$status "<span style=\"color: red\"><b>NOT Current</b></span>\t$age\t > $maxFileSecs secs <br/><b>$updateTime</b>";
  }
  
  return(
$status);


}


   
?>

   
  <p>This page shows the current status of the weather software used in the operation of this website.<br/><br/>
  Station system up for <b><?php print $windowsuptime?></b><br/>
  Station system free memory <b><?php print $freememory?></b><br/>
  Weather Display last started <b><?php print $Startimedate?></b><br/></p>

  <table width="100%" border="1" cellspacing="3" cellpadding="2">
    <tr>
      <th width="40%" scope="col">Component</th>
      <th width="15%" scope="col" align="center">Status</th>
      <th width="5%" scope="col" align="center">Age<br />Secs</th>
      <th width="40%" scope="col">Latest update time as of<br/> <?php print date('d-M-Y g:i:sa T',time()); ?></th>
    </tr>
    <tr>
      <td><a href="http://www.weather-display.com/">Weather Display</a> (<?php echo $wdversion?>) realtime </td>
  <?php list($stat,$age,$data) = explode("\t",check_file('clientraw.txt',15)); ?>
      <td align="center"><?php echo $stat?></td>      <td align="right"><?php echo $age?></td>
<td><?php echo $data?></td>
    </tr>
    <tr>
      <td><a href="http://www.weather-display.com/">Weather Display</a> (<?php echo $wdversion?>) FTP </td>
  <?php list($stat,$age,$data) = explode("\t",check_file('testtags.php',60*5+15)); ?>
      <td align="center"><?php echo $stat?></td>      <td align="right"><?php echo $age?></td>
<td><?php echo $data?></td>
    </tr>
    <tr>
      <td><a href="http://www.davisnet.com/weather/products/weather_product.asp?pnum=06510SER">WeatherLink</a> (<?php echo $WLversion?>) FTP </td>
  <?php list($stat,$age,$data) = explode("\t",check_file('NOAAMO.TXT',60*5+15)); ?>
      <td align="center"><?php echo $stat?></td>      <td align="right"><?php echo $age?></td>
<td><?php echo $data?></td>
    </tr>
    <tr>
      <td><a href="http://www.ambientweather.com/virtualstation.html">VWS</a> (<?php echo $VWS_version?>) WeatherFlash realtime </td>
  <?php list($stat,$age,$data) = explode("\t",check_file('./wflash/Data/wflash.txt',15)); ?>
      <td align="center"><?php echo $stat?></td>      <td align="right"><?php echo $age?></td>
<td><?php echo $data?></td>
    </tr>
    <tr>
      <td><a href="http://www.ambientweather.com/virtualstation.html">VWS</a> (<?php echo $VWS_version?>) FTP </td>
  <?php list($stat,$age,$data) = explode("\t",check_file('./AJAX/VWS/usa-V2.htm',60*5+15)); ?>
      <td align="center"><?php echo $stat?></td>      <td align="right"><?php echo $age?></td>
<td><?php echo $data?></td>
    </tr>
<tr>
  <td colspan="4"><?php include_once("radar-status-kt.php"); ?></td>
</tr>
    <tr>
      <td><a href="http://www.grlevelx.com/grlevel3/">GRLevel3</a> (<?php echo $GRLEVEL3_version?>) Radar FTP </td>
  <?php list($stat,$age,$data) = explode("\t",check_file('./GR3/kmux_cr248_0.jpg',60*10+15)); ?>
      <td align="center"><?php echo $stat?></td>      <td align="right"><?php echo $age?></td>
<td><?php echo $data?></td>
    </tr>
    <tr>
      <td><a href="http://www.astrogenic.com/nexstorm.html">NexStorm</a> (<?php echo $NEXSTORM_version?>) Lightning Map </td>
  <?php list($stat,$age,$data) = explode("\t",check_file('nexstorm.jpg',10*60+15)); ?>
      <td align="center"><?php echo $stat?></td>      <td align="right"><?php echo $age?></td>
<td><?php echo $data?></td>
    </tr>
    <tr>
      <td><a href="http://www.astrogenic.com/nexstorm.html">NexStorm</a> (<?php echo $NEXSTORM_version?>) TRACreport</td>
      <?php list($stat,$age,$data) = explode("\t",check_file('TRACReport.txt',10*60+15)); ?>
      <td align="center"><?php echo $stat?></td>      <td align="right"><?php echo $age?></td>
<td><?php echo $data?></td>
    </tr>
    <tr>
      <td><a href="http://www.astrogenic.com/nexstorm.html">NexStorm</a> (<?php echo $NEXSTORM_version?>) Data </td>
      <?php list($stat,$age,$data) = explode("\t",check_file('nexstorm_arc.dat',10*60+15)); ?>
      <td align="center"><?php echo $stat?></td>      <td align="right"><?php echo $age?></td>
<td><?php echo $data?></td>
    </tr>
    <tr>
      <td>WASP2 (<?php echo $WASP2_version?>) Lightning Map<br />upload </td>
  <?php list($stat,$age,$data) = explode("\t",check_file('./WASP2/wasp2.png',10*60+15)); ?>
      <td align="center"><?php echo $stat?></td>      <td align="right"><?php echo $age?></td>
<td><?php echo $data?></td>
    </tr>
    <tr>
      <td><a href="http://www.imagesalsa.com/download.htm">ImageSalsa</a> (<?php echo $IMAGESALSA_version?>) Netcam FTP </td>
  <?php list($stat,$age,$data) = explode("\t",check_file('netcam-thumb.jpg',25)); ?>
      <td align="center"><?php echo $stat?></td>      <td align="right"><?php echo $age?></td>
<td><?php echo $data?></td>
    </tr>
    <tr>
      <td><a href="http://www.wxsim.com/">WXSIM</a> (<?php echo $WXSIM_version?>) Forecast </td>
  <?php
     
$doPrint false;
 include_once("plaintext-parser.php");
 print "<!-- wdate='$wdate' -->\n";
 $lastWXSIM strtotime($wdate);
 
  ?>

  <?php list($stat,$age,$data) = explode("\t",check_applic($lastWXSIM,4*60*60 2*60)); ?>
      <td align="center"><?php echo $stat?></td>      <td align="right"><?php echo $age?></td>
<td><?php echo $data?></td>
    </tr>
    <tr>
      <td>Cron animation WASP2 </td>
  <?php list($stat,$age,$data) = explode("\t",check_file('./WASP2/status.txt',60*10+15)); ?>
      <td align="center"><?php echo $stat?></td>      <td align="right"><?php echo $age?></td>
<td><?php echo $data?></td>
    </tr>
    <tr>
      <td>Cron graphs</td>
  <?php list($stat,$age,$data) = explode("\t",check_file('./WDS/rain.png',60*5+15)); ?>
      <td align="center"><?php echo $stat?></td>      <td align="right"><?php echo $age?></td>
<td><?php echo $data?></td>
    </tr>
    <tr>
      <td>Cron SWN mesomap</td>
  <?php list($stat,$age,$data) = explode("\t",check_file('./SWN-cache.html',60*5+15)); ?>
      <td align="center"><?php echo $stat?></td>      <td align="right"><?php echo $age?></td>
<td><?php echo $data?></td>
    </tr>
    <tr>
      <td>Cron WD conditions logger</td>
  <?php list($stat,$age,$data) = explode("\t",check_file('./WD-conditions.html',60*5+15)); ?>
      <td align="center"><?php echo $stat?></td>      <td align="right"><?php echo $age?></td>
<td><?php echo $data?></td>
    </tr>

  </table>
  <p>&nbsp;</p>
  </div>
</div>

My version-info.php has
Code: [Select]
<?php
// allow viewing of generated source

if ( isset($_REQUEST['sce']) && strtolower($_REQUEST['sce']) == 'view' ) {
//--self downloader --
   
$filenameReal __FILE__;
   
$filenameLcl substr($PHP_SELF,1);
   
$download_size filesize($filenameReal);
   
header('Pragma: public');
   
header('Cache-Control: private');
   
header('Cache-Control: no-cache, must-revalidate');
   
header("Content-type: text/plain");
   
header("Accept-Ranges: bytes");
   
header("Content-Length: $download_size");
   
header('Connection: close');
   
   
readfile($filenameReal);
   exit;
}

// Version info for Saratoga-weather.org

$GRLEVEL3_version '1.41';
$NEXSTORM_version '1.6.0.2553';
$WASP2_version '2.2.3167.20051';
$WXSIM_version '12.2';
$WXSIMATE_version '4.2';
$STARTWATCH_version '1.0.2';
$VIRTUALVP_version '1.1.4';
$IMAGESALSA_version '2.0.13';
$MOVIESALSA_version '1.0.14';
$ODDCAST_version '3 (25-Aug-2006)';
$VWS_version '13.01 p09';

?>
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Mark / Ohio

  • Live from Mars!
  • Forecaster
  • *****
  • Posts: 2511
    • Fairfield County Weather
Re: System Status
« Reply #2 on: November 21, 2008, 07:33:58 PM »
Thanks for posting your code Ken!  I've wanted to do something like that myself mainly for ease of my own reference to check on things while away from home. 
Mark 
2002 Davis VP I Wireless, WeatherLink (Serial), GRLevel3, VirtualVP, StartWatch, Weather Display, Windows 10


jwyman

  • Guest
Re: System Status
« Reply #3 on: November 22, 2008, 12:12:17 AM »
If anyone is interested, I will make this available.... Just let me know..  :grin:
I will probably post it on my scripts page....

Jim

Offline jwwd

  • Senior Member
  • **
  • Posts: 59
    • Weather at Silkeborg, Denmark
Re: System Status
« Reply #4 on: November 22, 2008, 02:32:52 AM »
Hi

What a great script - I have modified it to my site:

http://www.silkeborg-vejret.dk/english/om.php

How do I get the time in the right timezone? GMT is 1 hour behind our normaltime here in Denmark.

And how do I get the time in 24-hour timeformat?

Here is the code:

Code: [Select]
  <?php
    
include_once("1version-info.php");


putenv("TZ=DK");

function 
check_file($chkfile,$maxFileSecs) {
  
$timeFormat 'd-M-Y g:i:sa T'
  
$now time();
  if (
file_exists($chkfile)) {
    
$age $now filemtime($chkfile);
$updateTime date($timeFormat,filemtime($chkfile));
  } else {
    
$age 'unknown';
$updateTime 'file not found';
  }
  
$status '';
  
  print 
"<!-- $chkfile age = $age secs. -->\n";
  if (
file_exists($chkfile) and (filemtime($chkfile) + $maxFileSecs $now) ) {     // stale file
    
$status "<span style=\"color: green\"><b>Opdateret</b></span>\t$age\t$updateTime ";

  } else {
    
$status "<span style=\"color: red\"><b>IKKE opdateret</b></span>\t$age\t > $maxFileSecs secs <br/><b>$updateTime</b>";
  }
  
  return(
$status);


}

function 
check_applic($applTime,$maxFileSecs) {
  
$timeFormat 'd-M-Y g:i:sa T'
  
$now time();
    
$age $now $applTime;
$updateTime date($timeFormat,$applTime);
  
$status '';
  
  print 
"<!-- $chkfile age = $age secs. -->\n";
  if (
$applTime $maxFileSecs $now ) {     // stale file
    
$status "<span style=\"color: green\"><b>Opdateret</b></span>\t$age\t$updateTime ";

  } else {
    
$status "<span style=\"color: red\"><b>IKKE opdateret</b></span>\t$age\t > $maxFileSecs secs <br/><b>$updateTime</b>";
  }
  
  return(
$status);


}


?>

Best regards,

Henrik

« Last Edit: November 22, 2008, 04:35:07 AM by jwwd »

Davis Vantage Pro2 w/FARS & solarsensor. Boltek LD-250 Lightningdetector

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9282
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: System Status
« Reply #5 on: November 22, 2008, 02:41:58 AM »
Hi Henrik!

Use

putenv("TZ=Europe/Copenhagen");


and

$timeFormat = 'd-M-Y H:i:s T';

or roll-your-own using the http://us3.php.net/manual/en/function.date.php docs :)

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline jwwd

  • Senior Member
  • **
  • Posts: 59
    • Weather at Silkeborg, Denmark
Re: System Status
« Reply #6 on: November 22, 2008, 03:01:34 AM »
Hi Ken

Thank you very much - now its working the way I like it.

Take care and say hi to Holly from me.

Best regards,

Henrik

Davis Vantage Pro2 w/FARS & solarsensor. Boltek LD-250 Lightningdetector

Offline jwwd

  • Senior Member
  • **
  • Posts: 59
    • Weather at Silkeborg, Denmark
Re: System Status
« Reply #7 on: November 22, 2008, 04:38:54 AM »
Hi again

I have it up and running:

http://www.silkeborg-vejret.dk/english/om.php

Just one last thing:

Would it be possible to recalculate the seconds into hours, minutes and seconds?

Example:

My plaintext is set to be uploaded every 3 hours + 2 minutes (10,920 seconds) - that would be nice to present in hours and minutes instead.

Best regards,

Henrik

Davis Vantage Pro2 w/FARS & solarsensor. Boltek LD-250 Lightningdetector

Offline ADM

  • Contributor
  • ***
  • Posts: 135
    • Barrow County Weather - Barrow County, Georgia
Re: System Status
« Reply #8 on: November 22, 2008, 08:26:07 AM »
Thanks to all for your responses, I appreciate them!

Al...

www.RockyCreekWeather.com




jwyman

  • Guest
Re: System Status
« Reply #9 on: November 22, 2008, 04:50:36 PM »
For those interested in the script , you can get it from espwxctr.coml Go to INFO -> SCRIPTS section. You will see it at the bottom of the page.. Enjoy!

Jim

Offline Mark / Ohio

  • Live from Mars!
  • Forecaster
  • *****
  • Posts: 2511
    • Fairfield County Weather
Re: System Status
« Reply #10 on: November 22, 2008, 11:20:27 PM »
Thanks for sharing your script with us Jim!  I saved a copy of it for future reference as well.   8-)
Mark 
2002 Davis VP I Wireless, WeatherLink (Serial), GRLevel3, VirtualVP, StartWatch, Weather Display, Windows 10


Offline jwwd

  • Senior Member
  • **
  • Posts: 59
    • Weather at Silkeborg, Denmark
Re: System Status
« Reply #11 on: November 23, 2008, 02:02:11 AM »
Hi Jim

Thank you very much for sharing your script.

I have it up and running - but I just cant figure out why the script keeps presenting the upload frequency in minutes - see example here:

http://www.silkeborg-vejret.dk/om.php

I have tried your script without any changeds - and I have tried modifying the dateformat - here is the code:

Code: [Select]
<?PHP

// System Status Report Script
// Author: Jim Wyman
// Date: 11/11/2008
// Esperanza Weather Center
// www.espwxctr.com
//


if (isset($_REQUEST['sce']) && strtolower($_REQUEST['sce']) == 'view' ) {
//--self downloader --
$filenameReal = $_SERVER["SCRIPT_FILENAME"];
$download_size = filesize($filenameReal);
header('Pragma: public');
header('Cache-Control: private');
header('Cache-Control: no-cache, must-revalidate');
header("Content-type: text/plain");
header("Accept-Ranges: bytes");
header("Content-Length: $download_size");
header('Connection: close');
readfile($filenameReal);
exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
.style11 {
color: #FFFFFF;
font-family: Arial;
border-width: 1px;
background-color: #666699;
}
.style22 {
font-family: Cambria;
font-size: small;
border-width: 1px;
background-color: #5B9CC6;
}
.style44 {
font-family: Cambria;
font-size: small;
border-width: 1px;
background-color: #99CCFF;
}
.style55 {
font-family: Cambria;
font-weight: bold;
}
.style66 {
font-family: Cambria;
}
</style>
</head>
<body style="background-color: #ffffff">

<?PHP date_default_timezone_set("Europe/Copenhagen");?> <!--Change to your time zone, see scripts website for help identifying your timezone-->
<span class="style66">The current data and time is: </span><span class="style55"><?PHP echo date("d-m-y H:i:s T");?></span><br/><br/>
<table border cellspacing=0 cellpadding=5>
<tr bgcolor=#D0D0D0><th class="style11">Application<th class="style11">Uploaded Files<th class="style11">Upload Frequency<th class="style11">Last Upload<th class="style11">Time Since Upload</tr>

<!-- Here we process the entries in the array - one routine to handle 1 or many files. -->

<?PHP

$application = array ("Weather Display","Weather Display","WXSIM","Webcam");
$filename = array ("vejrdata/clientraw.txt","vejrdata/testtags.php","vejrudsigt/1plaintext.txt","vejrdata/jpgwebcam.jpg");
$upload_time_secs = array (5,300,10800,300);

if(count($application) != count($filename))
 echo "Array Dimension Error";
if(count($upload_time_secs) != count($filename))
 echo "Array Dimension Error";
if(count($upload_time_secs ) != count($application))
 echo "Array Dimension Error";

for($i=0;$i<=count($application)-1;$i++){

$pos = strrpos($filename[$i],"/");

if($pos > 0 )
    $trunc_filename = substr($filename[$i],$pos+1);
    else
    $trunc_filename = $filename[$i];
       
echo '<tr><td align=center class="style22">' . $application[$i] . '<td align=center class="style22">' . $trunc_filename . '
<td align=center class="style22">' . strval($upload_time_secs[$i]/60)  . ' Minutes</td>';
echo '<td class="style22">'. date("d-m-y H:i:s T", filectime($filename[$i])) . '</td>';
echo '<td align=center class="style44">';

$tdiffsecs = timediffsecs ($filename[$i]);
$tdiff = timediff($filename[$i]);

if ($tdiffsecs > $upload_time_secs[$i]){
echo $tdiff . '&nbsp;&nbsp;<img src="billeder/answer_bad.gif" align="middle"></img>';
}
else
echo $tdiff . '&nbsp;&nbsp;<img src="billeder/answer_good.gif" align="middle"></img>';

echo '</td></tr>';
}
?>

</table>


<?PHP
//==========================================================================
//  Function timediff - Shawn Curran - CastleRockWeather.org
//  version: 1.0 - 08/11/08 - Initial Release
//  version: 1.1 - 09/03/08 - Public Released version
//  Description: This function calculates the number of seconds, minutes,
//  hours, or days since the file's timestamp has been written. This works
//  well for files uploaded to your website via FTP, since the timestamp
//  reflects when the file was last written to the server with FTP client.
//==========================================================================
function timediff ($filepath) {
//Get time stamp of file
$t = date("dmyHis", filectime($filepath));
//Split $t into month, day, and year values
$d = substr($t, 2, 2);
$m = substr($t, 0, 2);
$y = substr($t, 4, 2);
$h = substr($t, 6, 2);
$min = substr($t, 8, 2);
$s = substr($t, 10, 2);
$timestamp = mktime($h, $min, $s, $d, $m, $y);
$tdiff = mktime() - $timestamp; //Subtrack $timestamp from now, give us diff in seconds.
//Determin how to display by size of timediff
if ($tdiff < 60) {
//Timediff is less then 1 minute, so must be seconds
$tdiff=number_format($tdiff);
return $tdiff." sec";
} elseif ($tdiff < 3600) {
//timediff is less then 1 hour, so must be minutes
$tdiff=$tdiff/60;
$tdiff=number_format($tdiff, 1, '.', '');
return $tdiff." min";
} elseif ($tdiff < 86400) {
//timediff is less then 1 day, so must be hours.
$tdiff=($tdiff/60)/60;
$tdiff=number_format($tdiff, 1, '.', '');
return $tdiff." hr";
} elseif ($tdiff < 604800){
//timediff is greater then 1 day, so must be days.
$tdiff=(($tdiff/60)/60)/24;
$tdiff=number_format($tdiff, 1, '.', '');
return $tdiff." days";
}else{
//timediff is greater then 1 day, so must be days.
$tdiff=(($tdiff/60)/60)/24/7;
$tdiff=number_format($tdiff, 1, '.', '');
return $tdiff." weeks";
}

}
?><?PHP
//==========================================================================
//  Function timediffsecs - Jim Wyman - espwxctr.com
//                          derived from the above function timediff()
//==========================================================================
function timediffsecs ($filepath) {
//Get time stamp of file
$t = date("mdyHis", filectime($filepath));
//Split $t into month, day, and year values
$d = substr($t, 2, 2);
$m = substr($t, 0, 2);
$y = substr($t, 4, 2);
$h = substr($t, 6, 2);
$min = substr($t, 8, 2);
$s = substr($t, 10, 2);
$timestamp = mktime($h, $min, $s, $d, $m, $y);
$tdiff = mktime() - $timestamp; //Subtrack $timestamp from now, give us diff in seconds.
return $tdiff;
}
?>
</body>

</html>

Could it be some kind of timezone problem?

Best regards,

Henrik
« Last Edit: December 24, 2008, 02:45:18 AM by jwwd »

Davis Vantage Pro2 w/FARS & solarsensor. Boltek LD-250 Lightningdetector

jwyman

  • Guest
Re: System Status
« Reply #12 on: November 23, 2008, 08:06:57 AM »
Henrik,
  I made a modification to the script last night to show seconds if the upload frequency is under 60 seconds. download it again and try it out.... Had one other person test it and it works great ofr them. Let me know if you have any problems...


Jim

Offline jwwd

  • Senior Member
  • **
  • Posts: 59
    • Weather at Silkeborg, Denmark
Re: System Status
« Reply #13 on: November 23, 2008, 11:05:59 AM »
Hi Jim

Thanks for your reply.

I have it up and running now.

I would like to have a href tag in the first array - would that be possible?

Example: Weather Display - I would like to link to www.weather-display.com.

One thing more:

If one of the files dont excist - then the script returns and error - see example here:

http://www.silkeborg-vejret.dk/1nyom.php

Best regards,

Henrik
« Last Edit: November 23, 2008, 04:36:45 PM by jwwd »

Davis Vantage Pro2 w/FARS & solarsensor. Boltek LD-250 Lightningdetector

Offline BillW69

  • Member
  • *
  • Posts: 6
    • Evansville-Weather.com
Re: System Status
« Reply #14 on: November 23, 2008, 01:07:32 PM »
Ken, I am using IE8 beta. When I go to your site here....http://saratoga-weather.org/status.php The drop down menus only show up as black boxes. There is no text in them, nor can I click on anything in them. If I use 'compatability mode, all works correctly. I just thought I'd let you know.
Bill

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 923
    • North Bend Weather
Re: System Status
« Reply #15 on: November 23, 2008, 02:59:14 PM »
Ken...In this part of your system status..

Code: [Select]

<td><a href="http://www.weather-display.com/">Weather Display</a> (<?php echo $wdversion?>) FTP </td>
  <?php list($stat,$age,$data) = explode("\t",check_file('testtags.php',60*5+15)); ?>
      <td align="center"><?php echo $stat?></td>      <td align="right"><?php echo $age?></td>
<td><?php echo $data?></td>
    </tr>



I only FTP every 10 mins, so i get "not current" till the next upload. What number would I change to extend the time so i dont get that message? Thanks, Mark.
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam + Soil temp + Soil Moisture

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9282
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: System Status
« Reply #16 on: November 23, 2008, 03:23:04 PM »
Change the '60*5+15' to '60*10+15' for the seconds you need 10min+15sec=60*10+15 :)
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 923
    • North Bend Weather
Re: System Status
« Reply #17 on: November 23, 2008, 03:27:25 PM »
Thanks ken
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam + Soil temp + Soil Moisture

Offline jwwd

  • Senior Member
  • **
  • Posts: 59
    • Weather at Silkeborg, Denmark
Re: System Status
« Reply #18 on: November 23, 2008, 04:35:48 PM »
Hi again

Did another play with the script - and now I have the links working too:

www.silkeborg-vejret.dk/english/om.php

Thanks

Best regards,

Henrik

Davis Vantage Pro2 w/FARS & solarsensor. Boltek LD-250 Lightningdetector

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9282
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: System Status
« Reply #19 on: November 23, 2008, 10:42:26 PM »
Ken, I am using IE8 beta. When I go to your site here....http://saratoga-weather.org/status.php The drop down menus only show up as black boxes. There is no text in them, nor can I click on anything in them. If I use 'compatability mode, all works correctly. I just thought I'd let you know.
Bill
Thanks for the heads-up on IE8-Beta Bill, I am (and many of the web community are) hoping that M$ will perform HTML/CSS rendering in a standard manner (like all the non-MS browsers seem to) before they release a final IE8 product.

As the beta gets to Release Candidate, I'll take a look at it.  No sense testing against code that's likely to change before release.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline ANPweather

  • Contributor
  • ***
  • Posts: 134
    • Anthem North Parkside, AZ
Re: System Status
« Reply #20 on: November 24, 2008, 12:37:32 AM »
I'm not getting the green checkmarks or the red X's using e-rice as my host.  :?
http://azjerry.com/weather/wxstatus.php

Davis Vantage Vue, Davis Pro 2 Console with Wifi Logger
Weather Display software
WU: KAZNEWRI17
PWS: ANTHEMNP
CWOP: EW7526

Offline jwwd

  • Senior Member
  • **
  • Posts: 59
    • Weather at Silkeborg, Denmark
Re: System Status
« Reply #21 on: November 24, 2008, 12:44:30 AM »
I'm not getting the green checkmarks or the red X's using e-rice as my host.  :?
http://azjerry.com/weather/wxstatus.php

Hi

Have you uploaded the good and bad images to this folder:

http://azjerry.com/weather/

You can download them here:





Hope that helps.

Best regards,

Henrik


Davis Vantage Pro2 w/FARS & solarsensor. Boltek LD-250 Lightningdetector

Offline Axelvold

  • Forecaster
  • *****
  • Posts: 1704
    • Axelvold's weather and photo
Re: System Status
« Reply #22 on: August 21, 2010, 09:17:28 AM »
I was going to use this on my site but the file age is about 20 min behind it's actual age.

How could i correct this?

One example, one of my webcam pictures was created 15:15 but according to this script so was it created 14:56
Lars Magnusson
Axelvold / Sweden
55° 57' 41" N / 13° 6' 1" E
WX Station: Davis Vantage Pro2 Plus

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9282
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: System Status
« Reply #23 on: August 23, 2010, 10:32:48 PM »
I was going to use this on my site but the file age is about 20 min behind it's actual age.

How could i correct this?

One example, one of my webcam pictures was created 15:15 but according to this script so was it created 14:56
When checking files on the website (like your webcam picture), it uses the last-modified time filemtime() PHP function and compares it to the server's current time using the date() function to find the 'age' (difference) between the two.

If your webserver is not synchronized to a NTP time standard, then it is likely that the time updated on the server is incorrect.

Easy check for that using Firefox and Web Developer plugin.   Load the file in your browser, then use 'View Response Headers' in Web Developer.  It will show a Date: and a Last-modified: date time stamp, both of which should be in GMT/UTC time.  Compare the Date: time stamp to current UTC time .. if they match, the server is synchronized .. if not, it will tell you how fast/slow the server is relative to current UTC time and you can ask your hoster to make the time correction on the server (and ensure it is linked to an NTP time source).
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Mark / Ohio

  • Live from Mars!
  • Forecaster
  • *****
  • Posts: 2511
    • Fairfield County Weather
Re: System Status
« Reply #24 on: August 24, 2010, 12:05:11 AM »
I just tried it with my page.  E-Rice is running about a minute behind.  The server for this forum though seems to be with in a few seconds.

(Dimension 4 synced my computer which I base that on 20 minutes ago by .018 seconds.)
Mark 
2002 Davis VP I Wireless, WeatherLink (Serial), GRLevel3, VirtualVP, StartWatch, Weather Display, Windows 10