<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 9.00.8112.16447"></HEAD>
<BODY bgColor=#ffffff text=#000000>
<DIV dir=ltr align=left><FONT size=2 face=Arial><SPAN
class=207113413-22012013>Hi Michael,</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><SPAN class=207113413-22012013><FONT size=2 face=Arial>Thanks for your
suggestion and the example code. The problem is that the current test is a
nopost test. So in order to use your script, I would also need to convert
that and do something like [or perl equivalents]: call curl with the --data
option, and then use grep to search for the strings I want to make sure are not
in the result, and derive the colour for the status message from that. I
presume your script below is a server-side Xymon script? I haven't written
one before so I was a little reluctant to try and create one now. Ideally,
I would want the regular expressions to remain in hosts.cfg (or analysis.cfg
if/when tests get moved there in 5.0).</FONT></SPAN></DIV>
<DIV><SPAN class=207113413-22012013><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=207113413-22012013><FONT size=2 face=Arial>However, in this
case, I have asked the developer to put some carriage returns into his JSON HTML
display, so that looks like it will solve it, although the first rrd file is
being created as _u instead of u. That's not too important. It looks
like the rrd files are getting the correct data anyway now, so it is just the
graphing to do. The example I found didn't work for me. This
did:</FONT></SPAN></DIV>
<DIV><SPAN class=207113413-22012013><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=207113413-22012013><FONT size=2
face=Arial> DEF:p@RRDIDX@=@RRDFN@:lambda:AVERAGE<BR> LINE2:p@RRDIDX@#@COLOR@:@RRDPARAM@<BR> GPRINT:p@RRDIDX@:LAST:@RRDPARAM@
\: %5.1lf%s (cur)<BR> GPRINT:p@RRDIDX@:MAX: \: %5.1lf%s
(max)<BR> GPRINT:p@RRDIDX@:MIN: \: %5.1lf%s
(min)<BR> GPRINT:p@RRDIDX@:AVERAGE: \: %5.1lf%s
(avg)\n<BR></FONT></SPAN></DIV>
<DIV><SPAN class=207113413-22012013><FONT size=2 face=Arial>I had to replace
@RRDMETA@ with @RRDPARAM@ based on an old post.</DIV></FONT></SPAN><!-- Converted from text/rtf format -->
<P align=left><SPAN lang=en-gb><FONT size=2 face=Arial>Kind
regards,</FONT></SPAN> </P>
<P><SPAN lang=en-gb><SPAN class=207113413-22012013></SPAN></SPAN><FONT
face=Arial><FONT size=2>S<SPAN
class=207113413-22012013>ebA</SPAN></FONT></FONT><BR></P>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> xymon-bounces@xymon.com
[mailto:xymon-bounces@xymon.com] <B>On Behalf Of </B>Michael
Beatty<BR><B>Sent:</B> 22 January 2013 13:19<BR><B>To:</B>
xymon@xymon.com<BR><B>Subject:</B> Re: [Xymon] NCV RRD graphing for JSON
values<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=moz-cite-prefix><TT>SebA,<BR><BR>You could get around around this
problem by writing a simple script that calls the test and parses the result
and splits it into lines to be sent to Xymon. For example, a basic Perl
example:<BR><BR># Begin Script<BR>my $result =
`test_that_returns_data`;<BR><BR>($u, $rc, $asc, $usc) = split(','
$result);<BR><BR>$msg = "U : $u\n";<BR>$msg .= "RC :
$rc\n";<BR>$msg .= "ASC: $asc\n";<BR>$msg .= "USC: $usc";<BR><BR>`xymon
127.0.0.1 \"status host.mytest green $msg\n\"`; <BR>#End Script<BR><BR>In
other words use the script to call the test (instead of Xymon) split the
results on the comma and then build a new string with newline characters
inserted. Your result reported to Xymon would be:<BR><BR>U :
1391595<BR>RC : 3517<BR>ASC: 1628<BR>USC: 2154<BR><BR>... and easily read by
Xymon's NCV.<BR><BR>Alternatly, you can also look at the section in the
Xymon_RRD man page that discusses "Custom RRD Data Via Scripts". This
would spell out how to do what you like. With that said, I have never
tried it this route as it seems (from the man page) that it is more taxing
than the method I showed above.<BR></TT><PRE class=moz-signature cols="72">Michael Beatty
Sherwin-Williams
IT Analyst/Developer
<A class=moz-txt-link-abbreviated href="mailto:michael.beatty@sherwin.com">michael.beatty@sherwin.com</A>
216-515-7374
</PRE>On 01/22/2013 05:55 AM, SebA wrote:<BR></DIV>
<BLOCKQUOTE
cite=mid:!&!AAAAAAAAAAAuAAAAAAAAAL60wriLM9cRsTVojW0AAAABAFEdQVQs6tMRsLEAoMxarIMAAAABk2cAABAAAABqQFWHKNjVRIe+mnW5s9pJAQAAAAA=@syntec.co.uk
type="cite">
<META name=GENERATOR content="MSHTML 9.00.8112.16447">
<DIV><SPAN class=579393310-22012013><FONT size=2 face=Arial>I was hoping
that Xymon's NCV parsing would understand JSON as the tutorial @ <A
href="http://www.xymon.com/xymon/help/howtograph.html"
moz-do-not-send="true">http://www.xymon.com/xymon/help/howtograph.html</A> does
not specify that the NCVs need to be on seperate lines (although I
subsequently found that "man xymond_rrd" does). It's a shame because a
lot of data is presented as JSON these days. For example, I have this
test, which returns this:</FONT></SPAN></DIV>
<DIV><SPAN class=579393310-22012013><PRE><A href="http://URLremoved/" moz-do-not-send="true">http://URLremoved/</A> - Testing <A href="http://192.168.4.135:8080/tracker/co.do" moz-do-not-send="true">URL</A> yields:
{ u:1391595, rc:3517, asc:1628, usc:2154}</PRE></SPAN></DIV>
<DIV><FONT size=2 face=Arial><SPAN class=579393310-22012013>I am using
SPLITNCV and it just creates a testname,_u.rrd file.</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN
class=579393310-22012013></SPAN></FONT> </DIV>
<DIV><FONT size=2 face=Arial><SPAN class=579393310-22012013>I doubt it would
involve a huge diff to get /xymond/rrd/do_ncv.c to understand this
format. I also doubt that it is currently within my level of C
programming proficiency though unfortunately.</SPAN></FONT></DIV><!-- Converted from text/rtf format -->
<P align=left><SPAN lang=en-gb><FONT size=2 face=Arial>Kind
regards,</FONT></SPAN> </P>
<P><SPAN lang=en-gb><FONT size=2 face=Arial><SPAN
class=579393310-22012013>SebA</SPAN></FONT></SPAN></P><BR>
<FIELDSET class=mimeAttachmentHeader></FIELDSET> <BR><PRE wrap="">_______________________________________________
Xymon mailing list
<A class=moz-txt-link-abbreviated href="mailto:Xymon@xymon.com">Xymon@xymon.com</A>
<A class=moz-txt-link-freetext href="http://lists.xymon.com/mailman/listinfo/xymon">http://lists.xymon.com/mailman/listinfo/xymon</A>
</PRE></BLOCKQUOTE><BR><BR></BLOCKQUOTE></BODY></HTML>