Can't get "SNMP - Generic OID Template" to work

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
User avatar
MrEko
Posts: 8
Joined: Tue Apr 24, 2012 12:37 pm
Location: Prato, Italy

Can't get "SNMP - Generic OID Template" to work

Post by MrEko »

Hi to all,
this question would be stupid to many of you but it has been weeks I'm working on it and I can't get it to work.
I'm trying to configure Cacti to query linux host via SNMP v3.
Starting from the template "SNMP - Generic OID Template", I have created one to monitor SWAP usage.

Here it is the template:

Image
http://imgur.com/AsaCq

Here the 2 items:

Image
http://imgur.com/ZDC6y

Image
http://imgur.com/eqm8f

Here the 2 Data Templates:

Image
http://imgur.com/5NSkX

Image
http://imgur.com/KBSGy

I can't use the BB code "url" so I have put the link under the image to see them.

Requested OIDs (at the moment) are:
.1.3.6.1.2.1.25.2.3.1.5.10
HOST-RESOURCES-MIB::hrStorageSize.10 = INTEGER: 1015800
.1.3.6.1.2.1.25.2.3.1.6.10
HOST-RESOURCES-MIB::hrStorageUsed.10 = INTEGER: 0

Inside the Device configuration I have set the SNMP options and they works.
If I query SNMP on the linux host, everything works OK.
Attached you can find the cacti.log in Debug mode. swap-in, swap-out are other queries.
As you can see in the log, I have also errors about:
WARNING: Spine NOT running asroot. This is required if using ICMP. Please run "chmod +s;chown root:root spine" to resolve.
even if /usr/bin/spine is root:root and has the +s flag
POLLER: Poller[0] Maximum runtime of 298 seconds exceeded. Exiting.
I have searched but I didn't find how to solve them. But compared to the problem of the SNMP query they are secondary.
Poller is called only from /etc/cron.d/cacti and there are no entries in crontab for user 'root' and user 'cacti'.

CentOS 6.2
Cacti 0.8.8
cacti-spine 0.8.8

I have already read the documentation but I'm missing a step and I don't know what. :(

Can you please give me some hints?

Thanks

Massimo
Attachments
debug_log.txt
(11.78 KiB) Downloaded 89 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Can't get "SNMP - Generic OID Template" to work

Post by gandalf »

The "asroot" issue should not worry you too much. This is related to using ICMP as a downed host detection only. We recommend to use SNMP. Then, this warning message will disappear.
For the debugging, please see 2nd link of my sig
R.
User avatar
MrEko
Posts: 8
Joined: Tue Apr 24, 2012 12:37 pm
Location: Prato, Italy

Re: Can't get "SNMP - Generic OID Template" to work

Post by MrEko »

Thanks for your reply.
I already saw the pages in your signature. The log attached in the first post is in debug mode.
Here I attach the 'rrdtool info' of both files.

- Check Cacti Log File: attachment in first post
- Check Basic Data Gathering: see snmp v3 query in first post
- Check Cacti's Poller: attachment in first post
- Check MySQL Update: no problems detected
- Check RRD File Update: rrd files exist
- Check RRD File Ownership: owned by cacti:cacti
- Check RRD File Numbers: as MAX I have set 'U'
- Check RRDTool Graph Statement:
RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title='Localhost - Traffic - eth0' \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label='bytes per second' \
--slope-mode \
--font TITLE:10: \
--font AXIS:7: \
--font LEGEND:8: \
--font UNIT:7: \
DEF:a="/var/www/cacti/rra/localhost_traffic_in_15.rrd":"traffic_in":AVERAGE \
DEF:b="/var/www/cacti/rra/localhost_traffic_in_15.rrd":"traffic_out":AVERAGE \
AREA:a#00CF00FF:"Inbound" \
GPRINT:a:LAST:" Current\:%8.2lf %s" \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" \
LINE1:b#002A97FF:"Outbound" \
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


Next step is try with SNMP v2 to see if something changes... :(
Attachments
rrd_swap_used.txt
(2.27 KiB) Downloaded 99 times
rrd_swap_total.txt
(2.28 KiB) Downloaded 85 times
User avatar
MrEko
Posts: 8
Joined: Tue Apr 24, 2012 12:37 pm
Location: Prato, Italy

Re: Can't get "SNMP - Generic OID Template" to work

Post by MrEko »

Even with snmp v2c I have the same problem. In the graph I have only NaN. :roll:
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Can't get "SNMP - Generic OID Template" to work

Post by gandalf »

The debug log shows
04/24/2012 07:51:00 PM - SPINE: Poller[0] Host[1] TH[1] DS[21] SNMP: v3: 127.0.0.1, dsname: swap_in, oid: .1.3.6.1.4.1.2021.11.62.0, value: 0
04/24/2012 07:51:00 PM - SPINE: Poller[0] Host[1] TH[1] DS[22] SNMP: v3: 127.0.0.1, dsname: swap_out, oid: .1.3.6.1.4.1.2021.11.63.0, value: 0
...
04/24/2012 07:51:01 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/cacti/rra/localhost_swap_in_21.rrd --template swap_in 1335289861:0
04/24/2012 07:51:01 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/cacti/rra/localhost_swap_out_22.rrd --template swap_out 1335289861:0
So the values retrieved are both "0", but there ARE values retrieved.
The rrdtool update shows, that we "try to update" the related rrd files with that 0 values.

So you may run

Code: Select all

/usr/bin/rrdtool update /var/www/cacti/rra/localhost_swap_in_21.rrd --template swap_in N:0
as cactiuser to verify, that the rrd update is working. Now, you shouldn't see no NaN but a "0" instead.
Please verify
R.
User avatar
MrEko
Posts: 8
Joined: Tue Apr 24, 2012 12:37 pm
Location: Prato, Italy

Re: Can't get "SNMP - Generic OID Template" to work

Post by MrEko »

Thank you for your support!
As I said in my first post, swap_in and swap_out refer to other queries.
However, forget my previous posts for the moment. I have seen that setting the correct
ds[snmp_oid].max
I get a value for 'last_ds' but for 'value' I get always NaN

last_update = 1335657961
ds[snmp_oid].type = "GAUGE"
ds[snmp_oid].minimal_heartbeat = 120
ds[snmp_oid].min = 0.0000000000e+00
ds[snmp_oid].max = 0.0000000000e+00
ds[snmp_oid].last_ds = "1015800"
ds[snmp_oid].value = NaN

if I update it with
rrdtool update /var/www/cacti/rra/1/30.rrd --template snmp_oid 1335658262:99
I get

last_update = 1335658262
ds[snmp_oid].type = "GAUGE"
ds[snmp_oid].minimal_heartbeat = 120
ds[snmp_oid].min = 0.0000000000e+00
ds[snmp_oid].max = 0.0000000000e+00
ds[snmp_oid].last_ds = "999"
ds[snmp_oid].value = NaN


I do this with user 'cacti'.
What is the relation between 'last_ds' and 'value'?



EDIT:
If in the "Data template" I set
Maximum = U
inside the rrd I always get
ds[swap_total].max = NaN
joeborg
Posts: 4
Joined: Mon Apr 30, 2012 4:38 am

Re: Can't get "SNMP - Generic OID Template" to work

Post by joeborg »

Hi,
Was wondering if you found a solution to this issue as I have the same exact problem you describe above?

Thanks,

Joe
User avatar
MrEko
Posts: 8
Joined: Tue Apr 24, 2012 12:37 pm
Location: Prato, Italy

Re: Can't get "SNMP - Generic OID Template" to work

Post by MrEko »

I have seen that when the poller read the data and store it in last_ds but if last read exceed the time specified in the heartbeat, it will leave 'value = NaN'.
For example, in my case I have:

Step = 300 seconds
Heartbeat = 600 seconds

but the poller queries the host every 25 minutes!!! Now I have to find why the poller takes so long to query the host even if the poller is called every minute and the cron run every 5 minutes.

I'll go further into details to see what is the problem and I'll keep you updated.
User avatar
MrEko
Posts: 8
Joined: Tue Apr 24, 2012 12:37 pm
Location: Prato, Italy

Re: Can't get "SNMP - Generic OID Template" to work

Post by MrEko »

I have seen that I have to set
Poller = 1 minute
Cron = 1 minute
(poller and cron at the same interval)
as a workaround to an old bug in Cacti as described here
http://forums.cacti.net/viewtopic.php?f ... 6&start=30
http://bugs.cacti.net/view.php?id=1815

It doesn't matter if I use cmd.php or spine as poller, if I set
Poller = 1 minute
Cron = 5 minute
the queries are executed every 25 minutes, they go out of "heartbeat" and I get NaN in all graphs.
User avatar
MrEko
Posts: 8
Joined: Tue Apr 24, 2012 12:37 pm
Location: Prato, Italy

Re: Can't get "SNMP - Generic OID Template" to work

Post by MrEko »

My fault. During the tests, I switched distribution to Debian Squeeze that has Cacti 0.8.7g and it hadn't the patches:
ping.patch
poller_interval.patch

Working on them now :)
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests