Support > Security

Possible to receive email notification of syntax error?

(1/2) > >>

seadhna:
Hi, our website was down a couple of days ago but we did not receive an alert from the service we use: Uptime Robot.
The error message displayed for anyone visiting the site was:
Parse error: syntax error, unexpected end of file, expecting ')' in /home/example/public_html/example/logs/defender_ban.php on line 85

Could you advise, what type of error this is classed as? Database error? And is there a way to receive a notification via email from Elxis when it has happened?

datahell:
This is from Defender's log file which couldn't close properly and generated a PHP error. Due to this error the whole site generated a php error so an e-mail could not be sent.

seadhna:
Thanks datahell,
a solution to ensure an alert is received from UptimeRobot for this type of error is to add a "Keyword Exists" monitor for the keyword: syntax (which likely will not appear on the site as regular content) or there is also a "Keyword Does Not Exist" alert which notifies if a word disappears from the source code.

datahell:
A monitoring service, like uptime robot, usually checks if the web server is online or not. It doesn't check the site's content. The web server will set a "200" status in headers in both cases. So, you cannot distinguish if there is a php error or not with this method. See attached screenshot. However this can be solved but as this problem is very rare I think it doesn't worth the effort.

datahell:
A different approach/tip.
You can take advantage of the Elxis "heart beat" or generic AJAX features. If Elxis doesn't reply properly to these requests then it doesn't work properly.

Elxis administration (you must be logged in)
https://www.example.com/estia/beat
Elxis replies you with the current time in the form of UNIX timestamp.

Elxis frontend (take advantage of the generix AJAX call)
https://www.example.com/ajax
Elxis replies you with the word BAD because the request part is missing but you know that the site is working properly. If you don't get the "BAD" response then the site has problem. You can test this in any Elxis site.

Navigation

[0] Message Index

[#] Next page

Go to full version