Chapter 4. Tellnews - controlling the dnews server[return to index]

Tellnews commands can be used in all versions of dnews, they are just typed in on the command line, with the Windows NT and Macintosh versions they are also available throug the Dnews Manager interface.


Command: addlost

Syntax: tellnews addlost

Description: A very useful command, used when the history file and the database get out of synch, re-enters into the history file items that are not indexed. Also corrects the range of items for each group (as stored in the active.dat file)

This command runs as a background task, like an expire, it will take several hours per gig of news. So a large system may take 10-24 hours to complete.


Command: cached

Syntax: tellnews cached group_wildcard n_days

Description: Causes the group or groups listed to be cached on the server for the number of days specified.

Example: tellnews cached rec.bicycles.* 3

This will cause dnews to update the rec.bicycles hierarchy every day for 3 days even if no one reads any of those groups.


Command: checkgroups

Syntax: tellnews checkgroups check_news_item.txt

Description: Processes the given file as if it had been recieved as a checkgroups message. A checkgroups message is a list of 'real' news groups in a given news hierachy, for example all the rec.* news groups. Any news group that is not in the check groups messages is deleted, any news group which is missing is added.

Example: tellnews checkgroups message.txt


Command: clear_cache

Syntax: tellnews clear_cache

Description: Clears some of the internal caches used for reading item files.


Command: crash_now

Syntax: tellnews crash_now

Description: very dodgy command used to simulate the behaviour of other companies news servers.


Command: debug

Syntax: tellnews debug [chan_read:chan_write:… ]

Description: Used with loglvl debug or flush, to control which debugging messages are sent to the log file. The list of options must not contain spaces. The default list is:

control:db:cancel:file:lib:,warn:,fatal:,post:,chan:,feed:,hist:,nntp
str:,err:,debug:,expire:,info:,item:,group:,suck:,cmd:,ncmd:,init:,db:,mem:

Example: tellnews debug chan_read:chan_write:


Command: disconnect

Syntax: tellnews disconnect n (where n is the number of the channel to disconnect)

Description: Used by the dnews admin to disconnect a single channel, select the number 'n' by doing a tellnews status command first.


Command: dns_clear

Syntax: tellnews dns_clear

Description: Used by the dnews admin to clear DNEWS's cache of ip numbers and names. Very rarely necessary. If you change the names or numbers of local machines then this command should be used.


Command: dns_show

Syntax: tellnews dns_show

Description: Used by the dnews admin to inspect DNEWS's internal cache of ip numbers and names. Very rarely useful for normal operation unless you are having trouble granting access to a particular ip name and you need to see what name DNEWS is finding for that computer in the DNS.


Command: doupgrade

Syntax: tellnews doupgrade

Description: NEVER use this command. It was for converting the DNEWS database from version 1.0 to 2.0. It will also be used to force an upgrade from version 2.0 to version 3.0, however since this is automatic there is never any need to use this command.


Command: exit

Syntax: tellnews exit

Description: Shuts down the DNEWS server cleanly.


Command: expire

Syntax: tellnews expire

Description: Used by the dnews admin to force an expire run during the day, this is occasionally necessary if something has prevented normal expire runs to work and after fixing the problem you wish to start an expire run immediately to free up disk space. The expire run will begin as soon as the current entry in the sucking queue has completed.


Command: fileonly

Syntax: tellnews fileonly

Description: Used by Netwin support staff to test dnews performance. NEVER use this command.


Command: fixnames

Syntax: tellnews fixnames

Description: Used by dnews admin to fix the active.names file. This command will check the file is internally consistent and it will remove any duplicate entries. This command should be used every few months to keep the system clean.


Command: fixrange

Syntax: tellnews fixrange

Description: Tells dnews to forget how many items it thinks each group contains and actually check the next time a user enters the group. This is somtimes useful if winvn is crashing because dnews has lost track of how many items exist in a particular group.


Command: fixtimes

Syntax: tellnews fixtimes days_old

Description: Tells dnews to re-write the active.times file and pretend that all groups were created 'days_old' ago. This command should be used once every 6 months to clean out old groups from the active.times file.


Command: getgroups

Syntax: tellnews getgroups [n]

Description: Used with a sucking feed to get the list of groups from the provider, if there are more than 300 groups cached dnews will do this automatically every update_at period, if there are less than 300 groups cached it will do this command automatically once per day. It can also be used to get the groups lists from additional feeds by specifying 2, 3, or 4 as n. This has to be used to add an additional feed to dnews.

When you first start up dnews it will also try and get the full list of groups, but if it fails on the first attempt (due to some temporary problem, e.g. you forgot to plug in the ethernet cable) then use this command to force it to fetch the list again.

Example: tellnews getgroups 2


Command: getnames

Syntax: tellnews getnames

Description: Gets the list of news group names from the news server you are sucking from and stores them in the active.names file.

Very few news readers display these full names so it is not critical to get this.

Example: tellnews getnames


Command: getold

Syntax: tellnews getold <group wildcard> n

Description: DNEWS keeps track of the latest item number for every group on the site it is sucking from. This command lets you adjust this counter downward by 'n' for every matching group, this can be useful as a way to 'refetch' items that were somehow missed previously.

This command will not result in duplicate articles, because of the history file dnews will not refetch an article if it's message id is stored in the history file.

Example: tellnews getold rec.bicycles.tech 100


Command: group_age

Syntax: tellnews group_age

Description: Age all groups, this command emulates the passing of day. Each cached group has a counter of how many days it should remain cached for and this command will reduce every counter by one, and will then 'un-cache' any groups who's counter has reached 0.

Example: tellnews group_age


Command: group_merge

Syntax: tellnews group_merge

Description: Merge a file called active.add (in the workarea directory) with the existing active.dat file. This is the correct way to update your active list to include groups from a new site that is now sending you items via IHAVE. Don't edit the active.dat file by hand :-)


Command: group_nodup

Syntax: tellnews group_nodup

Description: Checks the active file and removes any duplicates, this command should never be necessary, it was added during an early version of dnews which had a bug which could allow duplicate groups to get into the active file.


Command: hist_test

Syntax: tellnews hist_test

Description: Shows in the log file every time an actual history file read is necessary, this is was used to confirm that history lookups were as rare as possible while accepting an ihave feed.


Command: key

Syntax: tellnews key

Description: Enter a license key to the server, the key is letter-number-letter-… and all of the letters are lower case. There are a few different responses this command may give, that indicate whether the key has been entered succesfully.

Example: tellnews key a6j5a0a2a4p6a9


Command: killgroup

Syntax: tellnews killgroup <group wildcard>

Description: Removes the specified group(s) from the active file, you must shut down and restart dnews after using this command. This command does not attempt to delete the items related to the group, this command is intended for use only when you know best.

To cleanly remove a news group use the rmgroup command (which is reversable) and then wait several days or weeks for the expire process to delete the items in the now deleted group.

Example: tellnews killgroup netwin.chat.group


Command: killitem

Syntax: tellnews killitem <group name item number | "message id">

Description: Delete an item in a group, the item is defined either by it's message id or by a combination of it's number and the group it is in, this information can be found by using a newsreader such as WinVN that shows the article numbers. Usually used for removing inappropriate postings from private local groups.

Example: tellnews killitem "<540kfg$75p@hplms2.hpl.hp.com>"

Example: tellnews killtitem rec.bicycles.tech 57536


Command: log

Syntax: tellnews log

Description: Display the last 50 lines of the dnews.log file.


Command: Loglvl

Syntax: tellnews loglvl <debug | flush | info | warn | error>

Description: Set the level of messages to be recorded in the dnews.log file, can be used in conjunction with the tellnews debug command. This command is very useful for enabling a higher level of debugging for a brief period while testing some problem system.

Example: tellnews loglvl debug

Example 2: Testing a problem with report messages not arriving:

	tellnews update_clear
	tellnews loglvl debug
	tellnews debug chan_read:chan_write:suck:
	tellnews report
	(wait 20 seconds)
	tellnews loglvl info
	(now examine the log file in detail)

Command: matchfeed

Syntax: tellnews matchfeed

Description: Marks all groups that dont match the groups entry under site me in the newsfeeds.conf file as deleted. This is typically used to change the me feed to allow groups that were previously blocked (in conjunction with tellnews undelete) or to set newly blocked groups to deleted.

Example:

	notepad newsfeeds.conf
	tellnews reload
	tellnews undelete *
	tellnews matchfeed

Command: newgroup

Syntax: tellnews newgroup <groupname> [y |m][creator][description]

Description: Add a new group to the group list, this can be a local group or a new group from another feed site, or a group from the upstream feed. The optional y or m field is to set the group as normal (y) or moderated (m), the optional creator field is a one word name of the groups creator, the optional description field is a few words describing the group.

Example: tellnews newgroup local.bicycle.rides y eddym Info about bike rides in our vicinity


Command: purgelost

Syntax: tellnews purgelost

Description: Removes all of those articles in Dnews's database that don't have an entry in the history file, very useful if the system has become very full due to some condition that caused it to loose a number of entries from the history file. Generally speaking, addlost is a better choice to fix a mixed up dnews database.


Command: purgegroups

Syntax: tellnews purgegroups

Description: Actually remove and forget about groups that have been marked for delete. You must stop and start dnews after using this command. If you use this on a sucking feed and the deleted groups exist on the site you are sucking from, then the groups will re-appear.


Command: purgelinks

Syntax: tellnews purgelinks

Description:Similar to the 'addlost' command, this command checks the integrity of the dnews database, for each cross posted article it checks that the actual article still exists, if it does not then the cross post is deleted. This command should only be necessary of you have corrupted the database by deleting item files by hand.


Command: refeed

Syntax: tellnews refeed feed.name

Description: This command will re-send all current articles to a particular news feed, this command is fairly cpu intensive as the entire history file (maybe 80MB) must be parsed. Also, it does not apply all the rules associated with the feed you have specified, it only checks that the group name matches. This command us particularly useful when setting up the FTS (Full Text Searching) system on a running server. It allows you to 're-index' all existing items.


Command: reindex

Syntax: tellnews reindex

Description: In theory this command is like 'addlost' but instead of working off the .idx files it reads the .itm files and recreates the .idx files. In practice it does not yet work correctly except to fix up problems caused by a bug in 3.0a. In future it will be modified to rebuild the .idx files under any conditions.


Command: reject

Syntax: tellnews reject "<message@id.host>"

Description: Tells dnews to immediatly reject the specified item if it is offered it by an ihave feed. This command is very rarely useful if a particular item is blocking an incoming feed for some unexplained reason.


Command: reload

Syntax: tellnews reload

Description: Reloads the .conf files, necessary to make any changes to the files take effect, if not done the changes will not take effect until you restart dnews.


Command: reload_fts

Syntax: tellnews reload_fts

Description: Tells dnews that the fts index has changed and should be reloaded from disk. This command is not usually needed, the index is normally re-read fairly often automatically.


Command: report

Syntax: tellnews report

Description: Forces dnews to generate the expire report and mail it to the manager address set in dnews conf. Very useful if you are not getting these reports, it allows you to check the log file and see why the report isn't successfully sent.


Command: reque

Syntax: tellnews reque

Description: Puts all outgoing feeds into the sucking queue and attempts to send them. Again this is useful if a builtin outgoint feed or smtp feed is not working, it allows you to trigger a retry and watch to see why it fails.


Command: resetall

Syntax: tellnews resetall

Description: Use with care, this resets all of the article counts in the active.dat file, the main use for this commnad is to clear an active file that has been ftp'd from some place other than your provider and the numbers are meaningless. NEVER NEVER NEVER use this command on a working dnews server, it is only intended for use during the initial installation to clear out an active file from a unix system. To add groups from someone elses active file use the group_merge command described above.


Command: rmgroup

Syntax: tellnews rmgroup <group name>

Example: tellnews rmrgroup local.secret*

Description: Flags the specified group(s) as deleted. This is the clean way to delete a group, and if you make a mistake you can undelete the groups.


Command: rotate

Syntax: tellnews rotate

Description: Manual command to rotate the log files and remove the oldest one, there is an automatic setting for doing this in the dnews.conf file (debug_rotate n) Moves dnews.log to dnews2.log, dnews2.log to dnews3.log, etc.


Command: setused

Syntax: tellnews setused <n Mb>

Description: Set the diskspace used to n Mb, n has to be manually calculated, and should be the actual amount of news on the system. Used to correct problems caused if the actual disk usage gets out of synch with what dnews thinks it has used. Related to the diskspace setting in dnews.conf, and displayed in the output of tellnews.status. For example if the expire process is not removing much from the system because dnews thinks it has only used 10% of the available diskspace, but the feed is stopped because there is no space left, setused can be used to tell dnews that it has used all of the space and the expire process will then take care of removing articles until the system is functioning normally again.

Example: tellnews setused 570

Lets say you have a 2 Gig disk, and your diskspace setting is 1500. 500mb is used by other software, but the disk is now full. A tellnews status shows:

750mb used (50%)

You would then do this:

tellnews setused 1500

Wait two minutes, and do a tellnews status to see if dnews now as the correct disk use showing.


Command: showcached

Syntax: tellnews showcached

Description: Displays a list of the groups that are cached on the system and the number of days that they will continue to be updated for. At the end of the update time no more new articles will be fetched for the group and the expire process will gradually remove the items from the group. The cached life of the group is reset to the value specified for the life parameter in dnews.conf each time an article from the group is read.

Output:


Command: showmem

Syntax: tellnews showmem

Description: Shows how much memory dnews is using in great detail, note: the value under strdup is not accureate. The output of thiscommand is useful to NetWin support staff if you are having a problem with memory use. (see also the related command test_mem)


Command: showqueue

Syntax: tellnews showqueue

Description: Display a list of groups waiting in the queue to be updated.

Output:


Command: speed

Syntax: tellnews speed

Description: Shows how fast articles are arriving. Use in conjunction with tellnews speed_reset for performance testing.


Command: speed_reset

Syntax: tellnews speed_reset

Description: Resets the counters for testing how many articles are arriving per second.


Command: speed_test

Syntax: tellnews speed_test

Description: This command acts as a toggle, it is used to test how fast articles would arrive if dnews didn't have to store them on disk, the items are thrown away, use at your own risk Normally used in conjunction with 'tellnews speed' to determine if dnews is slowing down the incoming feed or if it is limited by some external bottleneck (e.g. the network, or the sending machine)


Command: stats

Syntax: tellnews stats

Description: Returns a listing of statistics showing which nntp commands have been used and how long dnews has taken to process each command.

Explain stats output here with example:


Command: stats_in

Syntax: tellnews stats_in

Description: Returns a report about what dnews has sucked/accepted since the last expire.

Explanation and example output here


Command: stats_groups

Syntax: tellnews stats_groups

Description: Shows the top 40 groups by the number of times they have been read by users, and by the volume of articles recieved into that group. This allows you to spot groups which are gobbling up disk space and bandwidth, but are not being read by significant numbers of users.


Command: status

Syntax: tellnews status

Description: Returns a report about the status of the system, explanation and example output here.


Command: test_files

Syntax: tellnews test_files

Description: Used on unix systems for checking on memory problems, checks to see how file handles dnews can allocate.


Command: test_mem

Syntax: tellnews test_mem

Description: Used for checking on memory problems, checks to see how much memory dnews can allocate. If it cannot allocate at least 20 or 30 MB then your page file is probably not big enough.

You MUST restart dnews after using this command to allow the memory to be freed.


Command: test_sleep

Syntax: tellnews test_sleep n

Description: Locks up dnews for n seconds (only works on Windows NT). This is used to test behaviour of dnews under certain load conditions.


Command: test_sockets

Syntax: tellnews test_sockets

Description: Tests how many sockets dnews can open.


Command: trimgroups

Syntax: tellnews trimgroups n

Description: Similar to the getgroups command, but instead of adding missing groups, this command removes groups that no longer exist on the site you are sucking news from. Groups will not be deleted if they don't match the wild card in dnews.conf for that feed, in this way local groups will probably not be deleted :-)


Command: uncached

Syntax: tellnews uncached <group wild card>

Description: Sets the specified groups as not cached.


Command: undelete

Syntax: tellnews undelete <group wildcard>

Description: Mark a previously deleted group as undeleted


Command: update, update2, update3, update4

Syntax: tellnews update[n]

Description: Cause an update from the specified feed to be queued, only used for sucking feeds. New items in any cached groups will be fetched.


Command: update_clear

Syntax: tellnews update_clear

Description: Clear the update queue


Command: updateone

Syntax: tellnews updateone <group wildcard> [n]

Description: Add the specified group or groups from the feed [n] in the update queue, n is an optional value from 1 to 4, it will default to the main feed if there is no n specified.

Example: tellnews updateone rec.bicycles.* 2, get the rec.bicycles hierarchy from the second feed.

[return to index]