Xymon Mailing List Archive search

Custom non-ncv graph

6 messages in this thread

list Tomáš Wachtarczyk · Wed, 23 Mar 2016 11:43:24 +0100 ·
Hello,

I am struggling with displaying custom graph.

It should display volumegroups on host with VGSIZE, VGFREE and VGPRCT
(usage of VG)
Number of VG are not constant, it may differ.

So i am sending it as data and i can find rrd on xymon server.

TEST=*VG*

BBVGB=$(sudo /usr/sbin/vgs --units B --nosuffix --noheadings --aligned --o
vg_name,vg_size,vg_free)

while read VG VGSIZE VGFREE; do
VGPRCT=$(bc <<< "scale=2;100-(${VGFREE}/${VGSIZE}*100)")
DATA="${DATA}
[*VG2*,${VG}.rrd]
DS:vgsize:GAUGE:600:0:U ${VGSIZE}
DS:vgfree:GAUGE:600:0:U ${VGFREE}
DS:vgprct:GAUGE:600:0:100 ${VGPRCT}
"
done <<< "${BBVGB}"


It produce
[*VG2*,appvg.rrd]
DS:vgsize:GAUGE:600:0:U 314572800000
DS:vgfree:GAUGE:600:0:U 69130518528
DS:vgprct:GAUGE:600:0:100 75

[*VG2*,rootvg.rrd]
DS:vgsize:GAUGE:600:0:U 2472800000
DS:vgfree:GAUGE:600:0:U 430518528
DS:vgprct:GAUGE:600:0:100 97

Sending it to xymon server with
${XYMON} ${XYMSRV} "data ${MACHINE}.trends
${DATA}"

Data are delivered, i can dump rrd on xymonserver, seems to ok to me,
archive is filling up, but i am not able to display it on trends or GRAPH_
*VG*="*VG2*" page.

rrdttol dump *VG2*,appvg.rrd
        <ds>
                <name> vgsize </name>
                <type> GAUGE </type>
                <minimal_heartbeat> 600 </minimal_heartbeat>
                <min> 0.0000000000e+00 </min>
                <max> NaN </max>

                <!-- PDP Status -->
                <last_ds> 314572800000 </last_ds>
                <value> 2.6109542400e+13 </value>
                <unknown_sec> 0 </unknown_sec>
        </ds>


I set it in xymonserver.cfg to TEST2RRD="....VG2"  (is it correct?) and
GRAPHS="...VG2"

I tried to define it also in graphs.cfg
[*VG2*]
        FNPATTERN VG2.(.+).rrd
        TITLE Volume group
        DEF:vgsize=@RRDFN@:vgsize:AVERAGE
        DEF:vgfree=@RRDFN@:vgfree:AVERAGE
        DEF:vgprct=@RRDFN@:vgprct:AVERAGE
        LINE1.5:p at RRDIDX@#@COLOR@:@RRDPARAM@
        GPRINT:vgsize:LAST: \: %5.1lf (cur)
        GPRINT:vgsize:MAX: \: %5.1lf (max)
        GPRINT:vgsize:MIN: \: %5.1lf (min)
        GPRINT:vgsize:AVERAGE: \: %5.1lf (avg)\n
        GPRINT:vgfree:LAST: \: %5.1lf (cur)
        GPRINT:vgfree:MAX: \: %5.1lf (max)
        GPRINT:vgfree:MIN: \: %5.1lf (min)
        GPRINT:vgfree:AVERAGE: \: %5.1lf (avg)\n
        GPRINT:vgprct:LAST: \: %5.1lf (cur)
        GPRINT:vgprct:MAX: \: %5.1lf (max)
        GPRINT:vgprct:MIN: \: %5.1lf (min)
        GPRINT:vgprct:AVERAGE: \: %5.1lf (avg)\n


I was able to understand when i was sending ncv only
vg:percentage
appvg:75
rootvg:98

, and it worked.

But i am stupid for more complex solutions and lost in english. I am sure
it is very easy task, but i just do not get it.

Thank you for your help

W.

P.S: I have plan to send VG as status with human formated output and VG2
will be data for graphs.
list Jeremy Laidman · Wed, 23 Mar 2016 10:59:22 +0000 ·
On Wed, Mar 23, 2016 at 9:43 PM Tomáš Wachtarczyk <
user-b22ac339dcad@xymon.invalid> wrote:

It produce
[*VG2*,appvg.rrd]
[*VG2*,rootvg.rrd]
I tried to define it also in graphs.cfg
[*VG2*]
        FNPATTERN VG2.(.+).rrd
Shouldn't that be:
          FNPATTERN VG2,(.+).rrd

I'm not entirely sure but I always thought the PCRE parser only looks
inside the parens, and so a dot (aka period, or ".") outside the parens
will be a literal dot, and won't match a comma in the filename.

J
list Tomáš Wachtarczyk · Wed, 23 Mar 2016 12:29:59 +0100 ·
I tried it with "VG2," but same.

When i had ncv VG graph,

SPLITNCV_VG="*:GAUGE"

i used

FNPATTERN VG.(.+).rrd
without problem and

-rw-rw-r-- 1 xymon xymon 19640 Mar 23 10:59
../data/rrd/hostname/VG,appvg.rrd
-rw-rw-r-- 1 xymon xymon 19640 Mar 23 11:00
../data/rrd/hostname/VG,rootvg.rrd
-rw-rw-r-- 1 xymon xymon 19640 Mar 23 11:00
../data/rrd/hostname/VG,vgdata.rrd

were created into one graph without problem.


[VG]
        FNPATTERN VG.(.+).rrd
        TITLE Volume group
        YAXIS Percentage
        DEF:p at RRDIDX@=@RRDFN@:lambda:AVERAGE
        LINE1.5:p at RRDIDX@#@COLOR@:@RRDPARAM@
        GPRINT:p at RRDIDX@:LAST: \: %5.1lf (cur)
        GPRINT:p at RRDIDX@:MAX: \: %5.1lf (max)
        GPRINT:p at RRDIDX@:MIN: \: %5.1lf (min)
        GPRINT:p at RRDIDX@:AVERAGE: \: %5.1lf (avg)\n


On Wed, Mar 23, 2016 at 11:59 AM, Jeremy Laidman <user-71895fb2e44c@xymon.invalid>
quoted from Jeremy Laidman
wrote:
On Wed, Mar 23, 2016 at 9:43 PM Tomáš Wachtarczyk <
user-b22ac339dcad@xymon.invalid> wrote:

It produce
[*VG2*,appvg.rrd]
[*VG2*,rootvg.rrd]
I tried to define it also in graphs.cfg
[*VG2*]
        FNPATTERN VG2.(.+).rrd
Shouldn't that be:
          FNPATTERN VG2,(.+).rrd

I'm not entirely sure but I always thought the PCRE parser only looks
inside the parens, and so a dot (aka period, or ".") outside the parens
will be a literal dot, and won't match a comma in the filename.

J

list Tomáš Wachtarczyk · Wed, 23 Mar 2016 13:15:01 +0100 ·
I am able to generate graph manualy by

rrdtool graph /tmp/output.png --width 500 --start 1458648243 -v "VG"  \
DEF:vgsize=/tmp/VG2,appvg.rrd:vgsize:AVERAGE \
DEF:vgfree=/tmp/VG2,appvg.rrd:vgfree:AVERAGE \
DEF:vgprct=/tmp/VG2,appvg.rrd:vgprct:AVERAGE \
LINE2:vgsize#FF0000:vgsize \
LINE2:vgfree#00FF00:vgfree \
LINE2:vgprct#0000FF:vgprct


So i think i have something wrong in graphs.cfg

W.


On Wed, Mar 23, 2016 at 12:29 PM, Tomáš Wachtarczyk <
quoted from Tomáš Wachtarczyk
user-b22ac339dcad@xymon.invalid> wrote:
I tried it with "VG2," but same.

When i had ncv VG graph,

SPLITNCV_VG="*:GAUGE"

i used

FNPATTERN VG.(.+).rrd
without problem and

-rw-rw-r-- 1 xymon xymon 19640 Mar 23 10:59
../data/rrd/hostname/VG,appvg.rrd
-rw-rw-r-- 1 xymon xymon 19640 Mar 23 11:00
../data/rrd/hostname/VG,rootvg.rrd
-rw-rw-r-- 1 xymon xymon 19640 Mar 23 11:00
../data/rrd/hostname/VG,vgdata.rrd

were created into one graph without problem.


[VG]
        FNPATTERN VG.(.+).rrd
        TITLE Volume group
        YAXIS Percentage
        DEF:p at RRDIDX@=@RRDFN@:lambda:AVERAGE
        LINE1.5:p at RRDIDX@#@COLOR@:@RRDPARAM@
        GPRINT:p at RRDIDX@:LAST: \: %5.1lf (cur)
        GPRINT:p at RRDIDX@:MAX: \: %5.1lf (max)
        GPRINT:p at RRDIDX@:MIN: \: %5.1lf (min)
        GPRINT:p at RRDIDX@:AVERAGE: \: %5.1lf (avg)\n


On Wed, Mar 23, 2016 at 11:59 AM, Jeremy Laidman <user-71895fb2e44c@xymon.invalid
wrote:
On Wed, Mar 23, 2016 at 9:43 PM Tomáš Wachtarczyk <
user-b22ac339dcad@xymon.invalid> wrote:

It produce
[*VG2*,appvg.rrd]
[*VG2*,rootvg.rrd]
I tried to define it also in graphs.cfg
[*VG2*]
        FNPATTERN VG2.(.+).rrd
Shouldn't that be:
          FNPATTERN VG2,(.+).rrd

I'm not entirely sure but I always thought the PCRE parser only looks
inside the parens, and so a dot (aka period, or ".") outside the parens
will be a literal dot, and won't match a comma in the filename.

J

list Tomáš Wachtarczyk · Wed, 23 Mar 2016 14:04:04 +0100 ·
When i define

[VG2]
        TITLE VG - Size
        YAxis Bytes
        FNPATTERN VG2,(.+).rrd
        DEF:vgs at RRDIDX@=@RRDFN@:vgsize:AVERAGE
        LINE2:vgs at RRDIDX@#@COLOR@:@RRDPARAM@

I am able to generate VGSIZE for 3 VG on machine.

I think i will do 3 graphs for VGSIZE, VGFREE and VGPRCT
I am not able to do that into one.

W.

On Wed, Mar 23, 2016 at 1:15 PM, Tomáš Wachtarczyk <
quoted from Tomáš Wachtarczyk
user-b22ac339dcad@xymon.invalid> wrote:
I am able to generate graph manualy by

rrdtool graph /tmp/output.png --width 500 --start 1458648243 -v "VG"  \
DEF:vgsize=/tmp/VG2,appvg.rrd:vgsize:AVERAGE \
DEF:vgfree=/tmp/VG2,appvg.rrd:vgfree:AVERAGE \
DEF:vgprct=/tmp/VG2,appvg.rrd:vgprct:AVERAGE \
LINE2:vgsize#FF0000:vgsize \
LINE2:vgfree#00FF00:vgfree \
LINE2:vgprct#0000FF:vgprct


So i think i have something wrong in graphs.cfg

W.


On Wed, Mar 23, 2016 at 12:29 PM, Tomáš Wachtarczyk <
user-b22ac339dcad@xymon.invalid> wrote:
I tried it with "VG2," but same.

When i had ncv VG graph,

SPLITNCV_VG="*:GAUGE"

i used

FNPATTERN VG.(.+).rrd
without problem and

-rw-rw-r-- 1 xymon xymon 19640 Mar 23 10:59
../data/rrd/hostname/VG,appvg.rrd
-rw-rw-r-- 1 xymon xymon 19640 Mar 23 11:00
../data/rrd/hostname/VG,rootvg.rrd
-rw-rw-r-- 1 xymon xymon 19640 Mar 23 11:00
../data/rrd/hostname/VG,vgdata.rrd

were created into one graph without problem.


[VG]
        FNPATTERN VG.(.+).rrd
        TITLE Volume group
        YAXIS Percentage
        DEF:p at RRDIDX@=@RRDFN@:lambda:AVERAGE
        LINE1.5:p at RRDIDX@#@COLOR@:@RRDPARAM@
        GPRINT:p at RRDIDX@:LAST: \: %5.1lf (cur)
        GPRINT:p at RRDIDX@:MAX: \: %5.1lf (max)
        GPRINT:p at RRDIDX@:MIN: \: %5.1lf (min)
        GPRINT:p at RRDIDX@:AVERAGE: \: %5.1lf (avg)\n


On Wed, Mar 23, 2016 at 11:59 AM, Jeremy Laidman <
user-71895fb2e44c@xymon.invalid> wrote:
On Wed, Mar 23, 2016 at 9:43 PM Tomáš Wachtarczyk <
user-b22ac339dcad@xymon.invalid> wrote:

It produce
[*VG2*,appvg.rrd]
[*VG2*,rootvg.rrd]
I tried to define it also in graphs.cfg
[*VG2*]
        FNPATTERN VG2.(.+).rrd
Shouldn't that be:
          FNPATTERN VG2,(.+).rrd

I'm not entirely sure but I always thought the PCRE parser only looks
inside the parens, and so a dot (aka period, or ".") outside the parens
will be a literal dot, and won't match a comma in the filename.

J

list Jeremy Laidman · Wed, 23 Mar 2016 13:26:53 +0000 ·
On Wed, 23 Mar 2016, 21:43 Tomáš Wachtarczyk <user-b22ac339dcad@xymon.invalid>
quoted from Tomáš Wachtarczyk
wrote:

I tried to define it also in graphs.cfg
[*VG2*]
        FNPATTERN VG2.(.+).rrd
        TITLE Volume group
        DEF:vgsize=@RRDFN@:vgsize:AVERAGE
        DEF:vgfree=@RRDFN@:vgfree:AVERAGE
        DEF:vgprct=@RRDFN@:vgprct:AVERAGE
        LINE1.5:p at RRDIDX@#@COLOR@:@RRDPARAM@
        GPRINT:vgsize:LAST: \: %5.1lf (cur)
I don't think you can use "LINE1.5" here. It's only LINE1, LINE2, LINE3,
AREA or STACK.

J