<meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; color: rgb(34, 34, 34); ">well, I'm doing a cacti graph to show the weblogic server status..<div>
I take the status with a snmp get and my ideas was to do the following..</div><div>1) get the Status..</div><div>2) compare the status with the "Running" string</div><div>3) if the strings match, the variable status_value would receive the value 1, else it would be 0</div>
<div>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 ..</div><div><br></div><div>do you have any idea of how could I do that?</div></span><br>
<div class="gmail_quote">2011/11/7 Simon Hobson <span dir="ltr"><<a href="mailto:linux@thehobsons.co.uk">linux@thehobsons.co.uk</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">Andre Luis wrote:<br>
>hello, I'm new into cacti and I would like to know it there's a way<br>
>to compare strings with CDEF ...<br>
><br>
>I did some tests using numbers and it worked, but when I try with<br>
>strings, it gives an error.."ERROR: invalid rpn expression in:"<br>
<br>
</div>That's because these functions only work, and only makes sense with,<br>
numbers. You cannot store strings in RRD databases, so there aren't<br>
tools to work with them.<br>
<br>
If you need to do conditionals based on strings from "the outside",<br>
then you may need to dynamically build your graph/query definitions.<br>
Eg, in Bash :<br>
<br>
(<br>
echo "<some stuff>"<br>
<br>
if [ "$a" = "test" ]<br>
then<br>
echo "<some more stuff>"<br>
else<br>
echo "<some other stuff>"<br>
fi<br>
echo "<finishing stuff>"<br>
) | rrdcgi .....<br>
<br>
I have some cgi scripts building many dynamic graphs, all written in Bash.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Simon Hobson<br>
<br>
Visit <a href="http://www.magpiesnestpublishing.co.uk/" target="_blank">http://www.magpiesnestpublishing.co.uk/</a> for books by acclaimed<br>
author Gladys Hobson. Novels - poetry - short stories - ideal as<br>
Christmas stocking fillers. Some available as e-books.<br>
<br>
_______________________________________________<br>
rrd-users mailing list<br>
<a href="mailto:rrd-users@lists.oetiker.ch">rrd-users@lists.oetiker.ch</a><br>
<a href="https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users" target="_blank">https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Att,<div><br></div><div><font face="arial, sans-serif"><span style="line-height:15px"><img src="http://209.20.66.234/ip/assinaturas/assinatura_mail_pax_andre_luis.jpg"><br>
</span></font></div><br>