No negative SNMP values are stored in the rrd-file:

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

Moderators: Moderators, Developers

Post Reply
Author
Message
Alpenjunge
Posts: 4
Joined: Thu Jun 28, 2018 10:02 am
Location: Switzerland

No negative SNMP values are stored in the rrd-file:

#1 Post by Alpenjunge » Mon Dec 03, 2018 9:58 am

Hello
Since English is not my language, I use DeepL to translate, excuse me...

I've been trying to fix a problem for weeks and I'm stuck:
I want to monitor positive and negative outside temperatures. The values are retrieved via SNMP.
Problem: No negative SNMP values are stored in the rrd-file:
SNMP-Value:

Code: Select all

snmpget -v2c -c public 192.168.92.100 iso.3.6.1.4.1.2021.2000.4.4.1.2.5.116.101.109.112.51.1
iso.3.6.1.4.1.2021.2000.4.4.1.2.5.116.101.109.112.51.1 = STRING: "-10.22"
rrrd-File, filled via snmp not works correct:

Code: Select all

rrdtool info server_sonne_snmp_oid_130.rrd 
filename = "server_sonne_snmp_oid_130.rrd"
rrd_version = "0003"
step = 60
last_update = 1543848236
header_size = 3704
ds[snmp_oid].index = 0
ds[snmp_oid].type = "GAUGE"
ds[snmp_oid].minimal_heartbeat = 600
ds[snmp_oid].min = -2.0000000000e+01
ds[snmp_oid].max = 6.0000000000e+01
ds[snmp_oid].last_ds = "10.22"
ds[snmp_oid].value = 5.7232000000e+02
ds[snmp_oid].unknown_sec = 0
rrd-File, filled via rrdtools update works fine:

Code: Select all

rrdtool update server_sonne_snmp_oid_130.rrd N:-10.22
info server_sonne_snmp_oid_130.rrd 

filename = "server_sonne_snmp_oid_130.rrd"
rrd_version = "0003"
step = 60
last_update = 1543848563
header_size = 3704
ds[snmp_oid].index = 0
ds[snmp_oid].type = "GAUGE"
ds[snmp_oid].minimal_heartbeat = 600
ds[snmp_oid].min = -2.0000000000e+01
ds[snmp_oid].max = 6.0000000000e+01
ds[snmp_oid].last_ds = "-10.22"
ds[snmp_oid].value = -2.4172703744e+02
ds[snmp_oid].unknown_sec = 0
Where do I make the mistake?

---
Cacti V 1.2.0 Beta 2
RRDtool V1.0.0
NET-SNMP V 5.7.3

Alpenjunge
Posts: 4
Joined: Thu Jun 28, 2018 10:02 am
Location: Switzerland

Re: No negative SNMP values are stored in the rrd-file:

#2 Post by Alpenjunge » Sat Dec 08, 2018 1:59 pm

Unfortunately I did not receive a solution. But I have an idea for a workaround:
The values (temperature) provided by the script are increased by 100. Via CDEF 100 are subtracted again before the output. Only positive values are transferred via SNMP, now also negative values are displayed... :-)

jozhik
Posts: 2
Joined: Tue Dec 11, 2018 2:36 pm

Re: No negative SNMP values are stored in the rrd-file:

#3 Post by jozhik » Tue Dec 11, 2018 4:12 pm

I have the same problem

by snmp I get a negative value

Code: Select all

snmpget -v1 -c klotik_ro 10.215.130.21 .1.3.6.1.4.1.2021.2000.10.4.1.2.5.116.101.109.112.48.1
UCD-SNMP-MIB::ucdavis.2000.10.4.1.2.5.116.101.109.112.48.1 = STRING: "-22.25"
cacti writes a positive value to the rrd file

Code: Select all

rrdtool info /var/db/cacti/rra/local_linux_machine_term_8.rrd | grep term
filename = "/var/db/cacti/rra/local_linux_machine_term_8.rrd"
ds[term].index = 0
ds[term].type = "GAUGE"
ds[term].minimal_heartbeat = 600
ds[term].min = -4,0000000000e+01
ds[term].max = 1,0000000000e+02
ds[term].last_ds = "22.25"
ds[term].value = 0,0000000000e+00
ds[term].unknown_sec = 0

Code: Select all

uname -a
FreeBSD jail_2 11.2-RELEASE FreeBSD 11.2-RELEASE #0 r335510: Fri Jun 22 04:32:14 UTC 2018     [email protected]:/usr/obj/usr/src/sys/GENERIC  amd64
pkg info | grep cacti
cacti-1.1.38                   Web-driven graphing interface for RRDTool
pkg info | grep rrd
rrdtool-1.7.0_2                Round Robin Database Tools
pkg info | grep net-snmp
net-snmp-5.7.3_19              Extendable SNMP implementation
What needs to be changed to work properly cacti?

jozhik
Posts: 2
Joined: Tue Dec 11, 2018 2:36 pm

Re: No negative SNMP values are stored in the rrd-file:

#4 Post by jozhik » Tue Dec 11, 2018 4:19 pm

The solution proposed by Alpenjunge is original. But I would like to make the cacti work properly

User avatar
Osiris
Cacti Pro User
Posts: 835
Joined: Mon Jan 05, 2015 10:10 am

Re: No negative SNMP values are stored in the rrd-file:

#5 Post by Osiris » Tue Dec 18, 2018 9:04 am

Looks like this was reported as a bug here and resolved: https://github.com/Cacti/cacti/issues/2217
Before history, there was a paradise, now dust.

Post Reply