The CLI
This page outlines how to use the switchmap-ng
command line interface
(CLI)
Viewing switchmap-ng
status
There are a few important switchmap-ng
daemons.
- Dashboard Displays device data on web pages
- poller: Gets data from devices
- server: An API server that interacts with a backend database. It accepts data from the poller and stores it in a cache. It also provides data to the dashboard.
- ingester: Updates the database with data from the cache.
You can get the status of each daemon using the following CLI commands:
NOTE: Remember before running any of these commands to first
activate venv
$ source venv/bin/activate
Poller status
You can get the status of the poller using this command:
(venv) $ bin/systemd/switchmap_poller --status
API server status
You can get the status of the API server using this command:
(venv) $ bin/systemd/switchmap_server --status
Ingester status
You can get the status of the ingester using this command:
(venv) $ bin/systemd/switchmap_ingester --status
Dashboard status
You can get the status of the dashboard using this command:
(venv) $ bin/systemd/switchmap_dashboard --status
Daemon Management
Note: You will need to do a restart whenever you modify a configuration parameter.
Poller Management
The poller can be started, stopped and restarted using the following
commands. Use the --force
option only if the daemon may be hung.
(venv) $ bin/systemd/switchmap_poller --start
(venv) $ bin/systemd/switchmap_poller --stop
(venv) $ bin/systemd/switchmap_poller --stop --force
(venv) $ bin/systemd/switchmap_poller --restart
(venv) $ bin/systemd/switchmap_poller --restart --force
API Server Management
The server can be started, stopped and restarted using the following
commands. Use the --force
option only if the daemon may be hung.
(venv) $ bin/systemd/switchmap_server --start
(venv) $ bin/systemd/switchmap_server --stop
(venv) $ bin/systemd/switchmap_server --stop --force
(venv) $ bin/systemd/switchmap_server --restart
(venv) $ bin/systemd/switchmap_server --restart --force
Ingester Management
The ingester can be started, stopped and restarted using the following
commands. Use the --force
option only if the daemon may be hung.
(venv) $ bin/systemd/switchmap_ingester --start
(venv) $ bin/systemd/switchmap_ingester --stop
(venv) $ bin/systemd/switchmap_ingester --stop --force
(venv) $ bin/systemd/switchmap_ingester --restart
(venv) $ bin/systemd/switchmap_ingester --restart --force
Dashboard Management
The dashboard can be started, stopped and restarted using the following
commands. Use the --force
option only if the daemon may be hung.
(venv) $ bin/systemd/switchmap_dashboard --start
(venv) $ bin/systemd/switchmap_dashboard --stop
(venv) $ bin/systemd/switchmap_dashboard --stop --force
(venv) $ bin/systemd/switchmap_dashboard --restart
(venv) $ bin/systemd/switchmap_dashboard --restart --force
Validating Device Polling
You may want to verify that the poller can access the hosts in the
configuration. This can be done using the switchmap_poller_test.py
command.
(venv) $ bin/tools/switchmap_poller_test.py --hostname HOSTNAME
Viewing switchmap-ng
logs
When troubleshooting it is a good practice to view the switchmap-ng
log files.
These can be found in the directory configured with the log_directory
in the configuration. The default is in the logs/
directory.
switchmap.log
: The general log fileswitchmap-server.log
: The log file used by the API serverswitchmap-poller.log
: The log file used by the pollerswitchmap-ingester.log
: The log file used by the ingesterswitchmap-dashboard.log
: The log file used by the dashboard