An Introduction to /stats — File Browser

AnIntroductiontostatsv1.0 / AnIntroductiontostatsv1.0 / stats.html

stats.html — 9.36 KB — Download this file

<div align=justify>
           
<table cellspacing="1" cellpadding="2"><tr><td bgcolor="#99BBDD" width="640"><font size="3">
<b>An Introduction to /stats</font><font size="2"> 
by <a href="mailto:ntd@mirc.net">Ntd</a></font></b></td></tr></table>
<p>

<table width="100%" bgcolor="#FFFFFF" border="0" cols=3> 
<tr><td width="16">&nbsp;</td><td width="160">Level:</td><td>4 (quite advanced)</td></tr>
</table><p>(<i>No scripting knowledge required, but talks about some un-newbie stuff like 
ircds, ports, etc.</i>)<P>

<table cellspacing="1" cellpadding="2"><tr><td bgcolor="#99BBDD" width="640">
<font size="2"><b>Introduction</b></font></td></tr></table><p>
<tt>/stats</tt> is a powerful command that lets you get a lot of very useful information 
about servers, but it is rather underused.  One possible reason is that it's replies are 
often rather cryptic.  While mIRC takes the <tt>/links</tt> output and renders it in a 
clear tree structure, /stats output simply fills your status window and is often little 
more than a stream of letter codes and numbers.  However, take the trouble to learn a 
little bit about the command and it can be worth your while.<p>

<table cellspacing="1" cellpadding="2"><tr><td bgcolor="#99BBDD" width="640">
<font size="2"><b>The Curse Of Deviation</b></font></td></tr></table><p>
As everyone who has used IRC for a fair length of time knows, a major problem at the moment 
is that there is probably not any network whose ircd matches the specification in RFC1459.  
All the 'big four' have ircds very different from that worthy but now outdated document, 
and the differences can be noticable when it comes to /stats.  These differences are the 
worst kind: not new features, but the same commands and raws doing different things.  For 
this reason, don't be surprised if things in this document don't do what I say they do, 
and for the same reason, any scripting from stats replies might want to use a few <tt>if 
($network ==</tt> clauses ;)<p>

<table cellspacing="1" cellpadding="2"><tr><td bgcolor="#99BBDD" width="640">
<font size="2"><b>The Basics</b></font></td></tr></table><p>
The first thing to understand about /stats is that on its own it does nothing.  You need 
to give it a letter saying which stats you want.  According to the RFC, the following 
letters are available:<p>

<blockquote>
<table cols=2 border=0 cellpadding=2>
 <tr><td><b>Letter&nbsp;&nbsp;</b></td><td><b>Output</b></td></tr>
 <tr><td>c</td><td>c:lines</td></tr>
 <tr><td>h</td><td>hub/leaf info</td></tr>
 <tr><td>i</td><td>i:lines</td></tr>
 <tr><td>k</td><td>k:lines</td></tr>
 <tr><td>l</td><td>links</td></tr>
 <tr><td>m</td><td>commands</td></tr>
 <tr><td>o</td><td>o:lines</td></tr>
 <tr><td>y</td><td>y:lines</td></tr>
 <tr><td>u</td><td>uptime</td></tr>
</table>
</blockquote><p>
Now you'll see a lot of 'lines' in there.  What are these?  Well, the IRC server has certain 
lines of text in the configuration file which say which hosts are allowed to do certain things.  
When a host is added, it is on a new line in the conf file, hence it is said to be an i:line 
(or whatever kind of line it is).  And here is what the lines mean. c means 'connection', and 
refers to what servers the server will try to connect to.  c:lines come in pairs with N:lines 
which are those servers allowed to connect to it.  i means 'invite' and refers to what 
clients are allowed to connect to it.  k means 'kill' and refers to those clients who are 
banned from connecting.  i and k are probably the most important to the average user, so more 
on them later.  o means 'operator' and refers to those hosts from which a client can 
become an operator.  Finally, y:lines define connection classes.  Of the others in that list, 
l shows what servers are <i>actually</i> connected at the time (different from n which is 
what servers <i>could</i> connect), m returns supported /commands, u shows how long the server 
has been running and hub/leaf information is probably of little interest unless you are 
fascinated by network topology...<p>
<table cellspacing="1" cellpadding="2"><tr><td bgcolor="#99BBDD" width="640">
<font size="2"><b>Other letters</b></font></td></tr></table><p>
Remember I warned you about different ircd's having different letters?  Here we go.<p>
First most of you who use nets with these features probably have heard of a G:Line, g for 
'global', and these are like global k:lines - anyone from that unlucky host is banned from the 
entire network.  These, incredibly enough, are visible from <tt>/stats g</tt>.<p>
Here is a real handy trick for all those who want to impress people with their eleet expert 
knowledge of irc: a stats portscan.  This is a good example of when /stats can actually be 
useful, because by seeing the amounts of traffic on each port you can see which one is quietest.  
Then you can connect to this port, and it will be faster.  Tip: 6667 is basically guaranteed to 
be the busiest, slowest port.  Do the cool thing and find a quieter one.  To list ports, it is 
usually <tt>/stats p</tt>.  However I seem to remember this varied on different nets.  So it's 
worth remembering that <tt>/stats l</tt> also gives some port related info, such as send queue 
in bytes/messages, etc.  You don't need to know which numbers mean what: just look for small 
numbers! :)<p>
The 'command cosmos' tells me that undernet supports stats t, z, w, and (when in debug mode) r 
and x, all giving various statistics and information, such as memory usage.  These are probably 
not the most useful things in the world, so I won't go into any more detail.  If you want to see 
what you get - just try it!<p>
IRCNet also supports Q:lines (quarantine), R:Lines (a bit like a K:line), S:lines (what services 
are allowed to connect), V:lines (restrictions on N:Lines based on things such as version), and 
even a few more which seem so esoteric that I shan't even list them.  Now, as a general rule, 
for each type of line there will be a corresponding /stats to return that information.  For 
example, <tt>/stats q</tt>.  Does this work?  I don't know, you'll have to try: thats the fun 
of /stats.<p>
And as usual, I have referred only to the nets I use.  I have no doubt that experienced 
dalnetters (if there is such thing) and efnetters will know of some other /stats supported on 
those networks.<p>
<table cellspacing="1" cellpadding="2"><tr><td bgcolor="#99BBDD" width="640">
<font size="2"><b>What use is this?</b></font></td></tr></table><p>
Well, I gave one use above, in finding a fast port to connect to.  There is of course another 
reason for this type of port query.  Maybe you are firewalled from IRC because your irritating 
college or workplace blocks 6000-7000 ports to prevent you wasting time on IRC.  Well, check 
what ports your favourite server supports and you may get a pleasant surprise.  My regular server 
is also open on all manner of weird ports such as 1234, and I have also seen a server listen on 
port 31337 (some sort of kewl joke ;)).  Connect to a port like that and you could evade a 
lame firewall, but when you get caught IRCing, don't tell them I told you how to! ;)<p>
Using unusual ports can also help avoid ICMP nukes.  If you have a copy of the infamous ICMP 
nuker CLICK.EXE that came with the infamous war script 7th Sphere (I won't ask why you have 
such a thing), then load it up.  See next to "server" it says start at port 6660 and go through 
to port 6669?  Well use a port outside this range and those nuke's wont get you unless the nuker 
changes this setting - and how many of the brain-dead lamers who thinks it's clever to nuke do 
you think are smart enough to change any of the default settings?  <p>
Another good use related to i and k:lines.  How many times will I see people post to 
<a href="news:alt.irc.mirc">alt.irc.mirc</a> and say "Help, I get this Unauthorized Connection 
message!"  It truly is an FAQ and the answer is i:lines.  Say a server is in Sweden (*.se).  
Usual practice with IRC servers is to allow connection from nearby places, so maybe it has 
i:lines for *.se, *.no, *.fi.  (Sweden, Norway, Finland).  Now you live in Holland and you 
connect to this Swedish server - and get disconnected, unauthorized connection.  The reason is 
there is no *.nl i:line, you are better off looking for a *.nl irc server to use!<p>
Do a /stats i and you will get your list of hosts which can connect.  But wait a minute, you 
say, since you are not on that server, how can you /stats it in the first place?  Welcome to 
the beauty of remote stats, where you can query servers other than your own.  Just use 
<tt>/stats i irc.server.com</tt> or whatever.  (NB: Undernet disabled many remote stats for 
bandwidth conservation reasons).<p>
<table cellspacing="1" cellpadding="2"><tr><td bgcolor="#99BBDD" width="640">
<font size="2"><b>Credits</b></font></td></tr></table><p>
Not something I usually do because I usually write docs from my own head.  But this time I 
really had to do some research, which came from the legendary RFC1459, the conf files that 
came with ircnet ircd2.10.2b4, and the 'IRC Command Cosmos' by Roar Nybo, which is an excellent 
and thorough guide to the more advanced and unknown features of irc, particularly ircu, available 
from <b><a href="http://www.irchelp.org/">irchelp</a></b>.  If you want to get a bit more 
detailed than this introduction, that is the file I suggest you look at!<p>
So, thanks to those, and hopefully this was a good condensed version for the rest of you!<p>
&nbsp;&nbsp;-<a href="mailto:ntd@mirc.net">Ntd</a><p>
</div>