python to fetch the arp table from cisco and unix hosts

This project received 9 bids from talented freelancers with an average bid price of $43 USD.

Get free quotes for a project like this
Project Budget
$10 - $30 USD
Total Bids
Project Description

You will write a function in Python that will ssh to a remote host, detect the remote Operating System and fetch the ARP table from the host.

The function will be run on a Ubuntu 12.04.4 Linux host using Python 2.7.3.

The function inputs will be:

- remote username

( eg: "arpuser" )

- remote host IP address

( eg: "" )

- path to local SSH RSA key file

( eg: "/home/localuser/.ssh/id_rsa" and [url removed, login to view] will also exist )

The remote host Operating System will either be Cisco iOS or OpenBSD. You will use the pexpect library. The OpenBSD prompt could be either "$" "#" because both root and not-root usernames will be used.

Detect the Operating System by running "uname -a" and "show ver" commands.

Fetch the arp table using either "show arp" or "arp -an" as determined by the Operating System.

The first time connecting to a host the remote fingerprint might not be known yet and must be stored in the ~/.ssh/known_hosts file.

The function will return a dictionary of ARP entries mapping IP address MAC address. eg:

{ '': '04:00:3e:01:02:03',

'': '04:00:3e:04:05:06'


MAC addresses will be formatted in MAC-48 and use lowercase letters.

Incomplete ARP table entries will not be included in the dictionary.

The code must accommodate ARP tables with thousands of entries.

The code must be robust. It must detect possible errors and handle them as gracefully as possible.

Exceptions will be thrown for errors as required. Including but not limited to:

- ssh key file not found

- unable to connect to remote host

- connection timed out

The code must be easy to read, understand, and maintain. It will be used as part of a larger program and other people will be looking at it and using it.

Skills Required

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online