Network devices and config checks

Edition: Network devices COMMUNITYCommunity · config checks PROPro ENTERPRISEEnterprise

Connector for: Cisco IOS/IOS-XE · Siemens SCALANCE

What it does

The Network devices connector logs in to switches over SSH, runs read-only show commands and compares what the switch reports with NetBox. It reads:

From this, the cinqstack Sync Engine makes a plan for each run: the NetBox fields that differ from the switch, with the old and the new value. Nothing is written until an operator applies the plan, unless the job's automation level allows it (see Collect, review and approve).

The connector also keeps every running configuration it reads. When a configuration differs from the last one kept for that switch, it records a config change with a readable summary and the raw diff. People review these under Review › Changes and acknowledge them.

FIG. 1 · How a configuration change is foundOne switch on a fictional site: the running configuration read, set against the last snapshot, the change record, and its acknowledgement.

Config checks PROPro ENTERPRISEEnterprise test the latest kept configuration of each switch against your configuration standard, written as rules: for example "SSH version 2 only" or "no default SNMP community". A switch that fails a rule becomes a finding, and the finding closes itself once a newer configuration passes.

Supported switches

CollectorPicked automatically when the NetBox platform slug isor the manufacturer slug contains
Cisco IOS / IOS-XEcisco-ios, cisco-ios-xe, ios, ios-xe, iosxe, cisco_ios, stratix, rockwell-stratix, stratix-ios, stratix-ios-xecisco; or rockwell / allen-bradley when the device type is a Stratix 5200, 5400, 5410, 5700 or 5800 (by name or 1783- catalogue number)
Siemens SCALANCE (XR-500, XC-200, XB-200 and XM-400 families, and SINEC OS)scalance, siemens-sinec-os, sinec-os, scalance-s, scalance-sc, siemens-scalance-s, siemens-scalance-scsiemens

If your platforms use other names, pick the collector on the job. Each collector runs the show commands for the version, the interfaces, the VLANs and the running configuration; the exact commands are listed on the Cisco IOS and SCALANCE troubleshooting pages, and on What each connector reads with what cinqstack takes from each one.

What it needs in NetBox

Config checks need nothing extra in NetBox. They work on the configurations the Network devices connector keeps.

Setting up

1. Add an SSH credential

An admin opens Connectors › Network devices, presses Credentials and fills in Name, Username, Password and, for Cisco, an optional Enable secret. When the enable secret is set, cinqstack enters enable mode before it runs the commands. Credentials are stored encrypted with the install's key.

Use a read-only account: collectors only run show commands, plus the session lines listed on What each connector reads (such as terminal length 0); they never enter configuration mode. What the account may run decides what you get:

A credential that a job uses cannot be deleted (That credential is used by a job.).

2. Create a job

An operator or admin presses New job on the Connectors › Network devices page. The job form has these fields:

FieldWhat it doesDefault
NameThe job's name.Network devices
Site slug, Device role slug, Tag slugWhich NetBox devices the job collects. All filters you fill in must match. At least one is required.none
CredentialThe SSH credential to sign in with.
CollectorAutomatic picks per device from its platform and manufacturer. Pick Cisco IOS / IOS-XE or Siemens SCALANCE to force one.Automatic
SSH portThe port for every device in the job.22
Update these in NetBoxWhich fields a plan may write: device serial number, firmware version, interface enabled, description, speed, VLAN mode and VLANs, and IP addresses. Unticked fields are still compared and reported, just never written.all ticked (IP addresses: ticked for new jobs, unticked for jobs created before it existed)

IP addresses. The interface addresses the device reports (Cisco: from the running configuration, including secondary addresses and the interface's VRF, so the account needs to read it; SCALANCE switches and S/SC appliances: show ip interface) are written onto the matching NetBox interface, with their prefix length. IPv4 only. On Cisco, an account that cannot read the running configuration gives no prefix lengths, so the addresses are left out with a note on the run, never written as /32; an ip address dhcp interface is left out too. Unset (0.0.0.0), loopback and link-local addresses are skipped. A new address is created, a wrong prefix is corrected, and an address NetBox has but assigns to nothing is assigned. Nothing is deleted, and an address NetBox assigns to another object is never moved: the plan reports it under IP address assigned to something else in NetBox. VRFs are matched by name and never created: an address in a VRF NetBox does not have is left out, not written into the global table. When NetBox has no primary IPv4 for the device and the address cinqstack reached it on is among them, the plan offers Set as primary IP, written only when the plan is applied. Interfaces are never created: a VLAN interface NetBox lacks is reported as missing. At apply, every address is looked up in NetBox again: one assigned elsewhere since the plan, a prefix edited since, or a primary IP set since, is held and reported, not overwritten. Jobs created before this field existed keep it unticked until an operator or admin ticks IP addresses on the job.

Devices in parallelHow many switches are collected at once, 1 to 32.8
ScheduleManual, Repeating (every N minutes, at least 5, optionally inside a daily time window), At a set time (chosen days) or Cron.Manual
What happens after a runReport only, Review first, Automatic updates or Fully automatic, plus a Safety limit that holds a large run for review.Review first
EnabledA disabled job is not run by its schedule.on

If no filter is set, the job is refused: Choose at least one filter (site, role or tag) so a job cannot target every device by accident.

Before the first run, press Targets on the job to see which NetBox devices match, with their platform, manufacturer and primary IP.

3. Run it

Press Run now on the job. cinqstack waits up to 20 seconds for each SSH connection and up to 60 seconds for most commands (120 for the running configuration). A run has no overall time limit and no cap on the number of devices. The arrow next to it offers Run with debug log, which also records every command and its raw output, with secrets masked. Use it when a switch is read but fields stay empty.

A job can also be routed to a Relay edge ENTERPRISEEnterprise when the switches sit in a network the server cannot reach.

4. Turn on config checks PROPro ENTERPRISEEnterprise

Open Security › Config checks. The first time, the page offers Start from common hardening rules. Tick the ones you want and press Add the ticked rules. Each can be edited afterwards. The starter rules are written for Cisco IOS-style configurations only; no starter rules ship for SCALANCE:

Starter ruleSeverityChecks that the config
SSH version 2 onlymediumhas the line ip ssh version 2
Remote sign-in over SSH onlyhighhas no transport input … telnet on any line vty
No default SNMP communitieshighhas no snmp-server community public or private
Plain HTTP management is offmediumhas no line ip http server
Logs go to a collectormediumhas a logging or logging host line with an address
Two NTP serverslowhas at least 2 ntp server lines
Central sign-in (AAA)mediumhas the line aaa new-model
Passwords are encryptedlowhas the line service password-encryption
A login banner is setlowhas a banner login or banner motd

To write your own, press Add a rule:

FieldWhat it does
NameWhat the rule is called in lists and findings.
The configMust have a line that or Must not have a line that.
Linecontains this text, is exactly this line, or matches this regular expression.
PatternThe text, line or regular expression. Matching ignores case and leading spaces.
At leastFor "must have": how many matching lines are needed. Two NTP servers = 2.
In every blockOptional. A regular expression for top-level lines, such as ^line vty or ^interface GigabitEthernet. Each block is checked on its own. Blank checks the whole config.
Only on devicesOptional. Device name patterns, such as hf-rot-*, separated by commas or new lines. Blank means every switch with a kept config.
SeverityHigh, Medium or Low. The finding gets this severity.
How to fix itShown on the rule and in the finding.
Check switches against it and raise findingsUntick to keep the rule without checking it.

Press Try it on every config first to see how many switches would pass and fail. Nothing is saved until you press Save rule.

Only operators and admins can add, edit or delete rules. Anyone signed in can view them.

Reading the results

The run

Each run page is headed Run #<n> with the job's name, under the eyebrow Network devices and the line Planned by the cinqstack Sync Engine · reviewed before anything is written to NetBox. It shows counts for devices, in sync, with changes, missing in NetBox, failed and config changes. Below that, the report groups devices by what needs doing, and each group says how to fix it:

GroupMeaning
In syncNetBox matches what the switch reports.
… differs from NetBox / … differs on interfacesThe switch reports a different value. Applying writes the switch's value to NetBox.
VLAN used on the device but not in NetBoxCreate the VLAN for the site (or globally); the next run links it.
Interface on the device but not in NetBoxAdd the interface in NetBox, usually from the device type.
IP addresses to writeInterface addresses to create, correct or assign in NetBox; each device's addresses are also listed in a table on the run.
IP address assigned to something else in NetBoxThe address belongs to another object in NetBox. It is never moved; fix it in NetBox if the switch is right.
VRF not in NetBox: address left outCreate the VRF in NetBox (same name) and the next run adds the address.
Set as primary IPNetBox has no primary IPv4 for the device; applying sets the address cinqstack reached it on.
Hostname differs from the NetBox nameInformation only. Nothing is renamed.
Firmware is not being recordedThe firmware_version field is not set up in NetBox.
SSH sign-in refused, No answer on SSH, No collector chosen, No primary IP in NetBox, Collection failed, Could not read the device from NetBoxThe device was not collected or not planned. See the troubleshooting pages for Cisco IOS and SCALANCE.
Could not write to NetBoxNetBox refused some writes during apply. The messages come from NetBox.
Running configuration changedLinks to the config changes this run found.

Per device lists each switch with its status; Needs attention hides switches that are in sync. When devices have changes and the job is not report-only, Apply changes writes them to NetBox. Interface link changes and VLAN changes are written separately, so a VLAN error does not block the rest. A job set to Report only can never be applied: This job is report-only: its plans are never written. Change the job's automation to apply them.

The job's history page shows every run with its counts: in sync, with changes, skipped and failed. A run is marked failed only when every device in it failed.

If the licence's device limit is exceeded or a schema field the job needs is missing, Apply changes is blocked until that is fixed. Acknowledgement journal entries are still written.

Apply re-checks NetBox first. Each planned field is compared with what NetBox holds now. A field someone edited in NetBox since the plan is left alone and listed per device under the apply line as "changed in NetBox since the plan", with a Plan again button; the run message ends with N left alone (changed in NetBox since the plan).

Config changes

Review › Changes: what changed between two syncs, newest first, each change with its risk.
Review › Changes: what changed between two syncs, newest first, each change with its risk.

Review › Changes lists running configurations that changed between two syncs, newest first. The first configuration kept for a switch is its baseline, so it never shows here. Lines that change on every read, such as Building configuration and ! Last configuration change, are ignored.

Each row shows the switch, a one-line summary (for example Gi1/0/5 · Access VLAN 120 → 110), lines added and removed, risk labels, site and status. On Cisco switches, the status also says who made the change: on the device by <user>, or no device record of who. Filter by Status (new or acknowledged), Detected, Site and Device, or search by name, change, ticket or note. With vCenter PROPro ENTERPRISEEnterprise, VM changes appear in the same list.

On a phone, each change reads as a short card.
On a phone, each change reads as a short card.
A config change: one pill names it, the readable summary first, the raw diff one click away.
A config change: one pill names it, the readable summary first, the raw diff one click away.

Open a change to see:

To acknowledge, an operator or admin enters an optional Change ticket and a Note, then presses Acknowledge. Several changes can be selected and acknowledged at once with Acknowledge selected.

NetBox journal. By default each acknowledgement is also written as a journal entry on the device in NetBox: who acknowledged it, the ticket and note, and what changed. Entries with a risk label are written as a warning. An admin can switch this off under Settings › NetBox (Acknowledged changes). It needs the NetBox write token; entries wait until it is set. The change shows where its entry stands: Written to the NetBox journal, Going to the NetBox journal shortly, or Not in the NetBox journal: … with Try again.

Config checks PROPro ENTERPRISEEnterprise

Security › Config checks shows how many rules are being checked, how many switches have a kept config and how many fail a rule. Each rule shows its failing, passing and not applicable counts. A switch whose config has no block matching In every block is not applicable, not a failure. A switch that is no longer in NetBox is left out of the checks, shown on a third card no longer in NetBox, left out; its open findings close with the reason Device no longer in NetBox. The Changes list keeps its history and marks it.

Open a rule to see the failing switches with What was found (the offending lines, or no matching line), and the passing ones. Export downloads the results as CSV.

Search configs finds a line in the latest config of every switch: an old log collector, a community string, a VLAN, a user name. Tick Regular expression for a pattern. Turn this into a rule opens a new rule.

A config check rule with its failing switches and what was found on each.
A config check rule with its failing switches and what was found on each.

Findings it raises

These appear in the Findings inbox PROPro ENTERPRISEEnterprise:

FindingSeverityCloses when
<device>: could not collect over SSHmediuma later completed run of that job collects the switch. After a run in which every device failed, the earlier SSH findings stay as they were until the next completed run.
<device>: running configuration changed (+N/-N lines)mediumthe change is acknowledged. On Cisco switches the detail ends with Changed on the device by <user> at <time> (the device's own record). or No device record of who made it.
<device>: <rule name> (config checks)the rule's severitya newer kept config passes, or the rule is switched off or deleted.

A config check finding says what was expected, what was found and from which config, with the rule's How to fix it text.

The connector can also send a notification when a running configuration changes (event "A device's running configuration changed"). See Notifications.

Limits