Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SiteMonitor


Jack_mcs

Recommended Posts

No one has a reported a problem and it is working here. Take a look at the admin/sitemonitor_config.php file. Are the items you want to exclude listed in there?

 

Jack

 

Sorry for not responding to your prompt reply. I got tied up and then forgot about it.

 

Any the sitemonitor_config.php file is working fine.

EG: this is the array that is currently in it.

 

array("home/trublue/public_html/shop/admin/includes/graphs",
"home/trublue/public_html/shop/admin/backups","home/trublue/public_html/shop/admin/preformat",
"home/trublue/public_html/shop/temp","home/trublue/public_html/shop/images/imagecache",
"home/trublue/public_html/shop/cache");

 

This is the report via email from a script run I just did.

NEW FILES:

Found a new file named admin/backups/db_trublue_osc1-20070128143743.sql

Found a new file named admin/backups/db_trublue_osc1-20070122153536.sql

Found a new file named admin/backups/db_trublue_osc1-20070124105115.sql

Found a new file named admin/backups/db_trublue_osc1-20070125011847.sql

Found a new file named admin/backups/db_trublue_osc1-20070127120412.sql

Found a new file named images/imagecache/chimei_t39d.jpg Found a new file named images/imagecache/chimei_945a.jpg Found a new file named images/imagecache/chimei_946D.jpg Found a new file named images/monitors/lcd/chimei_945a.jpg

Found a new file named images/monitors/lcd/chimei_946D.jpg

Found a new file named cache/also_purchased-english.cache1187

Found a new file named cache/also_purchased-english.cache851

Found a new file named cache/also_purchased-english.cache962

Found a new file named cache/also_purchased-english.cache963

Found a new file named cache/also_purchased-english.cache964

Found a new file named cache/also_purchased-english.cache1027

Found a new file named cache/also_purchased-english.cache552

 

DELETED FILES:

Found a deleted file named admin/backups/db_trublue_osc1-20061226163148.sql

Found a deleted file named admin/backups/db_trublue_osc1-20061227000124.sql

Found a deleted file named admin/backups/db_trublue_osc1-20061219001351.sql

Found a deleted file named admin/backups/db_trublue_osc1-20061220103631.sql

Found a deleted file named admin/backups/db_trublue_osc1-20061221110712.sql

Found a deleted file named admin/backups/db_trublue_osc1-20061222092652.sql

Found a deleted file named admin/backups/db_trublue_osc1-20061223180143.sql

Found a deleted file named admin/backups/db_trublue_osc1-20061224144204.sql

Found a deleted file named cache/also_purchased-english.cache1153

Found a deleted file named cache/also_purchased-english.cache1133

Found a deleted file named cache/also_purchased-english.cache1065

Found a deleted file named cache/also_purchased-english.cache980

 

SIZE MISMATCH:

Size differences not checked due to deleted file(s)

 

TIME MISMATCH:

Time differences not checked due to deleted file(s)

 

PERMISSIONS MISMATCH:

Permissions not checked due to deleted file(s)

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Sitemonitor ran on January 28, 2007, 2:38 pm Total mismatches found were 29 Total files being monitored is 3282

 

As you can see it's just ignoring the ignore array.

 

I am wondering if there is something in the directory tree however.

The array in the script is showing "home/trublue/public_html/" but the email does not show the home URL at all.

Link to comment
Share on other sites

Yes, the problem is the exclude array has invalid entries. It should just contain the actual directories, not the path to them. Maybe your configure file is not set up correctly? You can edit that list before saving it and that should allow it to run. I can't say why it is recording the full path though.

 

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 downloaded site monitor 7 Jan 2007

 

When I click on update on either of these:

 

Execute Sitemonitor & Delete Reference File, I get this lovely error:

 

Warning: filesize() [function.filesize]: stat failed for sitemonitor_log.txt in /home/wwwshop/public_html/admin/includes/functions/sitemonitor_functions.php on line 59

 

Warning: opendir(/home/username/public_html) [function.opendir]: failed to open dir: No such file or directory in /home/wwwshop/public_html/admin/includes/functions/sitemonitor_functions.php on line 71

 

Warning: readdir(): supplied argument is not a valid Directory resource in /home/wwwshop/public_html/admin/includes/functions/sitemonitor_functions.php on line 73

Reference file creation failed.

 

I tried deleting the set_time_limit(0); as stated in install file but it made no difference. I disabled cron jobs, it made no difference. Have I forgotten something some where or could this be a server thing as stated in previous posts?

 

Thanks

Link to comment
Share on other sites

The first error is probably happening as a result of your server settings. The others are happening because the first failed. That's a small bug in the code I will have to fix. For the first, you can either turn the check log size option to off or contact your host and ask why that function fails. Turning the check log size option off won't cause any problems except that, over time, the log file will keep growning in size. If you remember to monitor it and delete or rename it at some pointer, then that would work fine.

 

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

Might be a silly question but how do I turn the check log size option to off ?

 

Do I uncheck this box?

 

Log File - If this option is checked, the sitemonitor.txt log file will be updated indicating the changes, if any, that were found.

 

Or just put the log file size to 0?

 

Or maybe neither?

 

Thanks

Link to comment
Share on other sites

Oops, you are correct. I don't know what I was thinking about turning that off. If you need it later though, edit the admin/indlcudes/funtions/site_monitor.php file and remove this line

CheckLogSize();

 

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...

awesome contribution .. very important for sake of security!

 

What about blank page when hiting UPDATE button .. possible timeout? any idea on fixing timeout?

Edited by gregy
Link to comment
Share on other sites

I don't use that contribution so can't say for sure but the sitemonitor files are no different than other files. Just add the configure_setup.php file to the menu as you would some other file. If you don't know how to do that, compare it to one that is already setup in the menu. Or you could ask in the support thread for that contribution as to how to add an item.

 

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

its this part i cant get right

 

 

$box_files_list[] = array("sitemonitor", "sitemonitor.php" , BOX_HEADING_SITEMONITOR);

 

 

apparently the 1st entry in the array has to be correct. ive tried Site Monitor, site monitor, SiteMonitor the box appears. but the items within the box dont, is this the correct name for the box?

Edited by Pilly
Link to comment
Share on other sites

This is the support thread for sitemonitor. You'll need to ask that question in the support thread for that contribution.

 

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

  • 1 month later...

jack,

 

when i get to:

Step 5: Go to admin->Sitemonitor->Configure, setup the various settings and

click Update.

 

 

 

it hangs and then wants to open the file as a text document. i haven't even had a chance to use this tool yet, so i'm doubtful it's anything to do with the size of any directories?

Link to comment
Share on other sites

Hmm, I don't know what that might be. You might want to try to edit the configure file manually. You shouldn't have to do that but maybe there is something about your server setup that is confusing 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

Hi!

 

That´s a great contrib!

 

But I have still two problems...

 

1. Exclude sub-directories:

The directory "/shopcache" contains a great number of sub-directories and files. The name of most of them changes daily. But the contrib just excludes the files in "/shopcache", not rekursivly the sub-directories und there files.

 

2. Exclude List Form:

The entries are seperated only by comma with no space behind and the listing is next to eath other and not line by line. Cause of this, the readability is really bad.

 

Will these things be better with an later release or does someone have any ideas to solve this?

 

Thx in advance,

Sascha

Link to comment
Share on other sites

1 - If you enter a directory to exclude, all sub-directories should be excluded.

 

2 - Some changes to the configure form are planned for the next version. Don't know when that will be though.

 

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

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

 

Jack:

 

Having just had a hacker get into our site with a javascript iframe insertion which overwrote our store files and our forums, I came across your great script. I installed, but did find that I could not get it to work until I manually created and uploaded an initial log file. Also still have problems with the Admin CP config and have been manually changing the config file for now. At least it is working, which is what is needed right now.

 

My problem/question is this: I would like to monitor the entire web site, but as per you post, if the script encounters any added or deleted files, it stops the comparative scan part. Our forum directory, however, creates a couple new files and deletes one for each post. We don't get many posts, so the changes are easy to verify. Since that is where the hack started (in that directory), I would hate to comment it out. But if I leave it in, I would never know if any existing files had been modified.

 

I don't mind the email about the posts, but is it possible for me to adjust your code to let it do the full scan even if it finds new and/or deleted files? I'm not very good with php, but can add, change code etc. Just can't write much, so am very appreciative of people like you that can.

 

Thanks.

Link to comment
Share on other sites

Not to sidestep the question but forums and galleries and other such add-ons should open in their own brwoser window. There was a hack a few years back that took down sites all over the place by entering the shop through the forum. But even if that wasn't a problem, you will lose your session ID's with it opening in the same browser, which is not a good idea.

 

To bypass the deleted problem, find this code in functions/sitemonitor.php

 $diff_deleted = array_diff($refFiles, $files);

and change it to

 $diff_deleted = 0;

I haven't tested that change but it won't hurt to try it. But even if it works, if you are on a shared server, I doubt the script will finish if you are monitoring the whole site, especially with the forum directory.

 

An alternative, and I haven't tried this either, is to create another copy of the admin/sitemonitor.php file. Name it admin/sitemonitor_2.php or whatever you want. Then create a copy of the sitemonitor_configure.php file, naming it whatever you want, like sitemonitor_configure_2.php. Then edit the new sitemonitor.php file and change this line

require('sitemonitor_configure.php');

to load in the other configure file, like

require('sitemonitor_configure_2.php');

Then manually edit the sitemonitor_configure_2.php file so that it checks different directories than the main one. Set up a second cron job to run the second script (at different times). This should by pass the timeout problem and allow you to monitor the whole site.

 

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...
  • 1 month later...

This is a great Contrib, I must say. I do not feel comfortable leaving my admin at 777, so I did not. Every time I update a file (which is all the time) I will just recreate the reference. Security is always a big thing for me, and this contrib puts some ease of mind, especially when I go on vacation if anything happens I'll know immediately (via my phone) and correct the problem.

 

Thanks for this,

-Jon

Link to comment
Share on other sites

  • 4 weeks later...

I have added the sitemonitor and uploaded the files as requested but I get the following error when going to Sitemonitor in Admin. Anyone have any ideas what this could be?

 

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

 

More information about this error may be available in the server error log.

 

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Link to comment
Share on other sites

Many things can cause an Internal Server error. Depending upon your hosts setup, it could be something as simple as the permissions settings. Or it might be the script is timing out due to too many files being checked. If the former, you will need to check with your host. For the latter, try limiting the number of files being checked in the configure settings. Those are the only two I can think to have you check but it could be caused by many others. Your host should be able to tell you what file is causing the failure. That won't solve it by itself but it may lead to the cause.

 

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

Hello,

 

Great contrib....security is an important element to conseider these days.

 

I Installed the contrib v 1.4 but when I Go to admin->Sitemonitor->Configure, setup the various settings and

click Update, I get the very same error that Ausgirl got in post 103

 

 

Warning: filesize() [function.filesize]: Stat failed for sitemonitor_log.txt (errno=2 - No such file or directory) in /home/dca/public_html/admin/includes/functions/sitemonitor_functions.php on line 59

 

Warning: opendir(/home/username/public_html) [function.opendir]: failed to open dir: No such file or directory in /home/dca/public_html/admin/includes/functions/sitemonitor_functions.php on line 71

 

Warning: readdir(): supplied argument is not a valid Directory resource in /home/dca/public_html/admin/includes/functions/sitemonitor_functions.php on line 73

Reference file creation failed.

 

I followed the insttructions in post 107 :

Oops, you are correct. I don't know what I was thinking about turning that off. If you need it later though, edit the admin/indlcudes/funtions/site_monitor.php file and remove this line

CODE

CheckLogSize();

 

the first error disappears, but the the other 2 continue there....

 

any ideas ?

 

dca

Link to comment
Share on other sites

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...