Jump to content
Jack_mcs

SiteMonitor

Recommended Posts

Thanks for pointing out the error.

 

As for the timeout, I just found some problems in the configure setup file that will cause a timeout even if the override option is used. I don't have time to go through all of the changes right now but this one may help. In sitemonitor_configure_setup.php, delete this code

  $exclude_hacked_files_array = array();

 GetListAllFiles($start_dir, 1, 1, $exclude_hacked_files_array, strlen($start_dir), $start_dir);
 $exclude_hacked_files_selector = array();

 $exclude_hacked_files_selector[] = array('id' => 0, 'text' => TEXT_MAKE_SELECTION);
 for ($i = 0; $i < count($exclude_hacked_files_array); ++$i) {
     $exclude_hacked_files_selector[] = array('id' => $i+1, 'text' => $exclude_hacked_files_array[$i]);
 }

 

Thanks! That seems to have worked. Any idea about the other error that I keep getting when I try to delete files out of the admin section of Site Monitor?

 

 

Failed to write to file - %s

Share this post


Link to post
Share on other sites

Thanks! That seems to have worked. Any idea about the other error that I keep getting when I try to delete files out of the admin section of Site Monitor?

 

 

Failed to write to file - %s

 

 

Figured out the above error finally. It's because my quarantine directory permissions weren't set to 777. Is it safe to keep this at 777? Also how come I cannot delete anything out of it now? It says 550 no such file or directory when I try to delete anything out of the quarantine directory.

Share this post


Link to post
Share on other sites

Figured out the above error finally. It's because my quarantine directory permissions weren't set to 777. Is it safe to keep this at 777? Also how come I cannot delete anything out of it now? It says 550 no such file or directory when I try to delete anything out of the quarantine directory.

Those are both questions you need to ask your host about. 777 should never be used but many servers are setup to where you have to use them. As long as your admin is password protected, that should not be a problem but it isn't a good idea, in general.

Share this post


Link to post
Share on other sites

Jack,

 

Was wondering if you had a solution for this issue

 

Link to post in OSC Forum

 

Great contribution. I'm using it on several sites.

 

I've only run into an issue today and I'm not sure if it was because of the order of installation of various security contributions.

 

The other sites I've always added your contrib last.

 

This time, I added Security Pro 2, then Bad Behavior then Site Monitor.

 

Now when I go into my admin section to set up Site Monitor, I get the 403 page and my IP gets added to the htaccess file as 'deny from'.

 

So, I temporarily disabled Bad Behavior - then continued setting up Site Monitor.

 

I also added two cron jobs that will run Site Monitor. I re-enabled Bad Behavior and now I still get the 403 page, and my IP is denied when I try to access the 'configure' section of Site Monitor in my admin.

 

Is there a way to always allow a script to run? How can I remedy this situation?

 

Thanks in advance.

 

Dave

 

Thanks,

 

Dave

Share this post


Link to post
Share on other sites

Was wondering if you had a solution for this issue

I'm not familiar with either of those contributions. You'll need to ask in their support threads.

Share this post


Link to post
Share on other sites

Hi all and thanks Jack for all your work.

I've tried this (SiteMonitor V2.8) on two of my sites but I can't figure it out.

The first four steps seem basic like any other addon contribution so I can't figure out what I've done wrong.

 

For step 5, I logged into the admin and looked at the left for SiteMonitor but nothing.

 

Can anyone offer any dvice?

Edited by CutieCute2

Share this post


Link to post
Share on other sites

Hi all and thanks Jack for all your work.

I've tried this (SiteMonitor V2.8) on two of my sites but I can't figure it out.

The first four steps seem basic like any other addon contribution so I can't figure out what I've done wrong.

 

For step 5, I logged into the admin and looked at the left for SiteMonitor but nothing.

 

Can anyone offer any dvice?

What does "nothing" mean? Nothing is there? Nothing happens when you click on the link? Something else? What version of oscommerce are you using?

Share this post


Link to post
Share on other sites

What does "nothing" mean? Nothing is there? Nothing happens when you click on the link? Something else? What version of oscommerce are you using?

Nothing is there to click on. OSC V2.2. I have tried new and old versions of sitemonitor, tried to install it on a site with security pro, one without then I made a fresh OSC shop and tried it there. I have no clue as to what's wrong.

 

Thanks

Share this post


Link to post
Share on other sites

I've spent a few hours looking at the files trying to work out how things work but didn't make much progress at all.

If one wanted to create a new line (with or without a link to click on) in the admin menu list, which file would need to be modified? How would this be done?

Or Is the one line placed in "admin/includes/leftcolumn.php" and the seperate file like sitemonitor.php produce the text in the admin menu?

Share this post


Link to post
Share on other sites

I've spent a few hours looking at the files trying to work out how things work but didn't make much progress at all.

If one wanted to create a new line (with or without a link to click on) in the admin menu list, which file would need to be modified? How would this be done?

Or Is the one line placed in "admin/includes/leftcolumn.php" and the seperate file like sitemonitor.php produce the text in the admin menu?

If you don't see a link in the left column of admin, you've either made a mistake or you have some contribution installed that requires extra steps. You said you tried it in a fresh shop but you mention the "admin menu list," which doesn't exist in a stock shop. In a fresh shop, if you have made the change to the column_left.php file, it wouldn't matter if any other of the changes were made or not. The link would still be there. So you need to figure out what shop you are installing this into, what contributions you have installed and if you have made the changes to the correct file.

Share this post


Link to post
Share on other sites

If you don't see a link in the left column of admin, you've either made a mistake or you have some contribution installed that requires extra steps. You said you tried it in a fresh shop but you mention the "admin menu list," which doesn't exist in a stock shop. In a fresh shop, if you have made the change to the column_left.php file, it wouldn't matter if any other of the changes were made or not. The link would still be there. So you need to figure out what shop you are installing this into, what contributions you have installed and if you have made the changes to the correct file.

Thanks for taking the time to try to help me.

When i said "admin menu list" I meant the column on the left side of the admin page.

I've been through the first four steps a number of times to see if I'm making a mistake, but still no luck.

 

Are you saying if my admin/includes/column_left.php file includes

require(DIR_WS_BOXES . 'sitemonitor.php');

with no other changes, I would be able to see something in the left column?

 

How about

require(DIR_WS_BOXES . 'blablabla.php');

?

 

If this is not the case, my curiosity still lies in the question. If one wanted to create a new line (with or without a link to click on) in the left column on the admin page, which file or files would need to be modified? How would this be done?

Edited by CutieCute2

Share this post


Link to post
Share on other sites

Thanks for taking the time to try to help me.

Are you saying if my admin/includes/column_left.php file includes

require(DIR_WS_BOXES . 'sitemonitor.php');

with no other changes, I would be able to see something in the left column?

 

How about

require(DIR_WS_BOXES . 'blablabla.php');

?

Yes, that is correct. It may not display something useable there, depending upon how you add it, but it will make a change to the left column. In the case of require(DIR_WS_BOXES . 'blablabla.php');, it should cause a load failure message to be displayed. So if you add that and your admin loads without error, then you aren't changing the right file. In that case, try deleting the column_left.php file completely (make a backup, of course) and the admin will probably still load. If that is the case, be sure you are making the changes in the admin/includes/ directory, not the includes/ directory.

Share this post


Link to post
Share on other sites

I'm not familiar with either of those contributions. You'll need to ask in their support threads.

 

Hi Jack,

 

I did, that's the link to the forum for the Bad Behavior contrib.

 

Just wasn't sure if you had anyone else use Site Monitor in conjuction with Bad Behavior.

 

Cheers,

Dave

Share this post


Link to post
Share on other sites

Yes, that is correct. It may not display something useable there, depending upon how you add it, but it will make a change to the left column. In the case of require(DIR_WS_BOXES . 'blablabla.php');, it should cause a load failure message to be displayed. So if you add that and your admin loads without error, then you aren't changing the right file. In that case, try deleting the column_left.php file completely (make a backup, of course) and the admin will probably still load. If that is the case, be sure you are making the changes in the admin/includes/ directory, not the includes/ directory.

 

Thanks for you post.

I can confirm that

(DIR_WS_BOXES . 'blablabla.php');, does create a fatal error message

(DIR_WS_BOXES . 'tools.php');,

(DIR_WS_BOXES . 'tools.php');, Creates the tools link twice. and

(DIR_WS_BOXES . 'sitemonitor.php');, produces nothing at all.

 

I think I have a basic problem so I've tried to understand the basic operations of the (your?) addon contribution.

When the admin index page is loaded it calls (pardon my amature languague) the admin/includes/column_left.php which lists all the links to be placed in the left column. (as above). The line (DIR_WS_BOXES . 'tools.php');,

calls the admin/includes/boxes/tools.php file which contains something like HEADING_BOX_TOOLS which call the word "Tools" from the admin...english.php . All the above is true for the sitemonitor link but nothing is displayed.

 

I even cut the contents of boxes/sitemonitor.php and pasted into boxes/tools.php but the word Tools disappeared from the list of links in the left column.

 

I've been wanting a contribution like this for the last year but just came across it recently. It's such a shame I can't use it.

Share this post


Link to post
Share on other sites

Thanks for you post.

I can confirm that

(DIR_WS_BOXES . 'blablabla.php');, does create a fatal error message

(DIR_WS_BOXES . 'tools.php');,

(DIR_WS_BOXES . 'tools.php');, Creates the tools link twice. and

(DIR_WS_BOXES . 'sitemonitor.php');, produces nothing at all.

 

I think I have a basic problem so I've tried to understand the basic operations of the (your?) addon contribution.

When the admin index page is loaded it calls (pardon my amature languague) the admin/includes/column_left.php which lists all the links to be placed in the left column. (as above). The line (DIR_WS_BOXES . 'tools.php');,

calls the admin/includes/boxes/tools.php file which contains something like HEADING_BOX_TOOLS which call the word "Tools" from the admin...english.php . All the above is true for the sitemonitor link but nothing is displayed.

 

I even cut the contents of boxes/sitemonitor.php and pasted into boxes/tools.php but the word Tools disappeared from the list of links in the left column.

 

I've been wanting a contribution like this for the last year but just came across it recently. It's such a shame I can't use it.

SiteMonitor will work in any oscommerce-based shop so there's no reason why you can't use it. Your explanation of how the code works is exactly what happens so it seems you have a grasp of what is going on. THe left parenthesis in (DIR_WS... is incorrect but I'm guessing you just typed that in here. If the tools link disappeared after you copied the contents of the file, then it would seem something in the file is causing a failure. Although I don't see how the rest of your admin can function if that is the case. But assuming it is, check the error_log in the admin directory, if there is one, or ask your host to look at the error log so see what is causing the problem. Also, try renaming admin/includes/boxes/tools.php to sitemonitor.php and vice versa to see what results that gives.

Share this post


Link to post
Share on other sites

SiteMonitor will work in any oscommerce-based shop so there's no reason why you can't use it. Your explanation of how the code works is exactly what happens so it seems you have a grasp of what is going on. THe left parenthesis in (DIR_WS... is incorrect but I'm guessing you just typed that in here. If the tools link disappeared after you copied the contents of the file, then it would seem something in the file is causing a failure. Although I don't see how the rest of your admin can function if that is the case. But assuming it is, check the error_log in the admin directory, if there is one, or ask your host to look at the error log so see what is causing the problem. Also, try renaming admin/includes/boxes/tools.php to sitemonitor.php and vice versa to see what results that gives.

 

Hi Jack,

 

Problem solved. I had contributions 7729 and 4441 downloaded to my computer. I was using 7729 which is for OSC V2.3. When I opened 4441, I saw the two versions and realized there was a seperate version for V2.2.

 

I've made good progress since then.

Thanks for a great contribution and for your advice.

Share this post


Link to post
Share on other sites

Problem solved. I had contributions 7729 and 4441 downloaded to my computer. I was using 7729 which is for OSC V2.3. When I opened 4441, I saw the two versions and realized there was a seperate version for V2.2.

 

I've made good progress since then.

Thanks for a great contribution and for your advice.

Ahh, I wasn't aware someone had uploaded a different version. Too bad that person chose to muddy the contribution waters. It happens all to often, unfortunately. This version is for both versions of oscommerce so the other will just tend to confuse people. Thanks for pointing that out since I'm sure it will come up again.

Share this post


Link to post
Share on other sites

Hi Jack,

 

I did, that's the link to the forum for the Bad Behavior contrib.

 

Just wasn't sure if you had anyone else use Site Monitor in conjuction with Bad Behavior.

 

Cheers,

Dave

Share this post


Link to post
Share on other sites

The problem is in your .htaccess file you added changes that ban anyone from accessing any file with _setup in it, basically preventing anyone trying to get in thinking there may be a setup file. Either need to remove that or just change sitemonitor file name that ends in _setup to something else and all referring links to it.

 

Banned myself couple times before I looked at that.

 

All you should have to do is change the filename and the definition under filenames.php to your new name.

 

Or again remove that condition in your htaccess file

 

Havent bothered because still playing w/2.3 newness and seeing how much I can break it

Edited by MHWD

Share this post


Link to post
Share on other sites

Hi Jack

 

ive just installed site monitor on my oscommerce store but i keep getting timed out when i click site monitor > configure or admin

 

i read your contribution to change the below

 

in admin/sitemonitor_admin.php

$handleErrors = true;

and change it to

$handleErrors = false;

 

thing is , i cant find the code in sitemonitor_admin.php

 

i keep getting this error below

 

Fatal error: Maximum execution time of 30 seconds exceeded in /home/ecommerva/domains/ecommercevalue.com/public_html/1/includes/functions/sitemonitor_functions.php on line 430

 

 

please help!

 

thanks much!

 

ray

Edited by rayjuan

Share this post


Link to post
Share on other sites

i read your contribution to change the below

 

in admin/sitemonitor_admin.php

$handleErrors = true;

and change it to

$handleErrors = false;

It's in admin/includes/functions/sitemonitor_functions.php. But your problenm is probably due to code I mentioned removing on the last page.

Share this post


Link to post
Share on other sites

A new version has been uploaded containing the following changes:

 

- Added an option to the configure settings to delete log files after a set number of days.

- Added a log reader.

- Changed filter code so sitemonitor files are ignored in a scan.

- Changed code that checks for possible hacker files in the images directory (suggested by user burt).

- Changed the setting that add error checking to false since too many sites were having problems with it.

- Corrected instructions for creatnig cron jobs (found by user csiemons).

- Declared a variable at the beginning of sitemonitor_admin.php to prevent a missing variable warning.

- Fixed coding mistake in sitemonitor_hacker_cron.php that prevented the reference file that was causing the array_flip error.

Share this post


Link to post
Share on other sites

Hi Jack,

 

updated to the latest version and I am trying to get to grips with things.

 

I have an option of 0-9 configuration files (what is the difference or is it so that I can create several different options to concentrate on various areas?

 

with respect to the hacker code section. this is what i need to get my head around.

Can you explain briefly what each part means and what happens if I do x y or z.

 

just i am doing things and dont really understand what they are doing, I havent excluded anything, as after all I would want to make sure nothing changes with any file??

 

error_reporting(0) for admin/sitemonitor_configure_9.php also numbers 0 1 and 2 which are the config files I ran, but I dont know why I ran them.

 

also I dont have .htaccess file protecting the image directory however is there any guidance on what should be used as I rea a thread about it and was surprised there was conflicting information so wasnt sure what i should be using.

 

sorry if I sound stupid, but run the code its highlighted a few things but just dont have a clue whats going on and what i should be doing with the info I get. The files highlighted and checked are okay, but I dont know if I have checked all the files i should have and or why i havent checked them.

 

Thanks


Getting better with mods but no programmer am I.

Share this post


Link to post
Share on other sites

I have an option of 0-9 configuration files (what is the difference or is it so that I can create several different options to concentrate on various areas?

It allows you to create multiple instances of SiteMonitor. That is only needed if one instance can't moniotr all of your files. For many shops, one is all that is needed.

 

with respect to the hacker code section. this is what i need to get my head around.

Can you explain briefly what each part means and what happens if I do x y or z.

I can't answer a general question like that. There is text on the page that explains the results. Repeating it here would be a waste of time. Ask a specific question and I will address it though.

 

just i am doing things and dont really understand what they are doing, I havent excluded anything, as after all I would want to make sure nothing changes with any file??

 

error_reporting(0) for admin/sitemonitor_configure_9.php also numbers 0 1 and 2 which are the config files I ran, but I dont know why I ran them.

 

also I dont have .htaccess file protecting the image directory however is there any guidance on what should be used as I rea a thread about it and was surprised there was conflicting information so wasnt sure what i should be using.

 

Read the instructions on how to fix that.

 

sorry if I sound stupid, but run the code its highlighted a few things but just dont have a clue whats going on and what i should be doing with the info I get. The files highlighted and checked are okay, but I dont know if I have checked all the files i should have and or why i havent checked them.

The hacker test checks all of the files in your shop and admin. It will only skip reporting some it finds if they have been excluded. You shouldn't exclude any in the hacker test unless you know they are not hacker files. Read the instructions for help in determining that.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×