Announcing the 1.44 release of DPDiscover

Addons for Cacti and discussion about those addons

Moderators: Developers, Moderators

ericdives
Posts: 27
Joined: Mon Oct 21, 2013 10:16 am

Announcing the 1.44 release of DPDiscover

Post by ericdives »

DPDiscover is a plugin that uses discovery protocol information from known devices to search for an attempt to add devices not already in Cacti. The 0.1 release includes LLDP and CDP (LLDP is attempted first, and, failing that, CDP is used). A future release will support FDP.

DPDiscover requires PHP >= 5.2.0 (or, for the brave, the PECL "filter" module). If you're running CentOS 5.x, I suggest you look at uninstalling all of your "php" modules and replace them with "php53".

This plugin is heavily based off of the Auto Discovery plugin. The plugin requires that equipment to be detected exist in DNS, but should be IPv6 compatible (if a v4 address is not detected).

The plugin does not do graph/tree additions. If you need that functionality, I suggest you install Autom8; it makes (theoretically) a perfect companion to DP Discover.

This is a Works For Me (mostly) release. Use at your own risk.

Feel free to discuss bugs here, but before bugging me about them, I suggest you look at:

http://runningoffatthemouth.com/?p=1067

And note that known caveats before you do.

If you're a GitHub user, you can optionally use the GitHub issues page for DPDiscover

The latest release can be downloaded here.

If you really want to, you can use git to clone the repository using: https://github.com/botfodder/dpdiscover.git

EDIT: Plugin is also listed at: http://docs.cacti.net/userplugin:dpdiscover

EDIT 20131119: 0.2 is released. Upgrade instructions are available at the two URLs on this page. This made a few things more stable, but we went through a "name unification" (dropping the "y" where needed).

EDIT 20131120: 0.3 release; upgrade process from 0.2 to 0.3 is simple - overwrite all files (actually, only findhosts.php changed). We also discovered the PHP requirement might be a little more widespread than originally thought. The upgrade process from 0.1 to 0.3 ... well, should be the same as 0.1 to 0.2.

EDIT 20131121: 0.4 release. IPv6 tested and working (see caveats).

EDIT 20131122: 1.0 release. FDP working. Additional IPv6 code added. Obviously, if I see bugs, I will patch them. However, it may be a while before I play with this plugin more (holidays are upon us, and I have another plugin I want to write).

EDIT 20131203: 1.1 and 1.2 release. 1.2 introduced code to detect changes in a host's IP (and update cacti tables accordingly), and 1.1 made the upgrade path smoother and introduced an option that would eliminate unwanted lines of information in the email report.

EDIT 20131204: 1.25 - better IP changing code.

EDIT 20131215: Aw heck check the blog post link - it has the best info.

EDIT 20140616: 1.44 released - updating not required but strongly suggested.

EDIT 20150511: 1.46 released - fixes some time drift issues (1.45) and a bug that occurs if host templates are not set up properly.
Last edited by ericdives on Thu Dec 17, 2015 3:14 pm, edited 19 times in total.
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Re: Announcing the 0.1 release of DPDiscover

Post by Linegod »

If you get a chance, please add this to the plugins site: http://docs.cacti.net/plugins.guidelines
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
ericdives
Posts: 27
Joined: Mon Oct 21, 2013 10:16 am

Re: Announcing the 0.1 release of DPDiscover

Post by ericdives »

Linegod wrote:If you get a chance, please add this to the plugins site: http://docs.cacti.net/plugins.guidelines
I can't seem to get logged in; my forum account info isn't working on docs. I'll take a look at my cookie settings a bit more to see if that's it.

EDIT: signing up for bugtracker account now.

EDIT 2: Well. There's a page there now, that much I can say.
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Re: Announcing the 0.1 release of DPDiscover

Post by Linegod »

Excellent. Thanks.
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
ericdives
Posts: 27
Joined: Mon Oct 21, 2013 10:16 am

Re: Announcing the 0.2 release of DPDiscover

Post by ericdives »

Updated the version; this release includes name standardization, slightly expanded email report functionality, and cleanup of the "discover" tab report.
ericdives
Posts: 27
Joined: Mon Oct 21, 2013 10:16 am

Re: Announcing the 0.3 release of DPDiscover

Post by ericdives »

Bugfix! Doesn't look like anyone downloaded the 0.2 release so hopefully not too many people got bitten by the bug.

Also note that PHP 5.2.0 is required. CentOS 5.x users: you'll want to look at switching from "php" to "php53".

EDIT:

IPv6 is not working at this time. Will be fixed in 0.4 tomorrow.

FDP may find its way in to 0.5 either tomorrow or Friday.
ericdives
Posts: 27
Joined: Mon Oct 21, 2013 10:16 am

Re: Announcing the 1.0 release of DPDiscover

Post by ericdives »

DPDiscover hits 1.0! At least, in my mind it does.

Okay - final update (hopefully) for a while. I have another plugin I want to work on as well as some other things going on that will take me away from this for a while.

If you deselect "Use IP as Hostname" and DPDiscover sees only an IPv6 address, it will add the hostname as "udp6:hostname.com". This isn't fully tested and I've already realized there might be a bug there, so I'll be putting a patch in the code shortly. However, I won't bother updating the version number.

FDP is installed and tested! Configure it the same way you do the other two. :)

Upgrading from everything other than 0.1 should simply require overwriting files and visiting the settings page to verify the settings.

EDIT, 15:10 EST: My apologies. If you've downloaded "dpdiscover-latest.tar.gz" before 13:30 EST/12:30 CST, you might want to redownload and try again. The code was still a bit buggy. It should run now though. The code may still report being 1.0 - let's just say that the earlier "1.0" was wrong.
ericdives
Posts: 27
Joined: Mon Oct 21, 2013 10:16 am

Re: Announcing the 1.1 release of DPDiscover

Post by ericdives »

So I lied.

1.1 includes a smoother upgrade path from all versions: disable plugin (no need to uninstall), overwrite files, enable plugin. This should work for all versions.

Also includes an option to exclude the list of "excluded" hosts from the email report. A recent DNS change here resulted in IPs being available for a whole list of equipment that otherwise isn't addable to Cacti, so I listed excluded equipment separately in the report and also provide the option to not include that list.

EDIT: I just can leave this thing alone.

1.25 includes code to detect changes in a host's IP and will change the relevant entry in the 'host' table as well as the 'poller_items' table. Could be very buggy. Let me know. ;)
cinico
Posts: 4
Joined: Mon Dec 04, 2006 7:56 pm

Re: Announcing the 1.25 release of DPDiscover

Post by cinico »

Howdy!

Cool plugin. I noticed it via your Reddit post. I assume your conception was something along the lines of starting with a fresh Cacti install and working out from the center or main devices?

I have it installed on CactiEZ .7.

Anyhow, I am seeing the following in the cell next to the "add" button in the discovered devices table:

Notice: Undefined index: community in /var/www/html/plugins/dpdiscover/dpdiscover.php on line 408 '

I have disabled the Autom8 Tree Item Creation.

Lastly, some system details:

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

Apache Version Apache/2.2.15 (CentOS)

PHP Version 5.3.3
PHP OS Linux

plugin_dpdiscover_hosts 19 MyISAM latin1_swedish_ci
plugin_dpdiscover_template 0 MyISAM latin1_swedish_ci


Thanks for making the plugin!
ericdives
Posts: 27
Joined: Mon Oct 21, 2013 10:16 am

Re: Announcing the 1.27 release of DPDiscover

Post by ericdives »

http://runningoffatthemouth.com/dpdisco ... est.tar.gz has been updated to 1.27. You shouldn't need to go through the upgrade process; setup.php just changed to change the version number (not important) and dpdiscover.php changed to fix that issue (should have been "snmp_community" in at least one other place).

Alternatively, the git savvy can clone the github repository for the project at: https://github.com/ericdives/dpdiscover.git

Thanks for your bug report. I can't promise I will always be this responsive, but I managed to fix this while waiting for (wait for it) ...

... the bug guy.

In our environ it was kind of like you describe, but since we have multiple cacti servers, it was more along the lines of "manually add core/distribution devices, prevent those from being added unintentionally to the wrong Cacti install, and then try to add everything below a given set of distribution routers."

Glad to know someone's finding it useful. :) After I finish my next (internal to my network, sorry) plugin, this one will become less useful to me (but useful enough to possibly find rogue equipment or equipment added physically to the network, but not to the "master database" we have for our MRTG based system that we also use for Nagios).
cinico
Posts: 4
Joined: Mon Dec 04, 2006 7:56 pm

Re: Announcing the 1.27 release of DPDiscover

Post by cinico »

:P

Thanks! Just updated and ran it again. This time around it seems to have done more of a walk (over 600 items vs 19).

Now, one more little bug (maybe?).

The Uptime column is listing some odd times. Many hosts list 248 Days 13 Hours, which is not correct. My core with over 4 years uptime was listed at a little over one day before I added it. Not that it matters much what that column says in the DPDiscover Interface, but it could be useful for determining when something arrived.

Gracias señor!
ericdives
Posts: 27
Joined: Mon Oct 21, 2013 10:16 am

Re: Announcing the 1.27 release of DPDiscover

Post by ericdives »

cinico wrote:Now, one more little bug (maybe?).

The Uptime column is listing some odd times. Many hosts list 248 Days 13 Hours, which is not correct.
Yeah ... that.

It's no secret that a lot of the code was lifted wholesale from the original autodiscovery plugin. As such, that's one of those things I neglected to decide to either take out completely or convert to my own uses and fix. Mainly because it's not something I make that much use of. Now that someone wants it to actually make sense, I guess I'll have to do something with it.

I'll probably do something with it Monday - probably just query the uptime value as things are dumped into the table (and make sure it's reset/blanked out for devices without an IP or that don't for one reason or another return an uptime).
ericdives
Posts: 27
Joined: Mon Oct 21, 2013 10:16 am

Re: Announcing the 1.27 release of DPDiscover

Post by ericdives »

okay - 1.29 isn't up on the site yet, but it is available through the git repo previously mentioned.

One bug I can't quite figure out (as it deals with plugin api stuff I haven't mastered yet) is that the "Clear DPDiscover Results" in "System Utilities" doesn't work. If you really need to clear your results, two options:

Go into the db and do the delete yourself.

Uninstall and reinstall the plugin.

Now, what's changed:

For known and added equipment, we should have all/most of the SNMP information available, if the device responds appropriately during the initial part of the run.

The database entry for "sysUptime" has been changed to an bigint(64) instead of an int(32). Guess how many 100ths of a second come out to roughly 248 days?

The DPDiscover upgrade functionality will run either at the start of a poll or while looking at dpdiscover.php - no need to deactivate/reactivate the plugin (though that should still work, too).

If I figure out the Utilities clear thing I'll be posting 1.30 later today. If not, 1.29 will become the option on the download link tomorrow.

EDIT: BTW, I think you'll still see the 228 day issue with devices that refuse to run anything other than SNMP v1, since they don't return ints larger than 32 bits.

EDIT 2: Got it - 1.30 is available both git and download link.
ericdives
Posts: 27
Joined: Mon Oct 21, 2013 10:16 am

Re: Announcing the 1.30 release of DPDiscover

Post by ericdives »

You can turn your Autom8 stuff back on as long as your using "mysql" as your Cacti database type.

If you're using "mysqli", that's the problem.
ericdives
Posts: 27
Joined: Mon Oct 21, 2013 10:16 am

Re: Announcing the 1.40 release of DPDiscover

Post by ericdives »

1.40 is released. New code covers:

- Name Change detection: if discovery reports a hostname that isn't "known" but resolves to an IP that is, the device that has that IP is renamed to the discovered name.

- Some software versions of Brocade equipment we use have a "get_bulk_request" issue where they can't properly be walked so their FDP information can be pulled in (they end up "timing out" and DPDiscovery sees it as a "failure"). A Settings checkbox has been added that will trigger code that will rewalk the device for FDP entries using SNMPv1, IF: LLDP, CDP, and FDP initially fail (or LLDP or CDP are not active). They have to fail (either by SNMP not detecting any discovery information or neighbor port information), as opposed to returning 0 names (as the functions involved report "new" names only).
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests