Send netdisco-users mailing list submissions to
        netdisco-users@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/netdisco-users
or, via email, send a message with subject or body 'help' to
        netdisco-users-requ...@lists.sourceforge.net

You can reach the person managing the list at
        netdisco-users-ow...@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of netdisco-users digest..."
Today's Topics:

   1. Re: neighbor map database errors: "cannot take logarithm of
      zero" (Oliver Gorwits)
   2. Re: Backend stopping, errors (Oliver Gorwits)
   3. Re: Backend stopping, errors (Oliver Gorwits)
   4. Re: Backend stopping, errors (o...@leferguson.com)
--- Begin Message ---

Thanks Chris! This patch will be in the next release.

regards,
Oliver.

On 2018-04-03 20:28, Chris Stromsoe wrote:
Neighbor maps are failing for my install.  I'm currently running
2.39.20. I first noticed the failure with 2.39.17 and then upgraded.
I'm not sure when they were last working.

~/logs/netdisco-web.log has:

[13811] 2018-04-03 18:36:16 error request to GET
/ajax/data/device/netmap crashed:
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::Pg::st
execute failed: ERROR:  cannot take logarithm of zero [for Statement
"SELECT me.ip, me.creation, me.dns, me.description, me.uptime,
me.contact, me.name, me.location, me.layers, me.ports, me.mac,
me.serial, me.model, me.ps1_type, me.ps2_type, me.ps1_status,
me.ps2_status, me.fan, me.slots, me.vendor, me.os, me.os_ver, me.log,
me.snmp_ver, me.snmp_comm, me.snmp_class, me.vtp_domain,
me.last_discover, me.last_macsuck, me.last_arpnip,
to_char(me.creation, 'YYYY-MM-DD HH24:MI'), to_char(last_arpnip,
'YYYY-MM-DD HH24:MI'), to_char(last_discover, 'YYYY-MM-DD HH24:MI'),
to_char(last_macsuck,  'YYYY-MM-DD HH24:MI'), extract(epoch from
(age(now(), me.creation))), extract(epoch from (age(now(),
last_arpnip))), extract(epoch from (age(now(), last_discover))),
extract(epoch from (age(now(), last_macsuck))), replace(age(timestamp
'epoch!
' + uptime / 100 * interval '1 second', timestamp '1970-01-01
00:00:00-00')::text, 'mon', 'month'), floor(log(throughput.total))
FROM device me  JOIN (  SELECT ip,
         sum( COALESCE(dpp.raw_speed,1) ) as total
  FROM device_port
  LEFT OUTER JOIN device_port_properties dpp USING (ip, port)
  WHERE port !~* 'vlan'
    AND (type IS NULL OR type !~*
'^(53|ieee8023adLag|propVirtual|l2vlan|l3ipvlan|135|136|137)$')
    AND (name IS NULL OR name !~* 'vlan')
  GROUP BY ip
  ORDER BY total DESC, ip ASC
) throughput ON throughput.ip = me.ip"] at
/opt/netdisco/perl5/lib/perl5/App/Netdisco/Web/Plugin/Device/Neighbors.pm
line 195


The problem is caused by a handful of devices returning a value of 0
for dpp.raw_speed causing the COALESCE() to return 0 and the log() to
fail.

Modifying line 14 in
perl5/lib/perl5/App/Netdisco/DB/Result/Virtual/DevicePortSpeed.pm

as below with GREATEST(1, ...) around the sum() to ensure a minimum
value of 1 for the value of total solves the problem for me:

 12 __PACKAGE__->result_source_instance->view_definition(<<ENDSQL
 13   SELECT ip,
 14          GREATEST(1, sum( COALESCE(dpp.raw_speed,1) )) as total
 15   FROM device_port
 16   LEFT OUTER JOIN device_port_properties dpp USING (ip, port)
 17   WHERE port !~* 'vlan'
 18     AND (type IS NULL OR type !~*
'^(53|ieee8023adLag|propVirtual|l2vlan|l3ipvlan|135|136|137)\$')
 19     AND (name IS NULL OR name !~* 'vlan')
 20   GROUP BY ip
 21   ORDER BY total DESC, ip ASC
 22 ENDSQL






-Chris

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
Netdisco mailing list
netdisco-users@lists.sourceforge.net
https://sourceforge.net/p/netdisco/mailman/netdisco-users/



--- End Message ---
--- Begin Message ---
Hi Linwood,

Many thanks for the reports. I've put in a small fix to the next release for the MAC address error you saw.

However I cannot see why this would stop the whole backend from processing. The way the backend is written, each job is a worker subprocess which quits and is respawned fresh, so even the error you saw will just make one job die and then a new worker is started.

regards,
oliver.

On 2018-04-06 20:17, o...@leferguson.com wrote:
Running 2.39.17, snmp 3.52, db 51, perl 5.22.1, on Ubuntu 16.04.6.

A couple times now at unpredictable times I have had the backend stop
processing, though the service is running.

I don't see starts and stops in the log so I'm struggling a bit to
know what errors correspond to the actual issues, but I see thousands
of these:

Use of uninitialized value $args{"mac"} in pattern match (m//) at
/home/netdisco/perl5/lib/perl5/NetAddr/MAC.pm line 128, <__ANONIO__>
line 1.

Use of uninitialized value $node in sprintf at
/home/netdisco/perl5/lib/perl5/App/Netdisco/Util/Node.pm line 74,
<__ANONIO__> line 1.

M

And also quite a few though less of these (below), which may be
related to DLINK? And I have some DLINK's.

Not sure if either of these relate to it stopping. It stops rarely,
running days between, so leaving debug on the whole time is not an
attractive option due to log size. Any simple way to tell what's
happening absent something definitive in the log?

By the way the symptom is that jobs just stay queued, and do not
process, and do not receive errors. A service restart runs them all
almost instantly.

Linwood

Cannot find module (AGENT-GENERAL-MIB): At line 1 in (none)

MIB search path:

/home/netdisco/netdisco-mibs/3com:/home/netdisco/netdisco-mibs/adtran:/home/netdisco/netdisco-mibs/aerohive:/home/netdisco/netdisco-mibs/alcatel:/home/netdisco/netdisco-mibs/allied:/home/netdisco/netdisco-mibs/apc:/home/netdisco/netdisco-mibs/arista:/home/netdisco/netdisco-mibs/aruba:/home/netdisco/netdisco-mibs/asante:/home/netdisco/netdisco-mibs/avaya:/home/netdisco/netdisco-mibs/bluecoat:/home/netdisco/netdisco-mibs/bluesocket:/home/netdisco/netdisco-mibs/brother:/home/netdisco/netdisco-mibs/cabletron:/home/netdisco/netdisco-mibs/checkpoint:/home/netdisco/netdisco-mibs/cisco:/home/netdisco/netdisco-mibs/ciscosb:/home/netdisco/netdisco-mibs/citrix:/home/netdisco/netdisco-mibs/colubris:/home/netdisco/netdisco-mibs/cyclades:/home/netdisco/netdisco-mibs/d-link:/home/netdisco/netdisco-mibs/dell:/home/netdisco/netdisco-mibs/enterasys:/home/netdisco/netdisco-mibs/EXTRAS:/home/netdisco/netdisco-mibs/extreme:/home/netdisco/netdisco-mibs/extricom:/home/netdisco/netdisco-mibs/f5:/home/netdis
co/netdisco-mibs/force10:/home/netdisco/netdisco-mibs/fortinet:/home/netdisco/netdisco-mibs/foundry:/home/netdisco/netdisco-mibs/gigamon:/home/netdisco/netdisco-mibs/h3c:/home/netdisco/netdisco-mibs/hp:/home/netdisco/netdisco-mibs/huawei:/home/netdisco/netdisco-mibs/ibm:/home/netdisco/netdisco-mibs/juniper:/home/netdisco/netdisco-mibs/lancom:/home/netdisco/netdisco-mibs/lantronix:/home/netdisco/netdisco-mibs/liebert:/home/netdisco/netdisco-mibs/mediant:/home/netdisco/netdisco-mibs/meraki:/home/netdisco/netdisco-mibs/meru:/home/netdisco/netdisco-mibs/mikrotik:/home/netdisco/netdisco-mibs/moser-baer:/home/netdisco/netdisco-mibs/motorola:/home/netdisco/netdisco-mibs/net-snmp:/home/netdisco/netdisco-mibs/netapp:/home/netdisco/netdisco-mibs/netgear:/home/netdisco/netdisco-mibs/netscreen:/home/netdisco/netdisco-mibs/nexans:/home/netdisco/netdisco-mibs/nortel:/home/netdisco/netdisco-mibs/northerndesign:/home/netdisco/netdisco-mibs/opengear:/home/netdisco/netdisco-mibs/packetfront:/home/netd
isco/netdisco-mibs/paloalto:/home/netdisco/netdisco-mibs/pica8:/home/netdisco/netdisco-mibs/rad:/home/netdisco/netdisco-mibs/rfc:/home/netdisco/netdisco-mibs/riverbed:/home/netdisco/netdisco-mibs/ruckus:/home/netdisco/netdisco-mibs/schleifenbauer:/home/netdisco/netdisco-mibs/sentry:/home/netdisco/netdisco-mibs/sixnet:/home/netdisco/netdisco-mibs/sonicwall:/home/netdisco/netdisco-mibs/tplink:/home/netdisco/netdisco-mibs/trapeze:/home/netdisco/netdisco-mibs/vmware:/home/netdisco/netdisco-mibs/xirrus



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
Netdisco mailing list
netdisco-users@lists.sourceforge.net
https://sourceforge.net/p/netdisco/mailman/netdisco-users/



--- End Message ---
--- Begin Message ---

Sorry Linwood, I forgot to mention... if you find the backend is stalling again, please can you look at the process table for the system and see what the nd2 entries are doing?

For example "ps aux".

There should be useful information in the process listing on the manager, scheduler, and workers. In particular there should be a "manager" or "mgr" process running which is handling the queues.

regards,
oliver.

On 2018-04-06 20:17, o...@leferguson.com wrote:
Running 2.39.17, snmp 3.52, db 51, perl 5.22.1, on Ubuntu 16.04.6.

A couple times now at unpredictable times I have had the backend stop
processing, though the service is running.

I don't see starts and stops in the log so I'm struggling a bit to
know what errors correspond to the actual issues, but I see thousands
of these:

Use of uninitialized value $args{"mac"} in pattern match (m//) at
/home/netdisco/perl5/lib/perl5/NetAddr/MAC.pm line 128, <__ANONIO__>
line 1.

Use of uninitialized value $node in sprintf at
/home/netdisco/perl5/lib/perl5/App/Netdisco/Util/Node.pm line 74,
<__ANONIO__> line 1.

M

And also quite a few though less of these (below), which may be
related to DLINK? And I have some DLINK's.

Not sure if either of these relate to it stopping. It stops rarely,
running days between, so leaving debug on the whole time is not an
attractive option due to log size. Any simple way to tell what's
happening absent something definitive in the log?

By the way the symptom is that jobs just stay queued, and do not
process, and do not receive errors. A service restart runs them all
almost instantly.

Linwood

Cannot find module (AGENT-GENERAL-MIB): At line 1 in (none)

MIB search path:

/home/netdisco/netdisco-mibs/3com:/home/netdisco/netdisco-mibs/adtran:/home/netdisco/netdisco-mibs/aerohive:/home/netdisco/netdisco-mibs/alcatel:/home/netdisco/netdisco-mibs/allied:/home/netdisco/netdisco-mibs/apc:/home/netdisco/netdisco-mibs/arista:/home/netdisco/netdisco-mibs/aruba:/home/netdisco/netdisco-mibs/asante:/home/netdisco/netdisco-mibs/avaya:/home/netdisco/netdisco-mibs/bluecoat:/home/netdisco/netdisco-mibs/bluesocket:/home/netdisco/netdisco-mibs/brother:/home/netdisco/netdisco-mibs/cabletron:/home/netdisco/netdisco-mibs/checkpoint:/home/netdisco/netdisco-mibs/cisco:/home/netdisco/netdisco-mibs/ciscosb:/home/netdisco/netdisco-mibs/citrix:/home/netdisco/netdisco-mibs/colubris:/home/netdisco/netdisco-mibs/cyclades:/home/netdisco/netdisco-mibs/d-link:/home/netdisco/netdisco-mibs/dell:/home/netdisco/netdisco-mibs/enterasys:/home/netdisco/netdisco-mibs/EXTRAS:/home/netdisco/netdisco-mibs/extreme:/home/netdisco/netdisco-mibs/extricom:/home/netdisco/netdisco-mibs/f5:/home/netdis
co/netdisco-mibs/force10:/home/netdisco/netdisco-mibs/fortinet:/home/netdisco/netdisco-mibs/foundry:/home/netdisco/netdisco-mibs/gigamon:/home/netdisco/netdisco-mibs/h3c:/home/netdisco/netdisco-mibs/hp:/home/netdisco/netdisco-mibs/huawei:/home/netdisco/netdisco-mibs/ibm:/home/netdisco/netdisco-mibs/juniper:/home/netdisco/netdisco-mibs/lancom:/home/netdisco/netdisco-mibs/lantronix:/home/netdisco/netdisco-mibs/liebert:/home/netdisco/netdisco-mibs/mediant:/home/netdisco/netdisco-mibs/meraki:/home/netdisco/netdisco-mibs/meru:/home/netdisco/netdisco-mibs/mikrotik:/home/netdisco/netdisco-mibs/moser-baer:/home/netdisco/netdisco-mibs/motorola:/home/netdisco/netdisco-mibs/net-snmp:/home/netdisco/netdisco-mibs/netapp:/home/netdisco/netdisco-mibs/netgear:/home/netdisco/netdisco-mibs/netscreen:/home/netdisco/netdisco-mibs/nexans:/home/netdisco/netdisco-mibs/nortel:/home/netdisco/netdisco-mibs/northerndesign:/home/netdisco/netdisco-mibs/opengear:/home/netdisco/netdisco-mibs/packetfront:/home/netd
isco/netdisco-mibs/paloalto:/home/netdisco/netdisco-mibs/pica8:/home/netdisco/netdisco-mibs/rad:/home/netdisco/netdisco-mibs/rfc:/home/netdisco/netdisco-mibs/riverbed:/home/netdisco/netdisco-mibs/ruckus:/home/netdisco/netdisco-mibs/schleifenbauer:/home/netdisco/netdisco-mibs/sentry:/home/netdisco/netdisco-mibs/sixnet:/home/netdisco/netdisco-mibs/sonicwall:/home/netdisco/netdisco-mibs/tplink:/home/netdisco/netdisco-mibs/trapeze:/home/netdisco/netdisco-mibs/vmware:/home/netdisco/netdisco-mibs/xirrus



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
Netdisco mailing list
netdisco-users@lists.sourceforge.net
https://sourceforge.net/p/netdisco/mailman/netdisco-users/



--- End Message ---
--- Begin Message ---
I really do not know that it was causing it, it was just among the last things 
in the log (that and the missing MIB). 

I will (per your subsequent note) collect more info next time.

Thank you.

Linwood


-----Original Message-----
From: Oliver Gorwits [mailto:oli...@cpan.org] 
Sent: Saturday, April 7, 2018 7:14 PM
To: netdisco-users@lists.sourceforge.net
Subject: Re: [Netdisco] Backend stopping, errors

Hi Linwood,

Many thanks for the reports. I've put in a small fix to the next release for 
the MAC address error you saw.

However I cannot see why this would stop the whole backend from processing. The 
way the backend is written, each job is a worker subprocess which quits and is 
respawned fresh, so even the error you saw will just make one job die and then 
a new worker is started.

regards,
oliver.

On 2018-04-06 20:17, o...@leferguson.com wrote:
> Running 2.39.17, snmp 3.52, db 51, perl 5.22.1, on Ubuntu 16.04.6.
> 
> A couple times now at unpredictable times I have had the backend stop 
> processing, though the service is running.
> 
> I don't see starts and stops in the log so I'm struggling a bit to 
> know what errors correspond to the actual issues, but I see thousands 
> of these:
> 
> Use of uninitialized value $args{"mac"} in pattern match (m//) at 
> /home/netdisco/perl5/lib/perl5/NetAddr/MAC.pm line 128, <__ANONIO__> 
> line 1.
> 
> Use of uninitialized value $node in sprintf at 
> /home/netdisco/perl5/lib/perl5/App/Netdisco/Util/Node.pm line 74, 
> <__ANONIO__> line 1.
> 
> M
> 
> And also quite a few though less of these (below), which may be 
> related to DLINK? And I have some DLINK's.
> 
> Not sure if either of these relate to it stopping. It stops rarely, 
> running days between, so leaving debug on the whole time is not an 
> attractive option due to log size. Any simple way to tell what's 
> happening absent something definitive in the log?
> 
> By the way the symptom is that jobs just stay queued, and do not 
> process, and do not receive errors. A service restart runs them all 
> almost instantly.
> 
> Linwood
> 
> Cannot find module (AGENT-GENERAL-MIB): At line 1 in (none)
> 
> MIB search path:
>
/home/netdisco/netdisco-mibs/3com:/home/netdisco/netdisco-mibs/adtran:/home/netdisco/netdisco-mibs/aerohive:/home/netdisco/netdisco-mibs/alcatel:/home/netdisco/netdisco-mibs/allied:/home/netdisco/netdisco-mibs/apc:/home/netdisco/netdisco-mibs/arista:/home/netdisco/netdisco-mibs/aruba:/home/netdisco/netdisco-mibs/asante:/home/netdisco/netdisco-mibs/avaya:/home/netdisco/netdisco-mibs/bluecoat:/home/netdisco/netdisco-mibs/bluesocket:/home/netdisco/netdisco-mibs/brother:/home/netdisco/netdisco-mibs/cabletron:/home/netdisco/netdisco-mibs/checkpoint:/home/netdisco/netdisco-mibs/cisco:/home/netdisco/netdisco-mibs/ciscosb:/home/netdisco/netdisco-mibs/citrix:/home/netdisco/netdisco-mibs/colubris:/home/netdisco/netdisco-mibs/cyclades:/home/netdisco/netdisco-mibs/d-link:/home/netdisco/netdisco-mibs/dell:/home/netdisco/netdisco-mibs/enterasys:/home/netdisco/netdisco-mibs/EXTRAS:/home/netdisco/netdisco-mibs/extreme:/home/netdisco/netdisco-mibs/extricom:/home/netdisco/netdisco-mibs/f5:/home/netdis
co/netdisco-mibs/force10:/home/netdisco/netdisco-mibs/fortinet:/home/netdisco/netdisco-mibs/foundry:/home/netdisco/netdisco-mibs/gigamon:/home/netdisco/netdisco-mibs/h3c:/home/netdisco/netdisco-mibs/hp:/home/netdisco/netdisco-mibs/huawei:/home/netdisco/netdisco-mibs/ibm:/home/netdisco/netdisco-mibs/juniper:/home/netdisco/netdisco-mibs/lancom:/home/netdisco/netdisco-mibs/lantronix:/home/netdisco/netdisco-mibs/liebert:/home/netdisco/netdisco-mibs/mediant:/home/netdisco/netdisco-mibs/meraki:/home/netdisco/netdisco-mibs/meru:/home/netdisco/netdisco-mibs/mikrotik:/home/netdisco/netdisco-mibs/moser-baer:/home/netdisco/netdisco-mibs/motorola:/home/netdisco/netdisco-mibs/net-snmp:/home/netdisco/netdisco-mibs/netapp:/home/netdisco/netdisco-mibs/netgear:/home/netdisco/netdisco-mibs/netscreen:/home/netdisco/netdisco-mibs/nexans:/home/netdisco/netdisco-mibs/nortel:/home/netdisco/netdisco-mibs/northerndesign:/home/netdisco/netdisco-mibs/opengear:/home/netdisco/netdisco-mibs/packetfront:/home/netd
isco/netdisco-mibs/paloalto:/home/netdisco/netdisco-mibs/pica8:/home/netdisco/netdisco-mibs/rad:/home/netdisco/netdisco-mibs/rfc:/home/netdisco/netdisco-mibs/riverbed:/home/netdisco/netdisco-mibs/ruckus:/home/netdisco/netdisco-mibs/schleifenbauer:/home/netdisco/netdisco-mibs/sentry:/home/netdisco/netdisco-mibs/sixnet:/home/netdisco/netdisco-mibs/sonicwall:/home/netdisco/netdisco-mibs/tplink:/home/netdisco/netdisco-mibs/trapeze:/home/netdisco/netdisco-mibs/vmware:/home/netdisco/netdisco-mibs/xirrus
> 
> 
> 
> ----------------------------------------------------------------------
> -------- Check out the vibrant tech community on one of the world's 
> most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> 
> _______________________________________________
> Netdisco mailing list
> netdisco-users@lists.sourceforge.net
> https://sourceforge.net/p/netdisco/mailman/netdisco-users/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech 
sites, Slashdot.org! http://sdm.link/slashdot 
_______________________________________________
Netdisco mailing list
netdisco-users@lists.sourceforge.net
https://sourceforge.net/p/netdisco/mailman/netdisco-users/



--- End Message ---
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Netdisco mailing list - Digest Mode
netdisco-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/netdisco-users

Reply via email to