Jump to content



Photo
* * * * * 3 votes

SiteMonitor


  • Please log in to reply
2155 replies to this topic

#21   Sid04

Sid04
  • Members
  • 433 posts
  • Real Name:Bob bob

Posted 08 August 2006 - 15:35

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");

Edited by Sid04, 08 August 2006 - 15:37.


#22   Jack_mcs

Jack_mcs
  • Members
  • 26,497 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 08 August 2006 - 17:04

It should but I never tested it. You can try it though. Just delete your reference file and run it from admin. If it runs and your reference file has valid entries, then you are all set.

Jack

#23   Sid04

Sid04
  • Members
  • 433 posts
  • Real Name:Bob bob

Posted 09 August 2006 - 04:00

What I posted above does work, just FYI.

Question for you though. I can use the above and scan my admin directory minus the images folder.....all works fine. I can then run the sitemonitor.php file and it runs very quickly, but if I add a small text file on the server(just a test file so it can find something different) it times out. Why does it run SO fast if no files have changed but time out if anything has changed?

#24   Jack_mcs

Jack_mcs
  • Members
  • 26,497 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 09 August 2006 - 12:52

When a new file is added a different section of code is used to check for changes. This other section requires several passes to be made to find the changes. If the number of files being checked are large then it might time out on you. You would need to limit the files a little more until it will run without timing out. It is a server limitation and there is no easy way to code around that, other than limiting the size of the reference file.

Jack

#25   Sid04

Sid04
  • Members
  • 433 posts
  • Real Name:Bob bob

Posted 09 August 2006 - 14:37

What actually controls the length of time until the timeout?

#26   Jack_mcs

Jack_mcs
  • Members
  • 26,497 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 09 August 2006 - 16:04

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

#27   eww

eww
  • Members
  • 2,466 posts
  • Real Name:eww
  • Gender:Not Telling

Posted 09 August 2006 - 17:07

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?

#28   Jack_mcs

Jack_mcs
  • Members
  • 26,497 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 09 August 2006 - 18:28

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

#29   Sid04

Sid04
  • Members
  • 433 posts
  • Real Name:Bob bob

Posted 10 August 2006 - 03:58

Anybody else getting errors in their cron output? Ive got the cron job setup and running ok but its outputting errors(the cron sends an email out after it runs).

This normal?

#30   Sid04

Sid04
  • Members
  • 433 posts
  • Real Name:Bob bob

Posted 10 August 2006 - 04:06

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



#31   moraira

moraira
  • Members
  • 2 posts
  • Real Name:Fournier

Posted 10 August 2006 - 11:47

Hi all,
I downloaded and installed Sitemonitor contribution and it works great, no pb at all /biggrin.gif' class='bbc_emoticon' alt=':D' />
All the features work perfectly...

Many thanks to the author !!!

Jean-Pierre.

#32   Jack_mcs

Jack_mcs
  • Members
  • 26,497 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 10 August 2006 - 12:58

heres the cron output is interested:

Does the sitemonitor.php script work when ran manually?

Jack

#33   moraira

moraira
  • Members
  • 2 posts
  • Real Name:Fournier

Posted 10 August 2006 - 13:40

Does the sitemonitor.php script work when ran manually?

Jack


Yes it works fine when run manually, I tried to modify one file and the email alert work too !!!
Thanks a lot.
Jean-Pierre

#34   Sid04

Sid04
  • Members
  • 433 posts
  • Real Name:Bob bob

Posted 10 August 2006 - 14:30

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

#35   Sid04

Sid04
  • Members
  • 433 posts
  • Real Name:Bob bob

Posted 12 August 2006 - 15:05

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?

#36   Rezolles_Net

Rezolles_Net
  • Members
  • 201 posts
  • Real Name:Rezolles
  • Location:Malaysia

Posted 12 August 2006 - 15:29

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

#37   matrix2223

matrix2223
  • Members
  • 862 posts
  • Real Name:Eric
  • Gender:Male
  • Location:MD USA

Posted 13 August 2006 - 07:29

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, 13 August 2006 - 07:31.

Eric

Keep up on osCommerce changes and updates at Github | Understand osCommerce a little further at OsCommerce Documentation | Copy and paste your error message in Google add "in osCommerce" at the end to get relevant answers to most issues.


#38   Jack_mcs

Jack_mcs
  • Members
  • 26,497 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 13 August 2006 - 13:47

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

#39   pyramids

pyramids
  • Members
  • 380 posts
  • Real Name:Jeff
  • Gender:Male
  • Location:Pennsylvania

Posted 14 August 2006 - 21:15

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, 14 August 2006 - 21:16.


#40   Jack_mcs

Jack_mcs
  • Members
  • 26,497 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 14 August 2006 - 23:13

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