[solved] Float values stored as Strings to graph the number

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

Moderators: Developers, Moderators

Post Reply
lowenbehold
Posts: 3
Joined: Thu Aug 06, 2015 2:23 pm

[solved] Float values stored as Strings to graph the number

Post by lowenbehold »

Hello,

I've looked around a bit for a solution to this but either have not found one or didn't know I found it.

I am trying to graph metering data from an SNMP gateway device that stores floats as string values. See Figure 1:snmpwalk. Sensitive info redacted.

Figure 1:
[root@devcacti ~]# snmpwalk -v 1 -c ******* ##.##.##.## .1.3.6.1.4.1.3815.1.2.2.1.1.2.1.1.2.1
SNMPv2-SMI::enterprises.3815.1.2.2.1.1.2.1.1.2.1 = STRING: "409681.500000"

Unsurprisingly, the graph returns NaN. See Figure 2: graph attached.

RRDTool sees, hears and speaks no evil. See Figure 3: RRDTool

Figure 3:
RRDTool Says:
OK

Is there a plugin or other script that I can use to convert this string back to a float or integer so that I can graph it numerically? As far as I, or the makers of the snmp gateway I am using, know I can not change the format of the value in the snmp table.

Please let me know if you need any more information. Here is my VM and general info:

[root@devcacti ~]# cat /etc/*release*
CentOS release 6.5 (Final)
LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch
cat: /etc/lsb-release.d: Is a directory
CentOS release 6.5 (Final)
CentOS release 6.5 (Final)
cpe:/o:centos:linux:6:GA

Cacti Version 0.8.8b
Cacti OS unix
SNMP Version NET-SNMP version: 5.5
RRDTool Version RRDTool 1.3.x


Thank you in advance!
Attachments
NaN
NaN
graph_image.png (13.05 KiB) Viewed 1137 times
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Reading Float values stored as Strings to graph the numb

Post by BSOD2600 »

lowenbehold wrote:Unsurprisingly, the graph returns NaN. See Figure 2: graph attached.
what method are you using to get the data into cacti? maybe forgot to alter the data template data source MAX field?

increase the logging level for cacti.log to high or debug. is that string value being correctly interpreted?
What about the rrdtool update command?
lowenbehold
Posts: 3
Joined: Thu Aug 06, 2015 2:23 pm

Re: Reading Float values stored as Strings to graph the numb

Post by lowenbehold »

I was using a Get SNMP Data source but made a data query and now the data is showing up as numbers. Thanks a lot!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest