Welcome, Guest. Please login or register.

Author Topic: An idea for simplify configuration of multithread NeDi launches  (Read 3768 times)

pc_sg

  • Guest
An idea for simplify configuration of multithread NeDi launches
« on: November 08, 2011, 04:25:45 PM »
Hi to all.

About the "multiple lauch" solution to "multithread" NeDi, the current way, at least for a multi site case like mine,  needs to use a different nedi.conf ad a different seedlist for any distinguished "launch" of NeDi.
But, at least in nedi.conf, a lot (almost all) parameters remain equal, and only a few needs to be changed.

Could be a improvement to consolidate this always common configuration parameters in a common configuration file, and keep in a separated ones  only the other parameters that need variations?

Or is a stupid thing?

Thanks.

P.C.

SteffenS

  • Guest
Re: An idea for simplify configuration of multithread NeDi launches
« Reply #1 on: November 11, 2011, 12:31:36 AM »
Hello pc_sg,

since 1.0.6, it's not needed anymore to use different config-files for parallel-discovery.
You can use different "nedi.pl -A <filter>"-jobs, like I do.

greetings

Steffen

pc_sg

  • Guest
Re: An idea for simplify configuration of multithread NeDi launches
« Reply #2 on: November 14, 2011, 11:28:25 AM »
Hi Steffen,

I'm trying to use "-A" switch, but I haven't undestand which syntax to use as filter. Seems powerfull, but haven't found enough examples.

And I haven't understood if thist switch may be used always, or only after a "full" discovery.
I mean: in command line help nedi says
-A cond Add devices from DB cond=all or e.g.'loc regexp "here"
so I suppose that it picks devices from database based on filters.

I like to always do a full discovery, mulitreathed, but only a site for any single nedi.pl launch (but may in parallel)

Since you already use nedi in this way, can you explain the method with some examples?

Thanks in advance!

pc_sg (Paolo)

SteffenS

  • Guest
Re: An idea for simplify configuration of multithread NeDi launches
« Reply #3 on: November 15, 2011, 11:36:32 AM »
Hi Paolo,

here some lines from my crontab as sample:
Code: [Select]

# nightly: 3 o'clock local time (UTC - Timezone)
# refresh-run WITH -r="Route table discovery (on L3 devices)" AND WITH -p="Read LLDP,CDP or FDP discovery protocol" AND WITH -n="resolve node names via DNS":
#-----------------------------------------------------------------------------------
0 2 * * *   /var/nedi/nedi.pl -prNA "location regexp '^DE;' OR device regexp '^DE' ORDER BY devip" >/tmp/nedi-DE-`date +\%H`.lastrun 2>&1
0 23 * * *   /var/nedi/nedi.pl -prNA "location regexp '^RU;' ORDER BY devip" >/tmp/nedi-RU-`date +\%H`.lastrun 2>&1
0 3 * * *   /var/nedi/nedi.pl -prNA "location NOT regexp '^..;' AND device NOT regexp '^AT|^AZ|^BA|^BG|^CZ|^DE|^HR|^HU' ORDER BY devip" > /tmp/nedi-leftover-`date +\%H`.lastrun 2>&1

# during the day (9,15,21 o'clock local time):
# refresh-run WITHOUT -r="Route table discovery (on L3 devices)" AND  WITHOUT -p="Read LLDP,CDP or FDP discovery protocol" AND WITHOUT -n="resolve node names via DNS":
#-----------------------------------------------------------------------------------
0 8,14,20 * * *   /var/nedi/nedi.pl -nNA "location regexp '^DE;' OR device regexp '^DE' ORDER BY devip" >/tmp/nedi-DE-`date +\%H`.lastrun 2>&1
0 5,11,17 * * *   /var/nedi/nedi.pl -nNA "location regexp '^RU;' ORDER BY devip" >/tmp/nedi-RU-`date +\%H`.lastrun 2>&1
0 9,15,21 * * *   /var/nedi/nedi.pl -nNA "location NOT regexp '^..;' AND device NOT regexp '^AT|^AZ|^BA|^BG|^CZ|^DE|^HR|^HU' ORDER BY devip" > /tmp/nedi-leftover-`date +\%H`.lastrun 2>&1


I've split my refresh-discovery in fequency of 6 hours to 3 "small"-discoveries during the day round about 9,15,21 o'clock - and one "full"-deep-discovery at night round about 3 o'clock .

The first sample-lines do refresh every devices in germany (location-string start with "DE;" - or device-name start with "DE").
The second line do the same for russian devices (location-string start with "RU;").
The third line refresh all (leftover) devices that are not discover by a other line above.

(The first+second character in hostname and location-string on our devices uses ISO-3166-1(ALPHA-2)-country-code.)

(I have many additional lines for every country (or regions by "large" coutries with to many devices for one job) - but for understanding this make no sense to list all.
The other uses the same way.)

Note: My nedi-server uses UTC-timeszone, and the start-time for every country is the local time 9,15,21 and 3 o'clock in UTC-format.
(6,12,18 and midnight used by my testing/development system) ;o)
In this way, the traffic will be shared over the time because the different time-zones. This is very helpfull for me.

I hope this may help you.

Greetings
Steffen