Skip to content

rConfig - CLI Commands

10 mins V7 Pro V6 Core

rConfig V7 has a number of very useful CLI commands built-in. The commands are useful if;

  • You prefer to use CLI for your configuration management tasks
  • You want to extend an Infrastructure as Code platform such as Ansible, or Chef
  • You have custom scripts that you would like to run against rConfig

You need to be logged in as root user to run these commands, and you need to be in the rConfig ‘current’ directory.

Terminal window
cd /var/www/html/rconfig7/current

Running the following will output all available Laravel commands but you will also see all rConfig command options. Try to stick to using the rConfig commands unless you have a good knowledge of Laravel.

Terminal window
php artisan
Terminal window
rconfig
rconfig:archive-logs Will archive x amount of activity log rows or days
rconfig:clear-all Clear all cache and config elements for Laravel, NPM and other dependencies
rconfig:clear-horizon Clear Horizon Queue History
rconfig:download-api Download api configurations for one or multiple api connections via the CLI
rconfig:download-category Download configurations for one or multiple Command Group of devices
rconfig:download-device Download configurations for one or multiple devices via the CLI
rconfig:download-tag Download configurations for devices with one or multiple tags
rconfig:download-task Download configurations for devices with one or multiple tasks
rconfig:integration-zabbix In Development: Command to sync Zabbix devices to rConfig via API integration.
rconfig:list-categories List all Command Group IDs and names in rConfig
rconfig:list-devices List all tag IDs and names in rConfig
rconfig:list-snippets List all Snippets in rConfig
rconfig:list-tags List all tag IDs and names in rConfig
rconfig:list-tasks List all task IDs and names in rConfig
rconfig:purge-configs Purge configs older than X days
rconfig:purge-failedconfigs Purge failed configs for some or all devices
rconfig:report-lastDownload Output report of all devices latest downloaded configs
rconfig:run-policy-compliance Send a policy assignment job to the queue
rconfig:search-configs Search all config files for a given string
rconfig:send-snippet Send a snippet to one or multiple devices via the CLI
rconfig:snippet-task Send snippets to devices with one or multiple tasks
rconfig:sweep-tftp-dir Sweeps the TFTP directory for files, attempts to match filename to device ID and uploads them to the correct device directory
rconfig:sync-search Sync search models with laravel scout
rconfig:sync-tasks Sync the schedule of the app with the schedule monitor
rconfig:test-script Test BYOC scripts from the command line
rconfig:tftp-server Toggle rConfig TFTP on or off
rconfig:update-rbac-data Command to update permissions table with new permissions
rconfig:update-snippet-roles Update all snippets to ensure they at least have admin have roles attached to them.

All above commands must be run from within the rConfig7 directory, and must be run in the following format.

Terminal window
php artisan rconfig:clear-all

rconfig:archive-logs

Command Summary

Archives logs from the logs table.

Command Use

Terminal window
php artisan rconfig:archive-logs --days=7

Command Parameters

Terminal window
#move logs entries older than 7 days to the activity_log_archives table
php artisan rconfig:archive-logs --days=7
#move logs entries older than 7 records to the activity_log_archives table
php artisan rconfig:archive-logs --rows=7

Command Output

Terminal window
10 logs entries sent to activity log archive table!

rconfig:clear-all

Command Summary

Clear out cached information, reset permissions and generally fix broke-stuff across the application.

Command Use

Terminal window
php artisan rconfig:clear-all

Command Output

Terminal window
------ Begin rConfig Laravel Clear Out! ------
Configuration cache cleared!
Configuration cached successfully!
Application cache cleared!
Compiled views cleared!
Route cache cleared!
Broadcasting queue restart signal.
No config updates to processes
Do not run Composer as root/super user! See https://getcomposer.org/root for details
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Generated optimized autoload files containing 5419 classes
------ End rConfig Laravel Clear Out! ------

rconfig:clear-horizon

Command Summary

Clear out Horizon Queue system

Command Use

Terminal window
php artisan rconfig:clear-horizon

Command Output

Terminal window
All failed jobs deleted successfully.
Broadcasting queue restart signal.
each individual failed job flushed
failed_jobs flushed

Command Summary

Use this command if you are searching for items from the database, such as devices, Command Groups etc.. and you are not getting the full or correct results. Sync database tables with the internal search engine.

Command Use

Terminal window
php artisan rconfig:sync-search

Command Output

Terminal window
Syncing search models...
Search models synced.

Download Commands

rconfig:download-category

Command Summary

Run commands on all devices within the specific Command Groups. You can send multiple category IDs as parameters.

Command Use

Terminal window
php artisan rconfig:download-category 1 2

Command Output

Terminal window
Start rconfig:download-category IDs:1
Start device download for router1 ID:1001
Config downloaded for router1 with command: "show clock" was successful
Config downloaded for router1 with command: "show version" was successful
Config downloaded for router1 with command: "show run" was successful
Start device download for router2 ID:1002
Config downloaded for router2 with command: "show clock" was successful
Config downloaded for router2 with command: "show version" was successful
Config downloaded for router2 with command: "show run" was successful
Start device download for router3 ID:1003
Config downloaded for router3 with command: "show clock" was successful
Config downloaded for router3 with command: "show version" was successful
Config downloaded for router3 with command: "show run" was successful
Start device download for router4 ID:1004
Config downloaded for router4 with command: "show clock" was successful
Config downloaded for router4 with command: "show version" was successful
Config downloaded for router4 with command: "show run" was successful
Start device download for router5 ID:1005
No config data returned for router5 - ID:1005. Check your logs for more information
End rconfig:download-category

rconfig:download-device

Command Summary

Download configurations for given devices. You can send multiple device IDs as parameters.

Command Use

Terminal window
php artisan rconfig:download-device 1002 1003

Command Options

Adding the -d switch to the above command will cause verbose debugging output for both Telnet and SSH. Adding the -i Search for devices by integration_host_id, which is unique to devices that have been imported via the Device Sync integration i.e. Zabbix

Terminal window
php artisan rconfig:download-device 1002 1003 -d

Command Output

Terminal window
Start rconfig:download-device IDs:1002 1003
Start device download for router2 ID:1002
Config downloaded for router2 with command: "show clock" was successful
Config downloaded for router2 with command: "show version" was successful
Config downloaded for router2 with command: "show run" was successful
Start device download for router3 ID:1003
Config downloaded for router3 with command: "show clock" was successful
Config downloaded for router3 with command: "show version" was successful
Config downloaded for router3 with command: "show run" was successful
End rconfig:download-device

rconfig:download-api

Command Summary

Download configurations for given API Collections. You can send multiple API collection IDs as parameters.

Command Use

Terminal window
php artisan rconfig:download-api 500000 500001

Command Options

Adding the -d switch to the above command will cause verbose debugging output for API connectivity.

Terminal window
php artisan rconfig:download-device 500000 500001 -d

Command Output

Terminal window
Start rconfig:download-device IDs:500000 500001
Start device download for router2 ID:500000
Config downloaded for Api1 with command: "/users" was successful
Start device download for router3 ID:500001
Config downloaded for Api2 with command: "/products" was successful
End rconfig:download-device

rconfig:download-tag

Command Summary

Run commands on all devices within the specific tags. You can send multiple Tag IDs as parameters.

Command Use

Terminal window
php artisan rconfig:download-tag 1001

Command Output

Terminal window
Start rconfig:download-tag IDs:1001
Start device download for router1 ID:1001
Config downloaded for router1 with command: "show clock" was successful
Config downloaded for router1 with command: "show version" was successful
Config downloaded for router1 with command: "show run" was successful
End rconfig:download-tag

rconfig:download-task

Command Summary

Run commands on all devices within the specific task ID. You can send multiple Task IDs as parameters.

Command Use

Terminal window
php artisan rconfig:download-task 555555 666666

Command Output

Terminal window
This operation can take some time, depending on how many devices are configured for this task!!!
Start rconfig:download-task IDs:555555 666666
Start device download for router1 ID:1001
Config downloaded for router1 with command: "show clock" was successful
Config downloaded for router1 with command: "show version" was successful
Config downloaded for router1 with command: "show run" was successful
Start device download for router2 ID:1002
Config downloaded for router2 with command: "show clock" was successful
Config downloaded for router2 with command: "show version" was successful
Config downloaded for router2 with command: "show run" was successful
End rconfig:download-task
Start device download for router2 ID:1002
Config downloaded for router2 with command: "show clock" was successful
Config downloaded for router2 with command: "show version" was successful
Config downloaded for router2 with command: "show run" was successful
End rconfig:download-task

rconfig:integration-zabbix

Command Summary

Command to sync Zabbix devices to rConfig via API integration. All information related to Zabbix integration is available in the Zabbix Integration section.

Command Use

Terminal window
php artisan rconfig:integration-zabbix

Command Output

##List Commands

rconfig:list-categories

Command Summary

Lists all configured device Command Groups. The ID is required when running rconfig:download-categories.

Command Use

Terminal window
php artisan rconfig:list-categories

Command Output

Terminal window
Results for Categories List:
+------+---------------+
| ID | CATEGORY NAME |
+------+---------------+
| 1 | Routers |
| 2 | Switches |
| 3 | Firewalls |
| 1010 | devcategory10 |
+------+---------------+

rconfig:list-devices

Command Summary

Lists all configured devices. The ID is required when running rconfig:download-device.

Command Use

Terminal window
php artisan rconfig:list-devices

Command Output

Terminal window
Results for Devices List:
+------+-------------+-----------+
| ID | DEVICE NAME | DEVICE IP |
+------+-------------+-----------+
| 1001 | router1 | 10.0.0.5 |
| 1002 | router2 | 10.0.0.5 |
| 1003 | router3 | 10.0.0.5 |
| 1004 | router4 | 10.0.0.5 |
| 1005 | router5 | 10.0.0.50 |
+------+-------------+-----------+

rconfig:list-snippets

Command Summary

Lists all configured command snippets. The ID is required when running rconfig:send-snippet.

Command Use

Terminal window
php artisan rconfig:list-snippets

Command Output

Terminal window
Results for Snippets List:
+------+--------------------------------+------------------------------------+---------------------------------------------+
| ID | NAME | DESCRIPTION | SNIPPET |
+------+--------------------------------+------------------------------------+---------------------------------------------+
| 1 | Set Standard SNMP | Standard SNMP Community and Server | conf t |
| | | | snmp-server host 1.1.1.1 TESTCOMMUNITY10 |
| | | | exit |
| | | | wr mem |
| | | | exit |
| 2 | Set Standard SNMP | Standard SNMP Community and Server | conf t |
| | | | snmp-server host 1.1.1.1 TESTCOMMUNITY20 |
| | | | exit |
| | | | wr mem |
| | | | exit |
| 3 | Set Standard SNMP | Standard SNMP Community and Server | conf t |
| | | | snmp-server host 1.1.1.1 TESTCOMMUNITY30 |
| | | | exit |
| | | | wr mem |
| | | | exit |
| 1000 | Remove all test SNMP Standards | Standard SNMP Community and Server | conf t |
| | | | no snmp-server host 1.1.1.1 TESTCOMMUNITY10 |
| | | | no snmp-server host 1.1.1.1 TESTCOMMUNITY20 |
| | | | no snmp-server host 1.1.1.1 TESTCOMMUNITY30 |
| | | | exit |
| | | | wr mem |
| | | | exit |
+------+--------------------------------+------------------------------------+---------------------------------------------+

rconfig:list-tags

Command Summary

Lists all configured tags. The ID is required when running rconfig:download-tag.

Command Use

Terminal window
php artisan rconfig:list-tags

Command Output

Terminal window
Results for Tags List:
+------+----------+
| ID | TAGNAME |
+------+----------+
| 1 | Routers |
| 2 | Switches |
| 1001 | devtag1 |
| 1002 | devtag2 |
| 1003 | devtag3 |
| 1010 | devtag10 |
+------+----------+

rconfig:list-tasks

Command Summary

Lists all configured tags. The ID is required when running rconfig:download-task.

Command Use

Terminal window
php artisan rconfig:list-tasks

Command Output

Terminal window
Results for Tasks List:
+--------+----------+----------------------+
| ID | NAME | DESCRIPTION |
+--------+----------+----------------------+
| 555555 | DevTask1 | DevTask1 Description |
| 666666 | DevTask2 | DevTask2 Description |
| 777777 | DevTask3 | DevTask3 Description |
+--------+----------+----------------------+

rconfig::purge-configs

Command Summary

Purge configs older than X days

Command Use

Terminal window
php artisan rconfig:purge-configs

Command Parameters

Terminal window
#Configs files older than X days will be purged
php artisan rconfig:purge-configs 30

Command Output

Terminal window
Do you wish to continue? (yes|no)[no] (yes/no) [yes]:
> yes
Nothing to purge! Thanks!
0 Configurations purged for last 30 days!

rconfig::purge-failedconfigs

Command Summary

Clear all failed or invalid configs for many or all devices

Command Use

Terminal window
php artisan rconfig:purge-failedconfigs

Command Parameters

Terminal window
#some or one devices IDs
php artisan rconfig:purge-failedconfigs 1001 1002 1003
#All devices will be checked and cleared for invalid config files
php artisan rconfig:purge-failedconfigs --all

Command Output

Terminal window
php artisan rconfig:purge-failedconfigs --all
3 invalid or failed configurations purged!

rconfig:report-lastDownload

Command Summary

CLI based report of all devices latest downloaded configs

Command Use

Terminal window
php artisan rconfig:report-lastDownload

Command Output

Terminal window
Results for Latest Configs List:
+----+-----------+-------------+----------+---------+-----------+--------------+
| ID | DEVICE ID | DEVICE_NAME | CATEGORY | COMMAND | FILE SZIE | CREATED DATE |
+----+-----------+-------------+----------+---------+-----------+--------------+

rconfig:run-policy-compliance

Command Summary

CLI based report of all devices latest downloaded configs

Command Use

Terminal window
php artisan rconfig:run-policy-compliance 1

Command Parameters

Terminal window
# One or many policy assignment IDs
php artisan rconfig:run-policy-compliance 1

Command Output

Terminal window
Starting policy compliance for policy assignment ID (1).
Total compliance jobs: 7
100/100 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
Completed: Please check the queue manager for detailed information on the Jobs status. https://v6dev1.rconfig.com/horizon/dashboard
Completed: Please check Policy Compliance Reports for information on configuration compliance. https://v6dev1.rconfig.com/policy/reports

rconfig:search-configs

Command Summary

Search configuration files for given text across a given category of devices.

####Options:

{Category : The Category of devices to search.}

{SearchString : The search string. If searching multiple words, wrap in double-quotes.}

{--lines=0 : Number of lines to display before/ after matches.}

Command Use

Terminal window
php artisan rconfig:search-configs Routers snmp

Command Output

Terminal window
.....
-::/var/www/html/rconfig5/storage/app/rconfig/data/Routers/router4/2020/Jun/06/showrun_1320.txt::-
151 snmp-server host 1.1.1.1 TESTCOMMUNITY10
152 snmp-server host 1.1.1.1 TESTCOMMUNITY30
-::/var/www/html/rconfig5/storage/app/rconfig/data/Routers/router4/2020/Jun/06/SetStandardSNMP_1320.txt::-
2 router1(config)#snmp-server host 1.1.1.1 TESTCOMMUNITY30
-::/var/www/html/rconfig5/storage/app/rconfig/data/Routers/router4/2020/Jun/06/showrun_1321.txt::-
151 snmp-server host 1.1.1.1 TESTCOMMUNITY10
152 snmp-server host 1.1.1.1 TESTCOMMUNITY30
-::/var/www/html/rconfig5/storage/app/rconfig/data/Routers/router4/2020/Jun/07/showrun_000.txt::-
151 snmp-server host 1.1.1.1 TESTCOMMUNITY10
152 snmp-server host 1.1.1.1 TESTCOMMUNITY30
.....
Duration: 161ms
Line Count: 5666
Match Count: 2710
File Count: 1478

rconfig:send-snippet

Command Summary

Send a specific command snippet to a given set of devices. Requires

snippetid

deviceid - One or multiple

Command Use

Terminal window
php artisan rconfig:send-snippet 5 21 22

Command Output

Terminal window
Start rconfig:send-snippet Snippet ID: 1 Device IDs:1001 1002
Start snippet send for router1 ID:1001
conf t
Enter configuration commands, one per line. End with CNTL/Z.
router1(config)#snmp-server host 1.1.1.1 TESTCOMMUNITY10
router1(config)# exit
router1#wr mem
Building configuration...
Send snippet for router1 with snippet: "Set Standard SNMP" was successful
Start snippet send for router2 ID:1002
conf t
Enter configuration commands, one per line. End with CNTL/Z.
router1(config)#snmp-server host 1.1.1.1 TESTCOMMUNITY10
router1(config)# exit
router1#wr mem
Building configuration...
Send snippet for router2 with snippet: "Set Standard SNMP" was successful
End rconfig:send-snippet

rconfig:snippet-task

Command Summary

Send snippets to devices with one or multiple tasks

taskid

Adding the -d switch to the above command will cause verbose debugging output for both Telnet and SSH.

Command Use

Terminal window
php artisan rconfig:snippet-task 123456

Command Output

Terminal window
Start rconfig:send-snippet Snippet Task ID: 123456
Start snippet send for router1 ID:1001
conf t
Enter configuration commands, one per line. End with CNTL/Z.
router1(config)#snmp-server host 1.1.1.1 TESTCOMMUNITY10
router1(config)# exit
router1#wr mem
Building configuration...
Send snippet for router1 with snippet: "Set Standard SNMP" was successful
Start snippet send for router2 ID:1002
conf t
Enter configuration commands, one per line. End with CNTL/Z.
router1(config)#snmp-server host 1.1.1.1 TESTCOMMUNITY10
router1(config)# exit
router1#wr mem
Building configuration...
Send snippet for router2 with snippet: "Set Standard SNMP" was successful
End rconfig:send-snippet

rconfig:sweep-tftp-dir

Command Summary

Sweeps the TFTP directory for files, attempts to match filename to device ID and uploads them to the correct device directory

Command Use

Terminal window
php artisan rconfig:sweep-tftp-dir

Command Output

Terminal window

rconfig:sync-search

Command Summary

Sync search models with laravel scout

Command Use

Terminal window
php artisan rconfig:sync-search

Command Output

Terminal window

rconfig:sync-tasks

Command Summary

Sync the schedule of the app with the schedule monitor

Command Use

Terminal window
php artisan rconfig:sync-tasks

Command Output

Terminal window

rconfig:test-script

Command Summary

Test BYOC scripts from the command line. See the BYOC section for more information.

Command Use

Terminal window
php artisan rconfig:test-script

Command Output

Terminal window

rconfig:tftp-server

Command Summary

Toggle rConfig TFTP on or off

Command Use

Terminal window
php artisan rconfig:tftp-server on/off

rconfig:update-rbac-data

Command Summary

Command to update permissions table with new permissions

Command Use

Terminal window
php artisan rconfig:update-rbac-data

Command Output

Terminal window

rconfig:update-snippet-roles

Command Summary

Update all snippets to ensure they at least have admin have roles attached to them.

Command Use

Terminal window
php artisan rconfig:update-snippet-roles

Command Output

Terminal window