Introduction
In the previous article, we introduced safplus_info, a lightweight interface designed for displaying SAFplus Platform status and providing basic control functions. In this work, we extend the discussion by presenting safplus_console. Unlike safplus_info, this tool supports not only basic observation and control but also provides a comprehensive CLI for detailed examination and debugging of the SAFplus Platform system.
What is the safplus_console?
The OpenClovis SAFplus Platform Console is a simple command line interface (CLI) that provides distributed diagnostics access to all system components, including OpenClovis ASP service components, as well as ASP-based customer applications. Safplus_console can be launched from any of the system nodes. It allows the user to list the available nodes, list the accessible components on each node (those that registered with the debug service), and list all diagnostic functions registered by each component. Via a simple command line interface (CLI), the user can trigger any of these routines in an interactive way, and the results will be displayed on the console. Safplus_console can be started on any of the ASP-enabled system nodes, and the Safplus_console provides unified access to any components on any nodes, irrespective of where it has been started. It simply routes the request to the given component based on the selected node and component context.
This CLI is designed to assist the application developers and field engineers in testing and debugging applications, and so is also called the “Debug CLI”.
Safplus_console can provide significant benefit to system designers trying to monitor the internals of the system or trigger natural or artificial events in the system for testing purposes. Specific examples include:
- Show the content of the internal data structures of a component
- Allow the modification of such data structures
- Trigger rarely occurring stimuli to components, simulating various fault scenarios
Features
- Using CLI commands, you can view or manipulate the data managed by OpenClovis ASP components. All these features are designed to assist the application developers and field engineers in testing and debugging applications.
- This CLI can be used for ASP-based customer applications. The CLI framework ensures that the application is accessible from the central CLI server. The actual CLI commands and the functionality are left for the application developers.
- The Safplus_console provides centralized access to all OpenClovis ASP components and ASP-based applications. Using custom CLI commands, a wide variety of services and features can be exposed to the CLI framework, which allows sophisticated, multi-component tests orchestrated through the Safplus_console.
Prerequisites
- A full model generated from the OpenClovis IDE.
- The model must be started and running.
Starting Safplus_console
Open a terminal in the bin directory and run the tool with root privileges. For example:
sudo ./safplus_console
After starting the safplus_console, you are in the OpenClovis ASP global context.
How to use the commands in the safplus_console?
When a command is entered at the terminal, it is sent to the gateway as is. The gateway parses the command and matches the command with the existing commands for the component for which the context is set. It then makes an RMD call to the debug object in the EO for that component. The debug object then matches the command to a function as per the registration done earlier and calls the appropriate function. The function is expected to return a string that is routed back to the terminal and displayed to the user. Below is an overview of the most commonly used commands:
1. help
With the “help” command, you can see all the commands available for the current context. In different contexts, the console may show a different output.

2. list
You can list all the nodes that are visible in the cluster.

Once you are in a node’s context, you can list all the components available on that node.

And then you can start using the commands that are available in that component. This time can be combined with “help” to see all the commands.

3. setc
You can use “setc” to navigate to a particular context. The figure below is an example of navigating from the global context to the node context, and the final is amf component context.

4. end
You can use the “end” command to go back to the previous context.
5. bye
Finally, you can use “bye” to exit the safplus_console tool.
Example
By combining some commands, you can navigate the context to the specific node or component needed for the operation. Suppose you need to observe the ams database, here is the specific implementation process:
setc 1 -> setc amf -> amsDbPrint

As illustrated in the figure, we begin by executing the “list” command to display the slots available in the global context. From there, the context is switched to Node0I0 using “setc 1”. Next, the command “setc amf” is issued to move into the AMF component context. Finally, by typing “amsDbPrint”, the console displays the complete set of AMS database information.
Conclusion
In summary, safplus_console extends the functionality of safplus_info by not only supporting commands for displaying status and performing basic functions (e.g., amsEntityPrint, amsLockAssignment, amsLockInstantiation, amsUnlock) but also providing advanced commands that facilitate system investigation, debugging, and fault simulation (e.g., amsDbPrint, amsRepaired, amsFaultReport, amsShutdown). If you would like to explore the full potential of safplus_console or discuss custom extensions tailored to your environment, please contact us at support@openclovis.org.
