Send netdisco-users mailing list submissions to
        [email protected]

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
        [email protected]

You can reach the person managing the list at
        [email protected]

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

   1. Re: Arpwalk, Macsuck or Discover not successful on some
      devices (Nick Nauwelaerts)
   2. Re: Router Acess (Tim Polimeni)
--- Begin Message ---
(sourceforge held my mail for being oversize, so trimmed old replies a bit)

kinda late to the party, tried to make sense of the thread via the mailinglist 
archive.

"Happens in my case on a lot of devices, not just a few. The stuck jobs doesn't 
finish after even days. "


if you restart netdisco-backend, are your jobs then reported as complete in the 
poller performance report, but with very long runtimes?


i've been seeing something similar from time to time but can't find a way to 
reproduce it:
https://github.com/netdisco/netdisco/issues/466
jobs that ran for "1 day 01:29:30".


what i'm looking, which could be totally unrelated, is the timestamp precision, 
since some fields use high precision "2018-12-13 20:05:30.887272", some just up 
to the second: " 2018-12-13 20:05:30". this shouldn't be an issue if we compare 
using sql, but that's not always the case, for example in

https://github.com/netdisco/netdisco/blob/92bc49f27444ff201cc2178132979e0d89c08850/lib/App/Netdisco/DB/Result/Admin.pm#L80-L82
we use "$args->{foreign_alias}.last_defer" => { '>', \'(LOCALTIMESTAMP - 
?::interval)' },



but in other parts 
https://github.com/netdisco/netdisco/blob/92bc49f27444ff201cc2178132979e0d89c08850/lib/App/Netdisco/DB/ResultSet/Admin.pm#L61-L63
we cast those timestamps:           entered_stamp => \"to_char(entered, 
'YYYY-MM-DD HH24:MI')",


also think i saw 1 or 2 time comparisons done in perl.


and for some reason sometimes the high precision timer has a leading 0 for 
microseconds:
no leading 0 -> "35119"  ---  macsuck  | 2018-12-13 12:55:20.35119
leading 0 -> "058855 " ---- arpnip   | 2018-12-13 12:05:12.058855


// nick

From: Pavel Skovajsa [mailto:[email protected]]
Sent: Monday, October 14, 2019 22:09
To: Oliver Gorwits <[email protected]>
Cc: Tobias Gerlach <[email protected]>; [email protected]
Subject: Re: [Netdisco] Arpwalk, Macsuck or Discover not successful on some 
devices

bump

On Mon, Oct 7, 2019 at 6:39 PM Pavel Skovajsa <[email protected]> wrote:
Hello,

I think we have the same issue - the jobs haven't finished since the upgrade to 
2.44.0. Last week I deleted all the job (using the web frontend trash bin 
icon). Poller performance only shows nbtstat job completed, nothing else is 
there since the update. The output for the slow queries and running queries is 
on https://pastebin.com/LPtEDD6h.

On the other side, it looks like it is really working, because things are 
working based on the output below:
query
result
select count(name) from device where vendor = 'cisco' AND (last_discover 
BETWEEN (CURRENT_TIMESTAMP - interval '2 hours') AND  (CURRENT_TIMESTAMP - 
interval '1 hours'));
1809
select count(name) from device where vendor = 'cisco' AND (last_discover 
BETWEEN (CURRENT_TIMESTAMP - interval '3 hours') AND  (CURRENT_TIMESTAMP - 
interval '2 hours'));
1856
select count(name) from device where vendor = 'cisco' AND (last_discover 
BETWEEN (CURRENT_TIMESTAMP - interval '4 hours') AND  (CURRENT_TIMESTAMP - 
interval '3 hours'));
1815
select count(name) from device where vendor = 'cisco' AND (last_discover 
BETWEEN (CURRENT_TIMESTAMP - interval '5 hours') AND  (CURRENT_TIMESTAMP - 
interval '4 hours'));
1932
select count(name) from device where vendor = 'cisco' AND (last_discover 
BETWEEN (CURRENT_TIMESTAMP - interval '6 hours') AND  (CURRENT_TIMESTAMP - 
interval '5 hours'));
712
select count(name) from device where vendor = 'cisco' AND (last_discover 
BETWEEN (CURRENT_TIMESTAMP - interval '7 hours') AND  (CURRENT_TIMESTAMP - 
interval '6 hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_discover 
BETWEEN (CURRENT_TIMESTAMP - interval '8 hours') AND  (CURRENT_TIMESTAMP - 
interval '7 hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_discover 
BETWEEN (CURRENT_TIMESTAMP - interval '9 hours') AND  (CURRENT_TIMESTAMP - 
interval '8 hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_discover 
BETWEEN (CURRENT_TIMESTAMP - interval '10 hours') AND  (CURRENT_TIMESTAMP - 
interval '9 hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_discover 
BETWEEN (CURRENT_TIMESTAMP - interval '11 hours') AND  (CURRENT_TIMESTAMP - 
interval '10 hours'));
0



select count(name) from device where vendor = 'cisco' AND (last_macsuck BETWEEN 
(CURRENT_TIMESTAMP - interval '2 hours') AND  (CURRENT_TIMESTAMP - interval '1 
hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_macsuck BETWEEN 
(CURRENT_TIMESTAMP - interval '3 hours') AND  (CURRENT_TIMESTAMP - interval '2 
hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_macsuck BETWEEN 
(CURRENT_TIMESTAMP - interval '4 hours') AND  (CURRENT_TIMESTAMP - interval '3 
hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_macsuck BETWEEN 
(CURRENT_TIMESTAMP - interval '5 hours') AND  (CURRENT_TIMESTAMP - interval '4 
hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_macsuck BETWEEN 
(CURRENT_TIMESTAMP - interval '6 hours') AND  (CURRENT_TIMESTAMP - interval '5 
hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_macsuck BETWEEN 
(CURRENT_TIMESTAMP - interval '7 hours') AND  (CURRENT_TIMESTAMP - interval '6 
hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_macsuck BETWEEN 
(CURRENT_TIMESTAMP - interval '8 hours') AND  (CURRENT_TIMESTAMP - interval '7 
hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_macsuck BETWEEN 
(CURRENT_TIMESTAMP - interval '9 hours') AND  (CURRENT_TIMESTAMP - interval '8 
hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_macsuck BETWEEN 
(CURRENT_TIMESTAMP - interval '10 hours') AND  (CURRENT_TIMESTAMP - interval '9 
hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_macsuck BETWEEN 
(CURRENT_TIMESTAMP - interval '11 hours') AND  (CURRENT_TIMESTAMP - interval 
'10 hours'));
1066
select count(name) from device where vendor = 'cisco' AND (last_macsuck BETWEEN 
(CURRENT_TIMESTAMP - interval '12 hours') AND  (CURRENT_TIMESTAMP - interval 
'11hours'));
2021
select count(name) from device where vendor = 'cisco' AND (last_macsuck BETWEEN 
(CURRENT_TIMESTAMP - interval '13 hours') AND  (CURRENT_TIMESTAMP - interval 
'12 hours'));
1957
select count(name) from device where vendor = 'cisco' AND (last_macsuck BETWEEN 
(CURRENT_TIMESTAMP - interval '14 hours') AND  (CURRENT_TIMESTAMP - interval 
'13 hours'));
1913
select count(name) from device where vendor = 'cisco' AND (last_macsuck BETWEEN 
(CURRENT_TIMESTAMP - interval '15 hours') AND  (CURRENT_TIMESTAMP - interval 
'14 hours'));
1972
select count(name) from device where vendor = 'cisco' AND (last_macsuck BETWEEN 
(CURRENT_TIMESTAMP - interval '16 hours') AND  (CURRENT_TIMESTAMP - interval 
'15 hours'));
237

select count(name) from device where vendor = 'cisco' AND (last_arpnip BETWEEN 
(CURRENT_TIMESTAMP - interval '2 hours') AND  (CURRENT_TIMESTAMP - interval '1 
hours'));
2010
select count(name) from device where vendor = 'cisco' AND (last_arpnip BETWEEN 
(CURRENT_TIMESTAMP - interval '3 hours') AND  (CURRENT_TIMESTAMP - interval '2 
hours'));
2271
select count(name) from device where vendor = 'cisco' AND (last_arpnip BETWEEN 
(CURRENT_TIMESTAMP - interval '4 hours') AND  (CURRENT_TIMESTAMP - interval '3 
hours'));
1301
select count(name) from device where vendor = 'cisco' AND (last_arpnip BETWEEN 
(CURRENT_TIMESTAMP - interval '5 hours') AND  (CURRENT_TIMESTAMP - interval '4 
hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_arpnip BETWEEN 
(CURRENT_TIMESTAMP - interval '6 hours') AND  (CURRENT_TIMESTAMP - interval '5 
hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_arpnip BETWEEN 
(CURRENT_TIMESTAMP - interval '7 hours') AND  (CURRENT_TIMESTAMP - interval '6 
hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_arpnip BETWEEN 
(CURRENT_TIMESTAMP - interval '8 hours') AND  (CURRENT_TIMESTAMP - interval '7 
hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_arpnip BETWEEN 
(CURRENT_TIMESTAMP - interval '9 hours') AND  (CURRENT_TIMESTAMP - interval '8 
hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_arpnip BETWEEN 
(CURRENT_TIMESTAMP - interval '10 hours') AND  (CURRENT_TIMESTAMP - interval '9 
hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_arpnip BETWEEN 
(CURRENT_TIMESTAMP - interval '11 hours') AND  (CURRENT_TIMESTAMP - interval 
'10 hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_arpnip BETWEEN 
(CURRENT_TIMESTAMP - interval '12 hours') AND  (CURRENT_TIMESTAMP - interval 
'11hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_arpnip BETWEEN 
(CURRENT_TIMESTAMP - interval '13 hours') AND  (CURRENT_TIMESTAMP - interval 
'12 hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_arpnip BETWEEN 
(CURRENT_TIMESTAMP - interval '14 hours') AND  (CURRENT_TIMESTAMP - interval 
'13 hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_arpnip BETWEEN 
(CURRENT_TIMESTAMP - interval '15 hours') AND  (CURRENT_TIMESTAMP - interval 
'14 hours'));
0
select count(name) from device where vendor = 'cisco' AND (last_arpnip BETWEEN 
(CURRENT_TIMESTAMP - interval '16 hours') AND  (CURRENT_TIMESTAMP - interval 
'15 hours'));
0

netdisco=> select action,status,count (job) from admin group by action,status;
   action    |          status           | count
-------------+---------------------------+--------
 arpnip      | done                      |  51663
 arpnip      | queued                    |    248
 arpwalk     | done                      |      6
 discover    | done                      |  36793
 discover    | error                     |   6635
 discover    | info                      |      5
 discover    | queued                    |   4076
 discoverall | done                      |      3
 expire      | done                      |      4
 macsuck     | done                      |  46684
 macsuck     | queued                    |    299
 macsuck     | queued-mdnetdisco         |      2
 macwalk     | done                      |      4
 nbtstat     | done                      | 105197
 nbtstat     | queued                    |    303
 nbtwalk     | done                      |      9
(16 rows)

-pavel

On Sat, Oct 5, 2019 at 1:17 PM Oliver Gorwits <[email protected]> wrote:
It would be interesting to know what the backend server process table shows 
when the workers are not progressing. Output of ps should show what the workers 
are doing.

Also, here is a way to show active queries against a database and at the same 
time I wonder if running this will show some blockage somewhere:

-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;

-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;

-- long running (9.2)
SELECT now() - query_start as "runtime", usename, datname, waiting, state, query
  FROM  pg_stat_activity
  WHERE now() - query_start > '2 minutes'::interval
 ORDER BY runtime DESC;

________________________________

Volg Aquafin op Facebook<https://www.facebook.com/AquafinNV> | 
Twitter<https://twitter.com/aquafinnv> | 
YouTube<http://www.youtube.com/channel/UCk_4P5BJ-MtEEDCkCsR_KqQ?feature=mhee> | 
LinkedIN<http://www.linkedin.com/company/aquafin/products> | 
Instagram<https://www.instagram.com/aquafin_nv/>

In het kader van de uitoefening van onze taken verzamelen we bij Aquafin 
persoonsgegevens. Hoe we omgaan met deze gegevens en wat de rechten van de 
betrokkenen zijn, kan je nalezen in onze privacy 
policy<https://www.aquafin.be/nl-be/privacy-policy>.

  P Denk aan het milieu. Druk deze mail niet onnodig af.



--- End Message ---
--- Begin Message ---
Thanks for the info, is there a way that I can setup and export of my
router database in netdisco to place them in the router database of rancid
on daily basis? I have from jobs set to scan our loopback space looking for
newly deployed routers and import them into netdisco. Do you know if this
is possible to export my discovery devices into rancid without doing it
manually

On Thu, Nov 7, 2019 at 8:22 AM Nick Nauwelaerts <[email protected]>
wrote:

> rancid, which most ppl just use for backups, can just as well be used to
> script things. either via dump cli commands or via expect (the original cli
> interaction language :) )
>
>
>
> the beauty there is that it's actively maintained and has support for the
> cli quirks of loads of devices and os versions. not that important if all
> you need is "show ip arp", but for anything more complex it tries to handle
> all the corner cases. also done in perl & expect (and a bit of python since
> 3.10)
>
> homepage: http://rancid.shrubbery.net/rancid/
>
> source: https://github.com/haussli/rancid
>
>
>
> made updating 250 cisco small business switches a 1 hour task, and i
> didn't have to deal with one of the worst remote consoles ever made.
>
>
>
> https://github.com/ytti/oxidized should also be able to do about the same.
>
>
>
>
>
>
>
> if we ever want to do more via cli, then i'm thinking of just interfacing
> with one of those 2 projects instead of trying to reinvent the wheel.
> according to the manual
> https://github.com/haussli/rancid/blob/master/lib/rancid.pm.in could be
> used as a gateway: "Specifically, the library is used by rancid(1), but it
> could be used by any perl program for site-specific handling or additional
> automata."
>
>
>
>
>
> // nick
>
>
>
>
>
>
>
> *From:* Oliver Gorwits [mailto:[email protected]]
> *Sent:* Thursday, October 31, 2019 20:43
> *To:* Tim Polimeni <[email protected]>;
> [email protected]
> *Subject:* Re: [Netdisco] Router Acess
>
>
>
> Hi Tim,
>
>
>
> Currently there is no support for command-line (ssh) actions for port
> up/down. The only command-line action we support is gathering of ARP tables.
>
>
>
> This could be patched into Netdisco, but would need someone who
> understands Perl very well. We have a framework for adding ssh/cli
> commands, but it has never been used before for a realtime task like this,
> so it would be a real experiment!
>
>
>
> Alternatively, you might like to look at the Netmiko library (python), and
> script this yourself.
>
>
>
> regards,
>
> oliver.
>
>
>
> On Wed, 30 Oct 2019 at 17:34, Tim Polimeni <[email protected]> wrote:
>
> Hello, I was looking thru the config file
> in /netdisco/environments/deployment.yml I see that there is a place that
> you can RW SNMP, however if you do not have RW SNM is there a way that if
> we have a static UID/PW for routers VIA RADIUS that you can enter these
> credentials in the file to admin up/down and do other tasks?
>
> _______________________________________________
> Netdisco mailing list
> [email protected]
> https://sourceforge.net/p/netdisco/mailman/netdisco-users/
>
>
> ------------------------------
>
> *Volg Aquafin op Facebook <https://www.facebook.com/AquafinNV> | Twitter
> <https://twitter.com/aquafinnv> | YouTube
> <http://www.youtube.com/channel/UCk_4P5BJ-MtEEDCkCsR_KqQ?feature=mhee> |
> LinkedIN <http://www.linkedin.com/company/aquafin/products> | Instagram
> <https://www.instagram.com/aquafin_nv/> *
>
> In het kader van de uitoefening van onze taken verzamelen we bij Aquafin
> persoonsgegevens. Hoe we omgaan met deze gegevens en wat de rechten van de
> betrokkenen zijn, kan je nalezen in onze privacy policy
> <https://www.aquafin.be/nl-be/privacy-policy>.
>
>   P Denk aan het milieu. Druk deze mail niet onnodig af.
>

--- End Message ---
_______________________________________________
Netdisco mailing list - Digest Mode
[email protected]
https://lists.sourceforge.net/lists/listinfo/netdisco-users

Reply via email to