Cron mode security#50
Open
Asenar wants to merge 23 commits into
Open
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 ;) |
Author
|
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 informationfrom @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.jsoncheck the value ofmodeis set tocron. Any other value will make ezServerMonitor works as before.crontab -eas root to execute the scriptcron/cron-monitoringevery 5 minutes (or more, or less, according to the precision you want).The cron script run each
libs/*.phpfile 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