Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SiteMonitor


Jack_mcs

Recommended Posts

It's a server setting. On shared servers, you don't have any control over it and it is usually 30 seconds. On dedicated servers, you can change it to what you want via the php.ini file.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

isn't it possible to spoof the edit time for any given file?

i would assume the majority of hackers would take this step to prevent you from knowing what files they touched.

 

would this contribution still work, in that case?

Link to comment
Share on other sites

You can change the timestamp of a file but the size would still have to be exact and that would be difficult to do since it involves more than just the file size.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

heres the cron output is interested:

 

Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in <b>/home2/mydomain/public_html/catalog/admin/includes/functions/sessions.php</b> on line <b>67</b><br />

<br />

<b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /home2/mydomain/public_html/catalog/admin/includes/functions/sessions.php:67) in <b>/home2/mydomain/public_html/catalog/admin/includes/functions/sessions.php</b> on line <b>67</b><br />

<br />

<b>Warning</b>: main(includes/languages/english/) [<a href='function.main'>function.main</a>]: failed to open stream: No such file or directory in <b>/home2/mydomain/public_html/catalog/admin/includes/application_top.php</b> on line <b>133</b><br />

<br />

<b>Warning</b>: main() [<a href='function.include'>function.include</a>]: Failed opening 'includes/languages/english/' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/home2/mydomain/public_html/catalog/admin') in <b>/home2/mydomain/public_html/catalog/admin/includes/application_top.php</b> on line <b>133</b><br />

Link to comment
Share on other sites

Does the sitemonitor.php script work when ran manually?

 

Jack

 

 

Yes. It works fine when run with the cron job as well, its just that the cron generates those errors. I still get the output from the sitemonitor if anything has changed.

 

I was just curious if anybody elses cron output was like that(if anybody even checks it).

Link to comment
Share on other sites

I have to block out my admin directory or the script times out. Is there a way to specify not to scan certain folders within the admin directory, such as images, so that we can scan the other php files in admin and not timeout?

 

Would something like this work? :

$excludeList = array("cgi-bin","admin/images","downloads","images","pub","tmp","temp");

 

 

Im back to this point. I was mistaken, the "admin/images" part didnt work. The admin images folder was still in the reference file.

 

Any ideas how how to block just this folder or any subfolder?

Link to comment
Share on other sites

Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in <b>/home2/mydomain/public_html/catalog/admin/includes/functions/sessions.php</b> on line <b>67</b><br />
<br />
<b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /home2/mydomain/public_html/catalog/admin/includes/functions/sessions.php:67) in <b>/home2/mydomain/public_html/catalog/admin/includes/functions/sessions.php</b> on line <b>67</b><br />
<br />
<b>Warning</b>: main(includes/languages/english/) [<a href='function.main'>function.main</a>]: failed to open stream: No such file or directory in <b>/home2/mydomain/public_html/catalog/admin/includes/application_top.php</b> on line <b>133</b><br />
<br />
<b>Warning</b>: main() [<a href='function.include'>function.include</a>]: Failed opening 'includes/languages/english/' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/home2/mydomain/public_html/catalog/admin') in <b>/home2/mydomain/public_html/catalog/admin/includes/application_top.php</b> on line <b>133</b><br />

I also facing with that problem

Link to comment
Share on other sites

Hi Jack,

 

Thanks agian for this supper tool. Their is only one issue that I see. I think I just have a configure that I didnt do but not sure what.

 

The script works great when you run it manually, but it finds nothing when it runs with a cron job.

 

Any ideas?

 

What does it mean when the times are mismatched?

 

Thanks,

Eric

Edited by matrix2223
Link to comment
Share on other sites

Are you getting an error message from cron?

 

When a file is written to the server, the date and time are recorded for when that happened. So if the times don't match, it means the file has been rewritten.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Great script, everything is working but....

 

If I delete a file and change a permission - only the deleted file is shown as being changed.

 

Anyway we can show both changes?

Edited by pyramids
Link to comment
Share on other sites

If a file is deleted, the rest of the checking is skipped. The reason for this is because in order to compare the reference file with the new list when a file is deleted, multiple compares would have to be performed between the two lists. That would take too much time for most servers and the script would time out. There is a way to code around it but I didn't think it was worth the time when I was writing it since, I think, most sites don't delete files as a general rule. But it can be added to the next version. For now, if a file is intentionally deleted, it is best to also delete the reference file.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi Jack,

 

Im not getting any errors from the cron job. When it sends me the email it says everything is fine. Even though I have been working on it and adding a bunch of new files. Howerver when I run it automatically. It tells me all the necessarry stuff. No biggie to me I was just wondering if it was something that I was supposed to set with it the sitemonitor.php

 

Thanks,

 

Eric

Link to comment
Share on other sites

The only difference between running it from cron and manually, is that the path may be different. Try deleting the reference file and let cron create it when it runs. That might fix it.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 2 weeks later...

Jack

I modified the script to do the following:

 

1: Keep a detailed log

2: Update the reference file every time there are changes.

3: Added a timer

4: Will now check all file changes including deleted files

5: List sub directories to exclude

6: Removed the call to "require('includes/application_top.php')" and updated the mail function

7: Updated message and email reporting

 

Besides being a script to keep an eye out for hackers....especially any 777 folders - it now is a

great way to journal any modifications automatically.

 

If you are interested I will post the script

Link to comment
Share on other sites

Update the reference file every time there are changes.
Doesn't this defeat the purpose? If an email is missed or not delivered for some reason, one would never know a change has been made.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I updated the script to be more of a journal to keep a running list of all changes. This way a year from now I won't be referencing files I may have removed or changed due to a modification. The script updates a log besides the email so a missing email shouldn't be a problem.

Link to comment
Share on other sites

I updated the script to be more of a journal to keep a running list of all changes. This way a year from now I won't be referencing files I may have removed or changed due to a modification. The script updates a log besides the email so a missing email shouldn't be a problem.

 

Jack,

After thinking about it you have a good point...In regard to the ref file and when it is written:

 

I added the ability for the user to choose between a journal that writes a new ref file every time there are changes or the original way of writing the file one time only that can only be overwritten when the user deletes the ref file.

 

Have a nice day!

Link to comment
Share on other sites

5: List sub directories to exclude

6: Removed the call to "require('includes/application_top.php')" and updated the mail function

 

Im interested in those two changes. Can we just remove the 'require('includes/application_top.php')' part without anything else being effected? Some of my cron job errors refer to application_top.php.

Edited by Sid04
Link to comment
Share on other sites

Im interested in those two changes. Can we just remove the 'require('includes/application_top.php')' part without anything else being effected? Some of my cron job errors refer to application_top.php.

 

It is more involved than just a few simple changes.

 

PM me with your email address and I will email you the updated script.

Link to comment
Share on other sites

Im interested in those two changes. Can we just remove the 'require('includes/application_top.php')' part without anything else being effected? Some of my cron job errors refer to application_top.php.

If your cron job is failing on that, it is because it is not setup correctly. You probably have to add a command to cd into the admin directory, something like

cd /home/user/public_html/admin/;

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...