Discussion:
[rancid] Adding a new device type
Chris Boot
2009-03-31 10:08:17 UTC
Permalink
All,

I've just discovered RANCID after an entry on the SANS ISC blog
(http://isc.sans.org/diary.html?storyid=6100) - very nice tool. I've set
it up for our HP ProCurve switches (a mixture of 2810s and 2610s) and
after a small struggle it's working really nicely, so thanks.

We also use several MikroTik routers around the company, so I wanted to
be able to add these to rancid. These aren't supported yet, so I wanted
to add support for them, but I haven't a clue where to start. Can anyone
give me a bit of an introduction please? Suffice to say they're nothing
like Ciscos or HPs with their own CLI accessible by SSH or Telnet so
they would need a whole new set of scripts to poll.

Any hints would be really appreciated.

Cheers,
Chris
Mike Ashcraft
2009-03-31 15:36:57 UTC
Permalink
Chris,

The quick basics:

1 -- Create an expect script similar to clogin that can connect to the device and run commands. You may be able to start with one of the existing *login scripts found in the bin directory, if they partially work on your device, to speed up the process. If you can find one that already works, use it. This would need to telnet in and the MikroTik interface is fairly simple. clogin might work for you with only minimal changes to address the format of the prompt.

2 -- create a perl script similar to rancid that uses the login expect script from the previous step to obtain the configuration and parse/sort it as needed to clean up the output. For example on the MikroTik this may just run the 'export' command and discard the login output and CLI prompt.

3 -- Add your new device type to rancid-fe

4 -- Setup the new devices in router.db using your new device type

Good luck,

Mike

-----Original Message-----
From: rancid-discuss-***@shrubbery.net [mailto:rancid-discuss-***@shrubbery.net] On Behalf Of Chris Boot
Sent: Tuesday, March 31, 2009 4:08 AM
To: rancid-***@shrubbery.net
Subject: [rancid] Adding a new device type

All,

I've just discovered RANCID after an entry on the SANS ISC blog
(http://isc.sans.org/diary.html?storyid=6100) - very nice tool. I've set
it up for our HP ProCurve switches (a mixture of 2810s and 2610s) and
after a small struggle it's working really nicely, so thanks.

We also use several MikroTik routers around the company, so I wanted to
be able to add these to rancid. These aren't supported yet, so I wanted
to add support for them, but I haven't a clue where to start. Can anyone
give me a bit of an introduction please? Suffice to say they're nothing
like Ciscos or HPs with their own CLI accessible by SSH or Telnet so
they would need a whole new set of scripts to poll.

Any hints would be really appreciated.

Cheers,
Chris
Chris Boot
2009-04-01 10:07:26 UTC
Permalink
Mike,

Many thanks! I have a set of working scripts now. Where do I send my patch?

Cheers,
Chris
Post by Mike Ashcraft
Chris,
1 -- Create an expect script similar to clogin that can connect to the device and run commands. You may be able to start with one of the existing *login scripts found in the bin directory, if they partially work on your device, to speed up the process. If you can find one that already works, use it. This would need to telnet in and the MikroTik interface is fairly simple. clogin might work for you with only minimal changes to address the format of the prompt.
2 -- create a perl script similar to rancid that uses the login expect script from the previous step to obtain the configuration and parse/sort it as needed to clean up the output. For example on the MikroTik this may just run the 'export' command and discard the login output and CLI prompt.
3 -- Add your new device type to rancid-fe
4 -- Setup the new devices in router.db using your new device type
Good luck,
Mike
-----Original Message-----
Sent: Tuesday, March 31, 2009 4:08 AM
Subject: [rancid] Adding a new device type
All,
I've just discovered RANCID after an entry on the SANS ISC blog
(http://isc.sans.org/diary.html?storyid=6100) - very nice tool. I've set
it up for our HP ProCurve switches (a mixture of 2810s and 2610s) and
after a small struggle it's working really nicely, so thanks.
We also use several MikroTik routers around the company, so I wanted to
be able to add these to rancid. These aren't supported yet, so I wanted
to add support for them, but I haven't a clue where to start. Can anyone
give me a bit of an introduction please? Suffice to say they're nothing
like Ciscos or HPs with their own CLI accessible by SSH or Telnet so
they would need a whole new set of scripts to poll.
Any hints would be really appreciated.
Cheers,
Chris
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Chris Boot
2009-04-02 08:32:15 UTC
Permalink
All,

I've attached the patch since Thunderbird seems to mangle tabs.

HTH,
Chris
Post by Chris Boot
Mike,
Many thanks! I have a set of working scripts now. Where do I send my patch?
Cheers,
Chris
Post by Mike Ashcraft
Chris,
1 -- Create an expect script similar to clogin that can connect to the device and run commands. You may be able to start with one of the existing *login scripts found in the bin directory, if they partially work on your device, to speed up the process. If you can find one that already works, use it. This would need to telnet in and the MikroTik interface is fairly simple. clogin might work for you with only minimal changes to address the format of the prompt.
2 -- create a perl script similar to rancid that uses the login expect script from the previous step to obtain the configuration and parse/sort it as needed to clean up the output. For example on the MikroTik this may just run the 'export' command and discard the login output and CLI prompt.
3 -- Add your new device type to rancid-fe
4 -- Setup the new devices in router.db using your new device type
Good luck,
Mike
-----Original Message-----
Sent: Tuesday, March 31, 2009 4:08 AM
Subject: [rancid] Adding a new device type
All,
I've just discovered RANCID after an entry on the SANS ISC blog
(http://isc.sans.org/diary.html?storyid=6100) - very nice tool. I've set
it up for our HP ProCurve switches (a mixture of 2810s and 2610s) and
after a small struggle it's working really nicely, so thanks.
We also use several MikroTik routers around the company, so I wanted to
be able to add these to rancid. These aren't supported yet, so I wanted
to add support for them, but I haven't a clue where to start. Can anyone
give me a bit of an introduction please? Suffice to say they're nothing
like Ciscos or HPs with their own CLI accessible by SSH or Telnet so
they would need a whole new set of scripts to poll.
Any hints would be really appreciated.
Cheers,
Chris
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Loading...