/********************************************************************** * uptimes.noctumdesign.com * Copyright (c) 2002 Ryan Grove . All rights reserved. * * This script is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA ********************************************************************** * protocol.php * * Uptime client protocol documentation. **********************************************************************/ require_once("lib/functions.php"); require_once("lib/ui.class.php"); $ui = new infoui; $ui->header(); $ui->template_open(); $ui->message("The Uptimes Protocol (rev. 5.0)", ""); ?>
What is this document about?
This document will describe the 5th revision of the uptimes protocol, used to communicate between the uptime client
and the server.
Overview
There are two protocols supported by the uptime server. The primary protocol (which should be used by all clients that
aren't behind a proxy) uses UDP to send client data to the server. The backup protocol uses HTTP and can be tunneled
through an HTTP proxy server. This document describes the UDP protocol. For information on the HTTP protocol,
look here.
Client Requirements
In order to meet the specifications of this protocol, a client must:
Sending the Report
Uptime reports should be sent via UDP to uptimes.noctumdesign.com on port 49153. The structure of the
report is just a simple string, formatted like this:
authkey|uptime|load|idle|os|oslevel|cpu|client
So, noctumdesign's Uptime Client might send the following string:
51cbb9711de405x06a877z75404be027|415|100.00|0|Windows|2000|i686|noctumdesignClient/2.1.0
If your client doesn't support CPU load or idle, you could leave those sections blank, like so:
51cbb9711de405x06a877z75404be027|415|||Windows|2000|i686|noctumdesignClient/2.1.0
Now, here's a description of each piece of data:
noctumdesignClient/2.1.0.Return Values
Since UDP is a sessionless protocol, the server will not send a message back when you send a report. You'll
just have to hope you got the data formatted right. In order to be at least a little helpful, I've added a field
called "UDP Status" to the host details page of hosts that you own. Assuming you at least send the correct authkey,
this field will be updated to contain the latest status or error message from the server.
Faking
Now that you know the protocol, it's easy to write a client that fakes its uptime. Personally, I think hosts
running FreeBSD 4.6.2 with uptimes over 3 years are pretty stupid. Maybe you think differently. In any case,
hosts with fake uptimes will be marked bogus and ignored in the statistics, so there's really no point in wasting
your time.