PATCH: net-snmp version 5.x support

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Blaine

PATCH: net-snmp version 5.x support

Post by Blaine »

http://www.goatee.com/cacti-0.6.8a-net-snmp-5.patch

Apply by changing into your cacti directory and running

Code: Select all

patch < /path/to/cacti/patch
Two configuration options are added to the Cacti Settings. Some code modifcations to handle the new config options, and a few changes to make the "SNMP Interfaces" snmpwalk work correctly.

This patch should also work with the Cacti upgrade procedure, but I warn that I have not tested that portion.

Feedback/fixes welcome.

Blaine Kahle
blaine@binary.net
Last edited by Blaine on Tue Sep 17, 2002 11:50 pm, edited 1 time in total.
Blaine

Post by Blaine »

Warning: if you're having problems with PHP SNMP, then this patch probably won't help you. It's mainly to fix syntax changes in calling the net-snmp 5 snmpget and snmpwalk.
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

Awesome!

Assuming this is functional, I am going to move this thread to the 'Scripts and Other Addons for cacti' forum for easier reference.

Thanks for your time and effort.

-Ian
Tealk
Posts: 5
Joined: Mon Sep 16, 2002 9:16 am

Post by Tealk »

I applied the patch, but it doesnt show any new functions/options in the 'cacti settings' option.. i refreshed several times but nothing new appears..
i have 0.6.8a, so i dont see the problem?
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

The new settings that this patch requires require SQL to be executed. To be more specific, if you run the following SQL on your cacti database you should be set:

Code: Select all

INSERT INTO settings VALUES ('net_snmp', '', 'net-snmp Settings', 'net-snmp Settings', 'group:net_snmp_5:net_snmp_version');
INSERT INTO settings VALUES ('net_snmp_5', '', 'net-snmp v5 Compatibility', 'net-snmp v5.x command-line syntax compatibility', 'checkbox:group');
INSERT INTO settings VALUES ('net_snmp_version', '', 'net-snmp version string', 'Optional SNMP version string. To force SNMPv2, use: -v 2c', 'textbox:group');
-Ian
Tealk
Posts: 5
Joined: Mon Sep 16, 2002 9:16 am

Post by Tealk »

okay, lol,

now the net-snmp v5.x is visible.. but what should i fill in for the command-line syntax.. only the the -c public etc etc, or?


Tom
valen
Posts: 11
Joined: Fri Oct 11, 2002 8:44 am

Trouble with net-snmp-5 patch

Post by valen »

First off, it didn't apply to my 0.8.6a install cleanly:

[root@krusty cacti-0.6.8a]# patch -p2 < ../cacti-0.6.8a-net-snmp-5.patch
missing header for unified diff at line 3 of patch
patching file cacti.sql
missing header for unified diff at line 15 of patch
patching file settings.php
missing header for unified diff at line 25 of patch
patching file include/snmp_functions.php
missing header for unified diff at line 84 of patch
patching file include/version_functions.php
Hunk #1 FAILED at 222.
1 out of 1 hunk FAILED -- saving rejects to file include/version_functions.php.rej

But, I patched it manually. Didn't see anything in the UI, so ran the SQL that it added to cacti.sql. Still, nothing appears in the screen linked off "Get SNMP Data | [Edit data[" part of Data Sources.

Could there be something else i'm forgetting ?
porkbelly

SNMP

Post by porkbelly »

Doesn't work for me either
Patrick

Post by Patrick »

Is there anybody who knows the answer about the following problem when applying the patch ??

Hunk #1 FAILED at 222.
1 out of 1 hunk FAILED -- saving rejects to file include/version_functions.php.rej

Thanx
yid
Cacti User
Posts: 83
Joined: Sat Apr 20, 2002 8:26 pm

Post by yid »

Try increasing your "fuzz factor".

patch -p? -F 20 < patch file name

try 20 or 40, and see if it goes. If not, then something in the original file isn't matching the patch.

Aaron
Blaine

Post by Blaine »

There appears to be a problem with applying the patch using Linux. Works fine
under FreeBSD, where I developed the patch. I'll see if I can find the portability
problem.
Blaine

Post by Blaine »

GNU patch wants "-p0" to work correctly. GNU patch was also not happy with include/version_functions.php not having an end-of-line character. I have updated my patch to add one, and tested that the patch applies cleanly under FreeBSD and Linux (Slackware).

The following command works on both platforms:

Code: Select all

patch -p0 < /path/to/cacti/patch
You'll automatically get the new configuration options if you follow the normal Cacti installation or upgrade procedure. If you're adding this patch to an existing Cacti installation, you'll need to manually insert the three new rows into your SQL table, as raX describes above.

Tealk: the community string '-c public' change is handled automatically. You may not need to specify anything in the 'version string' box, or you may need '-v 2c' to force snmp version 2, depending on the devices you're polling.

Blaine Kahle
blaine@binary.net
primeru

patching version 0.6.8a

Post by primeru »

patching the v. 0.6.8a is working but gathering data from net-SNMP v5.x is still not working.

When i click on Configuration / Cron Printout / Show output , i get no result on the value of the the configured Data Sources:
INTERNAL: [10.0.0.254/public] Interface: []

i'm using Red Hat 8.0 and php 4.2.2 ( the original one from the RedHat instalation).
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

It seems that standard php-snmp rpm is broken in RH 8.0. This causes that internal snmp support in cacti does not work.

External snmp support may not work either :(. snmpget output is different in some cases comparing to ucd-snmp 4.

- bulek
Rug
Posts: 6
Joined: Fri Nov 15, 2002 5:10 pm

Post by Rug »

Yup, you speak the truth. php-snmp no worky in RH 8. Is there way to submit a bug or something to them? I found this out while trying to write some custom php pages (not related to cacti).

Furthermore, stuff that calls net-snmp stuff without the -c wont work either. Sigh.

So... what does it take to get these things fixed?

1. RH needs to know their rpm blows.
2. It would be nice if it was an (included) option for cacti that you choose if you're using NET-SNMP or UCD-SNMP. The problem isn't going away and using the old XXX-SNMP version isn't a great solution either.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests