Mailing List Archive

Ubiquiti edgeswitch (edgemax) script?
Hi, I'm trying to get RANCID to poll my ubiquiti edge switches, and am a bit perplexed. From what I've found online in other mailing lists, it is possible to use RANCID to poll these, using the edgemax script. So far, I've set up the router.db with <device-type> edgemax. When I invoke rancid-run, nothing much happens, and when I look in the log, I see:
=====================================
Getting missed routers: round 2.
myEdgeSwitch: End of run not found
!
=====================================

So far, I have tried adding my own device type by copying the "EdgeMax" device config in rancid.types.base to rancid.types.conf, and calling it EdgeSwitch (which is the right thing to do right? Despite the dire warnings at the top of each file, it's not entirely clear how to do this, as they both warn against editing the file). I tried to use ulogin instead of clogin, with the same result.
I can successfully authenticate to the switches by using both clogin and ulogin.


What is now really confusing is that I don't know what script RANCID should be running. In rancid.types.base, the edgemax config looks like this:

## UBNT EdgeMAX
edgemax;script;rancid -t edgemax
edgemax;login;clogin
edgemax;module;edgemax
...more commands...

What confuses me is that there isn't a script in the bin directory called edgemax, so I'm not sure what script it should be running. There IS a file in lib/rancid called edgemax.pm, but that doesn't get referenced by the config in rancid.types.base.

If someone could help clarify

1. What "end of run not found" means to me, and
2. What script the edgemax config should be running, I might be able to figure this all out.

Thank you.

Kevin
Re: Ubiquiti edgeswitch (edgemax) script? [ In reply to ]
I have a few of the edge switches (edgeswitch-X)

I use this in my etc/rancid.types.conf

# Ubiquiti Switches and some radios
ubntsw;script;rancid -t ubntsw
ubntsw;login;ulogin
ubntsw;module;ubnt
ubntsw;inloop;ubnt::inloop
ubntsw;command;ubnt::ShowVersion;show version
ubntsw;command;ubnt::ShowConfig;show configuration

I have my own ulogin, but it looks like your login that you are
currently using works just fine.

Basically, there are only 2 commands that matter, the show version and
show configuration.

I contributed by lib/rancid/ubnt.pl back a couple of years ago, but
can't remember if it made it in. There may be a more recent way to do
it, but I'm happy to share it.



On 11/6/2018 1:13 PM, Kevin Geil wrote:
>
> Hi, I?m trying to get RANCID to poll my ubiquiti edge switches, and am
> a bit perplexed.? From what I?ve found online in other mailing lists,
> it is possible to use RANCID to poll these, using the edgemax script.
> So far, I?ve set up the router.db with <device-type> edgemax.? When I
> invoke rancid-run, nothing much happens, and when I look in the log, I
> see:
>
> =====================================
>
> Getting missed routers: round 2.
>
> myEdgeSwitch: End of run not found
>
> !
>
> =====================================
>
> ?
>
> So far, I have tried adding my own device type by copying the
> ?EdgeMax? device config in rancid.types.base to rancid.types.conf, and
> calling it EdgeSwitch (which is the right thing to do right? Despite
> the dire warnings at the top of each file, it?s not entirely clear how
> to do this, as they both warn against editing the file).? I tried to
> use ulogin instead of clogin, with the same result.
> I can successfully ?authenticate to the switches by using both clogin
> and ulogin.
>
> ?
>
>
> What is now really confusing is that I don?t know what script RANCID
> should be running.? In rancid.types.base, the edgemax config looks
> like this:
>
> ?
>
> ## UBNT EdgeMAX
>
> edgemax;script;rancid -t edgemax
>
> edgemax;login;clogin
>
> edgemax;module;edgemax
>
> ?more commands?
>
>
> What confuses me is that there isn?t a script in the bin directory
> called edgemax, so I?m not sure what script it should be running.?
> There IS a file in lib/rancid called edgemax.pm, but that doesn?t get
> referenced by the config in rancid.types.base.
>
>
> If someone could help clarify
>
> ?
>
> 1. What ?end of run not found? means to me, and
>
> 2. What script the edgemax config should be running, I might be able
> to figure this all out.?
>
>
> Thank you.
>
> ?
>
> Kevin
>
>
>
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss@shrubbery.net
> http://www.shrubbery.net/mailman/listinfo/rancid-discuss

--
Doug Hughes
Keystone NAP
Fairless Hills, PA
1.844.KEYBLOCK (539.2562)
Re: Ubiquiti edgeswitch (edgemax) script? [ In reply to ]
Tue, Nov 06, 2018 at 06:13:18PM +0000, Kevin Geil:
> Hi, I'm trying to get RANCID to poll my ubiquiti edge switches, and am a bit perplexed. From what I've found online in other mailing lists, it is possible to use RANCID to poll these, using the edgemax script. So far, I've set up the router.db with <device-type> edgemax. When I invoke rancid-run, nothing much happens, and when I look in the log, I see:
> =====================================
> Getting missed routers: round 2.
> myEdgeSwitch: End of run not found
> !
> =====================================
>
> So far, I have tried adding my own device type by copying the "EdgeMax" device config in rancid.types.base to rancid.types.conf, and calling it EdgeSwitch (which is the right thing to do right? Despite the dire warnings at the top of each file, it's not entirely clear how to do this, as they both warn against editing the file). I tried to use ulogin instead of clogin, with the same result.
> I can successfully authenticate to the switches by using both clogin and ulogin.

unless you are changing the device spec somehow, there is no need to copy
it. just use the edgemax spec. otherwise, yes, copy the spec to the .conf
file with a different name.

>
> What is now really confusing is that I don't know what script RANCID should be running. In rancid.types.base, the edgemax config looks like this:
>
> ## UBNT EdgeMAX
> edgemax;script;rancid -t edgemax
> edgemax;login;clogin
> edgemax;module;edgemax
> ...more commands...

the script is rancid, which imports the named modules, edgemax{.pm} in
this case. also see rancid.types.conf(5)

> What confuses me is that there isn't a script in the bin directory called edgemax, so I'm not sure what script it should be running. There IS a file in lib/rancid called edgemax.pm, but that doesn't get referenced by the config in rancid.types.base.
>
> If someone could help clarify
>
> 1. What "end of run not found" means to me, and

it means that it did not find the end of the config or possibly no config.
S3 Q2 of the FAQ has a good test outline.

> 2. What script the edgemax config should be running, I might be able to figure this all out.
>
> Thank you.
>
> Kevin

> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss@shrubbery.net
> http://www.shrubbery.net/mailman/listinfo/rancid-discuss

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss@shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Re: Ubiquiti edgeswitch (edgemax) script? [ In reply to ]
Tue, Nov 06, 2018 at 01:33:10PM -0500, Doug Hughes:
>
> I have a few of the edge switches (edgeswitch-X)
>
> I use this in my etc/rancid.types.conf
>
> # Ubiquiti Switches and some radios
> ubntsw;script;rancid -t ubntsw
> ubntsw;login;ulogin
> ubntsw;module;ubnt
> ubntsw;inloop;ubnt::inloop
> ubntsw;command;ubnt::ShowVersion;show version
> ubntsw;command;ubnt::ShowConfig;show configuration
>
> I have my own ulogin, but it looks like your login that you are
> currently using works just fine.
>
> Basically, there are only 2 commands that matter, the show version and
> show configuration.
>
> I contributed by lib/rancid/ubnt.pl back a couple of years ago, but
> can't remember if it made it in. There may be a more recent way to do
> it, but I'm happy to share it.

Lacking testing from other folks, I wrote one a few IETFs ago. there
are 3 variations for UBNT switches/routers; see rancid.types.conf. If I
missed anything that your script supports, please lmk, otherwise I expect
it matches or supercedes it.

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss@shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Re: Ubiquiti edgeswitch (edgemax) script? [ In reply to ]
Yeah, I haven't upgraded in a little while, so I had a suspicion that
you had released a more recent one.



On 11/6/2018 1:46 PM, heasley wrote:
> Tue, Nov 06, 2018 at 01:33:10PM -0500, Doug Hughes:
>> I have a few of the edge switches (edgeswitch-X)
>>
>> I use this in my etc/rancid.types.conf
>>
>> # Ubiquiti Switches and some radios
>> ubntsw;script;rancid -t ubntsw
>> ubntsw;login;ulogin
>> ubntsw;module;ubnt
>> ubntsw;inloop;ubnt::inloop
>> ubntsw;command;ubnt::ShowVersion;show version
>> ubntsw;command;ubnt::ShowConfig;show configuration
>>
>> I have my own ulogin, but it looks like your login that you are
>> currently using works just fine.
>>
>> Basically, there are only 2 commands that matter, the show version and
>> show configuration.
>>
>> I contributed by lib/rancid/ubnt.pl back a couple of years ago, but
>> can't remember if it made it in. There may be a more recent way to do
>> it, but I'm happy to share it.
> Lacking testing from other folks, I wrote one a few IETFs ago. there
> are 3 variations for UBNT switches/routers; see rancid.types.conf. If I
> missed anything that your script supports, please lmk, otherwise I expect
> it matches or supercedes it.

--
Doug Hughes
Keystone NAP
Fairless Hills, PA
1.844.KEYBLOCK (439.2562)