-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cron mode security #50
base: master
Are you sure you want to change the base?
Conversation
A ping which is not possible resulted in a "0 ms" value which is not consistent with the reality. A "+Infinity" is more appropriate.
Since a ping may fail, it is relevant to use the w15p class in order to show if the ping was successful or not. Moreover, showing the time of a not valid ping is not relevant and it means the server is offline.
Default json config example should not have the name of the real file.
Misc::cache($name, $data = null, $lifetime = 0) is a simple cache filesystem which will serialize $data to a file in write operation, or return the values in read operation. Writes are made if the argument `--save` is used when running the command. Misc::exec() and Misc::shellexec() will first check if a result is in cache for that command, and return it if exists. Otherwise, command will be executed then eventually saved in cache for next call (if `--save` argument has been used).
I'll have a look and give my feedback, it seems promising ;) |
To be more precise, it's about the commit
But the current master contains this :
I compared the 3 command and found than the newest «official version» was better (with my local config, debian 9) I didn't checked anywhere else. By the way about that unix command, it tells me locally my last connection was the 22th may (and not today), but from the server I installed ezWeb I have more accurate dates :) |
This PR replace the #46 «mode cron + base config in .example file»
Changes:
Theses are the same commits with some fix due to the rebase. I removed the commit
8cfbf82 Last login: Show more relevant information
from @QuentinCG because the new version seemed to works fine (I just typed in a shell so maybe I'm wrong).The main improvement is still the cron mode to give a more secure way to retrieve information.
Cron Mode
Installation
conf/esm.config.json
check the value ofmode
is set tocron
. Any other value will make ezServerMonitor works as before.crontab -e
as root to execute the scriptcron/cron-monitoring
every 5 minutes (or more, or less, according to the precision you want).The cron script run each
libs/*.php
file and store the result in cache file. Alternatively, you can run each php script separately.Usage
just open the main index.php into a browser, the interface will show you the last cron update