What is Canned Beef?
"Canned beef" is a jargon term, meaning SA Script session, canned in form of portable container along with script input and result. All CLI and SNMP interactions of the script are stored in the can.
Canned beef can be unpacked by NOC testing suite and can be used to reproduce the script session, even if the original box is absent. Canned beef used for testing and debugging issues, allowing NOC to presume personality of different software versions and hardware platforms, making sure no future changes broke an existing behavior.
Second use of the beef, is to provide NOC developers access to the personality of the box, not giving shell access to it.
Third, just like a real world beef, NOC's canned beef can be conserved from completely dead meat. Failed script session can be still canned, allowing developers to reproduce lifetime of the session and find an exact reason of failure
What is Canned Beef Repo
Beefs are organized in the separate mercurial repos. The number of repos are available. Repo can be marked as either public or private. Public repos contains beef which store no sensitive information and can be made publically available. In contrary, private repos can contain sensitive information and designated to use in closed environment.
Beef repos are configured in etc/beef.conf. Each repo is a separate config section like
- sa_public - repo name
- enabled - true or false. To temporary disable beef repo mark it as enabled = false
- type - Always sa
- private - true or false. Private repos denoted as private = true
- repo - Mercurial repo path
To check current repo status:
- E - Status of repo
- P - Repo is private or not
- T - Type of repo
- Name - Name of repo
- Repo - Mercurial repo path
NOC project maintains public repo (sa_public) one and separate private repos per subscriber. You can create additional repos to support your customers and local installations.
How to prepare a Canned Beef?
Acting as noc user:
where script name is a common script name, like Cisco.IOS.get_version or get_version. access url can be one of:
- path to JSON file with credentials
- managed object name
- managed object id
resulting beef can be stored in output.
Run script without any parameters, when: user name "foo", user password "bar", and enable password "superpassword":
Where cred.json contain:
Run script for existing managed object router1
Run script for existing managed object with id 10
Run script with SNMP RO community public:
Where cred.json contain:
Run script with parameter address:
Create private beef
Each beef accepts unique GUID number, which can be used as unique identifier.
If you got error like "Failed to load script DLink.DxS.get_spanning_tree: syntax error", try this to find error:
Testing Canned Beef
Before testing canned beed, pull changes to all enabled repos
Perform full unittests (including beef)
Test only beefs
Test single repo (i.e. sa_public)
To analyze beef code coverage run tests with --coverage-html-out key
then refer to /tmp/coverage/index.html for details
Check which beef do you have
Contribute the Beef
Finally submit an issue with you beef, we will gracefully include it into the next releases. Send it to email@example.com.
DO NOT FORGET TO SET "PRIVATE" FLAG IF YOUR BEEF MAY CONTAIN SENSITIVE INFORMATION