Discovery not discovering!

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
Xcaliber009
Posts: 4
Joined: Wed Jan 28, 2009 7:16 pm

Discovery not discovering!

Post by Xcaliber009 »

At this point, I turn to the knowledge of you guys as I have dredged through about every forum post associated to the Discovery Plugin to find an answer. I have the Discovery plugin install, the poller runs, but I return back with this:
02/09/2009 01:35:48 PM - DISCOVER: Poller[0] 254 IPs Scanned, 0 IPs Responded to Ping, 0 Responded to SNMP, 0 Device Added, 0 Graphs Added to Cacti

I've tried about every configuration I can think of in the discovery settings. Manually running php -q /usr/share/cacti/site/plugins/discovery/findhosts.php -f -d looks like it runs, but then of course returns the aforementioned results.

Can anyone think of why I'm not getting any response from the IP's I'm looking for? I can confirm that ping works from the machine from the CLI, and the firewall at the router allows access of this machine to the IP block I'm trying to scan.
Xcaliber009
Posts: 4
Joined: Wed Jan 28, 2009 7:16 pm

UPDATE:

Post by Xcaliber009 »

So the discovery plugin found some devices, not the ones I'm looking for just yet but that is ok. This is a good start. However, forcing the scan after the devices, I came back with these messages when I hit each device that was already added to the discover list:
Notice: Undefined offset: 0 in /usr/share/cacti/site/plugins/discovery/findhosts.php on line 327
is a valid device!
Warning: stristr(): Empty delimiter. in /usr/share/cacti/site/plugins/discovery/findhosts.php on line 769
Is this normal operation, or am I on to something?
iso1779
Posts: 17
Joined: Fri Feb 20, 2009 1:32 pm

snmp v2 devices

Post by iso1779 »

Hi,
I run into a similar problem.
Are your devices snmp v2 only?
if yes edit findhosts.php, at line 308 and change snmp_version from 1 to 2

br
Olivier
miguel
Posts: 10
Joined: Wed Apr 01, 2009 9:49 pm
Location: Rio de Janeiro, Brazil

Post by miguel »

the discovery plugin found some devices, but don´t create the device and when I start with command it return this :


10.179.1.2 is a valid device!PHP Warning: stristr(): Empty delimiter in /usr/share/cacti/plugins/discovery/findhosts.php on line 781
PHP Warning: stristr(): Empty delimiter in /usr/share/cacti/plugins/discovery/findhosts.php on line 781


DISCOVER: Poller[0] 128 IPs Scanned, 36 IPs Responded to Ping, 36 Responded to SNMP, 0 Device Added, 0 Graphs Added to Cacti
marianne.dherens
Posts: 31
Joined: Mon Mar 09, 2009 5:02 am
Location: Brussels

Post by marianne.dherens »

Hi

I'm running into the same issue.

config:

Operating System:windows XP
Webserver: Apache2.2
Cacti: 0.8.7d
MySQL: 5.0.77
PHP: 5.2.9
RRDTool (Cygwin or Win32 version): 1-2.15
Net-SNMP:5.4.2.1-1
Cygwin (cygwin1.dll version): 1.5.20
Plugin Architecture: P2.4
plugins: aggregate v0.71
loginmod v1.0
monitor v0.9
settings v0.6
superlinks v0.8
discovery v0.9

I tested every solution I found on the forum:

I changed the snmp version in the findhosts.php file from 1 to 2, I checked View Host Auto-Discovery in the admin user settings/permission realm tab.
I can run findhosts.php by myself and it returns this results:

Code: Select all

Checking to determine if it's time to run.
Checking if user changed the start time
The next run time has been determined to be at
   2009-06-25 11:12:01
Scanning has been forced
Setting 'Rerun Data Queries' = false
Setting 'Create Graphs for Up Interfaces Only' = true
06/25/2009 11:08:08 AM - POLLER: Poller[0] Network Discover is now running
Primary Community Name    : public
Secondary Community Names : armagedon
Calculating Info for Subnet :10.48.64.0-10.48.64.10
Start IP is 10.48.64.0
Total IPs is 11
10.48.64.0 is a valid device!PHP Warning:  stristr(): Empty delimiter in C:\apache2\htdocs\cacti\plugins\discovery\findhosts.php on line 769

10.48.64.1 is a valid device!PHP Warning:  stristr(): Empty delimiter in C:\apache2\htdocs\cacti\plugins\discovery\findhosts.php on line 769

10.48.64.2 is a valid device!PHP Warning:  stristr(): Empty delimiter in C:\apache2\htdocs\cacti\plugins\discovery\findhosts.php on line 769

10.48.64.3 is a valid device!PHP Warning:  stristr(): Empty delimiter in C:\apache2\htdocs\cacti\plugins\discovery\findhosts.php on line 769

10.48.64.4
10.48.64.5
10.48.64.6
10.48.64.7
10.48.64.8
10.48.64.9
When I comment this part of the code which is giving the error:

Code: Select all

function discover_find_os($text) {
	global $os;
	for ($a = 0; $a < count($os); $a++) {
		/*if (stristr($text, $os[$a]['sysdescr'])) {
			return $os[$a];
		}*/
	}
	return false;
}
Then I don't get the php error messages but the results are the same:

Code: Select all

06/25/2009 11:08:24 AM - DISCOVER: Poller[0] 11 IPs Scanned, 4 IPs Responded to
Ping, 4 Responded to SNMP, 0 Device Added, 0 Graphs Added to Cacti
Plus I have to make it run manually because when set at a specific time it doesn't start !

Have you found a solution to your problem ? Something that could potentially help me ? Or any idea that I could try ? Any suggestion is the most welcome :)

thanks a lot

Marianne
User avatar
tilli
Posts: 22
Joined: Tue Jul 14, 2009 9:16 am

Discovery plugin discovers but does not add devices

Post by tilli »

Hi

The discovery plugin is discovering devices and they can be seen in the discovery tab,
but they are not being added to the devices list.

I have already created the discovery templates, and also changes the SNMP version in findhosts.php, but still devices are not being added to the device list.

any help will be greatly appreciated.......

thanks
User avatar
tilli
Posts: 22
Joined: Tue Jul 14, 2009 9:16 am

Post by tilli »

Have figured it out..


The problem was that the system description in the discovery template was not matching to the system description of the switches...

Once i changed that the devices were added and the graphs were created automatically..
Dyr
Posts: 23
Joined: Mon Sep 10, 2007 5:21 am

Post by Dyr »

I have this problem too and don't understand reasons to do so (check matching sysdescr in template and from SNMP). It looks silly.
It happens in line 334:

Code: Select all

                        $fos = discover_find_os($device['snmp_sysDescr']);
                        if ($fos != false) {
                            $device['os'] = $fos['name'];
                            discover_debug("\n     Host Template: " . $fos['name']);
                            $device['host_template'] = $fos['host_template'];
                            $device['snmp_version'] = $fos['snmp_version'];
                            $device['tree'] = $fos['tree'];
                            $host_id = discover_add_device($device);
                            $stats['added']++;
                        }
I've got devices with various sysDescr (Dlink 3526, 3100, 3200 etc), so why I should to make templates per devices? Much better to make description automatically by hostname or ip or something like that, isn't it?
surajitpal2007
Posts: 35
Joined: Tue Feb 15, 2011 4:51 am

Re:

Post by surajitpal2007 »

tilli wrote:Have figured it out..


The problem was that the system description in the discovery template was not matching to the system description of the switches...

Once i changed that the devices were added and the graphs were created automatically..

Hi Can you please elaborate more about this system description change? Suppose, my Cisco 2800 router name is abc and community string is xyz, what should be system description in discovery template?

Thanks in advaance,
Jit
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re:

Post by cigamit »

Dyr wrote:I have this problem too and don't understand reasons to do so (check matching sysdescr in template and from SNMP). It looks silly.
It happens in line 334:

Code: Select all

                        $fos = discover_find_os($device['snmp_sysDescr']);
                        if ($fos != false) {
                            $device['os'] = $fos['name'];
                            discover_debug("\n     Host Template: " . $fos['name']);
                            $device['host_template'] = $fos['host_template'];
                            $device['snmp_version'] = $fos['snmp_version'];
                            $device['tree'] = $fos['tree'];
                            $host_id = discover_add_device($device);
                            $stats['added']++;
                        }
I've got devices with various sysDescr (Dlink 3526, 3100, 3200 etc), so why I should to make templates per devices? Much better to make description automatically by hostname or ip or something like that, isn't it?
Just make 1 template with a sysDescr of "Dlink", there is no need to create a separate one for each.
surajitpal2007
Posts: 35
Joined: Tue Feb 15, 2011 4:51 am

Re: Re:

Post by surajitpal2007 »

cigamit wrote:
Dyr wrote:I have this problem too and don't understand reasons to do so (check matching sysdescr in template and from SNMP). It looks silly.
It happens in line 334:

Code: Select all

                        $fos = discover_find_os($device['snmp_sysDescr']);
                        if ($fos != false) {
                            $device['os'] = $fos['name'];
                            discover_debug("\n     Host Template: " . $fos['name']);
                            $device['host_template'] = $fos['host_template'];
                            $device['snmp_version'] = $fos['snmp_version'];
                            $device['tree'] = $fos['tree'];
                            $host_id = discover_add_device($device);
                            $stats['added']++;
                        }
I've got devices with various sysDescr (Dlink 3526, 3100, 3200 etc), so why I should to make templates per devices? Much better to make description automatically by hostname or ip or something like that, isn't it?
Just make 1 template with a sysDescr of "Dlink", there is no need to create a separate one for each.
In addition to that, can you please specify how I can add different subnet in discovery plugin? I would like to add 10.24.0.254/28 at following at default subnet area mentioned in plugin findhosts.php:

// 10.1.0.1
if (preg_match("/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/", $h)) {
return $h;
}

and

// 10.1.0.1
if (preg_match("/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/", $h)) {
return 1;
}
Thanks in advance
Jit
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: Re:

Post by cigamit »

surajitpal2007 wrote:10.24.0.254/28
That doesn't look right to me, shouldn't you be entering it as
10.24.0.241/28 ?
That appears to work for me.
surajitpal2007
Posts: 35
Joined: Tue Feb 15, 2011 4:51 am

Re: Re:

Post by surajitpal2007 »

cigamit wrote:
surajitpal2007 wrote:10.24.0.254/28
That doesn't look right to me, shouldn't you be entering it as
10.24.0.241/28 ?
That appears to work for me.
I have installed and enabled discovery plugin. I want to add other network also excluding default ones as I have multiple routers so I have multiple network also. I want to discover all small networks through discovery template. I have networks in:
10.24.16.1/30, 10.24.177.5/30, 10.32.177.5/30, 10.40.177.5/30, 10.104.193.5/30.

How I can add these subnets? Thanks a lot in advance.
Kindest - Jit
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests