[Xymon] Monitoring multiple values

Jeremy Laidman jlaidman at rebel-it.com.au
Wed Aug 20 05:01:37 CEST 2014


Ralph's suggestion looks very interesting, and means you can have it apply
to any and all clients without having to make changes to each one.

In case you can't get it working for some reason, I think something
client-side like the following might work:

#!/bin/sh
die() { echo "$@" >&2; exit 1; }
[ "$XYMON" -a "$XYMONSRV" -a "$MACHINE" ] || die "Please run within a Xymon
environment"
VALUES=`get_values`  # gets 5 numbers
set - ""$SAMPLES
[ $# -eq 5 ] || die "Value count $# was not 5: $VALUES"
SLEEP=0
DELAY=60 # 300/5+1
for VALUE in $VALUES; do
    MSG=`printf "data $MACHINE.trends\n[filename.rrd]\nDS:dsname:$DELAY:U:U
$VALUE\n"`
    ( sleep $SLEEP; echo "$MSG" | $XYMON $XYMSRV @ ) &
    let SLEEP=$SLEEP+$DELAY
done

This should fire off 5 background tasks, each waiting a multiple of 60
seconds before sending in their value to the RRD collector, thus staggering
the updates across the next 5 minutes.

J



On 20 August 2014 01:22, David Welker <dewelker at gmail.com> wrote:

> This sounded like a great idea, so I got the status showing up via the
> extra-scripts option, but the info on the data message is a little vague.
>  According to the example, I just echo the DS statements, then the dataset
> name on a line by itself, followed by the data for one dataset on a line by
> itself, which doesn't seem to do anything in the way of creating any of the
> multiple rrds I need, nor does it address the time consideration for
> multple values (I need to insert 5 values a minute apart  from 5 mins.
> before putting them into the rrd - I know this can be done with the rrdtool
> update command, but can it be done here somehow?)  Anybody have an example
> of a multi-dataset case being run via the extra-scripts option of the
> xymond_rrd they'd be willing to share?
>
> Thanks!
> David
>
>
> On Fri, Aug 15, 2014 at 10:09 AM, Ralph Mitchell <ralphmitchell at gmail.com>
> wrote:
>
>> You could do that server-side.  Look at the man page for xymond_rrd. The
>> --extra-script option allows you to pipe incoming data through a script to
>> process. You could take the report time and subtract 1 min, 2 min, etc,
>> then emit rrd updates as required.  The client would still send all 5
>> values at the same time, but they'd be recorded as if received over the
>> preceding 5 minute block.
>>
>> Ralph Mitchell
>> On Aug 15, 2014 9:55 AM, "David Welker" <dewelker at gmail.com> wrote:
>>
>>> I've been looking, but haven't seen anything in the documentation, on
>>> the website, or in the mailing list that addresses this:
>>>
>>> I need to monitor 5 values that are received all at the same time.  I'd
>>> like to insert the values at one minute intervals getting a consolidated
>>> data point (CDP) every 5 minutes that I can graph.
>>>
>>> For example, I ping a host via client script, 5 times, returning all of
>>> the data at one time.  I want to put all 5 values in the database (rrd),
>>> but spaced apart every minute so I get a decent CDP. I could probably do
>>> this if this was on the server (could I?), but the script HAS to be on the
>>> client in this case.  Is this even doable?
>>>
>>> Thanks, in advance, for any suggestions!
>>>
>>> David
>>>
>>> _______________________________________________
>>> Xymon mailing list
>>> Xymon at xymon.com
>>> http://lists.xymon.com/mailman/listinfo/xymon
>>>
>>>
>
> _______________________________________________
> Xymon mailing list
> Xymon at xymon.com
> http://lists.xymon.com/mailman/listinfo/xymon
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20140820/a668ad43/attachment.html>


More information about the Xymon mailing list