.. highlight:: xml
.. index:: Reporting commands
.. _status_tasks:
Status and Configuration Reporting
==================================
.. _objectStatus:
.. _listObjects:
``listObjects``/``objectStatus``
--------------------------------
``listObjects`` prints the list of all objects and their operational (up/down), administration (enabled/disabled) and configuration states. You can easily "grep" the output to search for objects in the specific state
``listObjects`` is capable of querying multiple domains and providing information about objects running in each domain.
``objectStatus`` is an alias of ``listObjects``.
Attributes/Options
^^^^^^^^^^^^^^^^^^
.. list-table::
:widths: 20 80 8
:header-rows: 1
* - Name
- Description
- Required
* - objects
- Comma-delimited list of regexp patterns to objects to include in the report in the format "class:name, class:name". Class and name could be optional, e.g., "class, class" or ":name".
- No
* - exclude
- Comma-delimited list of regexp patterns to exclude from the report in the format "class:name, class:name".
- No
* - | domainPatterns
| CLI alias: domains
- Comma-delimited list of regular expression patterns defining which domains to query.
To query all domains use ".*"
Defaults to the current domain. The current domain is specified using the ``dpDomain`` property or ``domain`` attribute of the task.
- No
* - usage
- Print usage of all matched objects in the format Type:Name, Type:Name. Each Type:Name is the parent of the previous object, so it represent an object reference graph.
Defaults to 'false'
- No
* - excludeInternal
- Exclude log labels and generated policies.
Defaults to 'true'
- No
* - down
- Show only the objects that are "down"
Defaults to 'false'
- No
* - disabled
- Show only the objects that are disabled
Defaults to 'false'
- No
* - enabled
- Show only the objects that are enabled
Defaults to 'false'
- No
* - fail
- Fail if there is at least one object in the list, e.g., at least one object is in the "down" state
Defaults to 'false'
- No
Examples
^^^^^^^^
Display the status of disabled firewalls and proxies from all the domains of the two devices (dev and test):
.. code-block:: bat
dpbuddy listObjects -objects "XMLFire.*,WSGateway" -domainPatterns ".*" -device "dev, test" | grep disabled
Sample output::
Device Domain Type (class) Name Op St. Adm St. Conf St.
--------------------------------------------------------------------------------------------------
devloc ci WSGateway testServiceProxy up enabled saved
devloc ci XMLFirewallService testFirewall up enabled saved
devloc dpbuddy-samples WSGateway testServiceProxy up enabled saved
devloc dpbuddy-samples XMLFirewallService testFirewall up enabled saved
devloc e2e-preprod WSGateway testServiceProxy up enabled saved
devloc e2e-preprod XMLFirewallService testFirewall up enabled saved
devloc d1 WSGateway testServiceProxy up enabled saved
devloc d1 XMLFirewallService testFirewall up enabled saved
devloc d2 WSGateway testServiceProxy up enabled saved
devloc d2 XMLFirewallService testFirewall up enabled saved
devloc getting-started- WSGateway testServiceProxy up enabled saved
devloc getting-started- XMLFirewallService testFirewall up enabled saved
devloc newd1 WSGateway testServiceProxy up enabled saved
devloc newd1 XMLFirewallService testFirewall up enabled saved
.. code-block:: bat
dpbuddy listObjects -enabled -usage
Examples of the usage output::
SSLProxyProfile sslserver HTTPSSourceProtocolHandler:https_5041, MultiProtocolGateway:oauth-mpgw-rs
.. _serviceStatus:
``listServices``/``serviceStatus``
----------------------------------
``listServices`` prints the list of active services and their port numbers. This is the same information that is available from WebGUI under "Status"/"Main"/"Active Services".
``listServices`` is also capable of querying multiple domains and providing information about services running in each domain.
``serviceStatus`` is an alias of ``listServices``.
Attributes/Options
^^^^^^^^^^^^^^^^^^
.. list-table::
:widths: 20 80 8
:header-rows: 1
* - Name
- Description
- Required
* - | domainPatterns
| CLI alias: domains
- Comma-delimited list of regular expression patterns defining which domains to query.
To query all domains use ".*"
Defaults to the current domain. The current domain is specified using the ``dpDomain`` property or ``domain`` attribute of the task.
- No
Examples
^^^^^^^^
.. code-block:: bat
dpbuddy listServices -domainPatterns ".*"
.. code-block:: xml
Sample output::
Device Domain Type (class) Name Port
----------------------------------------------------------------------------------------
devloc dpbuddy-samples XMLFirewallService testFirewall 2056
devloc dpbuddy-samples WSGateway testServiceProxy 8064
devloc e2e-preprod XMLFirewallService testFirewall 9098
devloc e2e-preprod WSGateway testServiceProxy 9096
devloc getting-started-tes WSGateway testServiceProxy 4096
devloc getting-started-tes XMLFirewallService testFirewall 4098
devloc default MgmtInterface xml-mgmt 5550
devloc default WebGUI web-mgmt 9090
devloc dev XMLFirewallService testFirewall 7099
devloc dev WSGateway testServiceProxy 4069
devloc e2e-prod WSGateway testServiceProxy 5096
devloc e2e-prod XMLFirewallService testFirewall 5098
devloc e2e-test XMLFirewallService testFirewall 8098
devloc e2e-test WSGateway testServiceProxy 8087
.. _listDomains:
``listDomains``
---------------
``listDomains`` prints the list of DataPower domains and their status. This task requires access to the default domain.
Examples
^^^^^^^^
.. code-block:: bat
dpbuddy listDomains
Sample output::
Device Domain Name Op St. Adm St. Conf St.
dev dpbuddy-samples up enabled saved
dev dev up enabled saved
dev e2e-test up enabled saved
dev default up enabled saved
dev dpbuddy-ut up enabled saved
dev apiconnect2 down disabled saved
dev api-connect down disabled saved
dev playground up enabled saved
dev ci up enabled saved
dev test2 up enabled saved
dev e2e-preprod up enabled saved
dev test up enabled saved
dev e2e-prod up enabled saved
.. _configReport:
``configReport``
----------------
This task produces reports with the list of DataPower objects and their complete configuration. Reports can be generated in CSV or Excel formats.
Each row of a report represents a DataPower object. Each column is a configuration element. Nested elements are shown using path notation /.
When the format is CSV, each DataPower class/type is saved in a separate file. In Excel format, each class/type is saved in its own sheet (tab).
Report samples:
* `All WS Gateways `_
* `WS Gateways Diff `_
Attributes/Options
^^^^^^^^^^^^^^^^^^
.. list-table::
:widths: 20 80 8
:header-rows: 1
* - Name
- Description
- Required
* - objects
- Comma-delimited list of regexp patterns to objects to include in the report in the format "class:name, class:name". Class and name could be optional, e.g., "class, class" or ":name".
- No
* - exclude
- Comma-delimited list of regexp patterns to exclude from the report in the format "class:name, class:name".
- No
* - includeElements
- Comma-delimited list of configuration elements to include into the report.
Defaults to all elements.
- No
* - excludeElements
- Comma-delimited list of configuration elements to exclude from the report.
Defaults to none.
- No
* - | domainPatterns
| CLI alias: domains
- Comma-delimited list of regular expression patterns defining what domains to apply the command to. Use '.*' for all domains except the default. Use '.*,default' to include the default.
Defaults to the current domain. The current domain is specified using the ``dpDomain`` property or ``domain`` attribute of the task.
- No
* - | toDir
| CLI alias: dir
- Folder/directory to save the reports and the exported files to.
- Yes
* - | reportFileName
| CLI alias: fileName
- File name of the report relative to 'toDir'. Excel report defaults to "DataPowerConfigurationReport.xlsx"
- Yes
* - diff
- Include only those elements that have different values. Convenient for quickly diffing configs.
Defaults to ``false``
- No
* - excel
- Produce report in Excel format
Defaults to CSV format
- No
* - cleanToDir
- Remove all files and subdirectories in 'toDir' prior to generating reports.
Defaults to ``true``
- No
* - persisted
- If set to ``true``, export only the persisted configuration.
Defaults to ``false`` (DataPower default).
- No
* - refObjects
- If set to true, include all objects referenced/required by exported objects.
Defaults to ``true`` (DataPower default).
- No
* - refFiles
- If set to true, include all files referenced by exported objects.
Defaults to ``true`` (DataPower default).
- No
* - includeDebug
- Include debug information (probe data) in the report.
Defaults to ``false`` (DataPower default).
- No
Examples
^^^^^^^^
.. code-block:: bash
# Generate configuration report in Excel
dpbuddy configReport -dir confrep -persisted -objects "WSGatew.*, .*Firewall.*:test.*" -domains ".*" -excel -reportFileName DPReport.xlsx -excludeElements "UserInfo"
# Generate configuration report with differences
dpbuddy configReport -dir confrep -persisted -objects "WSGatew.*, .*Firewall.*:test.*" -domains ".*" -device devloc -excel -reportFileName DPReport.xlsx -diff
.. _status:
``status``
----------
The ``status`` task retrieves the status of various parameters of a device and prints it to standard out. The status is displayed in the form "name: valueā€¯, where "name" is the name of the parameter.
DataPower groups status parameters into "classes" (not to be confused with the classes of :ref:`DataPower objects `). Each status class is responsible for a certain characteristic of the device, such as memory, CPU utilization and so on.
A complete list of status classes can be found under the "StatusEnum" type in xml-mgmt.xsd.
The most useful classes include "MemoryStatus" and "FilesystemStatus". These classes give information about available RAM and disk space.
Attributes/Options
^^^^^^^^^^^^^^^^^^
.. list-table::
:widths: 20 80 8
:header-rows: 1
* - Name
- Description
- Required
* - class
- Status ``class`` as defined in xml-mgmt.xsd.
- Yes
* - | domainPatterns
| CLI alias: domains
- Comma-delimited list of regular expression patterns defining which domains to query.
To query all domains use ".*"
Defaults to the current domain. The current domain is specified using the ``dpDomain`` property or ``domain`` attribute of the task.
- No
* - json
- Output status in JSON format as opposed to a more human-readable name:value format. JSON is printed to standard out as well as to the dp-status.log log file. The location of the log files is defined in :ref:`logback.xml `
Defaults to false.
- No
Examples
^^^^^^^^
.. code-block:: bat
dpbuddy status -class MemoryStatus
.. code-block:: xml