[rrd-users] CDEF: comparing Strings

Andre Luis andre.luis at paxtecnologia.com.br
Tue Nov 8 12:50:05 CET 2011


well, I'm doing a cacti graph to show the weblogic server status..
I take the status with a snmp get and my ideas was to do the following..
1) get the Status..
2) compare the status with the "Running" string
3) if the strings match, the variable status_value would receive the value
1, else it would be 0
4) create the graph with the status_value variable ..so if the server is
running, my graphs would be in 1 .. else it would be in 0 ..

do you have any idea of how could I do that?

2011/11/7 Simon Hobson <linux at thehobsons.co.uk>

> Andre Luis wrote:
> >hello, I'm new into cacti and I would like to know it there's a way
> >to compare strings with CDEF ...
> >
> >I did some tests using numbers and it worked, but when I try with
> >strings, it gives an error.."ERROR: invalid rpn expression in:"
>
> That's because these functions only work, and only makes sense with,
> numbers. You cannot store strings in RRD databases, so there aren't
> tools to work with them.
>
> If you need to do conditionals based on strings from "the outside",
> then you may need to dynamically build your graph/query definitions.
> Eg, in Bash :
>
> (
>   echo "<some stuff>"
>
>   if [ "$a" = "test" ]
>   then
>     echo "<some more stuff>"
>   else
>     echo "<some other stuff>"
>   fi
>   echo "<finishing stuff>"
> ) | rrdcgi .....
>
> I have some cgi scripts building many dynamic graphs, all written in Bash.
>
> --
> Simon Hobson
>
> Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
> author Gladys Hobson. Novels - poetry - short stories - ideal as
> Christmas stocking fillers. Some available as e-books.
>
> _______________________________________________
> rrd-users mailing list
> rrd-users at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
>



-- 
Att,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20111108/6c97e967/attachment.htm 


More information about the rrd-users mailing list