Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SiteMonitor


Jack_mcs

Recommended Posts

The original code did check the directories but I changed it for speed. My thinking was that there isn't any reason to check directories since, if someone hacked into your site, it would be a waste of time for them to just change the directory settings. Is there another reason you would want those monitored?

 

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

In case any body is interested: try the following to get the manual way to run in admin area.

 

 

1 In sitemonitor.php find line 29 ish and make sure:

 

define('VERBOSE', 1);

 

2 Edit admin/includes/boxes/tools.php

 

Add the following line to the end of ' $contents[] = array( ' after last '<a href'

 

'<a href="' . tep_href_link(sitemonitor.php) . '" class="menuBoxContentLink">' . BOX_TOOLS_SITEMONITOR . '</a>');

 

Remember to replace '</a>'); on previous line with '</a><br>' . or you will get an error

 

3 Edit admin/includes/languages/english.php

 

Add the following:

 

define('BOX_TOOLS_SITEMONITOR', 'Site Monitor');

 

 

 

Under tools section in admin should be site monitor. This will manually run the check and display the results.

 

Once finished click back button.

 

Chris

Link to comment
Share on other sites

  • 2 weeks later...
chmod your admin directory with 777 but DON'T chmod the files within! just the directory!

 

 

Is this safe? Without doing this I get an openbase dir error, but I'm a bit concerned about 777ing the admin directory.

 

Thanks... very nice and simple contrib.

Link to comment
Share on other sites

  • 2 weeks later...

I can manually run site monitor with great results, I am new to cron jobs but I tried to set it up and this was the result I got.

 

Status: 404

X-Powered-By: PHP/4.4.2

Content-type: text/html

 

No input file specified.

 

This is the command I used

php /home/xxxx/public_html/catalog/xxxx/sitemonitor.php

 

Since I am unfamiliar with cronjobs I am not sure this error No input file specified is on my side in the cron job or I need to set something in the php files.

 

Thank you

Wendy

Link to comment
Share on other sites

The syntax for cron jobs vary with hosts. You may have to cd into your admin directory for it to work. Your host should be able to provide you with the proper syntax but you could try

cd /home/xxxx/public_html/catalog/xxxx/; php sitemonitor.php

 

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...
I can manually run site monitor with great results, I am new to cron jobs but I tried to set it up and this was the result I got.

 

Status: 404

X-Powered-By: PHP/4.4.2

Content-type: text/html

 

No input file specified.

 

This is the command I used

php /home/xxxx/public_html/catalog/xxxx/sitemonitor.php

 

Since I am unfamiliar with cronjobs I am not sure this error No input file specified is on my side in the cron job or I need to set something in the php files.

 

Thank you

Wendy

I received a similar error 404 when setting up cron... removed the bit that Jack mentions in the path as USERNAME and it worked perfectly. :thumbsup:

 

Cheers Jack, great contribution!

 

----------

Dave

one-click installation..

Dave's info

Link to comment
Share on other sites

This is the results Im getting when I run SiteMonitor manualy.........

 

What am I doing wrong ?

 

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /homepages/18/d174507728/htdocs/rivercityweb/admin/sitemonitor.php:1) in /homepages/18/d174507728/htdocs/rivercityweb/admin/includes/functions/sessions.php on line 67

No new files found...

No deleted files found...

No size differences found...

No time mismatches found...

No permissions mismatches found...

Email sent to shop owner.

Toby Wilson

Link to comment
Share on other sites

A new version has been uploded. Here are the major changes:

 

- Added error_log to the excluded files code (works now).

- Added admin control section.

- Added code to allow sub-directories to be excluded.

- Added log function (creates a log of all changes if option is set).

- Fixed bug in functions file.

 

I didn't provide any update instructions since all of the files were changed. Just follow the install instructions in the readme. You can delete the sitemonitor_functions.php file from the admin directory since that has been moved to the functions directory.

 

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 had to comment out these two lines in sitemonitor_functions.php in order to make the script run without giving me error messages:

 

$dp=opendir($dir);

 

while (false!=($file=readdir($dp)) && $level == $last)

 

If I leave those two lines in, I get these error messages:

 

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

 

Warning: readdir(): supplied argument is not a valid Directory resource in /home/[username]/public_html/osCommerce/catalog/[admin]/includes/functions/sitemonitor_functions.php on line 58

Reference file creation failed.

 

Any suggestions?

Link to comment
Share on other sites

I had to comment out these two lines in sitemonitor_functions.php in order to make the script run without giving me error messages:

 

$dp=opendir($dir);

 

while (false!=($file=readdir($dp)) && $level == $last)

 

If I leave those two lines in, I get these error messages:

 

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

 

Warning: readdir(): supplied argument is not a valid Directory resource in /home/[username]/public_html/osCommerce/catalog/[admin]/includes/functions/sitemonitor_functions.php on line 58

Reference file creation failed.

 

OK, I think I have it working now. I had to use Control Panel to CHMOD the configuration file to get it to take the changes I made, then everything started to work.

Link to comment
Share on other sites

Hi, Jack,

 

I installed your newest contribution and I have one issue. I don't have a problem in creating the reference file, however, whenever I try to use Execute Sitemonitor, a blank page ultimately appears after about 60 seconds and there is no email sent to my email address.

 

Any help will be appreciated!

 

Ken

Link to comment
Share on other sites

There's a timeout limit on servers (60 seconds is quite long). If you reach that limit, that might happen. Try excluding some directories from the search (be sure to regenerate the reference file afterwards).

 

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

My cron job is not working here is what i get. I tried both ways to run the job.

 

Status: 302

X-Powered-By: PHP/4.4.1

Set-Cookie: osCAdminID=54a2be68ad897cf711891d1e789d3cec; path=/catalog/; domain=www.mywebsite.com

Expires: Thu, 19 Nov 1981 08:52:00 GMT

Cache-Control: no-catalog, no-cache, must-revalidate, post-check=0, pre-check=0

Pragma: no-cache

Location: https://www.mywebsite.com/catalog/admin/log...1891d1e789d3cec

Content-type: text/html

 

<br />

<b>Warning</b>: main(includes/languages/english/): failed to open stream: No such file or directory in <b>/home/xxxx/public_html/catalog/admin/includes/application_top.php</b> on line <b>202</b><br /> <br />

<b>Warning</b>: main(includes/languages/english/): failed to open stream: No such file or directory in <b>/home/xxxx/public_html/catalog/admin/includes/application_top.php</b> on line <b>202</b><br /> <br />

<b>Warning</b>: main(): Failed opening 'includes/languages/english/' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in <b>/home/xxxx/public_html/catalog/admin/includes/application_top.php</b> on line <b>202</b><br />

Link to comment
Share on other sites

The standard cron syntax won't work for all servers. You will need to contact your host to get the proper syntax.

 

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

My cron job is not working here is what i get. I tried both ways to run the job.

 

Status: 302

X-Powered-By: PHP/4.4.1

Set-Cookie: osCAdminID=54a2be68ad897cf711891d1e789d3cec; path=/catalog/; domain=www.mywebsite.com

Expires: Thu, 19 Nov 1981 08:52:00 GMT

Cache-Control: no-catalog, no-cache, must-revalidate, post-check=0, pre-check=0

Pragma: no-cache

Location: https://www.mywebsite.com/catalog/admin/log...1891d1e789d3cec

Content-type: text/html

 

<br />

<b>Warning</b>: main(includes/languages/english/): failed to open stream: No such file or directory in <b>/home/xxxx/public_html/catalog/admin/includes/application_top.php</b> on line <b>202</b><br /> <br />

<b>Warning</b>: main(includes/languages/english/): failed to open stream: No such file or directory in <b>/home/xxxx/public_html/catalog/admin/includes/application_top.php</b> on line <b>202</b><br /> <br />

<b>Warning</b>: main(): Failed opening 'includes/languages/english/' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in <b>/home/xxxx/public_html/catalog/admin/includes/application_top.php</b> on line <b>202</b><br />

My Hosting said that syntax I put in is correct. This is what is in line 202 in the application_top.php

 

include(DIR_WS_LANGUAGES . $language . '/' . $current_page);

 

Any ideas

Link to comment
Share on other sites

Assuming you can run the script manually, the problem is with cron. Although convincing your host of that may not be so easy. Try this command

cd /home/USERNAME/public_html/admin; /usr/local/bin/php /home/USERNAME/public_html/admin/sitemonitor.php

You will need to change USERNAME as well as correct the paths if they are not correct. If that doesn't work, go back to your host and explain that the script can be ran manually so it has to be cron related.

 

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

Assuming you can run the script manually, the problem is with cron. Although convincing your host of that may not be so easy. Try this command
cd /home/USERNAME/public_html/admin; /usr/local/bin/php /home/USERNAME/public_html/admin/sitemonitor.php

You will need to change USERNAME as well as correct the paths if they are not correct. If that doesn't work, go back to your host and explain that the script can be ran manually so it has to be cron related.

 

Jack

Will tray and let you know thanks for a quick response.

Link to comment
Share on other sites

Will tray and let you know thanks for a quick response.

I also tried that but get the same error. This is what support told me

 

Hello:

The errors you are seeing are just warnings so running it manually may be suppressing the warnings. If you have the PHP reporting mode set so that it reports Warnings also, you may receive the warnings as well.

 

Any Ideas?

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