Cacti / cacti

Cacti ™
http://www.cacti.net
GNU General Public License v2.0
1.63k stars 404 forks source link

Single OID graph only works in realtime but not with Poller #3174

Open bmfmancini opened 4 years ago

bmfmancini commented 4 years ago

Hey Guys

I have posted this in the forums before without an answer so I hope that maybe on github someone can help me find what I am doing wrong

We have a new cisco ISR that has a differnt CPU mib that other ciscos so I duplicated the data source and graph template updated the OID and datasource name when I click realtime everyworks nicely but after waiting the graph does not populate with polls

Here are my checks and outputs

Here is my datasource template

image

Here is my graph template

image

Here is the output I get with device debug

2020/01/08 14:11:06 - SPINE: Poller[Main Poller] PID[24126] Device[device-name HT[1] DS[device-name - 5 Minute CPU] Graphs[device-name - CPU Usage] SNMP: v2: ip-address, dsname: isr5min_cpu, oid: .enterprises.9.9.109.1.1.1.1.6.7, value: U 2020/01/08 14:10:07 - SPINE: Poller[Main Poller] PID[22000] Device[device-name HT[1] DS[device-name - 5 Minute CPU] Graphs[device-name - CPU Usage] SNMP: v2: ip-address, dsname: isr5min_cpu, oid: .enterprises.9.9.109.1.1.1.1.6.7, value: U 2020/01/08 14:09:07 - SPINE: Poller[Main Poller] PID[19793] Device[device-name HT[1] DS[device-name - 5 Minute CPU] Graphs[device-name - CPU Usage] SNMP: v2: ip-address, dsname: isr5min_cpu, oid: .enterprises.9.9.109.1.1.1.1.6.7, value: U 2020/01/08 14:08:08 - SPINE: Poller[Main Poller] PID[17683] Device[device-name HT[1] DS[device-name - 5 Minute CPU] Graphs[device-name - CPU Usage] SNMP: v2: ip-address, dsname: isr5min_cpu, oid: .enterprises.9.9.109.1.1.1.1.6.7, value: U 2020/01/08 14:07:10 - SPINE: Poller[Main Poller] PID[15505] Device[device-name HT[1] DS[device-name - 5 Minute CPU] Graphs[device-name - CPU Usage] SNMP: v2: ip-address, dsname: isr5min_cpu, oid: .enterprises.9.9.109.1.1.1.1.6.7, value: U

Here is what I get with realtime

image

Here is the graph debug output

RRDtool Command: /bin/rrdtool graph - \ --imgformat=PNG \ --start='1578424380' \ --end='1578510780' \ --pango-markup \ --title='xxxxxxxxxxx - CPU Usage' \ --vertical-label='percent' \ --slope-mode \ --base=1000 \ --height=200 \ --width=700 \ --tabwidth '40' \ --rigid \ --alt-autoscale-max \ --lower-limit='0' \ COMMENT:"From 2020/01/07 14\:13\:00 To 2020/01/08 14\:13\:00\c" \ COMMENT:" \n" \ --color BACK#F3F3F3 \ --color CANVAS#FDFDFD \ --color SHADEA#CBCBCB \ --color SHADEB#999999 \ --color FONT#000000 \ --color AXIS#2C4D43 \ --color ARROW#2C4D43 \ --color FRAME#2C4D43 \ --border 1 --font TITLE:11:'Arial' \ --font AXIS:8:'Arial' \ --font LEGEND:8:'Courier' \ --font UNIT:8:'Arial' \ --font WATERMARK:6:'Arial' \ --slope-mode \ DEF:a='/var/www/html/cacti/rra/xxxxxxxxxxx':'isr5min_cpu':MAX \ AREA:a#FF0000FF:'CPU Usage' \ GPRINT:a:LAST:'Current\:%8.0lf' \ GPRINT:a:AVERAGE:'Average\:%8.0lf' \ GPRINT:a:MAX:'Maximum\:%8.0lf\n' RRDtool Says: OK

Graph permission output -rw-r--r-- 1 apache apache 321K Jan 8 14:14 device-name

Does anyone have any ideas or is this some sort of bug ? BTW I am using 1.2.7

bmfmancini commented 4 years ago

here is the output from the poller cache

device-name - 5 Minute CPU device-name SNMP Version: 2, Community: string, OID: .enterprises.9.9.109.1.1.1.1.6.7 RRD: /var/www/html/cacti/rra/device-name

bmfmancini commented 4 years ago

Today I went into the error log and it shows that the OID is bad however it works fine via net-snmp and in realtime so I am not sure how cacti is coming to that conclusion

cigamit commented 4 years ago

Spine does not parse the OID's into numeric representation. It's been a perenial issue for us. It's been documented, but then I have not read the documentation in quite a while. You should create a pull request to state that clearly. It was done strictly for RAW performance reasons as loading the MIB's stole cycles from spine. For Windows it was much worse than *NIX, so it was just left off.

So, change edit that Data Input Method, or Data Template/Source and change ".enterprises." to it's numeric value and you will be all set. You should also answer your forum post ;)

cigamit commented 4 years ago

You might have to resave the device, check your poller cache after you make the change and let us know if you had to or not. Saving the device is like a device specific rebuild on the poller cache.

netniV commented 4 years ago

I suppose the enhancement would be have two fields, one with the entered OID and one that held the numeric value calculated upon save. However, if an OID could flux in its value when queried by name, caching could then become a problem.

That would be a 1.3+ enhancement though.

cigamit commented 4 years ago

Well, we could put a switch in the settings table and then simply turn on mib parsing if the switch is enabled. Pretty strait forward. 1.3 for sure.

bmfmancini commented 4 years ago

Ok

I changed to the Numeric OID and now the realtime graphs don't work although the invalid OID error in the log is gone

snmpwalk -v2c -c string IP .1.3.6.1.4.1.9.9.109.1.1.1.1.7 enterprises.9.9.109.1.1.1.1.7.7 = Gauge32: 10

image

image

Here is the poller cache output

SNMP Version: 2, Community: string, OID: .1.3.6.1.4.1.9.9.109.1.1.1.1.7 RRD: /var/www/html/cacti/rra/Devicename.rrd

bmfmancini commented 4 years ago

Ah FML

the full OID is .1.3.6.1.4.1.9.9.109.1.1.1.1.7.7 LOl sorry guys Working good now

bmfmancini commented 4 years ago

Hey Maybe a suggestion can we put a check in the textbox to not allow charicters to force only numbers since spine doesnt work with charicters

netniV commented 4 years ago

We can probably enable a regex against the OID if the option for numeric only is set (eg, no mibs). Again, that would really be an enhancement as per above.

cigamit commented 4 years ago

We should create a validation filter called VALIDATE_OID. It's might already be in PHP, but I doubt it.