Announcing the 1.44 release of DPDiscover

Addons for Cacti and discussion about those addons

Moderators: Developers, Moderators

cnarvasa
Posts: 2
Joined: Sun Mar 16, 2014 1:00 pm

Re: Announcing the 1.41 release of DPDiscover

Post by cnarvasa »

I'm hoping I can get some clarification on the dpdiscover reports:

I get dpdiscover reports emailed to me weekly and get a long list of devices under:

"REPORT: Has IP, but not added:"

Why is dpdiscover not adding these devices?
ericdives
Posts: 27
Joined: Mon Oct 21, 2013 10:16 am

Re: Announcing the 1.41 release of DPDiscover

Post by ericdives »

For some reason, DPDiscover can't actually connect to those devices; it has found them via a discovery protocol and successfully located an IP in DNS, but cannot otherwise pull any SNMP data from it. If the SNMP community or v3 information is not available to DPDiscover, or the IP is wrong in DNS, it can't add a device.

If you think it should be able to with what you've configured, you can try running:

php -q findhosts.php -d -f

This will force a debug run that will dump a crapload of debugging info to the screen and may give you a hint as to what's wrong. Make sure you have a very large scrollback buffer, or pipe the output somewhere to look at later.

Can you snmpwalk the devices in question at the IPs discovered using SNMP info provided to DPDiscover? If not, then that's why DPDiscover isn't adding them. If so ... well, then check a debug run for other clues.
ericdives
Posts: 27
Joined: Mon Oct 21, 2013 10:16 am

Re: Announcing the 1.41 release of DPDiscover

Post by ericdives »

Oh - and check for exclusions - if any part of the host names of the found devices match something you've told DPDiscover not to add, it of course won't add it.
cnarvasa
Posts: 2
Joined: Sun Mar 16, 2014 1:00 pm

Re: Announcing the 1.41 release of DPDiscover

Post by cnarvasa »

It's been a while since i've been able to revist this. But i had a moment to follow your suggestions. I'm able to snmpwalk the device that's reported as "has an IP but not added" from the cacti server. All dns records point to the correct IP as well. I ran the findhosts script in debug

PHP Notice: Undefined index: 0 in /usr/share/cacti/plugins/dpdiscover/findhosts.php on line 264
PHP Notice: Undefined index: 0 in /usr/share/cacti/plugins/dpdiscover/findhosts.php on line 264
PHP Notice: Undefined index: 0 in /usr/share/cacti/plugins/dpdiscover/findhosts.php on line 264
PHP Notice: Undefined index: 0 in /usr/share/cacti/plugins/dpdiscover/findhosts.php on line 264



Trying parent SNMP! ggcs-stageswitch2 parent ggstageswitch3
IT WORKED! .1.3.6.1.4.1.9.1.615
I think we can add ggcs-stageswitch2
PHP Warning: stristr(): Empty delimiter in /usr/share/cacti/plugins/dpdiscover/findhosts.php on line 948
Trying parent SNMP! ggcs-stageswitch parent ggstageswitch3
IT WORKED! .1.3.6.1.4.1.9.1.615
I think we can add ggcs-stageswitch
PHP Warning: stristr(): Empty delimiter in /usr/share/cacti/plugins/dpdiscover/findhosts.php on line 948
Trying parent SNMP! ggstage2-tor-01.sfo2 parent ggstageswitch3
IT WORKED! .1.3.6.1.4.1.9.1.626
I think we can add ggstage2-tor-01.sfo2
PHP Warning: stristr(): Empty delimiter in /usr/share/cacti/plugins/dpdiscover/findhosts.php on line 948

Not to sure how to move forward from here... :/
ericdives
Posts: 27
Joined: Mon Oct 21, 2013 10:16 am

Re: Announcing the 1.41 release of DPDiscover

Post by ericdives »

Okay - without more information, I'm just guessing here:

First, 1.43 is out, so I'm guessing that that you're using an older version, because line numbers are not lining up.

There are a few things going on. First, I need to make sure everywhere (like, say, my blog) has proper instructions of what's required before hand, and I need to have some stuff double checked (and logged if it's missing) before findhosts.php will actually run. So there will be some minor bug proofing added in the next day or so resulting in the release of 1.44.

Does your Cacti install have an *DP capable host to start with?

Assuming it does, the next thing is that you need to tell DPDiscover (through the Templates option, which you might have to grant yourself access to if you're not the "admin" user - user with admin rights not always enough) what Host Template matches the sysdescription pulled via SNMP.

I'd like to know in version 1.43 what might be triggering that Undefined Index - I can't figure it out.

I'm guessing that the stristr problem is either one of two things: whatever you're scanning isn't pulling a proper string sysdescription, or you don't have any DPDiscover Templates set up for your Host Template/sysdescription matched up.

I'll look at it some more but it's Sunday afternoon where I'm at so further development may have to wait until tomorrow.
ericdives
Posts: 27
Joined: Mon Oct 21, 2013 10:16 am

Re: Announcing the 1.44 release of DPDiscover

Post by ericdives »

1.44 is released - it includes a couple of sanity checks that will stop findhosts.php from running and will log errors to cacti's logging indicating what supposedly went wrong.

My blog post and the docs page were updated with some verbage that should indicate certain requirements that may not have been obvious before.
User avatar
pizu
Posts: 42
Joined: Thu Nov 17, 2011 5:15 pm

Re: Announcing the 1.44 release of DPDiscover

Post by pizu »

Hi,

am having the below:
[root@xxxx dpdiscover]# php -q ./findhosts.php -d
PHP Notice: Undefined index: 0 in /var/www/html/cacti/plugins/dpdiscover/findhosts.php on line 284
PHP Notice: Undefined index: 0 in /var/www/html/cacti/plugins/dpdiscover/findhosts.php on line 284
Line: 284
$dpdiscovered['dphost'][$dphost]['os'] = $templates[$dpdiscovered['dphost'][$dphost]['host_template_id']];
Thanks,
Regards,
Pizu
ericdives
Posts: 27
Joined: Mon Oct 21, 2013 10:16 am

Re: Announcing the 1.44 release of DPDiscover

Post by ericdives »

Per: http://docs.cacti.net/userplugin:dpdiscover

Code: Select all

Also, in the left menu, there should be a “DPDiscover Templates”. Configure entries so that discovered equipment is given the proper Host Template. Hosts that do not match any DPDiscover Template will not be added. Scanning will exit and log an error if there are no templates detected.
I'm guessing either you don't have any templates configured or you've managed to put in a template without all of the required information.

Perhaps you don't have any host templates at all?

You'll need to set up Host Templates and then configure DPDiscover per the instructions quoted above to attach the discovered devices to a given host template.
ericdives
Posts: 27
Joined: Mon Oct 21, 2013 10:16 am

Re: Announcing the 1.44 release of DPDiscover

Post by ericdives »

I've a newly updated version (1.46) on the download site and via github. It should appropriately detect what I think is the error and log it.

I was checking if a value was an array, which it should already be since I casted it that way ... but I didn't check to see if said array had a size of more than 0.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest