Xymon Mailing List Archive search

Custom script working as the builtin http test

5 messages in this thread

list Heine Andersen · Tue, 6 Nov 2012 09:18:40 +0100 ·
Hi,


I'm trying to write a server side script to monitor MQ put/get status and
times,
the script output looks like this :


Tue Nov 6 09:08:38 CET 2012


    MQ1 - OK

   put : 21
   get : 20

    MQ2 - OK

   put : 20
   get : 20


The script works well, but i can't figure out how to do the graphs the same
way as the built in
http, that is with multiple test showing up in the same graph, is that
possible ?
list Vernon Everett · Tue, 6 Nov 2012 20:24:13 +0800 ·
Hi

I think having multiple fields called put and get will cause confusion for
the graphing module.
You probably want to have a status message that's human readable, and then
send the data you want to graph as a data message, which doesn't appear on
the test page.
If you need it on a test page, you can always send it as HTML, with a tiny
font, and black background and text.
You also probably want to modify your field names to something like
MQ1_put : 21
MQ1_get : 20
MQ2_put : 20
MQ2_get : 20
And use the splitNCV feature to generate and graph multiple datasets.
The above fields will generate 4 lines. You data will create 2, but will
drop some of the values.

Cheers
     Vernon
quoted from Heine Andersen

On 6 November 2012 16:18, Heine Andersen <user-f754449a0946@xymon.invalid> wrote:
Hi,


I'm trying to write a server side script to monitor MQ put/get status and
times,
the script output looks like this :


Tue Nov 6 09:08:38 CET 2012


    MQ1 - OK

   put : 21
   get : 20

    MQ2 - OK

   put : 20
   get : 20


The script works well, but i can't figure out how to do the graphs the
same way as the built in
http, that is with multiple test showing up in the same graph, is that
possible ?

-- 

"Accept the challenges so that you can feel the exhilaration of victory"
- General George Patton
list Heine Andersen · Tue, 6 Nov 2012 15:58:36 +0100 ·
Great ! now im getting data in two rrd files, i just cant display them,
this is what i put in my graphs.cfg

[mqnet]
        FNPATTERN ^mqnet.(.+).rrd
        TITLE MQ Put Get Times
        YAXIS ms
        DEF:put at RRDIDX@=@RRDFN@:ms:AVERAGE
        DEF:get at RRDIDX@=@RRDFN@:ms:AVERAGE
        LINE2:put at RRDIDX@#@COLOR@:@RRDPARAM@
        LINE2:get at RRDIDX@#@COLOR@:@RRDPARAM@
        GPRINT:put at RRDIDX@:LAST:Put \: %5.1lf%s (cur)
        GPRINT:put at RRDIDX@:MAX: \: %5.1lf%s (max)
        GPRINT:put at RRDIDX@:MIN: \: %5.1lf%s (min)
        GPRINT:put at RRDIDX@:AVERAGE: \: %5.1lf%s (avg)\n
        GPRINT:get at RRDIDX@:LAST:Get\: %5.1lf%s (cur)
        GPRINT:get at RRDIDX@:MAX: \: %5.1lf%s (max)
        GPRINT:get at RRDIDX@:MIN: \: %5.1lf%s (min)
        GPRINT:get at RRDIDX@:AVERAGE: \: %5.1lf%s (avg)\n

the graphs are just blank, any tips on how to debug this ?

regards


On Tue, Nov 6, 2012 at 1:51 PM, W.J.M. Nelis <user-6956df205d63@xymon.invalid> wrote:
Hello,
quoted from Vernon Everett


 I'm trying to write a server side script to monitor MQ put/get status and
times,
the script output looks like this :


Tue Nov 6 09:08:38 CET 2012


MQ1 - OK

put : 21
get : 20
MQ2 - OK

put : 20
get : 20


The script works well, but i can't figure out how to do the graphs the
same
way as the built in
http, that is with multiple test showing up in the same graph, is that
possible ?
I can think of three different ways to do this type of work in Xymon. A
relative simple way is to use the same way devmon is using.

If you make the output of the script to contain something like:

<!-- linecount=2 -->
<!--DEVMON RRD: XYZ 0 0
DS:put:GAUGE:600:0:U DS:get:GAUGE:600:0:U
mq1 21:20
mq2 20:20
-->

and add to xymonserver.cfg:
TEST2RRD= ...,ABC=devmon

(in which ABC is the name of the test / column), you're done. It will
create for the host for which this test is reported two RRD's called
XYZ.mq1.rrd and XYZ.mq2.rrd. With a suitable graph definition you can show
this in one graph.

HTH,
  Wim Nelis.


****************************************************************
********************************************************

The NLR disclaimer is valid for NLR e-mail messages.

This message is only meant for providing information. Nothing in this
e-mail message amounts to a contractual
or legal commitment on the part of the sender.
This message may contain information that is not intended for you. If you
are not the addressee or if this
message was sent to you by mistake, you are requested to inform the sender
and delete the message.
Sender accepts no liability for damage of any kind resulting from the
risks inherent in the electronic
transmission of messages.

****************************************************************
********************************************************

list Vernon Everett · Wed, 7 Nov 2012 15:43:10 +0800 ·
2 data files is a good start.
Try something like this

[mqnet]
    FNPATTERN mqnet.(.*).rrd
    TITLE MQ Put Get Times
    YAXIS ms
    -l 0
    DEF:p at RRDIDX@=@RRDFN@:lambda:AVERAGE
    LINE2:p at RRDIDX@#@COLOR@:@RRDPARAM@
    GPRINT:p at RRDIDX@:LAST: \: %5.2lf (cur)
    GPRINT:p at RRDIDX@:MAX: \: %5.2lf (max)
    GPRINT:p at RRDIDX@:MIN: \: %5.2lf (min)
    GPRINT:p at RRDIDX@:AVERAGE: \: %5.2lf (avg)\n
quoted from Heine Andersen

Cheers
     Vernon


On 6 November 2012 22:58, Heine Andersen <user-f754449a0946@xymon.invalid> wrote:
Great ! now im getting data in two rrd files, i just cant display them,
this is what i put in my graphs.cfg

[mqnet]
        FNPATTERN ^mqnet.(.+).rrd
        TITLE MQ Put Get Times
        YAXIS ms
        DEF:put at RRDIDX@=@RRDFN@:ms:AVERAGE
        DEF:get at RRDIDX@=@RRDFN@:ms:AVERAGE
        LINE2:put at RRDIDX@#@COLOR@:@RRDPARAM@
        LINE2:get at RRDIDX@#@COLOR@:@RRDPARAM@
        GPRINT:put at RRDIDX@:LAST:Put \: %5.1lf%s (cur)
        GPRINT:put at RRDIDX@:MAX: \: %5.1lf%s (max)
        GPRINT:put at RRDIDX@:MIN: \: %5.1lf%s (min)
        GPRINT:put at RRDIDX@:AVERAGE: \: %5.1lf%s (avg)\n
        GPRINT:get at RRDIDX@:LAST:Get\: %5.1lf%s (cur)
        GPRINT:get at RRDIDX@:MAX: \: %5.1lf%s (max)
        GPRINT:get at RRDIDX@:MIN: \: %5.1lf%s (min)
        GPRINT:get at RRDIDX@:AVERAGE: \: %5.1lf%s (avg)\n

the graphs are just blank, any tips on how to debug this ?

regards


On Tue, Nov 6, 2012 at 1:51 PM, W.J.M. Nelis <user-6956df205d63@xymon.invalid> wrote:
Hello,


 I'm trying to write a server side script to monitor MQ put/get status and
times,
the script output looks like this :


Tue Nov 6 09:08:38 CET 2012


MQ1 - OK

put : 21
get : 20
MQ2 - OK

put : 20
get : 20


The script works well, but i can't figure out how to do the graphs the
same
way as the built in
http, that is with multiple test showing up in the same graph, is that
possible ?
I can think of three different ways to do this type of work in Xymon. A
relative simple way is to use the same way devmon is using.

If you make the output of the script to contain something like:

<!-- linecount=2 -->
<!--DEVMON RRD: XYZ 0 0
DS:put:GAUGE:600:0:U DS:get:GAUGE:600:0:U
mq1 21:20
mq2 20:20
-->

and add to xymonserver.cfg:
TEST2RRD= ...,ABC=devmon

(in which ABC is the name of the test / column), you're done. It will
create for the host for which this test is reported two RRD's called
XYZ.mq1.rrd and XYZ.mq2.rrd. With a suitable graph definition you can show
this in one graph.

HTH,
  Wim Nelis.


****************************************************************
********************************************************

The NLR disclaimer is valid for NLR e-mail messages.

This message is only meant for providing information. Nothing in this
e-mail message amounts to a contractual
or legal commitment on the part of the sender.
This message may contain information that is not intended for you. If you
are not the addressee or if this
message was sent to you by mistake, you are requested to inform the
sender and delete the message.
Sender accepts no liability for damage of any kind resulting from the
risks inherent in the electronic
transmission of messages.

****************************************************************
********************************************************

-- 
"Accept the challenges so that you can feel the exhilaration of victory"
- General George Patton
list Heine Andersen · Wed, 7 Nov 2012 15:17:09 +0100 ·
ofc, thx for the help, everything is working now :)


On Tue, Nov 6, 2012 at 4:13 PM, W.J.M. Nelis <user-6956df205d63@xymon.invalid> wrote:
Hello Heine,
quoted from Vernon Everett


 Great ! now im getting data in two rrd files, i just cant display them,
this is what i put in my graphs.cfg

[mqnet]
FNPATTERN ^mqnet.(.+).rrd
TITLE MQ Put Get Times
YAXIS ms
DEF:put at RRDIDX@=@RRDFN@:ms:**AVERAGE
DEF:get at RRDIDX@=@RRDFN@:ms:**AVERAGE
LINE2:put at RRDIDX@#@COLOR@:@**RRDPARAM@
LINE2:get at RRDIDX@#@COLOR@:@**RRDPARAM@
GPRINT:put at RRDIDX@:LAST:Put \: %5.1lf%s (cur)
GPRINT:put at RRDIDX@:MAX: \: %5.1lf%s (max)
GPRINT:put at RRDIDX@:MIN: \: %5.1lf%s (min)
GPRINT:put at RRDIDX@:AVERAGE: \: %5.1lf%s (avg)\n
GPRINT:get at RRDIDX@:LAST:Get\: %5.1lf%s (cur)
GPRINT:get at RRDIDX@:MAX: \: %5.1lf%s (max)
GPRINT:get at RRDIDX@:MIN: \: %5.1lf%s (min)
GPRINT:get at RRDIDX@:AVERAGE: \: %5.1lf%s (avg)\n

the graphs are just blank, any tips on how to debug this ?
Assuming you've used the DEVMON way as described below, you will have two
datasets (DS) in both RRD files. The DS-names are 'put' and 'get'. You can
check this by using 'rrdtool info mqnet*rrd'. If this is correct, you can
change the DEF lines in the graph-definition accordingly, that is replace
ms by put or get.

HTH,
  Wim Nelis.
quoted from Vernon Everett

 On Tue, Nov 6, 2012 at 1:51 PM, W.J.M. Nelis <user-6956df205d63@xymon.invalid
<mailto:user-6956df205d63@xymon.invalid>> wrote:

    Hello,


        I'm trying to write a server side script to monitor MQ put/get
        status and
        times,
        the script output looks like this :


        Tue Nov 6 09:08:38 CET 2012


        MQ1 - OK

        put : 21
        get : 20
        MQ2 - OK

        put : 20
        get : 20


        The script works well, but i can't figure out how to do the graphs
        the same
        way as the built in
        http, that is with multiple test showing up in the same graph, is
that
        possible ?

    I can think of three different ways to do this type of work in Xymon.
A
    relative simple way is to use the same way devmon is using.

    If you make the output of the script to contain something like:

    <!-- linecount=2 -->
    <!--DEVMON RRD: XYZ 0 0
    DS:put:GAUGE:600:0:U DS:get:GAUGE:600:0:U
    mq1 21:20
    mq2 20:20
    -->

    and add to xymonserver.cfg:
    TEST2RRD= ...,ABC=devmon

    (in which ABC is the name of the test / column), you're done. It will
    create for the host for which this test is reported two RRD's called
    XYZ.mq1.rrd and XYZ.mq2.rrd. With a suitable graph definition you can
    show this in one graph.

    HTH,
    Wim Nelis.
****************************************************************
********************************************************

The NLR disclaimer is valid for NLR e-mail messages.

This message is only meant for providing information. Nothing in this
e-mail message amounts to a contractual
or legal commitment on the part of the sender.
This message may contain information that is not intended for you. If you
are not the addressee or if this
message was sent to you by mistake, you are requested to inform the sender
and delete the message.
Sender accepts no liability for damage of any kind resulting from the
risks inherent in the electronic
transmission of messages.

****************************************************************
********************************************************