[xymon] RE: graph a sum from different graphs
Bill Richardson
wrichardson at llbean.com
Thu Dec 23 14:36:41 CET 2010
I am using 4.3 b2. Split-NCV has been around for some time now. To get this to work in the 4.3 b2 version I needed to make some changes to the code due to a bug "not sure if this showed up in the version I'm running or not" and recompile as shown in this post: http://www.xymon.com/archive/2009/07/msg00241.html
>From the MAN page from hobbitd_rrd version 4.2.2 talks about split-ncv. Its the same commands as NCV.
CUSTOM RRD DATA IN NAME-COLON-VALUE (NCV) FORMAT
Many data-collection scripts report data in the form "NAME : value" or "NAME = value". So a generic module in hobbitd_rrd allows for easy tracking of this type of data.
The "ncv" module will automatically detect all occurrences of a "NAME : value" or "NAME = value" string in a status message, and generate an RRD file holding all of the name/value data found in the message (unless you use SPLITNCV, see above). The colon- or equal-sign must be present - if there is only whitespace, this module will fail.
Only the valid letters (A-Z, a-z) and digits (0-9) are used in the dataset names; whitespace and other characters are stripped off automatically. Only the first 19 characters of a dataset name are used (this is an RRD limitation). Underscore '_' is not allowed, even though RRDtool permits this, and will be stripped from the name.
When using the alternative SPLITNCV_testname, the dataset name is not limited in length, and non-valid characters are changed to underscores instead of being stripped off. The dataset inside the resulting rrd file is always "lambda".
Note that each "NAME : value" must be on a line by itself. If you have a custom script generating the status- or data-message that is fed into the NCV handler, make sure it inserts a newline before each of the data-items you want to track.
To enable the ncv module for a status, add a "COLUMNNAME=ncv" to the TEST2RRD setting and the COLUMNNAME to the GRAPHS setting in hobbitserver.cfg<https://big-bro.llbean.com/xymon/help/manpages/man5/hobbitserver.cfg.5.html>(5) , then restart Xymon. Xymon will now send all status-messages for the column COLUMNNAME through the hobbitd_rrd ncv-handler.
The name of the RRD file will be COLUMNNAME.rrd. When using SPLITNCV, the name of the RRD file will be COLUMNAME,DATASETNAME.rrd.
By default, all of the datasets are generated as the RRD type "DERIVE" which works for all types of monotonically increasing counters. If you have data that are of the type GAUGE, you can override the default via an environment variable NCV_COLUMNNAME (or SPLITNCV_COLUMNAME).
E.g. if you are using the bb-mysqlstatus script from www.deadcat.net<http://www.deadcat.net/> to collect data about your MySQL server, it generates a report in the column called "mysql". One data item is the average number of queries/second, which must be logged in the RRD file as type "GAUGE". To do that, add the following to hobbitserver.cfg:
NCV_mysql="Queriespersecondavg:GAUGE"
If you have multiple datasets that you myst define, add them to the environment variable separated by commas, e.g.
NCV_mysql="Uptime:NONE,Queriespersecondavg:GAUGE"
The dataset type "NONE" used above causes hobbitd_rrd to ignore this data, it is not included in the RRD file.
You can use "*" as the dataset name to match all datasets not listed. E.g.
NCV_weather="Rain:DERIVE,*:GAUGE"
will cause the "Rainfall" dataset to be of type DERIVE, and all others of type GAUGE. If you want to track only a few of the variables in your data, you can use "*:NONE" to drop any dataset not explicitly listed.
For a more detailed "how to" description, see the on-line HTML documentation of "How to create graph custom data" available in the Help menu section on your Xymon server.
________________________________
From: SEGLARD, Thomas [mailto:tseglard at wat.tv]
Sent: Wednesday, December 22, 2010 6:15 AM
To: xymon at xymon.com
Subject: RE: [xymon] RE: graph a sum from different graphs
Hi Bill, Hi all,
Do i need a Xymon version > 4.2 to be able to use SPLITNCV ? I have only on my production environment the 4.2.3 version deployed. Next question is do you have any doc about the use of this module ? Thanks.
Sincerly,
ThomaS
De : Bill Richardson [mailto:wrichardson at llbean.com]
Envoyé : lundi 20 décembre 2010 17:21
À : xymon at xymon.com
Objet : RE: [xymon] RE: graph a sum from different graphs
I have found using SPLITNCV is the best way to go on custom graphing. With SPLITNCV you have a separate rrd for each DS so at least you don't loose all your graphing just the one DS that may have changed. Even if you have one that changed at least you can still look at the old rrd and have history to look at. So in your case you have a new DS and like magic a new rrd is created.
________________________________
From: SEGLARD, Thomas [mailto:tseglard at wat.tv]
Sent: Friday, December 17, 2010 9:47 AM
To: xymon at xymon.com
Subject: RE: [xymon] RE: graph a sum from different graphs
Hello to every people on the list,
And thanks very much Bill ! I will try very soon and keep you in touch with this. In a more general way do you (the list) think that, in the future, it will be possible to easily add or remove DS definition inside rrds ? Actually, i's a pain to add new DS definition inside rrd without do a rm xxx.rrd and let Xymon to recreate it. If you have a clue...
Sincerly,
ThomaS
De : Bill Richardson [mailto:wrichardson at llbean.com]
Envoyé : mercredi 15 décembre 2010 16:22
À : xymon at xymon.com
Objet : [xymon] RE: graph a sum from different graphs
Thomas,
Here is what I'm doing to sum data from multiply rrd's and display on one graph "all data combined and sum'd in one line". I have not done this with bandwidth data but its the same basic thing. Its really easy to do. The trick is knowing that the graph will show up under the trends column and you must create a blank rrd file that matches your graph definition.
First use the rrdtool command to find out what your DS values are. In my example I'm using lambda. In your bandwidth rrd you will have 2 ds's one for in bits and one for out bits.
cd to your $xymon_home/data/rrd/host1
rrdtool dump your.rrd|more
My example:
rrdtool dump msu,grp.rrd |more
<!-- Round Robin Database Dump --><rrd> <version> 0003 </version>
<step> 300 </step> <!-- Seconds -->
<lastupdate> 1292424133 </lastupdate> <!-- 2010-12-15 09:42:13 EST -->
<ds>
<name> lambda </name>
<type> GAUGE </type>
<minimal_heartbeat> 600 </minimal_heartbeat>
<min> NaN </min>
<max> NaN </max>
<!-- PDP Status -->
<last_ds> 317 </last_ds>
<value> 4.2161000000e+04 </value>
<unknown_sec> 0 </unknown_sec>
</ds>
Based on the above data you are ready to build your graph definition in $xymon_home/server/etc/hobbitgraph.cfg. Since you will be looking at bandwidth in your CDEF you may want to add some more math "8,*" to get the right numbers. You could even add another CDEF line like CDEF:avg_total2=avg_total,8,* just to keep it simple
[combined]
TITLE Combined Example
-h 140
-w 592
YAXIS
DEF:cf1_avg_sum=/home/xymon/data/rrd/host1/msu,avg.rrd:lambda:AVERAGE
DEF:cf2_avg_sum=/home/xymon/data/rrd/host2/msu,avg.rrd:lambda:AVERAGE
DEF:cf3_avg_sum=/home/xymon/data/rrd/host2/msu,avg.rrd:lambda:AVERAGE
CDEF:avg_total=cf1_avg_sum,cf2_avg_sum,+,cf3_avg_sum,+
AREA:avg_total#aaaaaa:Combined Example
COMMENT:\n
GPRINT:avg_total:LAST:AVG \: %5.1lf%s (cur)
GPRINT:avg_total:MAX: \: %5.1lf%s (max)
GPRINT:avg_total:MIN: \: %5.1lf%s (min)
GPRINT:avg_total:AVERAGE: \: %5.1lf%s (avg)
Now edit $xymon_home/server/etc/hobbitserver.cfg look for "GRAPHS=" "this is the one to have it show up on the trends column" add your graph definition name to the end of this line. in this example you would add ",combined""
The last step the "Trick" is to create a blank "dummy" rrd file that matches your graph definition under what ever host/device you want this data to show up under. So in this case if I wanted to see this graph under host1 I would do the following:
cd $xymon_home/data/rrd/host1
"Create a dummy rrd file"
touch combined.rrd
Now you should see a new "combined graph" under the trends column of host1.
Troubleshooting is simple...
1.) When you look under the trends column and see a red X not graphing data then your graph definition is wrong go back and fix this in hobbitgraph,cfg
2.) If you see no red X and no graph at all you didn't add the graph definition name to the hobbitserver.cfg or you didn't add the dummy rrd file to $zymon_home/data/rrd/$host. Check spelling and case.
________________________________
From: SEGLARD, Thomas [mailto:tseglard at wat.tv]
Sent: Tuesday, December 14, 2010 8:58 AM
To: xymon at xymon.com
Subject: [xymon] graph a sum from different graphs
Hello,
I'm sorry for asking you this question again but I really can't figure how to graph a sum of values coming from other graphes. Basically I want to make a graph of the total bandwidth consumed by a pool of servers. For this I would like to use the values coming from the ifstat graph of each server. What will be the best solution ?
As I said I asked this question before and got answer from two people but I was not able to have the proposed solution working. So if you have other ideas you're very welcome !
I thank you very much for your answers.
Sincerly,
ThomaS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20101223/28396ba3/attachment.html>
More information about the Xymon
mailing list