[mrtg] Why only ds0 and ds1?

Steve Shipway s.shipway at auckland.ac.nz
Tue May 22 00:47:42 CEST 2007


Tuc saith:
> 	I wrote my own program to fetch some information from a
> source. I've always told the program to write out :
> 
> DATA ITEM 1
> DATA ITEM 1
> 0
> 0
> time() (Perl function)
> hostmon-data (Not sure why, but <SHRUG>)

This is wrong, but will probably work.  The correct format is:

Number1
Number2
Uptime string (can be blank)
Description string (can be blank)

The first two are placed into the database.  The next two may be used to
generate web pages, if you are using native .log files and not .rrd.

> 	Now I want to get crazy and do 3 items. I now write :
> 
> DATA ITEM 1
> DATA ITEM 2
> DATA ITEM 3
> DATA ITEM 4
> time() (Perl function)
> hostmon-data

This is wrong. 

> 	When I look at the resultant file, I only am told I have
> access to ds0 (DATA ITEM 1) and ds1 (DATA ITEM 2).

Exactly.  MRTG stores data for TWO and ONLY TWO items of data.  If you
only want one then you can suppress one (using the noo and noi options)
but it still requires two items, and stores two items, as ds0 and ds1.

> 	What do I need to do to tell it I want the rest?

You will need to create a new, separate Target which holds items 3 and
4.  

If all you are interested in is the sum of the items, you can define a
target that adds together multiple datasources.

If you use routers2 as your frontend, you can then suppress the two
Targets in the menu, and define a UserDefined graph to show ds0&ds1 from
Target1 and ds0&ds1 from Target2 all on the same graph.  See the
routers2 documentation and demo pages for more information.

Steve



More information about the mrtg mailing list