# TWiki Site Tools _Utilities for searching, navigation, and monitoring site activity_ TWiki Site Tools include utilities for navigating, searching and keeping up with site activity. Preferences can be configured by web or site-wide. You are currently in the **TWiki** web. In particular, TWiki provides two highly configurable, automated site monitoring tools, **WebNotify**, to e-mail alerts when topics are edited, and **WebStatistics**, to generate detailed activity reports. ## WebNotify - recent changes alert Each TWiki web has an automatic e-mail alert service that sends a list of recent changes on a preset schedule, like once a day. Users can subscribe and unsubscribe using [[WebNotify]] in each web. The Perl script `mailnotify` is called by a background process at regular intervals. The script sends an automated e-mail to subscribed users if topics were changed in a web since the script was last run. - You can create a [[WebNotify]] link using [[TWikiVariables]] with **%NOTIFYTOPIC%** You can also use `%MAINWEB%` instead of `Main`, but this is not necessary even if you have renamed the main web by configuring `{MainWebName}` in [configure](http://www.dementia.org/twiki/configure). ## WebSearch - search TWiki site [[WebSearch]] is an extremely fast and flexible search facility, part of the core TWiki feature set. [[WebSearchAdvanced]] offers more options, including: - topic title or full-text search - regular expressions - search within web or site-wide - index-style A-Z alphabetical listing sorted topic title - many more See also: [[SearchHelp]] for help; [[TWikiVariables]] and [[FormattedSearch]] for including hard-coded searches in text. ## WebChanges - what's new To check for the most recently edited topics while on-site, use the [[WebChanges]] link, usually located in the toolbar. It lists the most recently modified topics, newest first, along with the first couple of lines of the page content. This is simply a preset `SEARCH`. The number of topics listed by the `limit` parameter.: > %SEARCH{ ".*" web="%INCLUDINGWEB%" regex="on" nosearch="on" order="modified"%BR% reverse="on" limit="50" }% ## WebIndex - list of topics [[WebIndex]] lists all web topics in alphabetical order, with the first couple of lines of text. This is simply a preset `SEARCH`: > %SEARCH{ "\.*" scope="topic" regex="on" nosearch="on" }% ## WebStatistics - site statistics You can generate a listing manually, or on an automated schedule, of visits to individual pages, on a per web basis. Compiled as a running total on a monthly basis. Includes totals for Topic Views, Topic Saves, Attachment Uploads, Most Popular Topics with number of views, and Top Contributors showing total of saves and attachment uploads. Previous months are saved. - You can create a [[WebStatistics]] link using [[TWikiVariables]] with **%STATISTICSTOPIC%** ### Configuring for automatic operation - You can automatically generate usage statistics for all webs. To enable this: - Make sure variable **\{Log\}\{view\}**, **\{Log\}\{save\}** and \*\{Log\}\{upload\} in are set in [configure](http://www.dementia.org/twiki/configure). This will generate log file entries (see below). - The [[WebStatistics]] topic must be present in all webs where you want to have statistics. You can use the topic in the Main web as a template. - Call the `twiki/bin/statistics` script from a cron job, once a day is recommended. This will update the [[WebStatistics]] topics in all webs. - **_Attention:_** The script must run as the same user as the CGI scripts are running, which is user `nobody` on many systems. Example crontab entry: %BR% `0 0 * * * (cd /path/to/twiki/bin; ./statistics >/dev/null 2>&1)` - There is a workaround in case you can't run the script as user `nobody` : Run the utility `twiki/bin/geturl` in your cron job and specify the URL of the `twiki/bin/statistics` script as a parameter. Example: %BR% `0 0 * * * (cd /path/to/twiki/bin; ./geturl mydomain.com /urlpath/to/twiki/bin/statistics >/dev/null 2>&1)` ### Generating statistics manually by URL - The `twiki/bin/statistics` script can also be executed as a CGI script, just enter the URL in your browser. Examples: - Update current month for all webs: %BR% `http://www.dementia.org/twiki/statistics` - Update current month for Main web only: %BR% `http://www.dementia.org/twiki/statistics/Main` - Update January 2000 for Main web: %BR% `http://www.dementia.org/twiki/statistics/Main?logdate=201006` ## Log Files TWiki generates monthly log files which are used by the statistics script - The log file is defined by the **\{LogFileName\}** setting in [configure](http://www.dementia.org/twiki/configure) - The file name is `log.txt` - Example path name: `twiki/logs/log201006.txt` - Each access gets logged as: %BR% `|