Issue with graphing.

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
venudharmaji
Posts: 12
Joined: Thu Jul 08, 2010 3:33 am

Issue with graphing.

Post by venudharmaji »

Dear Folks,

We are using the latest Cacti with certain plugins from the Cacti community and few in-house developed plugins.
We have written PHP scripts as part of Data input methods. One such script polls modems for fetching bit-error rate
values (raw BER and corrected BER). Associated graph template is made to plot these two BERs on a single graph.

The output of the script is as shown below (after SNMP polling and sanity check):

Code: Select all

print "rawBER:$raw_ber correctedBER:$corrected_ber";
What we see on the graphs is only rawBER. correctedBER is not getting plotted.
Cacti log file displays only rawBER:value as the script output. Corrected BER value is not seen here.
When the script is run from the command line with same options it outputs both the BERs
as shown below:

rawBER:7.57E-04 correctedBER:2.92E-08

We are currently stuck with this!

Cheers,
Venu
Kind regards,
_venu_
victorantunes
Cacti User
Posts: 111
Joined: Fri Sep 28, 2012 6:52 pm

Re: Issue with graphing.

Post by victorantunes »

It would really help if you posted your graph statement.
And just for the sake of it, what poller are you using?
artagel
Cacti User
Posts: 226
Joined: Wed May 21, 2008 11:33 pm

Re: Issue with graphing.

Post by artagel »

Can you post the debug of this script running from the poller?
-Dan
Please mark the topic solved if this resolves your problem.
venudharmaji
Posts: 12
Joined: Thu Jul 08, 2010 3:33 am

Re: Issue with graphing.

Post by venudharmaji »

Thanks for that quick response.

1. Cactid (spine) is being used for polling.

2. Poller output in the Cacti log is as shown below:

Code: Select all

09/27/2012 11:15:02 AM - SPINE: Poller[0] Host[70] TH[1] DS[157] SCRIPT: php /opt/netmon/webui/cacti/scripts/modem_bers.php 192.168.2.1 public, output: rawBER:1.08E-03
3. RRD graph template:

Code: Select all

/usr/local/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-60 \
--title='Modem - Bit Error Rate' \
--rigid \
--base=1000 \
--height=150 \
--width=600 \
--alt-autoscale \
--logarithmic \
--vertical-label='BER' \
--slope-mode \
--font TITLE:10: \
--font AXIS:7: \
--font LEGEND:8: \
--font UNIT:7: \
DEF:a="/opt/netmon/webui/cacti/rra/73/142.rrd":'correctedBER':AVERAGE \
DEF:b="/opt/netmon/webui/cacti/rra/73/142.rrd":'rawBER':AVERAGE \
LINE1:a#7EE600FF:"Corrected-BER"  \
GPRINT:a:LAST:"Current\:%8.2lf %s"  \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n"  \
LINE1:b#FF0000FF:"Raw-BER"  \
GPRINT:b:LAST:"      Current\:%8.2lf %s"  \
GPRINT:b:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:b:MAX:"Maximum\:%8.2lf %s\n" 

RRDTool Says:

OK
Before the graph issue, we can see that only rawBER is outputted by the script.
Whereas if the script is run from the CLI both BERs are outputted.
Kind regards,
_venu_
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Issue with graphing.

Post by gandalf »

Please check your Data Input Method definitions for the output fields that are expected
R.
venudharmaji
Posts: 12
Joined: Thu Jul 08, 2010 3:33 am

Re: Issue with graphing.

Post by venudharmaji »

Sorry for delayed response, was on a long leave.

Checked the definitions of output fields in the Data Input Methods.
Fields seem to be defined properly. Let me know if any specific information is needed to debug this.
Kind regards,
_venu_
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Issue with graphing.

Post by gandalf »

venudharmaji wrote:rawBER:7.57E-04 correctedBER:2.92E-08
Please enter any whitespace between both output parms
R.
venudharmaji
Posts: 12
Joined: Thu Jul 08, 2010 3:33 am

Re: Issue with graphing.

Post by venudharmaji »

Fixed the issue!
Results from SNMPGET had stray/NULL characters at the end.
Added few comments in the poller.c and it reported 3-4 extra read_bytes while printing only 15 characters.

Did the following before doing print:

Code: Select all

$raw_ber = trim( $raw_ber );
$corrected_ber = trim( $corrected_ber );
Its a real relief!
Thanks.
Kind regards,
_venu_
venudharmaji
Posts: 12
Joined: Thu Jul 08, 2010 3:33 am

Re: Issue with graphing.

Post by venudharmaji »

White space is present. The $raw_ber string had couple of NULL characters at the end.
And being a string variable its getting terminated before printing $corrected_ber.
Kind regards,
_venu_
Post Reply

Who is online

Users browsing this forum: anwaraahmad1 and 2 guests