Author Topic: Alerts and Warnings  (Read 545 times)

0 Members and 1 Guest are viewing this topic.

Offline rlmarcum22

  • Senior Member
  • **
  • Posts: 85
    • East-Central Kentucky Weather
Alerts and Warnings
« on: July 10, 2021, 03:55:53 PM »
I updated the zone codes to add four new zones and started a Cron Job for the news-alerts.php.  It seems to be getting carried out but the zone codes on my page aren't updating to include the new zones I input.  Why is this happening? HELP!! :!:

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 489
    • Tyler Texas Weather
Re: Alerts and Warnings
« Reply #1 on: July 10, 2021, 04:36:45 PM »
Looking at the contents of your nws-alerts-config.php file, I see a couple of things you should change:

1) Although this is not related to your current issue, you should change "$ourTZ         = 'America/Los_Angeles'; " to "$ourTZ         = 'America/New_York'; "

2) I believe the reason for your issue is because of one of your settings. In the config file, look for the section "## BIG ICONS". In the second setting below this title, change "$addNone       = false;" to "$addNone       = true;"

You should then see your remaining entries with a NONE icon as they currently have no alerts associated with them.

Steve

Offline rlmarcum22

  • Senior Member
  • **
  • Posts: 85
    • East-Central Kentucky Weather
Re: Alerts and Warnings
« Reply #2 on: July 10, 2021, 04:38:17 PM »
Thanks for pointing those things out.  I fixed my issue but now I will fix those things as well.

Offline rlmarcum22

  • Senior Member
  • **
  • Posts: 85
    • East-Central Kentucky Weather
Re: Alerts and Warnings
« Reply #3 on: July 10, 2021, 06:50:38 PM »
Now my wxadvisory.php isn't updating.  It last updated an hour ago.  Also the warnings at the top of the home page and in the sidebar aren't updating.  You can check these here: www.ekyrrgweather.com and www.ekyrrgweather.com/wxadvisory.php  ](*,)

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 489
    • Tyler Texas Weather
Re: Alerts and Warnings
« Reply #4 on: July 10, 2021, 07:47:27 PM »
Do you have a cron job set up to execute nws-alerts.php at a regular interval? Your config file shows you'll be using a cron job so make sure it's working. If you manually execute nws-alerts.php, it will update the cache used by the alerts script. I'd recommend you have a cron job execute at least every 5 minutes or so.

Steve

Offline rlmarcum22

  • Senior Member
  • **
  • Posts: 85
    • East-Central Kentucky Weather
Re: Alerts and Warnings
« Reply #5 on: July 10, 2021, 08:13:24 PM »
I do and it seems to be working.  Heres the last email I got:
<!-- nws-alerts.php - V1.43 - 14-May-2019 -->
<!-- 16 unique Zone entries found. Zones='KYZ049,KYC049,KYZ058,KYC065,KYZ041,KYC067,KYZ057,KYC151,KYZ060,KYC165,KYZ050,KYC173,KYZ059,KYC197,KYZ108,KYC237' -->
<!-- Cron job enabled -->

<!-- 6:55:01 -->
<!-- Error: Resolving timed out after 2000 milliseconds -->
<!-- Source: https://alerts.weather.gov/cap/wwaatmget.php?x=KYZ049&y=1 -->
<!-- non XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=KYZ049&y=1 -->
<!-- HTTP stats:  RC=0 dest= port=0 (from sce=)
      Times: dns=0.000 conn=0.000 pxfer=0.000 get=2.033 total=2.033 secs -->
<!-- header type='' -->
<!-- First attempt in getting preliminary URL failed -->

<!-- 6:55:04 -->
<!-- Error: Operation timed out after 2005 milliseconds with 0 bytes received -->
<!-- Source: https://alerts.weather.gov/cap/wwaatmget.php?x=KYZ049&y=1 -->
<!-- non XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=KYZ049&y=1 -->
<!-- HTTP stats:  RC=0 dest=184.84.152.14 port=443 (from sce=198.57.247.135)
      Times: dns=0.000 conn=0.079 pxfer=0.174 get=1.832 total=2.006 secs -->
<!-- header type='' -->
<!-- Second attempt failed & skipped -->

<!-- XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=KYC049&y=1 -->
<!-- HTTP stats:  RC=200 dest=184.84.152.14 port=443 (from sce=198.57.247.135)
      Times: dns=0.000 conn=0.082 pxfer=0.176 get=0.375 total=0.551 secs -->
<!-- XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=KYZ058&y=1 -->
<!-- HTTP stats:  RC=200 dest=184.84.152.14 port=443 (from sce=198.57.247.135)
      Times: dns=0.000 conn=0.075 pxfer=0.162 get=0.540 total=0.703 secs -->
<!-- XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=KYC065&y=1 -->
<!-- HTTP stats:  RC=200 dest=184.84.152.14 port=443 (from sce=198.57.247.135)
      Times: dns=0.001 conn=0.083 pxfer=0.179 get=0.359 total=0.538 secs -->
<!-- XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=KYZ041&y=1 -->
<!-- HTTP stats:  RC=200 dest=184.84.152.14 port=443 (from sce=198.57.247.135)
      Times: dns=0.000 conn=0.082 pxfer=0.177 get=0.460 total=0.637 secs -->
<!-- XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=KYC067&y=1 -->
<!-- HTTP stats:  RC=200 dest=184.84.152.14 port=443 (from sce=198.57.247.135)
      Times: dns=0.001 conn=0.078 pxfer=0.170 get=0.358 total=0.528 secs -->
<!-- XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=KYZ057&y=1 -->
<!-- HTTP stats:  RC=200 dest=184.84.152.14 port=443 (from sce=198.57.247.135)
      Times: dns=0.000 conn=0.083 pxfer=0.184 get=0.394 total=0.578 secs -->
<!-- XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=KYC151&y=1 -->
<!-- HTTP stats:  RC=200 dest=184.84.152.14 port=443 (from sce=198.57.247.135)
      Times: dns=0.001 conn=0.082 pxfer=0.182 get=0.385 total=0.566 secs -->
<!-- XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=KYZ060&y=1 -->
<!-- HTTP stats:  RC=200 dest=184.84.152.14 port=443 (from sce=198.57.247.135)
      Times: dns=0.001 conn=0.088 pxfer=0.192 get=0.389 total=0.581 secs -->
<!-- XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=KYC165&y=1 -->
<!-- HTTP stats:  RC=200 dest=184.84.152.14 port=443 (from sce=198.57.247.135)
      Times: dns=0.000 conn=0.084 pxfer=0.183 get=0.414 total=0.597 secs -->
<!-- XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=KYZ050&y=1 -->
<!-- HTTP stats:  RC=200 dest=184.84.152.14 port=443 (from sce=198.57.247.135)
      Times: dns=0.001 conn=0.075 pxfer=0.163 get=0.343 total=0.506 secs -->
<!-- XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=KYC173&y=1 -->
<!-- HTTP stats:  RC=200 dest=184.84.152.14 port=443 (from sce=198.57.247.135)
      Times: dns=0.000 conn=0.088 pxfer=0.190 get=0.633 total=0.823 secs -->
<!-- XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=KYZ059&y=1 -->
<!-- HTTP stats:  RC=200 dest=184.84.152.14 port=443 (from sce=198.57.247.135)
      Times: dns=0.001 conn=0.082 pxfer=0.192 get=0.471 total=0.664 secs -->
<!-- XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=KYC197&y=1 -->
<!-- HTTP stats:  RC=200 dest=184.84.152.14 port=443 (from sce=198.57.247.135)
      Times: dns=0.000 conn=0.079 pxfer=0.185 get=0.356 total=0.541 secs -->
<!-- XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=KYZ108&y=1 -->
<!-- HTTP stats:  RC=200 dest=184.84.152.14 port=443 (from sce=198.57.247.135)
      Times: dns=0.001 conn=0.080 pxfer=0.174 get=0.758 total=0.932 secs -->
<!-- XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=KYC237&y=1 -->
<!-- HTTP stats:  RC=200 dest=184.84.152.14 port=443 (from sce=198.57.247.135)
      Times: dns=0.001 conn=0.081 pxfer=0.178 get=0.471 total=0.649 secs -->
<!-- XML source: https://alerts.weather.gov/cap/wwacapget.php?x=KY1261AC33C3D4.FloodAdvisory.1261AC344584KY.JKLFLSJKL.1c3842adb476bc70de5fbfa09d5e636d -->
<!-- HTTP stats:  RC=200 dest=184.84.152.14 port=443 (from sce=198.57.247.135)
      Times: dns=0.001 conn=0.084 pxfer=0.193 get=0.128 total=0.322 secs -->
<!-- XML source: https://alerts.weather.gov/cap/wwacapget.php?x=KY1261AC33C3D4.FloodAdvisory.1261AC4020ACKY.JKLFLSJKL.236fc92c746fd159731922c8e8a65660 -->
<!-- HTTP stats:  RC=200 dest=184.84.152.14 port=443 (from sce=198.57.247.135)
      Times: dns=0.003 conn=0.085 pxfer=0.182 get=0.433 total=0.615 secs -->
<!-- XML source: https://alerts.weather.gov/cap/wwacapget.php?x=KY1261AC33CFF0.FloodAdvisory.1261AC401AD0KY.JKLFLSJKL.8dd86914bb07d6b46c8646114d6be1c9 -->
<!-- HTTP stats:  RC=200 dest=184.84.152.14 port=443 (from sce=198.57.247.135)
      Times: dns=0.000 conn=0.081 pxfer=0.176 get=0.341 total=0.516 secs -->
<!-- XML source: https://alerts.weather.gov/cap/wwacapget.php?x=KY1261AC33C3D4.FloodAdvisory.1261AC401AD0KY.JKLFLSJKL.357a52ab2394b5c6c4e7a0891f476d2a -->
<!-- HTTP stats:  RC=200 dest=184.84.152.14 port=443 (from sce=198.57.247.135)
      Times: dns=0.007 conn=0.087 pxfer=0.189 get=0.122 total=0.311 secs -->
<!-- Cache file updated: Sat 07-10-2021 6:55 pm -->
<!-- Alert box data file updated -->
<!-- Icon data file updated -->
<!-- Total process time: 16.2433 seconds -->


Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 489
    • Tyler Texas Weather
Re: Alerts and Warnings
« Reply #6 on: July 10, 2021, 11:04:32 PM »
Looks like your alerts and wxadvisory page are getting updated now.

Steve

Offline rlmarcum22

  • Senior Member
  • **
  • Posts: 85
    • East-Central Kentucky Weather
Re: Alerts and Warnings
« Reply #7 on: July 10, 2021, 11:41:33 PM »
For me it says the last update was at 11:02 or 42 minutes ago.  Does it only update when watches, warnings, etc are issued?  www.ekyrrgweather.com/wxadvisory.php

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 489
    • Tyler Texas Weather
Re: Alerts and Warnings
« Reply #8 on: July 10, 2021, 11:44:26 PM »
No. It should update every time your cron job that calls nws-alerts.php runs. As I mentioned earlier, I would schedule it to run at  least every 5 minutes.

Offline rlmarcum22

  • Senior Member
  • **
  • Posts: 85
    • East-Central Kentucky Weather
Re: Alerts and Warnings
« Reply #9 on: July 11, 2021, 12:20:59 AM »
What do I call the cron job to run?

Offline rlmarcum22

  • Senior Member
  • **
  • Posts: 85
    • East-Central Kentucky Weather
Re: Alerts and Warnings
« Reply #10 on: July 11, 2021, 01:00:35 AM »
Ok, I've kinda figured out the problem, I think.  The files are updating a cache that is outside of my public_html.  What should I change the cache directory to?

Offline rlmarcum22

  • Senior Member
  • **
  • Posts: 85
    • East-Central Kentucky Weather
Re: Alerts and Warnings
« Reply #11 on: July 11, 2021, 01:04:36 AM »
Its currently at $notesfo = fopen($cacheFileDir.'nws-notes.txt', 'w'); but I want it to update a file in the cache on my public_html.  HOW?

Offline rlmarcum22

  • Senior Member
  • **
  • Posts: 85
    • East-Central Kentucky Weather
Re: Alerts and Warnings
« Reply #12 on: July 11, 2021, 01:50:11 AM »
I fixed it.  I had to change the cache file in settings.php from ./cache to ../cache

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 489
    • Tyler Texas Weather
Re: Alerts and Warnings
« Reply #13 on: July 11, 2021, 07:57:04 AM »
Good to hear you got it working.